Details
-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
5.11.1
-
None
Description
A disabled Mousearea forwards mouse events to the 'background'.
this is troublesome for me in many cases right now.
for example when i have a button that sits on top of a map-view.
the map view accepts doubleclick to maximize/unmaximize or zoom.
the button is sometimes disabled. and when it is disabled and the user still tries to click/tap on it multiple times, the action of the underlying element will be executed (in this case maximizing the view or zooming)
it would be desireable that the mouse area still catches and consumes these events without triggering the action when disabled.
right now i have to implement a second enabled property that replicates the buildin enabled property except for the mouse area.
this is especially difficult for the QtQuick controls 2 switch.
import QtQuick 2.12 import QtQuick.Window 2.12 Window { visible: true width: 400 height: 400 title: "qtbug69696" MouseArea { anchors.fill: parent onDoubleClicked: print("double clicked") Rectangle { anchors.fill: parent color: "tomato" opacity: 0.4 } MouseArea { enabled: false anchors.fill: parent anchors.margins: 100 Rectangle { anchors.fill: parent color: "steelblue" } Text { text: "Double-clicking in this square should not result in anything being printed" color: "white" fontSizeMode: Text.Fit wrapMode: Text.Wrap anchors.fill: parent anchors.margins: 20 } } } }
Attachments
Issue Links
- relates to
-
QTBUG-103788 Disabling parent of MouseArea in onPressed gets stuck with mouse but not through touch
-
- Closed
-
- resulted from
-
QTBUG-38364 MouseArea doesn't propagate the disabled state to children
-
- Open
-