summaryrefslogtreecommitdiff
path: root/silx/gui/utils/testutils.py
diff options
context:
space:
mode:
Diffstat (limited to 'silx/gui/utils/testutils.py')
-rw-r--r--silx/gui/utils/testutils.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/silx/gui/utils/testutils.py b/silx/gui/utils/testutils.py
index 14dcc3f..c086657 100644
--- a/silx/gui/utils/testutils.py
+++ b/silx/gui/utils/testutils.py
@@ -1,7 +1,7 @@
# coding: utf-8
# /*##########################################################################
#
-# Copyright (c) 2016-2019 European Synchrotron Radiation Facility
+# Copyright (c) 2016-2020 European Synchrotron Radiation Facility
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
@@ -265,7 +265,7 @@ class TestCaseQt(unittest.TestCase):
"""
if modifier is None:
modifier = qt.Qt.KeyboardModifiers()
- pos = qt.QPoint(pos[0], pos[1]) if pos is not None else qt.QPoint()
+ pos = qt.QPoint(int(pos[0]), int(pos[1])) if pos is not None else qt.QPoint()
QTest.mouseClick(widget, button, modifier, pos, delay)
self.qWait(20)
@@ -276,7 +276,7 @@ class TestCaseQt(unittest.TestCase):
"""
if modifier is None:
modifier = qt.Qt.KeyboardModifiers()
- pos = qt.QPoint(pos[0], pos[1]) if pos is not None else qt.QPoint()
+ pos = qt.QPoint(int(pos[0]), int(pos[1])) if pos is not None else qt.QPoint()
QTest.mouseDClick(widget, button, modifier, pos, delay)
self.qWait(20)
@@ -285,7 +285,7 @@ class TestCaseQt(unittest.TestCase):
See QTest.mouseMove for details.
"""
- pos = qt.QPoint(pos[0], pos[1]) if pos is not None else qt.QPoint()
+ pos = qt.QPoint(int(pos[0]), int(pos[1])) if pos is not None else qt.QPoint()
QTest.mouseMove(widget, pos, delay)
self.qWait(20)
@@ -296,7 +296,7 @@ class TestCaseQt(unittest.TestCase):
"""
if modifier is None:
modifier = qt.Qt.KeyboardModifiers()
- pos = qt.QPoint(pos[0], pos[1]) if pos is not None else qt.QPoint()
+ pos = qt.QPoint(int(pos[0]), int(pos[1])) if pos is not None else qt.QPoint()
QTest.mousePress(widget, button, modifier, pos, delay)
self.qWait(20)
@@ -307,7 +307,7 @@ class TestCaseQt(unittest.TestCase):
"""
if modifier is None:
modifier = qt.Qt.KeyboardModifiers()
- pos = qt.QPoint(pos[0], pos[1]) if pos is not None else qt.QPoint()
+ pos = qt.QPoint(int(pos[0]), int(pos[1])) if pos is not None else qt.QPoint()
QTest.mouseRelease(widget, button, modifier, pos, delay)
self.qWait(20)
@@ -316,7 +316,7 @@ class TestCaseQt(unittest.TestCase):
See QTest.qSleep for details.
"""
- QTest.qSleep(ms + self.TIMEOUT_WAIT)
+ QTest.qSleep(int(ms) + self.TIMEOUT_WAIT)
@classmethod
def qWait(cls, ms=None):
@@ -337,7 +337,7 @@ class TestCaseQt(unittest.TestCase):
maxtime=timeout)
timeout = endTimeMS - int(time.time() * 1000)
else:
- QTest.qWait(ms + cls.TIMEOUT_WAIT)
+ QTest.qWait(int(ms) + cls.TIMEOUT_WAIT)
def qWaitForWindowExposed(self, window, timeout=None):
"""Waits until the window is shown in the screen.