Add data validation read/write support
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
TARGET = datavalidation
|
||||
|
||||
#include(../../../src/xlsx/qtxlsx.pri)
|
||||
QT+=xlsx
|
||||
|
||||
CONFIG += console
|
||||
CONFIG -= app_bundle
|
||||
|
||||
SOURCES += main.cpp
|
||||
@@ -0,0 +1,22 @@
|
||||
#include <QtCore>
|
||||
#include "xlsxdocument.h"
|
||||
#include "xlsxdatavalidation.h"
|
||||
|
||||
QTXLSX_USE_NAMESPACE
|
||||
|
||||
int main()
|
||||
{
|
||||
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.save();
|
||||
return 0;
|
||||
}
|
||||
@@ -5,5 +5,6 @@ SUBDIRS = hello style \
|
||||
mergecells \
|
||||
rowcolumn \
|
||||
numberformat \
|
||||
readwrite
|
||||
readwrite \
|
||||
datavalidation
|
||||
|
||||
|
||||
Reference in New Issue
Block a user