Qt 6.11 is out! See what's new in the release
blog
Reading Xlsx file
-
Hi,
I was trying to read sample xlsx file using Qt library QXlsx
code below:
Document xlsxR("Test.xlsx"); if (xlsxR.load()) // load excel file { Cell* cell = xlsxR.cellAt(row, col); // get cell pointer. if ( cell != NULL ) { QVariant var = cell->readValue(); // read cell value (number(double), QDateTime, QString ...) qDebug() << var; // display value. it is 'Hello Qt!'. } }Here, it is giving compile error as:
c2039: 'load': is not a member of 'QXlsx::Document'Any help on this is appreciated.
I need to read Xlsx using QXlsx. -
HI,
I got this solution.
QXlsx::Document.read("A1");
usage example:
QVariant var1;
Document xlsxR("Test.xlsx");
qDebug() << "Test.xlsx - QXlsx::Document.read()";
var1 = xlsxR.read("A1");
qDebug() << "A1: " << var1.toString();