本文整理汇总了Python中Testing.findQObjectsByName方法的典型用法代码示例。如果您正苦于以下问题:Python Testing.findQObjectsByName方法的具体用法?Python Testing.findQObjectsByName怎么用?Python Testing.findQObjectsByName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Testing
的用法示例。
在下文中一共展示了Testing.findQObjectsByName方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: addToNode
# 需要导入模块: import Testing [as 别名]
# 或者: from Testing import findQObjectsByName [as 别名]
def addToNode(self, w, path, expand=False, include=False):
if expand:
self.clickOnTree(w, path, expand=True)
if include:
self.clickOnTree(w, path, include=True)
node_widget = self.getNodeWidget(w, path)
add_button = Testing.findQObjectsByName(node_widget, "add_button")
self.assertEqual(add_button[0].isEnabled(), True)
self.clickButton(add_button)
示例2: saveNodeWidget
# 需要导入模块: import Testing [as 别名]
# 或者: from Testing import findQObjectsByName [as 别名]
def saveNodeWidget(self, w, path, old_path=None):
node_widget = self.getNodeWidget(w, path, old_path)
self.assertNotEqual(node_widget, None)
apply_button = Testing.findQObjectsByName(node_widget, "apply_button")
self.assertEqual(len(apply_button), 1)
self.assertEqual(apply_button[0].isEnabled(), True)
self.clickButton(apply_button)
Testing.process_events(self.qapp, t=PROCESS_EVENT_TIME)
self.assertEqual(apply_button[0].isEnabled(), False)
示例3: clickTab
# 需要导入模块: import Testing [as 别名]
# 或者: from Testing import findQObjectsByName [as 别名]
def clickTab(self, app, tab_name):
peacock_tab_widgets = Testing.findQObjectsByName(app, "PeacockMainWindow/tab_plugin")
self.assertEqual(len(peacock_tab_widgets), 1)
tabs = peacock_tab_widgets[0]
for i in range(tabs.count()):
if tabs.tabText(i) == tab_name:
tab_bar = tabs.tabBar()
rect = tab_bar.tabRect(i)
QTest.mouseMove(tab_bar, rect.center())
QTest.mouseClick(tab_bar, Qt.LeftButton, pos=rect.center(), delay=100)
Testing.process_events(self.qapp, t=PROCESS_EVENT_TIME)
return
示例4: changeParamTypeCombo
# 需要导入模块: import Testing [as 别名]
# 或者: from Testing import findQObjectsByName [as 别名]
def changeParamTypeCombo(self, w, path, new_type, old_path=None):
node_widget = self.getNodeWidget(w, path, old_path)
self.assertNotEqual(node_widget, None)
type_combo = Testing.findQObjectsByName(node_widget, "type_combo")
self.assertEqual(len(type_combo), 1)
target = type_combo[0]
QTest.mouseMove(target)
QTest.mouseClick(target, Qt.LeftButton, delay=100)
# Now the selector should pop up which is a QListView
list_views = Testing.findQObjectsByType(target, "PyQt5.QtWidgets.QListView")
self.assertEqual(len(list_views), 1)
lv = list_views[0]
model = lv.model()
matches = model.findItems(new_type)
self.assertEqual(len(matches), 1)
model_idx = model.indexFromItem(matches[0])
rect = lv.visualRect(model_idx)
QTest.mouseMove(lv, pos=rect.center())
Testing.process_events(self.qapp, t=PROCESS_EVENT_TIME)
QTest.mouseClick(lv.viewport(), Qt.LeftButton, pos=rect.center(), delay=100)
Testing.process_events(self.qapp, t=PROCESS_EVENT_TIME)