Details
-
Suggestion
-
Resolution: Unresolved
-
Not Evaluated
-
None
-
None
-
None
-
Windows 10 21H2, MSVC 2019 x64
Description
HoverHandler behaviour – especially how it interacts with other mouse handlers – has changed somewhat frequently across versions. It is not clear which change is a regression, which change is a bugfix, and which change is simply due to undefined behaviour.
It would be helpful make the behaviour more well-defined and better documented, so that developers know what to expect and how to use it correctly.
Test app
import QtQuick 2.15 import QtQuick.Controls 2.15 import QtQuick.Window 2.15 Window { width: 800 height: 600 visible: true Column { anchors.fill: parent topPadding: 50 Rectangle { width: parent.width height: 400 color: "lightblue" ListView { id: view anchors.fill: parent model: 5 spacing: 2 delegate: Rectangle { height: view.height / 6 width: height anchors.horizontalCenter: parent.horizontalCenter color: "orange" } HoverHandler { id: hoverHandler } Rectangle { anchors.centerIn: parent width: parent.width / 3 height: parent.height / 3 color: "darkgreen" MouseArea { id: innerMouseArea anchors.fill: parent hoverEnabled: true } } } } CheckBox { text: "HoverHandler hovered?" checked: hoverHandler.hovered } CheckBox { text: "MouseArea hovered?" checked: innerMouseArea.containsMouse } } }
Test steps
- Place your mouse cursor at the center-top of the window, in the white region
- Move your mouse cursor downwards, along the orange column
- Move your mouse cursor downwards, into the green rectangle
- Click on the green rectangle
- Move your mouse cursor downwards, out of the green rectangle into the lower orange column
- Move your mouse cursor downwards, out of the orange column into the blue background
- Move your mouse cursor downwards, out of the blue rectange into the white region
Results: HoverHandler hovered?
Numerous differences between versions:
Step | Qt 5.15.2 | Qt 5.15.10 | Qt 6.2+ |
---|---|---|---|
1 | |||
2 | ✓ | ✓ | ✓ |
3 | ✓ | ||
4 | ✓ | ✓ | |
5 | ✓ | ✓ | ✓ |
6 | ✓ | ||
7 |
Results: MouseArea hovered?
Consistent behaviour between verisons:
Step | Qt 5.15.2 | Qt 5.15.10 | Qt 6.2+ |
---|---|---|---|
1 | |||
2 | |||
3 | ✓ | ✓ | ✓ |
4 | ✓ | ✓ | ✓ |
5 | |||
6 | |||
7 |
(Qt 6.2+ means the behaviour is the same in Qt 6.2.5, 6.3.2, and 6.4.0-RC1)
Attachments
Issue Links
- relates to
-
QTBUG-72843 HoverHandler is unreliable
- Closed