From 6d1444566d052a21287caea0798e60f02e3e0f4c Mon Sep 17 00:00:00 2001 From: Arin Alexander Date: Thu, 27 Feb 2020 19:34:52 +0300 Subject: [PATCH] Endless loop on adding not initialized QSqlQueryModels has been fixed --- common.pri | 2 +- limereport/lrdatadesignintf.cpp | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/common.pri b/common.pri index 6987c1e..a31bb50 100644 --- a/common.pri +++ b/common.pri @@ -127,7 +127,7 @@ RCC_DIR = $${ARCH_DIR}/$${BUILD_TYPE}/rcc LIMEREPORT_VERSION_MAJOR = 1 LIMEREPORT_VERSION_MINOR = 5 -LIMEREPORT_VERSION_RELEASE = 38 +LIMEREPORT_VERSION_RELEASE = 39 LIMEREPORT_VERSION = '$${LIMEREPORT_VERSION_MAJOR}.$${LIMEREPORT_VERSION_MINOR}.$${LIMEREPORT_VERSION_RELEASE}' DEFINES *= LIMEREPORT_VERSION_STR=\\\"$${LIMEREPORT_VERSION}\\\" diff --git a/limereport/lrdatadesignintf.cpp b/limereport/lrdatadesignintf.cpp index eb4b564..aca04e3 100644 --- a/limereport/lrdatadesignintf.cpp +++ b/limereport/lrdatadesignintf.cpp @@ -190,8 +190,10 @@ ModelToDataSource::ModelToDataSource(QAbstractItemModel* model, bool owned) { Q_ASSERT(model); if (model){ - while (model->canFetchMore(QModelIndex())) + while (model->canFetchMore(QModelIndex())){ model->fetchMore(QModelIndex()); + if (model->rowCount() <= 0) break; + } connect(model, SIGNAL(destroyed()), this, SLOT(slotModelDestroed())); connect(model, SIGNAL(modelReset()), this, SIGNAL(modelStateChanged())); }