diff --git a/src/sqlitedb.cpp b/src/sqlitedb.cpp index 8317de36..cda6871a 100644 --- a/src/sqlitedb.cpp +++ b/src/sqlitedb.cpp @@ -808,7 +808,7 @@ bool DBBrowserDB::executeMultiSQL(const QString& statement, bool dirty, bool log return true; } -bool DBBrowserDB::getRow(const sqlb::ObjectIdentifier& table, const QString& rowid, QList& rowdata) +bool DBBrowserDB::getRow(const sqlb::ObjectIdentifier& table, const QString& rowid, QVector& rowdata) { QString sQuery = QString("SELECT * FROM %1 WHERE %2='%3';") .arg(table.toString()) diff --git a/src/sqlitedb.h b/src/sqlitedb.h index dedced01..137fd58d 100644 --- a/src/sqlitedb.h +++ b/src/sqlitedb.h @@ -49,7 +49,7 @@ public: * @param rowdata A list of QByteArray containing the row data. * @return true if statement execution was ok, else false. */ - bool getRow(const sqlb::ObjectIdentifier& table, const QString& rowid, QList& rowdata); + bool getRow(const sqlb::ObjectIdentifier& table, const QString& rowid, QVector& rowdata); /** * @brief max Queries the table t for the max value of field. diff --git a/src/sqlitetablemodel.cpp b/src/sqlitetablemodel.cpp index a6a138b4..77baf922 100644 --- a/src/sqlitetablemodel.cpp +++ b/src/sqlitetablemodel.cpp @@ -436,7 +436,7 @@ bool SqliteTableModel::insertRows(int row, int count, const QModelIndex& parent) // update column with default values QByteArrayList rowdata; - if( m_db.getRow(m_sTable, rowid, rowdata) ) + if(m_db.getRow(m_sTable, rowid, rowdata)) { for(int j=1; j < m_headers.size(); ++j) { @@ -529,10 +529,11 @@ void SqliteTableModel::fetchData(unsigned int from, unsigned to) if(SQLITE_OK == status) { + int num_columns = m_headers.size(); while(sqlite3_step(stmt) == SQLITE_ROW) { QByteArrayList rowdata; - for (int i = 0; i < m_headers.size(); ++i) + for(int i=0;i QByteArrayList; + typedef QVector QByteArrayList; sqlb::ForeignKeyClause getForeignKeyClause(int column) const;