czyBlog
czyBlog copied to clipboard
- 问题 可能在wps 2013以上版本,会遇到无法向xls写入数据的问题。 - 解决方案 ```cpp //excelbase.cpp void ExcelBasePrivate::construct() { ... if (excel->isNull()) { excel->setControl("ket.Application"); //连接WPS2013以上控件 } ... } void ExcelBase::writeCurrentSheet(const QList &cells) { ... //将range->setProperty("Value", var); 替换为 range->dynamicCall("SetValue(const...
启动出错
Out of memory in ..\..\include/QtCore/../../src/corelib/tools/qvector.h, line 564terminate called without an active exception。
QString xlsFile = QFileDialog::getExistingDirectory(this); if(xlsFile.isEmpty()) return; xlsFile += "/excelRWByCztr1988.xls"; if(m_xls.isNull()) m_xls.reset(new ExcelBase); m_xls->create(xlsFile); //返回true m_xls->setCurrentSheet(1); // 返回true m_xls->writeCurrentSheet(write_data); //返回false,write_data已测试行数为187 m_xls->save();
我引用了 \GitHub\czyBlog\tech\fastReadExcel\src\fastReadExcelInWindows 代码 在编译的时候 debug 未出现问题,可以调试 ; 但是release版本时 会出现问题;启动失败;有时是可以启动但重复启动时失败; Desktop_Qt_5_10_1_MSVC2015_32bit-Release\release\fastReadExcelInWindows.exe... 程序异常结束。 The process was ended forcefully. 请问 可能的原因是什么 ? 我的qt没有提供足够的信息。 我推测是内存的问题。 在某次信息中提示qvector.h 中552行 即reallocData(const int sz) { reallocData(sz, d->alloc); }该函数问题。...
我用m_xls->setCurrentSheet(2); m_xls->writeCurrentSheet(m_datas);这2句为什么还是不能给sheet2 写数据。
比如我一次想获取1-100行的数据,除了 d->sheet->querySubObject("Cells(int, int)", row, col)这样循环有没有其他方法,这样速度应该会很慢。求解,十分感谢
当data是26的整数倍时,mode= data % 26 == 0,导致转换出“@”字符,导致表格保存失败。