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

TabView fails to display tabs created with a Repeater with a dynamic model

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • 5.2.0
    • 5.1.1
    • Quick: Controls 1
    • None
    • qtquickcontrols/stable: 53fa52bb604ab28ee37aba26e155486e94c66dec

    Description

      The following example shows no tabs in the TabView:

      import QtQuick 2.0
      import QtQuick.Controls 1.0
      
      Item {
        TabView {
           Repeater { id: repeater; Tab { title: "title " + index } }
        }
        Timer { 
          interval: 1; 
          running: true; 
          repeat: false; 
          onTriggered: repeater.model = 5 
        }
      }
      

      It works fine for a Repeater with a static model, or even a timer interval of 0.

      If I understand the implementation correctly, this is due to the Repeater being reparented to the internal tab stack due to the changed default data property on the TabView, while only TabView's children are monitored for new additions. The Repeater however will create new tabs as siblings to itself, ie. already reparented to the tab stack, which the TabView doesn't notice.

      Attachments

        For Gerrit Dashboard: QTBUG-33162
        # Subject Branch Project Status CR V

        Activity

          People

            Unassigned Unassigned
            vkrause Volker Krause
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes