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

[REG 5.15.2-6.2.2] Control doesn't propagate hover to his parent

    XMLWordPrintable

Details

    • All
    • 0c7b0a4306 (qt/qtdeclarative/dev) d4c31ec0cd (qt/qtdeclarative/6.2) 66d6c7ec01 (qt/qtdeclarative/6.3) d4c31ec0cd (qt/tqtc-qtdeclarative/6.2)

    Description

      Qt Quick Control (and its derivatives, like Button) doesn't propagate hover to his parent control.
      It looks like a regression happened somewhere in Qt 6 comparing with Qt 5.15.2 original behaviour.

      Code sample:

      import QtQuick
      import QtQuick.Window
      import QtQuick.Controls
      
      Window {
          width: 640
          height: 480
          visible: true
      
          component CustomControl: Control { // you can use just a regular Button instead
              id: control
              hoverEnabled: true
              background: Rectangle {
                  color: control.hovered ? 'red' : 'white'
                  border.width: 1
              }
          }
      
          CustomControl {
              anchors.fill: parent
              onHoveredChanged: console.log('Outer hovered: ' + hovered)
      
              CustomControl {
                  anchors.centerIn: parent
                  width: parent.width / 2
                  height: parent.height / 2
                  onHoveredChanged: console.log('Inner hovered: ' + hovered)
              }
          }
      }
      

      Steps to reproduce:
      Just run the sample code and move mouse from window's side to center. This will produce next output:

      qml: Outer hovered: true
      qml: Inner hovered: true
      qml: Outer hovered: false
      

      Attachments

        Issue Links

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

          Activity

            People

              richard Richard Moe Gustavsen
              studiosus Vladimir Belyavsky
              Votes:
              4 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes