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

TreeView component does not update items' indexes after moving

    XMLWordPrintable

Details

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

    Description

      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.

      Attachments

        1. 0001-Fix-parent.patch
          1 kB
        2. example.txt
          3 kB
        3. treeviewbugexample.zip
          36 kB
        4. treeviewbugexample-fixed.zip
          7 kB

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              qt.team.quick.subscriptions Qt Quick and Widgets Team
              bear.fred bear.fred
              Votes:
              4 Vote for this issue
              Watchers:
              10 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes