on xenial help sign in
[Stage/Spread] Detect mouse or touch events in newer qt versions (#33)
4664efeMarius Gripsgard
qml/Stage/Stage.qml+8−2
@@ -1885,11 +1885,12 @@ FocusScope {
1885
1885
1886 property int scrollAreaWidth: width / 3
1886 property int scrollAreaWidth: width / 3
1887 property bool progressiveScrollingEnabled: false
1887 property bool progressiveScrollingEnabled: false
1888+ property bool wasTouchPress: false
1888
1889
1889 onMouseXChanged: {
1890 onMouseXChanged: {
1890 mouse.accepted = false
1891 mouse.accepted = false
1891
1892
1892− if (hoverMouseArea.pressed) {
1893+ if (hoverMouseArea.pressed || wasTouchPress) {
1893 return;
1894 return;
1894 }
1895 }
1895
1896
@@ -1925,7 +1926,12 @@ FocusScope {
1925 }
1926 }
1926 }
1927 }
1927
1928
1929+ onPressed: {
1928− onPressed: mouse.accepted = false
1930+ mouse.accepted = false;
1931+ wasTouchPress = mouse.source === Qt.MouseEventSynthesizedByQt;
1932+ }
1933+
1934+ onExited: wasTouchPress = false;
1929 }
1935 }
1930
1936
1931 FloatingFlickable {
1937 FloatingFlickable {