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


Python QTest.mouseDClick方法代码示例

本文整理汇总了Python中qtpy.QtTest.QTest.mouseDClick方法的典型用法代码示例。如果您正苦于以下问题:Python QTest.mouseDClick方法的具体用法?Python QTest.mouseDClick怎么用?Python QTest.mouseDClick使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在qtpy.QtTest.QTest的用法示例。


在下文中一共展示了QTest.mouseDClick方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_run_dialog_opens_on_double_click

# 需要导入模块: from qtpy.QtTest import QTest [as 别名]
# 或者: from qtpy.QtTest.QTest import mouseDClick [as 别名]
 def test_run_dialog_opens_on_double_click(self):
     with patch(createDialogFromName_func_name) as createDialog:
         widget = AlgorithmSelectorWidget()
         self._select_in_tree(widget, 'Load v.1')
         selected_item = widget.tree.selectedItems()[0]
         item_pos = widget.tree.visualItemRect(selected_item).center()
         QTest.mouseDClick(widget.tree.viewport(), Qt.LeftButton,
                           Qt.NoModifier, pos=item_pos)
         createDialog.assert_called_once_with('Load', 1)
开发者ID:mantidproject,项目名称:mantid,代码行数:11,代码来源:test_algorithmselector.py

示例2: test_plot_name_double_clicked_calls_presenter_and_makes_plot_current

# 需要导入模块: from qtpy.QtTest import QTest [as 别名]
# 或者: from qtpy.QtTest.QTest import mouseDClick [as 别名]
    def test_plot_name_double_clicked_calls_presenter_and_makes_plot_current(self):
        plot_numbers = [0, 1, 2]
        self.view.set_plot_list(plot_numbers)

        item = self.view.table_widget.item(1, 1)
        item_center = self.view.table_widget.visualItemRect(item).center()
        # This single click should not be required, but otherwise the double click is not registered
        QTest.mouseClick(self.view.table_widget.viewport(), Qt.LeftButton, pos=item_center)
        QTest.mouseDClick(self.view.table_widget.viewport(), Qt.LeftButton, pos=item_center)

        self.assertEqual(self.presenter.show_single_selected.call_count, 1)
        # Expected result: 1
        # Something goes wrong in QTest here and the selection is
        # always the first plot.
        self.assertEqual(self.view.get_currently_selected_plot_number(), 0)
开发者ID:mantidproject,项目名称:mantid,代码行数:17,代码来源:test_plotselector_view.py


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