Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/qt/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Excel查询的C++ Qt范围_C++_Qt_Range_Export To Excel - Fatal编程技术网

Excel查询的C++ Qt范围

Excel查询的C++ Qt范围,c++,qt,range,export-to-excel,C++,Qt,Range,Export To Excel,我尝试将数据从Qt写入excel文件。我发现这段代码允许我将数据写入5*5的范围 //get a 5x5 range of cells : from A1 to E5 QAxObject *range = sheet1->querySubObject( "Range(const QString&, const QString&)", QString("A1"), QString("f5")); QVariant vTable(table); range->dynam

我尝试将数据从Qt写入excel文件。我发现这段代码允许我将数据写入5*5的范围

//get a 5x5 range of cells : from A1 to E5
QAxObject *range = sheet1->querySubObject( "Range(const QString&, const QString&)", QString("A1"), QString("f5")); 
QVariant vTable(table);
range->dynamicCall("SetValue(const QVariant&)", vTable);
我的数据比5列5行大得多,大小不一。是否有可能使用如下数字设置范围:

QAxObject *range = sheet1->querySubObject( "Range(7,123)"); 
这意味着我的数据应该有7列123行的大小

非常感谢你的回答


Itelly

如果您的数据是123x7表格,则可以将范围初始化为

QAxObject *range = sheet1->querySubObject( "Range(A1,G123)");
假设您正在vTable中存储值,则可以调用:

range->dynamicCall("setValue(const QVariant&)",vTable); 
将您的值放入电子表格