remove row from table
Unsolved
General and Desktop
-
I have a push button delete which is called when you want to delete a selected row from a table. Here is the function for delete the row
void frmIzlezniDokumentiPregled::deleteDok() { if(!m_OutputDocModel->removeRow(m_tableOutputDoc->currentIndex().row())) { qWarning()<<m_OutputDocModel->lastError(); } slotFilterTable(); // this is for refreshing the table so I can see that the row is removed. }
[edit:koahnig] code tags added
-
void frmIzlezniDokumentiPregled::deleteDok() { qDebug() << "current index " << m_tableOutputDoc->currentIndex(); qDebug() << "current size before " << m_tableOutputDoc->size(); if(!m_OutputDocModel->removeRow(m_tableOutputDoc->currentIndex().row())) { qWarning()<< "last error " << m_OutputDocModel->lastError(); } qDebug() << "current size before slot filter " << m_tableOutputDoc->size(); slotFilterTable(); // this is for refreshing the table so I can see that the row is removed. qDebug() << "current size after slot filter" << m_tableOutputDoc->size(); }