0
0
mirror of https://github.com/fralx/LimeReport.git synced 2024-12-25 17:14:40 +03:00

Finish 1.4.67

This commit is contained in:
Arin Alex 2018-03-07 20:04:45 +03:00
commit 608ae6cda6

View File

@ -70,7 +70,7 @@ bool QueryHolder::runQuery(IDataSource::DatasourceMode mode)
m_mode = mode; m_mode = mode;
QSqlDatabase db = QSqlDatabase::database(m_connectionName); QSqlDatabase db = QSqlDatabase::database(m_connectionName);
QSqlQuery* query = new QSqlQuery(db); QSqlQuery query(db);
if (!db.isValid()) { if (!db.isValid()) {
setLastError(QObject::tr("Invalid connection! %1").arg(m_connectionName)); setLastError(QObject::tr("Invalid connection! %1").arg(m_connectionName));
@ -82,13 +82,12 @@ bool QueryHolder::runQuery(IDataSource::DatasourceMode mode)
if (!m_prepared) return false; if (!m_prepared) return false;
} }
query->prepare(m_preparedSQL); query.prepare(m_preparedSQL);
fillParams(&query);
fillParams(query); query.exec();
query->exec();
QSqlQueryModel *model = new QSqlQueryModel; QSqlQueryModel *model = new QSqlQueryModel;
model->setQuery(*query); model->setQuery(query);
while (model->canFetchMore()) while (model->canFetchMore())
model->fetchMore(); model->fetchMore();