Skip to content

Commit

Permalink
Merge pull request #47 from Djedouas/patch-1
Browse files Browse the repository at this point in the history
Fix QTest with static methods
  • Loading branch information
stlehmann authored May 30, 2020
2 parents 9216a0c + 041fa32 commit 91f334f
Showing 1 changed file with 74 additions and 37 deletions.
111 changes: 74 additions & 37 deletions PyQt5-stubs/QtTest.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -101,73 +101,110 @@ class QTest(sip.simplewrapper):
def press(self, touchId: int, pt: QtCore.QPoint, widget: QtWidgets.QWidget) -> 'QTest.QTouchEventSequence': ...

@typing.overload
def touchEvent(self, widget: QtWidgets.QWidget, device: QtGui.QTouchDevice) -> 'QTest.QTouchEventSequence': ...
@staticmethod
def touchEvent(widget: QtWidgets.QWidget, device: QtGui.QTouchDevice) -> 'QTest.QTouchEventSequence': ...
@typing.overload
def touchEvent(self, window: QtGui.QWindow, device: QtGui.QTouchDevice) -> 'QTest.QTouchEventSequence': ...
@staticmethod
def touchEvent(window: QtGui.QWindow, device: QtGui.QTouchDevice) -> 'QTest.QTouchEventSequence': ...
@typing.overload
def qWaitForWindowExposed(self, window: QtGui.QWindow, timeout: int = ...) -> bool: ...
@staticmethod
def qWaitForWindowExposed(window: QtGui.QWindow, timeout: int = ...) -> bool: ...
@typing.overload
def qWaitForWindowExposed(self, widget: QtWidgets.QWidget, timeout: int = ...) -> bool: ...
@staticmethod
def qWaitForWindowExposed(widget: QtWidgets.QWidget, timeout: int = ...) -> bool: ...
@typing.overload
def qWaitForWindowActive(self, window: QtGui.QWindow, timeout: int = ...) -> bool: ...
@staticmethod
def qWaitForWindowActive(window: QtGui.QWindow, timeout: int = ...) -> bool: ...
@typing.overload
def qWaitForWindowActive(self, widget: QtWidgets.QWidget, timeout: int = ...) -> bool: ...
def qWait(self, ms: int) -> None: ...
@staticmethod
def qWaitForWindowActive(widget: QtWidgets.QWidget, timeout: int = ...) -> bool: ...
@staticmethod
def qWait(ms: int) -> None: ...
@typing.overload
def mouseRelease(self, widget: QtWidgets.QWidget, button: QtCore.Qt.MouseButton, modifier: typing.Union[QtCore.Qt.KeyboardModifiers, QtCore.Qt.KeyboardModifier] = ..., pos: QtCore.QPoint = ..., delay: int = ...) -> None: ...
@staticmethod
def mouseRelease(widget: QtWidgets.QWidget, button: QtCore.Qt.MouseButton, modifier: typing.Union[QtCore.Qt.KeyboardModifiers, QtCore.Qt.KeyboardModifier] = ..., pos: QtCore.QPoint = ..., delay: int = ...) -> None: ...
@typing.overload
def mouseRelease(self, window: QtGui.QWindow, button: QtCore.Qt.MouseButton, modifier: typing.Union[QtCore.Qt.KeyboardModifiers, QtCore.Qt.KeyboardModifier] = ..., pos: QtCore.QPoint = ..., delay: int = ...) -> None: ...
@staticmethod
def mouseRelease(window: QtGui.QWindow, button: QtCore.Qt.MouseButton, modifier: typing.Union[QtCore.Qt.KeyboardModifiers, QtCore.Qt.KeyboardModifier] = ..., pos: QtCore.QPoint = ..., delay: int = ...) -> None: ...
@typing.overload
def mousePress(self, widget: QtWidgets.QWidget, button: QtCore.Qt.MouseButton, modifier: typing.Union[QtCore.Qt.KeyboardModifiers, QtCore.Qt.KeyboardModifier] = ..., pos: QtCore.QPoint = ..., delay: int = ...) -> None: ...
@staticmethod
def mousePress(widget: QtWidgets.QWidget, button: QtCore.Qt.MouseButton, modifier: typing.Union[QtCore.Qt.KeyboardModifiers, QtCore.Qt.KeyboardModifier] = ..., pos: QtCore.QPoint = ..., delay: int = ...) -> None: ...
@typing.overload
def mousePress(self, window: QtGui.QWindow, button: QtCore.Qt.MouseButton, modifier: typing.Union[QtCore.Qt.KeyboardModifiers, QtCore.Qt.KeyboardModifier] = ..., pos: QtCore.QPoint = ..., delay: int = ...) -> None: ...
@staticmethod
def mousePress(window: QtGui.QWindow, button: QtCore.Qt.MouseButton, modifier: typing.Union[QtCore.Qt.KeyboardModifiers, QtCore.Qt.KeyboardModifier] = ..., pos: QtCore.QPoint = ..., delay: int = ...) -> None: ...
@typing.overload
def mouseMove(self, widget: QtWidgets.QWidget, pos: QtCore.QPoint = ..., delay: int = ...) -> None: ...
@staticmethod
def mouseMove(widget: QtWidgets.QWidget, pos: QtCore.QPoint = ..., delay: int = ...) -> None: ...
@typing.overload
def mouseMove(self, window: QtGui.QWindow, pos: QtCore.QPoint = ..., delay: int = ...) -> None: ...
@staticmethod
def mouseMove(window: QtGui.QWindow, pos: QtCore.QPoint = ..., delay: int = ...) -> None: ...
@typing.overload
def mouseDClick(self, widget: QtWidgets.QWidget, button: QtCore.Qt.MouseButton, modifier: typing.Union[QtCore.Qt.KeyboardModifiers, QtCore.Qt.KeyboardModifier] = ..., pos: QtCore.QPoint = ..., delay: int = ...) -> None: ...
@staticmethod
def mouseDClick(widget: QtWidgets.QWidget, button: QtCore.Qt.MouseButton, modifier: typing.Union[QtCore.Qt.KeyboardModifiers, QtCore.Qt.KeyboardModifier] = ..., pos: QtCore.QPoint = ..., delay: int = ...) -> None: ...
@typing.overload
def mouseDClick(self, window: QtGui.QWindow, button: QtCore.Qt.MouseButton, modifier: typing.Union[QtCore.Qt.KeyboardModifiers, QtCore.Qt.KeyboardModifier] = ..., pos: QtCore.QPoint = ..., delay: int = ...) -> None: ...
@staticmethod
def mouseDClick(window: QtGui.QWindow, button: QtCore.Qt.MouseButton, modifier: typing.Union[QtCore.Qt.KeyboardModifiers, QtCore.Qt.KeyboardModifier] = ..., pos: QtCore.QPoint = ..., delay: int = ...) -> None: ...
@typing.overload
def mouseClick(self, widget: QtWidgets.QWidget, button: QtCore.Qt.MouseButton, modifier: typing.Union[QtCore.Qt.KeyboardModifiers, QtCore.Qt.KeyboardModifier] = ..., pos: QtCore.QPoint = ..., delay: int = ...) -> None: ...
@staticmethod
def mouseClick(widget: QtWidgets.QWidget, button: QtCore.Qt.MouseButton, modifier: typing.Union[QtCore.Qt.KeyboardModifiers, QtCore.Qt.KeyboardModifier] = ..., pos: QtCore.QPoint = ..., delay: int = ...) -> None: ...
@typing.overload
def mouseClick(self, window: QtGui.QWindow, button: QtCore.Qt.MouseButton, modifier: typing.Union[QtCore.Qt.KeyboardModifiers, QtCore.Qt.KeyboardModifier] = ..., pos: QtCore.QPoint = ..., delay: int = ...) -> None: ...
@staticmethod
def mouseClick(window: QtGui.QWindow, button: QtCore.Qt.MouseButton, modifier: typing.Union[QtCore.Qt.KeyboardModifiers, QtCore.Qt.KeyboardModifier] = ..., pos: QtCore.QPoint = ..., delay: int = ...) -> None: ...
@typing.overload
def keySequence(self, widget: QtWidgets.QWidget, keySequence: typing.Union[QtGui.QKeySequence, QtGui.QKeySequence.StandardKey, str, int]) -> None: ...
@staticmethod
def keySequence(widget: QtWidgets.QWidget, keySequence: typing.Union[QtGui.QKeySequence, QtGui.QKeySequence.StandardKey, str, int]) -> None: ...
@typing.overload
def keySequence(self, window: QtGui.QWindow, keySequence: typing.Union[QtGui.QKeySequence, QtGui.QKeySequence.StandardKey, str, int]) -> None: ...
@staticmethod
def keySequence(window: QtGui.QWindow, keySequence: typing.Union[QtGui.QKeySequence, QtGui.QKeySequence.StandardKey, str, int]) -> None: ...
@typing.overload
def keyRelease(self, widget: QtWidgets.QWidget, key: QtCore.Qt.Key, modifier: typing.Union[QtCore.Qt.KeyboardModifiers, QtCore.Qt.KeyboardModifier] = ..., delay: int = ...) -> None: ...
@staticmethod
def keyRelease(widget: QtWidgets.QWidget, key: QtCore.Qt.Key, modifier: typing.Union[QtCore.Qt.KeyboardModifiers, QtCore.Qt.KeyboardModifier] = ..., delay: int = ...) -> None: ...
@typing.overload
def keyRelease(self, widget: QtWidgets.QWidget, key: str, modifier: typing.Union[QtCore.Qt.KeyboardModifiers, QtCore.Qt.KeyboardModifier] = ..., delay: int = ...) -> None: ... # type: ignore
@staticmethod
def keyRelease(widget: QtWidgets.QWidget, key: str, modifier: typing.Union[QtCore.Qt.KeyboardModifiers, QtCore.Qt.KeyboardModifier] = ..., delay: int = ...) -> None: ... # type: ignore
@typing.overload
def keyRelease(self, window: QtGui.QWindow, key: QtCore.Qt.Key, modifier: typing.Union[QtCore.Qt.KeyboardModifiers, QtCore.Qt.KeyboardModifier] = ..., delay: int = ...) -> None: ...
@staticmethod
def keyRelease(window: QtGui.QWindow, key: QtCore.Qt.Key, modifier: typing.Union[QtCore.Qt.KeyboardModifiers, QtCore.Qt.KeyboardModifier] = ..., delay: int = ...) -> None: ...
@typing.overload
def keyRelease(self, window: QtGui.QWindow, key: str, modifier: typing.Union[QtCore.Qt.KeyboardModifiers, QtCore.Qt.KeyboardModifier] = ..., delay: int = ...) -> None: ... # type: ignore
@staticmethod
def keyRelease(window: QtGui.QWindow, key: str, modifier: typing.Union[QtCore.Qt.KeyboardModifiers, QtCore.Qt.KeyboardModifier] = ..., delay: int = ...) -> None: ... # type: ignore
@typing.overload
def keyPress(self, widget: QtWidgets.QWidget, key: QtCore.Qt.Key, modifier: typing.Union[QtCore.Qt.KeyboardModifiers, QtCore.Qt.KeyboardModifier] = ..., delay: int = ...) -> None: ...
@staticmethod
def keyPress(widget: QtWidgets.QWidget, key: QtCore.Qt.Key, modifier: typing.Union[QtCore.Qt.KeyboardModifiers, QtCore.Qt.KeyboardModifier] = ..., delay: int = ...) -> None: ...
@typing.overload
def keyPress(self, widget: QtWidgets.QWidget, key: str, modifier: typing.Union[QtCore.Qt.KeyboardModifiers, QtCore.Qt.KeyboardModifier] = ..., delay: int = ...) -> None: ... # type: ignore
@staticmethod
def keyPress(widget: QtWidgets.QWidget, key: str, modifier: typing.Union[QtCore.Qt.KeyboardModifiers, QtCore.Qt.KeyboardModifier] = ..., delay: int = ...) -> None: ... # type: ignore
@typing.overload
def keyPress(self, window: QtGui.QWindow, key: QtCore.Qt.Key, modifier: typing.Union[QtCore.Qt.KeyboardModifiers, QtCore.Qt.KeyboardModifier] = ..., delay: int = ...) -> None: ...
@staticmethod
def keyPress(window: QtGui.QWindow, key: QtCore.Qt.Key, modifier: typing.Union[QtCore.Qt.KeyboardModifiers, QtCore.Qt.KeyboardModifier] = ..., delay: int = ...) -> None: ...
@typing.overload
def keyPress(self, window: QtGui.QWindow, key: str, modifier: typing.Union[QtCore.Qt.KeyboardModifiers, QtCore.Qt.KeyboardModifier] = ..., delay: int = ...) -> None: ... # type: ignore
@staticmethod
def keyPress(window: QtGui.QWindow, key: str, modifier: typing.Union[QtCore.Qt.KeyboardModifiers, QtCore.Qt.KeyboardModifier] = ..., delay: int = ...) -> None: ... # type: ignore
@typing.overload
def keyEvent(self, action: 'QTest.KeyAction', widget: QtWidgets.QWidget, key: QtCore.Qt.Key, modifier: typing.Union[QtCore.Qt.KeyboardModifiers, QtCore.Qt.KeyboardModifier] = ..., delay: int = ...) -> None: ...
@staticmethod
def keyEvent(action: 'QTest.KeyAction', widget: QtWidgets.QWidget, key: QtCore.Qt.Key, modifier: typing.Union[QtCore.Qt.KeyboardModifiers, QtCore.Qt.KeyboardModifier] = ..., delay: int = ...) -> None: ...
@typing.overload
def keyEvent(self, action: 'QTest.KeyAction', widget: QtWidgets.QWidget, ascii: str, modifier: typing.Union[QtCore.Qt.KeyboardModifiers, QtCore.Qt.KeyboardModifier] = ..., delay: int = ...) -> None: ...
@staticmethod
def keyEvent(action: 'QTest.KeyAction', widget: QtWidgets.QWidget, ascii: str, modifier: typing.Union[QtCore.Qt.KeyboardModifiers, QtCore.Qt.KeyboardModifier] = ..., delay: int = ...) -> None: ...
@typing.overload
def keyEvent(self, action: 'QTest.KeyAction', window: QtGui.QWindow, key: QtCore.Qt.Key, modifier: typing.Union[QtCore.Qt.KeyboardModifiers, QtCore.Qt.KeyboardModifier] = ..., delay: int = ...) -> None: ...
@staticmethod
def keyEvent(action: 'QTest.KeyAction', window: QtGui.QWindow, key: QtCore.Qt.Key, modifier: typing.Union[QtCore.Qt.KeyboardModifiers, QtCore.Qt.KeyboardModifier] = ..., delay: int = ...) -> None: ...
@typing.overload
def keyEvent(self, action: 'QTest.KeyAction', window: QtGui.QWindow, ascii: str, modifier: typing.Union[QtCore.Qt.KeyboardModifiers, QtCore.Qt.KeyboardModifier] = ..., delay: int = ...) -> None: ...
def keyClicks(self, widget: QtWidgets.QWidget, sequence: str, modifier: typing.Union[QtCore.Qt.KeyboardModifiers, QtCore.Qt.KeyboardModifier] = ..., delay: int = ...) -> None: ...
@staticmethod
def keyEvent(action: 'QTest.KeyAction', window: QtGui.QWindow, ascii: str, modifier: typing.Union[QtCore.Qt.KeyboardModifiers, QtCore.Qt.KeyboardModifier] = ..., delay: int = ...) -> None: ...
@staticmethod
def keyClicks(widget: QtWidgets.QWidget, sequence: str, modifier: typing.Union[QtCore.Qt.KeyboardModifiers, QtCore.Qt.KeyboardModifier] = ..., delay: int = ...) -> None: ...
@typing.overload
def keyClick(self, widget: QtWidgets.QWidget, key: QtCore.Qt.Key, modifier: typing.Union[QtCore.Qt.KeyboardModifiers, QtCore.Qt.KeyboardModifier] = ..., delay: int = ...) -> None: ...
@staticmethod
def keyClick(widget: QtWidgets.QWidget, key: QtCore.Qt.Key, modifier: typing.Union[QtCore.Qt.KeyboardModifiers, QtCore.Qt.KeyboardModifier] = ..., delay: int = ...) -> None: ...
@typing.overload
def keyClick(self, widget: QtWidgets.QWidget, key: str, modifier: typing.Union[QtCore.Qt.KeyboardModifiers, QtCore.Qt.KeyboardModifier] = ..., delay: int = ...) -> None: ... # type: ignore
@staticmethod
def keyClick(widget: QtWidgets.QWidget, key: str, modifier: typing.Union[QtCore.Qt.KeyboardModifiers, QtCore.Qt.KeyboardModifier] = ..., delay: int = ...) -> None: ... # type: ignore
@typing.overload
def keyClick(self, window: QtGui.QWindow, key: QtCore.Qt.Key, modifier: typing.Union[QtCore.Qt.KeyboardModifiers, QtCore.Qt.KeyboardModifier] = ..., delay: int = ...) -> None: ...
@staticmethod
def keyClick(window: QtGui.QWindow, key: QtCore.Qt.Key, modifier: typing.Union[QtCore.Qt.KeyboardModifiers, QtCore.Qt.KeyboardModifier] = ..., delay: int = ...) -> None: ...
@typing.overload
def keyClick(self, window: QtGui.QWindow, key: str, modifier: typing.Union[QtCore.Qt.KeyboardModifiers, QtCore.Qt.KeyboardModifier] = ..., delay: int = ...) -> None: ... # type: ignore
def qSleep(self, ms: int) -> None: ...
@staticmethod
def keyClick(window: QtGui.QWindow, key: str, modifier: typing.Union[QtCore.Qt.KeyboardModifiers, QtCore.Qt.KeyboardModifier] = ..., delay: int = ...) -> None: ... # type: ignore
@staticmethod
def qSleep(ms: int) -> None: ...

0 comments on commit 91f334f

Please sign in to comment.