Fixed loading of data in CrudModel.

This commit is contained in:
eelke 2018-12-31 09:33:34 +01:00
parent 15bee33076
commit 424fb5984d
2 changed files with 4 additions and 14 deletions

View file

@ -172,8 +172,8 @@ void CrudModel::loadData()
if (res.valid()) {
auto dbres = res.get();
if (dbres && *dbres) {
/// \todo Use ControllableTask instead with QFUtureWatcher
// m_asyncWindow->QueueTask([this, dbres]() { loadIntoModel(dbres); });
QMetaObject::invokeMethod(this, "loadIntoModel", Qt::QueuedConnection,
Q_ARG(std::shared_ptr<Pgsql::Result>, dbres));
}
}
else {
@ -197,7 +197,7 @@ void CrudModel::loadIntoModel(std::shared_ptr<Pgsql::Result> data)
void CrudModel::initRowMapping()
{
m_rowMapping.resize(m_rowCount);
m_rowMapping.resize(static_cast<size_t>(m_rowCount));
for (int i = 0; i < m_rowCount; ++i)
m_rowMapping[i] = RowMapping{ i };
}