[Qt-interest] Hide deleted rows in QSqlTableModel

Petric Frank pfrank at gmx.de
Sun Nov 29 00:59:20 CET 2009


Hello,

On Saturday 28 November 2009 20:20:59 Thomas Richard wrote:
> Err, unfortunately the changes do not get reverted. I thought they would
> because i used some old testcode which made every row visibile again
>  manually. It seems like headerDataChanged isn't emitted when a deleted row
>  gets reverted. I think this is a bug though. Should i report it?
>
> I can't seem to find a way to make revert work correctly then it seems. Too
> bad.

this is what i also struggle with. Due i don't have a 'Revert' button it is 
not a problem for me.

To my opinion the model should have a signal like 'rowStateChanged' to signal 
when one row is deleted/reverted, but not yet committed.
Due the model already maintains an internal list (as far as i understand the 
QT source) of deleted (but not yet committed) rows this should not be a 
complicated task.
Subclassing does not help here because this list is inside the private data 
(whose class is not exported), so it is not accessible by the derived class. 
Also it seems that there are even no methods defined to allow to access this 
(deleted-)list.

This could be subject for an enchancement of QT. Maybe he QT development crowd 
schedule this for QT 4.7 or later.

regards
  Petric



More information about the Qt-interest-old mailing list