@@ -59,30 +59,30 @@ class QtBot:
59
59
60
60
Below are methods used to simulate sending key events to widgets:
61
61
62
- .. staticmethod:: keyClick (widget, key[, modifier=Qt.NoModifier[, delay=-1]])
63
- .. staticmethod:: keyClicks (widget, key_sequence[, modifier=Qt.NoModifier[, delay=-1]])
64
- .. staticmethod:: keyEvent (action, widget, key[, modifier=Qt.NoModifier[, delay=-1]])
65
- .. staticmethod:: keyPress (widget, key[, modifier=Qt.NoModifier[, delay=-1]])
66
- .. staticmethod:: keyRelease (widget, key[, modifier=Qt.NoModifier[, delay=-1]])
62
+ .. staticmethod:: keyClick (widget, key[, modifier=Qt.KeyboardModifier. NoModifier[, delay=-1]])
63
+ .. staticmethod:: keyClicks (widget, key_sequence[, modifier=Qt.KeyboardModifier. NoModifier[, delay=-1]])
64
+ .. staticmethod:: keyEvent (action, widget, key[, modifier=Qt.KeyboardModifier. NoModifier[, delay=-1]])
65
+ .. staticmethod:: keyPress (widget, key[, modifier=Qt.KeyboardModifier. NoModifier[, delay=-1]])
66
+ .. staticmethod:: keyRelease (widget, key[, modifier=Qt.KeyboardModifier. NoModifier[, delay=-1]])
67
67
68
68
Sends one or more keyboard events to a widget.
69
69
70
70
:param QWidget widget: the widget that will receive the event
71
71
72
- :param str|int key: key to send, it can be either a Qt.Key_* constant or a single character string.
72
+ :param str|int key: key to send, it can be either a Qt.Key. Key_* constant or a single character string.
73
73
74
74
.. _keyboard modifiers:
75
75
76
76
:param Qt.KeyboardModifier modifier: flags OR'ed together representing other modifier keys
77
77
also pressed. Possible flags are:
78
78
79
- * ``Qt.NoModifier``: No modifier key is pressed.
80
- * ``Qt.ShiftModifier``: A Shift key on the keyboard is pressed.
81
- * ``Qt.ControlModifier``: A Ctrl key on the keyboard is pressed.
82
- * ``Qt.AltModifier``: An Alt key on the keyboard is pressed.
83
- * ``Qt.MetaModifier``: A Meta key on the keyboard is pressed.
84
- * ``Qt.KeypadModifier``: A keypad button is pressed.
85
- * ``Qt.GroupSwitchModifier``: X11 only. A Mode_switch key on the keyboard is pressed.
79
+ * ``Qt.KeyboardModifier. NoModifier``: No modifier key is pressed.
80
+ * ``Qt.KeyboardModifier. ShiftModifier``: A Shift key on the keyboard is pressed.
81
+ * ``Qt.KeyboardModifier. ControlModifier``: A Ctrl key on the keyboard is pressed.
82
+ * ``Qt.KeyboardModifier. AltModifier``: An Alt key on the keyboard is pressed.
83
+ * ``Qt.KeyboardModifier. MetaModifier``: A Meta key on the keyboard is pressed.
84
+ * ``Qt.KeyboardModifier. KeypadModifier``: A keypad button is pressed.
85
+ * ``Qt.KeyboardModifier. GroupSwitchModifier``: X11 only. A Mode_switch key on the keyboard is pressed.
86
86
87
87
:param int delay: after the event, delay the test for this milliseconds (if > 0).
88
88
@@ -91,7 +91,7 @@ class QtBot:
91
91
92
92
Auxiliary method that converts the given constant to its equivalent ascii.
93
93
94
- :param Qt.Key_* key: one of the constants for keys in the Qt namespace.
94
+ :param Qt.Key. Key_* key: one of the constants for keys in the Qt namespace.
95
95
96
96
:return type: str
97
97
:returns: the equivalent character string.
@@ -102,11 +102,11 @@ class QtBot:
102
102
103
103
Below are methods used to simulate sending mouse events to widgets.
104
104
105
- .. staticmethod:: mouseClick (widget, button[, stateKey =0[, pos=QPoint()[, delay=-1]]])
106
- .. staticmethod:: mouseDClick (widget, button[, stateKey =0[, pos=QPoint()[, delay=-1]]])
105
+ .. staticmethod:: mouseClick (widget, button[, modifier =0[, pos=QPoint()[, delay=-1]]])
106
+ .. staticmethod:: mouseDClick (widget, button[, modifier =0[, pos=QPoint()[, delay=-1]]])
107
107
.. staticmethod:: mouseMove (widget[, pos=QPoint()[, delay=-1]])
108
- .. staticmethod:: mousePress (widget, button[, stateKey =0[, pos=QPoint()[, delay=-1]]])
109
- .. staticmethod:: mouseRelease (widget, button[, stateKey =0[, pos=QPoint()[, delay=-1]]])
108
+ .. staticmethod:: mousePress (widget, button[, modifier =0[, pos=QPoint()[, delay=-1]]])
109
+ .. staticmethod:: mouseRelease (widget, button[, modifier =0[, pos=QPoint()[, delay=-1]]])
110
110
111
111
Sends a mouse moves and clicks to a widget.
112
112
@@ -128,10 +128,12 @@ class QtBot:
128
128
:param Qt.KeyboardModifier modifier: flags OR'ed together representing other modifier keys
129
129
also pressed. See `keyboard modifiers`_.
130
130
131
- :param QPoint position : position of the mouse pointer.
131
+ :param QPoint pos : position of the mouse pointer.
132
132
133
133
:param int delay: after the event, delay the test for this milliseconds (if > 0).
134
134
135
+ .. note:: In the PySide bindings, the *modifier* argument is called *stateKey*.
136
+
135
137
136
138
.. _QTest API: http://doc.qt.io/qt-5/qtest.html
137
139
0 commit comments