QAbstractItemModel: How to signal major change?
-
wrote on 11 May 2011, 19:36 last edited by
Hello,
If I've got a QAbstractItemModel based hierarchal model, and I need to make significant changes to it's structure at run time, what functions do I need to call to alert the view before and after the change?
(Rows would need to be added, removed, and relocated at the same time. Columns would not change.)
Since, I don't see any generic beginModelReorganization() and endModelReorganization() calls, what is the correct procedure?
Is it just beginResetModel()/endResetModel() to completely clear any viewer state?
Thank you
-
wrote on 11 May 2011, 19:58 last edited by
You should call "QAbstractItemModel::beginResetModel() ":http://doc.qt.nokia.com/4.7/qabstractitemmodel.html#beginResetModel and "QAbstractItemModel::endResetModel() ":http://doc.qt.nokia.com/4.7/qabstractitemmodel.html#endResetModel
-
wrote on 11 May 2011, 20:16 last edited by
Thank you, Volker.
1/3