Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
5.2.0, 6.4.0 Beta4
-
None
-
Windows 7 64 bit
Description
If two mouse areas overlap and the mouse area in the back has hoverEnabled set to true, its containsMouse property will not update while dragging when the mouse has been pressed on the front mouse area. It will only update after releasing the mouse and moving it again. The same it true for onEntered and onExited signals.
Here is an example that demonstrates the problem:
import QtQuick 2.2 import QtTest 1.0 Item { id: scene width: 300 height: 300 MouseArea { id: mouseAreaBack width:200; height:200; x: 50; y: 50 hoverEnabled: true } MouseArea { id: mouseAreaFront width:100; height:100; x: 100; y: 100 } TestCase { name: "OverlappingMouseAreas" when: windowShown function test_overlappingMouseArea(data) { mouseMove(scene, 25, 150); // move mouse over mouseAreaBack and mouseAreaFront mouseMove(scene, 150, 150); compare(mouseAreaBack.containsMouse, true); // <- PASS // press within mouseAreaFront and drag the mouse out of mouseAreaBack and mouseAreaFront mousePress(scene, 150, 150); mouseMove(scene, 275, 150); // not ok, we are outside of mouseAreaBack now compare(mouseAreaBack.containsMouse, false); // <- FAIL mouseRelease(scene, 275, 150); // not ok after releasing the mouse compare(mouseAreaBack.containsMouse, false); // <- FAIL // moving the mouse a bit updates containsMouse mouseMove(scene, 275 + 1, 150); compare(mouseAreaBack.containsMouse, false); // <- PASS } } }
Attachments
Issue Links
- relates to
-
QTBUG-88119 MouseArea::containsMouse incorrectly set to true upon toggle visible true
-
- Reported
-
-
QTBUG-88767 MouseArea: containsMouse property is not reset to false
-
- Reported
-
-
QTBUG-42578 MouseArea containsMouse is not cleared if item moves out of mouse position
-
- Closed
-
-
QTBUG-40475 MouseArea doesn't receive hover event if cursor isn't moving
-
- Closed
-
-
QTBUG-52537 MouseArea.onEntered not fired if component arrives under mouse
-
- Closed
-
-
QTBUG-33982 Position depending update of MouseArea containsMouse property
-
- Closed
-
-
QTBUG-42194 Provide a way to force re-evaluation of MouseArea's containsMouse property
-
- Closed
-
-
QTBUG-45146 MouseArea containsMouse is incorrect while button is pressed on another MouseArea
-
- Reported
-