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

ListView with transitions does not always position delegates properly

    XMLWordPrintable

    Details

    • Sprint:
      Bug Fixing Candidates, UI Bug Fixing Q1/2021

      Description

      In the attached code, the "Small Button" is incorrectly pushed off the bottom of the window (see "actual.png"). When resizing the window, the layout gets "nudged" so that the button appears correctly (see "expected.png").

      Possible diagnosis: positioning is scheduled to happen at polish time. However, positioning appears not to happen in certain pathological cases. One example is a ListView with a positioner item as the delegate. When you add an item to the model for the ListView, it causes the positioner to register and receive a geometry change event for items in the positioner. However, if the ListView is polished before the positioner, then it starts a transition before the positioner is able to update its position. When the positioner is polished/positioned, it emits a geometry change event that the ListView ignores since the transition has already been started.

      The change in the attached code review (from Daiwei Li, along with the diagnosis above) causes both buttons to appear correctly, but causes half of the tst_qquickpositioners unit tests to fail.

        Attachments

        1. actual.png
          actual.png
          86 kB
        2. expected.png
          expected.png
          90 kB
        3. main.qml
          1 kB
        For Gerrit Dashboard: QTBUG-62148
        # Subject Branch Project Status CR V

          Activity

            People

            Assignee:
            smd Jan Arve
            Reporter:
            erb Jason Erb (Suitable Technologies)
            Votes:
            6 Vote for this issue
            Watchers:
            7 Start watching this issue

              Dates

              Created:
              Updated:

                Gerrit Reviews

                There is 1 open Gerrit change