本文整理汇总了Python中PySide.QtTest.QTest.keyClicks方法的典型用法代码示例。如果您正苦于以下问题:Python QTest.keyClicks方法的具体用法?Python QTest.keyClicks怎么用?Python QTest.keyClicks使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PySide.QtTest.QTest
的用法示例。
在下文中一共展示了QTest.keyClicks方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: keyClicks
# 需要导入模块: from PySide.QtTest import QTest [as 别名]
# 或者: from PySide.QtTest.QTest import keyClicks [as 别名]
def keyClicks(self, widget, sequence, modifier=qt.Qt.NoModifier, delay=-1):
"""Simulate clicking a sequence of keys.
See QTest.keyClick for details.
"""
QTest.keyClicks(widget, sequence, modifier, delay)
self.qWait(20)
示例2: test_campusLinkLastYears
# 需要导入模块: from PySide.QtTest import QTest [as 别名]
# 或者: from PySide.QtTest.QTest import keyClicks [as 别名]
def test_campusLinkLastYears(self):
self.ui.tabWid.setCurrentIndex(2)
gear = tests.mkGear('J', 10)
tests.enterGearInfo(self, gear)
QTest.mouseClick(self.tGear.updtBut, QtCore.Qt.LeftButton)
self.ui.tabWid.setCurrentIndex(1)
self.tMemb.nameSearch.clear()
memb = tests.mkMember('A', 1, forms=True, campusLink=True,
formsDate=Util.convert_date('Qt2DB', QtCore.QDate.currentDate().addDays(1)),
campusDate=Util.convert_date('Qt2DB', QtCore.QDate.currentDate().addDays(-10)))
QTest.keyClicks(self.tMemb.nameSearch, memb['FirstName'] + ' ' + memb['LastName'])
tests.enterMemberInfo(self, memb)
self.assertTrue(self.tMemb.Button_addUpdButClick())
self.ui.tabWid.setCurrentIndex(0)
setTransGear(self, gear, 'Name')
setTransMemb(self, memb)
QTest.mouseClick(self.tTran.payBut, QtCore.Qt.LeftButton)
QTest.mouseClick(self.tTran.payWind.payBut, QtCore.Qt.LeftButton)
self.tTran.payWind.close()
self.tTran.radioOut.click()
self.assertTrue(self.tTran.trans())
示例3: test_add_task_with_description
# 需要导入模块: from PySide.QtTest import QTest [as 别名]
# 或者: from PySide.QtTest.QTest import keyClicks [as 别名]
def test_add_task_with_description(self):
itemsBefore = self.form.listWidget.count()
'''ensures AddTaskEdit contains text'''
QTest.keyClicks(self.form.AddTaskEdit, "task one")
addButton = self.form.AddTaskButton
QTest.mouseClick(addButton, Qt.LeftButton)
'''assert there is one more item'''
self.assertEqual(self.form.listWidget.count(), itemsBefore+1)
示例4: test_add_task_without_description
# 需要导入模块: from PySide.QtTest import QTest [as 别名]
# 或者: from PySide.QtTest.QTest import keyClicks [as 别名]
def test_add_task_without_description(self):
itemsBefore = self.form.listWidget.count()
'''ensures AddTaskEdit is empty'''
QTest.keyClicks(self.form.AddTaskEdit, "")
addButton = self.form.AddTaskButton
QTest.mouseClick(addButton, Qt.LeftButton)
'''assert no items were added'''
self.assertEqual(self.form.listWidget.count(), itemsBefore)
示例5: setTransGear
# 需要导入模块: from PySide.QtTest import QTest [as 别名]
# 或者: from PySide.QtTest.QTest import keyClicks [as 别名]
def setTransGear(this, gearAttr, nameID):
if nameID == 'Name':
IDName = 'ID'
else:
IDName = 'Name'
this.tTran.gNameIDSearch.clear()
QTest.keyClicks(this.tTran.gNameIDSearch, gearAttr[nameID])
if this.tTran.gDissAmbSearch.count() > 1:
this.tTran.gDissAmbSearch.setCurrentIndex(this.tTran.gDissAmbSearch.findText(gearAttr[IDName]))
示例6: testConfigureDialog
# 需要导入模块: from PySide.QtTest import QTest [as 别名]
# 或者: from PySide.QtTest.QTest import keyClicks [as 别名]
def testConfigureDialog(self):
if self.pixmap_unavailable:
return
from mapclientplugins.pointcloudserializerstep.widgets.configuredialog import ConfigureDialog, ConfigureDialogState
state = ConfigureDialogState()
d = ConfigureDialog(state)
self.assertEqual(d._ui.buttonBox.button(QtGui.QDialogButtonBox.Ok).isEnabled(), False)
QTest.keyClicks(d._ui.identifierLineEdit, 'hello')
self.assertEqual(d._ui.buttonBox.button(QtGui.QDialogButtonBox.Ok).isEnabled(), True)
# QTest.mouseClick(d._ui.buttonBox.button(QtGui.QDialogButtonBox.Ok), QtCore.Qt.LeftButton)
newstate = d.getState()
self.assertEqual(newstate.identifier(), 'hello')
示例7: test_add_two_tasks_correct_size
# 需要导入模块: from PySide.QtTest import QTest [as 别名]
# 或者: from PySide.QtTest.QTest import keyClicks [as 别名]
def test_add_two_tasks_correct_size(self):
itemsBefore = self.form.listWidget.count()
currentHeight = self.form.listWidget.parentWidget().size().height()
'''ensures AddTaskEdit contains text'''
QTest.keyClicks(self.form.AddTaskEdit, "task one")
addButton = self.form.AddTaskButton
QTest.mouseClick(addButton, Qt.LeftButton)
QTest.mouseClick(addButton, Qt.LeftButton)
'''assert there is two more items, and size grew'''
self.assertEqual(self.form.listWidget.count(), itemsBefore+2)
newHeight = self.form.listWidget.parentWidget().size().height()
twoLines = 2*21
twoSpaces = 2*2
self.assertEqual(currentHeight+twoLines+twoSpaces, newHeight)
示例8: test_pbox
# 需要导入模块: from PySide.QtTest import QTest [as 别名]
# 或者: from PySide.QtTest.QTest import keyClicks [as 别名]
def test_pbox(self):
""" Method to test if a pbox can be displayed properly.
"""
# Create the box
self.mypbox = Pbox(self.mypyramiddesc)
self.mypbox._boxes["c2"].active = False
self.mypbox._boxes["c7"].active = False
getattr(self.mypbox._boxes["c7"].inputs, "inp").optional = True
# Test view
pview = PipelineView(self.mypbox)
pview.show()
# Start the qt loop
self.app.exec_()
# Test events
pview.zoom_in()
pview.zoom_out()
QTest.keyClicks(pview, "p")
示例9: setTransMemb
# 需要导入模块: from PySide.QtTest import QTest [as 别名]
# 或者: from PySide.QtTest.QTest import keyClicks [as 别名]
def setTransMemb(this, membAttr):
this.tTran.nameSearch.clear()
QTest.keyClicks(this.tTran.nameSearch, membAttr['FirstName'] + ' ' + membAttr['LastName'])
if this.tTran.bDayBox.count() > 1:
this.tTran.bDayBox.setCurrentIndex(this.tTran.bDayBox.findText(membAttr['Birthday']))