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

Action-based TabButton breaks TabBar behavior

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 5.12
    • Quick: Controls 2
    • None
    • All

    Description

      In the example below, clicking on the TabButton doesn't change the TabBar's current index (as it ought to be) but only fires the related Action's onTriggered:

      import QtQuick 2.12
      import QtQuick.Controls 2.12
      
      Page {
          Action {
              id: a1
              text: "a1"
              onTriggered: console.warn("a1 triggered;", "tabBar.currentIndex:", tabBar.currentIndex)
          }
          Action {
              id: a2
              text: "a2"
              onTriggered: console.warn("a2 triggered;", "tabBar.currentIndex:", tabBar.currentIndex)
          }
      
          header: TabBar {
              id: tabBar
              TabButton {
                  action: a1
              }
              TabButton {
                  action: a2
              }
              onCurrentIndexChanged: console.warn("one would never see this message:", "currentIndex:", currentIndex)
          }
      }
      

      In fact, any AbstractButton is affected, not only the TabButton.

      Attachments

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

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            ritt.ks Konstantin Ritt
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes