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

Dynamically adding a tab to a TabView can result in two tabs with the same name

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.1.0
    • 5.1.0 Beta 1
    • Quick: Controls 1
    • None
    • qtquickcontrols/stable: a6deb27ba0252bc06fd6f28fb76b552e6320853f

    Description

      If you dynamically add a tab to a tabview too early in initialization, it creates an extra tab with the same name, but no contents.

      The example below should have a single tab named 'A Tab' with a blue rectangle filling it. Instead it results in two tabs named 'A Tab', with the first being empty, and the second having the blue rectangle in it.

      import QtQuick 2.1
      import QtQuick.Controls 1.0
      
      Item {
        id: root
      
        TabView {
          id: tabview
          anchors.fill: parent
        }
      
        Component {
          id: dynamic
          Rectangle {
            color: 'blue'
          }
        }
      
        Component.onCompleted: {
          tabview.addTab('A Tab', dynamic);
        }
      }
      

      Attachments

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

        Activity

          People

            Unassigned Unassigned
            jfaust Josh Faust
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes