mirror of
https://github.com/fralx/LimeReport.git
synced 2025-09-23 08:29:07 +03:00
Callback interface has been simplified
From now on if slot getCallbackData(const LimeReport::CallbackInfo& info, QVariant& data) returns row count then there is no more need to implement second slot changePos(const LimeReport::CallbackInfo::ChangePosType& type, bool& result);
This commit is contained in:
@@ -91,6 +91,10 @@ MainWindow::MainWindow(QWidget *parent) :
|
||||
stringListModel->setStringList(simpleData);
|
||||
|
||||
report->dataManager()->addModel("string_list",stringListModel,true);
|
||||
QStringList strList;
|
||||
strList<<"value1"<<"value2";
|
||||
QScriptValue value = qScriptValueFromSequence(report->scriptManager()->scriptEngine(),strList);
|
||||
report->scriptManager()->scriptEngine()->globalObject().setProperty("test_list",value);
|
||||
|
||||
|
||||
}
|
||||
@@ -152,6 +156,9 @@ void MainWindow::renderFinished()
|
||||
void MainWindow::prepareData(QSqlQuery* ds, LimeReport::CallbackInfo info, QVariant &data)
|
||||
{
|
||||
switch (info.dataType) {
|
||||
case LimeReport::CallbackInfo::ColumnCount:
|
||||
data = ds->record().count();
|
||||
break;
|
||||
case LimeReport::CallbackInfo::IsEmpty:
|
||||
data = !ds->first();
|
||||
break;
|
||||
|
Reference in New Issue
Block a user