My WTableView won't update when I change its model.
Added by Peter-Frank Spierenburg about 9 years ago
I've created a subclass of Wt::AbstractTableModel based on http://www.webtoolkit.eu/widgets/trees-tables/mvc-item-models
Looking at the example, I don't see how a Wt::WTableView would be notified when the contents of the model change.
Can you explain how that happens? Is there a method I need to call on either the model or the view to notify it of changes?
Replies (1)
RE: My WTableView won't update when I change its model. - Added by Koen Deforche about 9 years ago
Indeed if the model isn't just static, then you need to emit the correct signals in case of changes:
When changing the geometry you need to call a function before and after the change, see the set of 'protected' functions of WAbstractItemModel with names begin...() and end...().
If you're changing data, then you need to emit the dataChanged() signal.
Koen