on xenial help sign in
[Stage/Spread] Detect mouse or touch events in newer qt versions (#33)
035c3feMarius Gripsgard
qml/Stage/Stage.qml+8−2
@@ -1726,11 +1726,12 @@ FocusScope {
1726
1726
1727 property int scrollAreaWidth: width / 3
1727 property int scrollAreaWidth: width / 3
1728 property bool progressiveScrollingEnabled: false
1728 property bool progressiveScrollingEnabled: false
1729+ property bool wasTouchPress: false
1729
1730
1730 onMouseXChanged: {
1731 onMouseXChanged: {
1731 mouse.accepted = false
1732 mouse.accepted = false
1732
1733
1733− if (hoverMouseArea.pressed) {
1734+ if (hoverMouseArea.pressed || wasTouchPress) {
1734 return;
1735 return;
1735 }
1736 }
1736
1737
@@ -1766,7 +1767,12 @@ FocusScope {
1766 }
1767 }
1767 }
1768 }
1768
1769
1770+ onPressed: {
1769− onPressed: mouse.accepted = false
1771+ mouse.accepted = false;
1772+ wasTouchPress = mouse.source === Qt.MouseEventSynthesizedByQt;
1773+ }
1774+
1775+ onExited: wasTouchPress = false;
1770 }
1776 }
1771
1777
1772 FloatingFlickable {
1778 FloatingFlickable {