本文整理汇总了Python中qtpy.QtTest.QTest.keyClicks方法的典型用法代码示例。如果您正苦于以下问题:Python QTest.keyClicks方法的具体用法?Python QTest.keyClicks怎么用?Python QTest.keyClicks使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类qtpy.QtTest.QTest
的用法示例。
在下文中一共展示了QTest.keyClicks方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: view_set_parameter
# 需要导入模块: from qtpy.QtTest import QTest [as 别名]
# 或者: from qtpy.QtTest.QTest import keyClicks [as 别名]
def view_set_parameter(self, param_name, value):
view = self.widget.view()
rect = view.getVisualRectParameterProperty(param_name)
pos = rect.center()
if self.is_multi:
pos -= QPoint(rect.width() / 5, 0)
else:
pos += QPoint(rect.width() / 4, 0)
tree = view.treeWidget().viewport()
QTest.mouseMove(tree, pos)
yield
QTest.mouseClick(tree, Qt.LeftButton, Qt.NoModifier, pos)
yield
editor = QApplication.focusWidget()
QTest.keyClicks(editor, str(value))
QTest.keyClick(editor, Qt.Key_Return)
示例2: enter_value_into_text_field
# 需要导入模块: from qtpy.QtTest import QTest [as 别名]
# 或者: from qtpy.QtTest.QTest import keyClicks [as 别名]
def enter_value_into_text_field(text_field, value):
text_field.setText('')
QTest.keyClicks(text_field, str(value))
QTest.keyPress(text_field, QtCore.Qt.Key_Enter)
QtWidgets.QApplication.processEvents()
示例3: test_filter_text_typing_calls_presenter_and_sets_filter_text
# 需要导入模块: from qtpy.QtTest import QTest [as 别名]
# 或者: from qtpy.QtTest.QTest import keyClicks [as 别名]
def test_filter_text_typing_calls_presenter_and_sets_filter_text(self):
QTest.keyClicks(self.view.filter_box, 'plot1')
self.assertEquals(self.presenter.filter_text_changed.call_count, 5)
self.assertEquals(self.view.get_filter_text(), 'plot1')