// numberformat.cpp #include #include #include "xlsxdocument.h" #include "xlsxformat.h" using namespace QXlsx; int numberformat() { QXlsx::Document xlsx; xlsx.setColumnWidth(1, 4, 20.0); QXlsx::Format header; header.setFontBold(true); header.setFontSize(20); //Custom number formats QStringList numFormats; numFormats << "Qt #" << "yyyy-mmm-dd" << "$ #,##0.00" << "[red]0.00"; xlsx.write(1, 1, "Raw data", header); xlsx.write(1, 2, "Format", header); xlsx.write(1, 3, "Shown value", header); for (int i=0; i