本文整理汇总了Python中AnyQt.QtTest.QTest.keyClicks方法的典型用法代码示例。如果您正苦于以下问题:Python QTest.keyClicks方法的具体用法?Python QTest.keyClicks怎么用?Python QTest.keyClicks使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AnyQt.QtTest.QTest
的用法示例。
在下文中一共展示了QTest.keyClicks方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __set_value
# 需要导入模块: from AnyQt.QtTest import QTest [as 别名]
# 或者: from AnyQt.QtTest.QTest import keyClicks [as 别名]
def __set_value(widget, value):
if isinstance(widget, QLineEdit):
QTest.mouseClick(widget, Qt.LeftButton)
QTest.keyClicks(widget, value, delay=0)
QTest.keyClick(widget, Qt.Key_Enter)
elif isinstance(widget, QComboBox):
simulate.combobox_activate_item(widget, value)
else:
raise ValueError("Unsupported widget {}".format(widget))
示例2: enterFilter
# 需要导入模块: from AnyQt.QtTest import QTest [as 别名]
# 或者: from AnyQt.QtTest.QTest import keyClicks [as 别名]
def enterFilter(self, variable, filter, value=None, value2=None):
row = self.widget.cond_list.model().rowCount()
self.widget.add_button.click()
var_combo = self.widget.cond_list.cellWidget(row, 0)
simulate.combobox_activate_item(var_combo, variable.name, delay=0)
oper_combo = self.widget.cond_list.cellWidget(row, 1)
simulate.combobox_activate_item(oper_combo, filter, delay=0)
value_inputs = self._get_value_line_edits(row)
for i, value in enumerate([value, value2]):
if value is None:
continue
QTest.mouseClick(value_inputs[i], Qt.LeftButton)
QTest.keyClicks(value_inputs[i], value, delay=0)
QTest.keyClick(value_inputs[i], Qt.Key_Enter)
示例3: enter_text
# 需要导入模块: from AnyQt.QtTest import QTest [as 别名]
# 或者: from AnyQt.QtTest.QTest import keyClicks [as 别名]
def enter_text(widget, text):
# type: (QLineEdit, str) -> None
widget.selectAll()
QTest.keyClick(widget, Qt.Key_Delete)
QTest.keyClicks(widget, text)
QTest.keyClick(widget, Qt.Key_Return)