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

Item::enabled behaves inconsistently with docs on Qt 6

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 6.9
    • Documentation
    • None

    Description

      According to the documentation (https://doc.qt.io/qt-6/qml-qtquick-item.html#enabled-prop) enabled set to false should block any mouse/keyboard input:

      This property holds whether the item receives mouse and keyboard events. By default this is true.

      The actual behavior was like that in Qt 5, however it's different in Qt 6. E.g. the mouse hover events are notified even if the item is set to enabled = false.

      It means that the code below behaves differently for Qt 5/6. In the meantime the documentation is the same for both versions regarding enabled property.

       

          Button {
              text: "button"
              enabled: false
      
              ToolTip.text: "some text"
              ToolTip.visible: hovered
      
              MouseArea {
                  anchors.fill: parent
                  hoverEnabled: true
                  onEntered: console.log("ENTERED!")
              }
          }

       

       

      Attachments

        Issue Links

          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
              michalc Michał Cieślak
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes