Skip to content

Commit d228fa2

Browse files
committed
Touch input support: removed Qt5 specific code
1 parent 17841af commit d228fa2

2 files changed

Lines changed: 5 additions & 19 deletions

File tree

plotpy/events.py

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,6 @@
2828
CursorShape = type(QC.Qt.CursorShape.ArrowCursor)
2929

3030

31-
def is_touch_screen_available() -> bool:
32-
"""Check if a touch screen is available.
33-
34-
Returns:
35-
bool: True if a touch screen is available, False otherwise.
36-
"""
37-
touch_devices = QG.QTouchDevice.devices()
38-
return any(device.type() == QG.QTouchDevice.TouchScreen for device in touch_devices)
39-
40-
4131
def buttons_to_str(buttons: int) -> str:
4232
"""Conversion des flags Qt en chaine"""
4333
string = ""
@@ -1155,12 +1145,11 @@ def setup_standard_tool_filter(filter, start_state):
11551145
ZoomHandler(filter, QC.Qt.RightButton, start_state=start_state)
11561146
MenuHandler(filter, QC.Qt.RightButton, start_state=start_state)
11571147

1158-
if is_touch_screen_available():
1159-
# Gestes
1160-
PinchZoomHandler(filter, start_state=start_state)
1161-
# FIXME: Pinch/PanZoomHandler are currently mutually exclusive: when both
1162-
# are enabled, it doesn't work ; when only one is enabled, it works
1163-
PanGestureHandler(filter, start_state=start_state)
1148+
# Gestes
1149+
PinchZoomHandler(filter, start_state=start_state)
1150+
# FIXME: Pinch/PanZoomHandler are currently mutually exclusive: when both
1151+
# are enabled, it doesn't work ; when only one is enabled, it works
1152+
PanGestureHandler(filter, start_state=start_state)
11641153

11651154
# Autres (touches, move)
11661155
MoveHandler(filter, start_state=start_state)

plotpy/tests/items/test_image.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,15 @@
1010

1111
# guitest: show
1212

13-
from guidata.env import execenv
1413
from guidata.qthelpers import qt_app_context
1514

1615
from plotpy.builder import make
17-
from plotpy.events import is_touch_screen_available
1816
from plotpy.tests import data as ptd
1917
from plotpy.tests import vistools as ptv
2018

2119

2220
def test_image():
2321
"""Testing ImageItem object"""
24-
execenv.print(f"Touch screen available: {is_touch_screen_available()}")
2522
for index, func in enumerate((ptd.gen_image1, ptd.gen_image2, ptd.gen_image3)):
2623
title = test_image.__doc__ + f" #{index+1}"
2724
data = func()

0 commit comments

Comments
 (0)