PDA

View Full Version : QSqlTableModel doesn't delete the rows



AlexxanderX
15th September 2014, 14:17
I have this piece of code:

for (std::size_t i=0; i<m_rowsToDelete.size(); ++i)
{
qDebug() << m_rowsToDelete[i] << m_tableModelDB->removeRow(m_rowsToDelete[i]);
}

m_db.transaction();
bool a = m_tableModelDB->submitAll();
qDebug() << "submitAll() =>" << a;
m_db.commit();
I get true everywhere but the rows are not deleted from database.

d_stranz
17th September 2014, 03:10
That's very nice, but how are we supposed to tell you what is wrong when you give us 9 lines of code and no information about what your variables are or where this code lives in your project or even how execution got to this code? My crystal ball isn't working today.