1
0
mirror of https://github.com/QtExcel/QXlsx.git synced 2025-01-16 04:42:53 +08:00
QXlsx/TestExcel/datavalidation.cpp
Look Skyworker 8caad4c110 test excel
2018-04-20 08:58:43 +09:00

26 lines
595 B
C++

// datavalidation.cpp
#include <QtCore>
#include "xlsxdocument.h"
#include "xlsxdatavalidation.h"
using namespace QXlsx;
int datavalidation()
{
Document xlsx;
xlsx.write("A1", "A2 and A3:E5 only accept the number between 33 and 99");
//![1]
DataValidation validation(DataValidation::Whole, DataValidation::Between, "33", "99");
validation.addRange("A2");
validation.addRange("A3:E5");
validation.setPromptMessage("Please Input Integer between 33 and 99");
xlsx.addDataValidation(validation);
//![1]
xlsx.saveAs("datavalidation.xlsx");
return 0;
}