In the model you signal that the data has changed with
Q_EMIT dataChanged();
in the setData() method and any other place the data can change.
If you are doing things like sorting the data you will also need to emit/call
layoutAboutToBeChanged()
and
layoutChanged()
When you insert rows in your table you need to call beginInsertRows() ... endInsertRows() and a similar thing for removing rows. These are what signal the view that the model has changed and things in the view need up dating and that is when the delegate is used by the view.
At least the above is what works for my custom view/model code.




Reply With Quote

Bookmarks