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

Setting PathView offset such that all visible items are destroyed results in incorrect items being created

XMLWordPrintable

    • 0ed462973acc683882ac30ae6959340564f305a3

      I'm trying to combine a ListView and a PathView using the Package element, and would like my items to be able to reparent from one to another.

      >From the PathView to the ListView works fine, I can use ListView::positionViewAtIndex to prepare the view when switching, and animate my items from the path view to the list view.

      However, when I try to do the same from the ListView to the PathView, I run into problems. I have not found a good way to position the PathView at the right place that makes the ParentChange actually apply correctly.

      • First I tried modifying the PathView::currentIndex, but the PathView wants to animate the offset to the new index (and setting the highlightMoveDuration to 0 just breaks it).
      • Then I tried modifying the PathView::offset, but this still causes problems for the items for which no delegates existed on the PathView.

      I've attached a small example demonstrating the problem. I am using the latest Qt 4.7 branch. To reproduce:

      • Switch from path to list mode by clicking the left item (possibly after scrolling the path left/right).
      • Notice the items are positioned correctly in the ListView to the right.
      • Notice how clicking the items in the ListView moves them back into the PathView correctly.
      • Go back to list state, and now scroll the list a bit before clicking to make them go back to the PathView
      • Notice how the positions get all messed up (items basically get stuck in the top-left corner)

      I don't really understand how this can happen. It seems to me that modifying the PathView::offset does not make sure the visible delegates are created and layed out correctly by the time the ParentChange tries to go into effect.

        1. PathViewTest.qml
          5 kB
          Martin Jones (closed Nokia identity)
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            martjone Martin Jones (closed Nokia identity) (Inactive)
            martjone Martin Jones (closed Nokia identity) (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes