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

Item::enabled behaves inconsistently with docs on Qt 6

XMLWordPrintable

    • e32b292cd (dev), 210a99f58 (6.10), b26912b63 (6.9), 0c14028c5 (tqtc/lts-6.8)

      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!")
              }
          }

       

       

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

            dheerendra Dheerendra Purohit
            michalc Michał Cieślak
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes