Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-59606

TreeView component does not update items' indexes after moving

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: P2: Important P2: Important
    • 5.14.0 RC1
    • 5.8.0
    • Quick: Controls 1
    • None
    • Ubuntu 14.04 Qt 5.8
    • c2b6aa5e513a47939bad3703c6b0d984faff9d2a (qt/qtquickcontrols/5.13)

      TreeView works incorrectly after calling beginMoveRows and endMoveRows in model. This is blocker for our project.

      In the example.txt there is example which helps to reproduce the bug.

      Actually when first time we move item it is all right, however if we try to move the item which's been just moved it crashes as styleData.index is wrong.
      We had to reset model in order to update indexes. However we changed implementation and if we reset the model right after move it also crashes for some reason.
      Related topic https://bugreports.qt.io/browse/QTBUG-56490

      I spent some hours to provide the example (treeviewexample.zip).
      To start moving the item in TreeView, click on the red Rectange to charge source item and next push red Rectangle on target item. You can see that styleData.index is not updated properly. styleData.index is the only way to access index of item. Using this component is impossible (( Ask if I can help somehow else for soonest fix.

        1. example.txt
          3 kB
          user-76fbc
        2. treeviewbugexample.zip
          36 kB
          user-76fbc
        3. 0001-Fix-parent.patch
          1 kB
          Alberto Mardegan
        4. treeviewbugexample-fixed.zip
          7 kB
          Alberto Mardegan
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            jirauser43945 user-76fbc (Inactive)
            Votes:
            4 Vote for this issue
            Watchers:
            10 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes