Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Bug in qt 5.15.2: Button.checkable = false is gettin ignored

Bug in qt 5.15.2: Button.checkable = false is gettin ignored

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
2 Posts 2 Posters 125 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    themts
    wrote on last edited by themts
    #1

    Hi guys,

    I just found a bug in qt 5.15.2 which was not there on older version and is also not there in qt 6.8

    When you create 2 buttons and set checkable = false, you usually could set the checked property but clicking is not changing anything.
    Unfortunatley, even with checkable=false the button is changing the checked state.

        property bool t
    
        Button {
            x: 0
            id: button
            checkable: false
            checked : t
    
            onClicked: t = true
        }
    
        Button {
            x: 100
            id: button1
            checkable: false
            checked: !t
    
            onClicked: t = false
        }
    

    Is there any workaround to get the correct behaviour back?
    Of course I know about ButtonGroups, but that is not what I'm looking for.

    1 Reply Last reply
    0
    • MarkkyboyM Offline
      MarkkyboyM Offline
      Markkyboy
      wrote on last edited by Markkyboy
      #2

      Checkable and checked are not components of Button QML.

      A similar question here; https://forum.qt.io/topic/36479/solved-button-checkable-and-checked-not-working albeit a different answer/outcome from my response. Regardless, I still myself, cannot use checkable or checked with Button.

      Don't just sit there standing around, pick up a shovel and sweep up!

      I live by the sea, not in it.

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved