本文整理匯總了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')