PDA

View Full Version : a question regarding models



jajdoo
29th September 2011, 20:49
i made a tree model (reimplementing QAbsractItemModel),

i need to insert already-made-items into it, so i made a different method instead of reimplementing insertRows/removeRows.
i saw in the documentation an alarming sentence referring to these methods:
"If you want selections to be handled properly, you must ensure that you call these functions"
should i rethink my ways?

wysota
10th October 2011, 21:19
Your methods should call beginInsertRows() and endInsertRows() before and after you modify the internal structures of the model.