diff options
author | Alberto Mardegan <mardy@users.sourceforge.net> | 2019-10-24 23:06:57 +0300 |
---|---|---|
committer | Alberto Mardegan <mardy@users.sourceforge.net> | 2019-10-29 08:07:09 +0300 |
commit | c2b6aa5e513a47939bad3703c6b0d984faff9d2a (patch) | |
tree | 0ecda9895271c33c7549db0fba0466af26914612 /examples/quickcontrols/controls/texteditor/src/documenthandler.cpp | |
parent | 7f61a351148c7d67f8f4ee6f2d2c4a9c53766297 (diff) |
QQuickTreeModelAdaptor1: fix updating of ModelIndex role
The decision to store the original QModelIndex as a role has the
unfortunate consequence that we need to emit the dataChanged() signal
whenever its value change. The previous implementation of the "move
rows" operation failed in delivering this update in most cases.
While addressing that, this commit also fixes some similar issues with
the HasChildren role not being notified in certain scenarios.
Also, when the last child of an expanded item gets moved away and later
placed back in the original position, the item should not remember its
expanded state, but rather accept the children while staying collapsed.
Last but not least, it's important that the endMoveRows() protected
method is called *after* the original tree model has completed its
movement, because otherwise its elements might be accessed while in the
wrong state.
Similarly, we don't want the dataChanged() signals to be emitted while
rows are moved or removed; we queue up these events and fire them only
after the item indexes have settled.
Fixes: QTBUG-59606
Change-Id: Ib981c912ea19908e1283cc463331c3053d4d6e7d
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'examples/quickcontrols/controls/texteditor/src/documenthandler.cpp')
0 files changed, 0 insertions, 0 deletions