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

StackLayout Visible Item Does Not Update During Inserts

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P1: Critical
    • 6.5.1, 6.6.0
    • 6.4.1
    • Quick: Layouts
    • None
    • Windows
    • a0fb25491 (dev), 8d08d0d4e (6.5), adc3d8b2e (dev), 466e17a9a (6.5)

    Description

      I have been using a ListView paired with a StackLayout to implement tabs in QML. The StackLayout uses a repeater, driven by the same model as a ListView, to create the pages. I've discovered that when an item is inserted into the model at the currentIndex, the StackLayout does not change its visible item. This can be demonstrated in the attached example.

      In the example, there is a ListModel with 3 items. When the application is started, the 3 items are visible in the ListView and in the StackLayout. Clicking on an item in the ListView changes the visible page in the StackLayout. An Insert button is overlaid on to the Window. When Insert is pressed, a new item is inserted in to the ListModel at the currentIndex. The expected behavior would be that the ListView and StackLayout add a new delegate and display it. The ListView should highlight the new item and the StackLayout should make it visible. The ListView does meet this expectation, but the StackLayout continues to display the previously selected item. Selecting a different item in the ListView and then changing back to the original index does resolve the issue.

      Attachments

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

        Activity

          People

            smd Jan Arve
            tvoils Thomas Voils
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes