Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 5

Qt-interest Archive, May 2007
Model changed view not updated


Message 1 in thread

Hello list,
i have a Model derived from QAbstractTableModel. In it is a QSqlDatabse 
Member. I know there is a QSqlTableModel but i dont want to use it since the 
Columns in the View are not the same Columns of the Sql Database. Actually 
the Columns in the View/Model are fixed (5). 

My Model now Implements rowCount() using a select on the QSqlDatabase Member. 
I olso have a setFilter() function which should work as the setFilter from 
QSqlTableModel. The rowCount respects the filter returning the correct number 
of rows. 

My Problem now is, the View does not get noticed about the changed rows. Where 
would i emit layoutChanged()? I have emit'ed it in my setFilter Function, but 
without success. Do i have to connect the layoutChanged() with the view 
manualy? Or do i have to emit it somewhere else? The View is a standard 
QTableView. 

-- 
 [ signature omitted ]