当前位置: 首页>>代码示例>>Python>>正文


Python Testing.findQObjectsByName方法代码示例

本文整理汇总了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)
开发者ID:aeslaughter,项目名称:moose,代码行数:11,代码来源:InputTesting.py

示例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)
开发者ID:aeslaughter,项目名称:moose,代码行数:11,代码来源:InputTesting.py

示例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
开发者ID:aeslaughter,项目名称:moose,代码行数:14,代码来源:InputTesting.py

示例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)
开发者ID:aeslaughter,项目名称:moose,代码行数:23,代码来源:InputTesting.py


注:本文中的Testing.findQObjectsByName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。