[ui] Viewer Fisheye Circle: disable MouseArea when unused

As the events cannot be propagated all the time as needed, at least unload the MouseArea when unused so the events are propagated.
This commit is contained in:
Fabien Castan 2020-03-24 21:12:37 +01:00
parent f19797c58f
commit 9ef6eb48fc

View file

@ -59,9 +59,12 @@ Rectangle {
}
}
MouseArea {
Loader {
anchors.fill: parent
active: !root.readOnly
sourceComponent: MouseArea {
id: mArea
enabled: !root.readOnly
anchors.fill: parent
cursorShape: root.readOnly ? Qt.ArrowCursor : (controlModifierEnabled ? Qt.SizeBDiagCursor : (pressed ? Qt.ClosedHandCursor : Qt.OpenHandCursor))
propagateComposedEvents: true
@ -73,7 +76,7 @@ Rectangle {
}
acceptedButtons: Qt.LeftButton
hoverEnabled: true
drag.target: parent
drag.target: root
drag.onActiveChanged: {
if(!drag.active) {
@ -94,3 +97,4 @@ Rectangle {
}
}
}
}