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

Button can't be in checked state

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • 5.2.0
    • 5.1.0
    • Quick: Controls 1
    • None
    • Win7, QtCreator 2.7.2 (32 bit)
    • qtquickcontrols/stable: 0bf9c1c5b27009bae612cbef24e76e9e4ad60768 & 19c9ad7f109a8358c66008517b7535d99237424e

    Description

      Button's and ToolButton's checked states does not work properly.
      No one button stays pressed.

      import QtQuick 2.1
      import QtQuick.Controls 1.0
      import QtQuick.Layouts 1.0
      ...
      ApplicationWindow {
          ...
          ExclusiveGroup {
              Action {
                  id: action1
                  text: "Action 1"
                  checkable: true
                  checked: true
                  onToggled: console.log(checked)
              }
              Action {
                  id: action2
                  text: "Action 2"
                  checkable: true
                  onToggled: console.log(checked)
              }
          }
      
          toolBar: ToolBar {
              RowLayout {
                  ToolButton { action: action1 }
                  ToolButton { action: action2 }
              }
          }
      
          Row {
              spacing: 10
              Button {
                  action: action1
              }
              Button {
                  action: action2
              }
          }
      }

      Attachments

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

        Activity

          People

            Unassigned Unassigned
            ilya84a Ilya Aleshkov
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes