當前位置: 首頁>>代碼示例>>Python>>正文


Python QTest.mouseMove方法代碼示例

本文整理匯總了Python中qtpy.QtTest.QTest.mouseMove方法的典型用法代碼示例。如果您正苦於以下問題:Python QTest.mouseMove方法的具體用法?Python QTest.mouseMove怎麽用?Python QTest.mouseMove使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在qtpy.QtTest.QTest的用法示例。


在下文中一共展示了QTest.mouseMove方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: mouse_click

# 需要導入模塊: from qtpy.QtTest import QTest [as 別名]
# 或者: from qtpy.QtTest.QTest import mouseMove [as 別名]
def mouse_click(widget, pos, button=Qt.LeftButton):
    QTest.mouseMove(widget, pos)
    yield
    QTest.mousePress(widget, button, Qt.NoModifier, pos)
    yield
    QTest.mouseRelease(widget, button, Qt.NoModifier, pos)
    yield 0.1
開發者ID:mantidproject,項目名稱:mantid,代碼行數:9,代碼來源:gui_window_test.py

示例2: show_context_menu

# 需要導入模塊: from qtpy.QtTest import QTest [as 別名]
# 或者: from qtpy.QtTest.QTest import mouseMove [as 別名]
 def show_context_menu(self, widget, pos, pause=0):
     QTest.mouseMove(widget, pos)
     yield pause
     QTest.mouseClick(widget, Qt.RightButton, Qt.NoModifier, pos)
     yield pause
     ev = QMouseEvent(QEvent.ContextMenu, pos, Qt.RightButton, Qt.NoButton, Qt.NoModifier)
     QApplication.postEvent(widget, ev)
     yield self.wait_for_popup()
開發者ID:mantidproject,項目名稱:mantid,代碼行數:10,代碼來源:gui_window_test.py

示例3: drag_mouse

# 需要導入模塊: from qtpy.QtTest import QTest [as 別名]
# 或者: from qtpy.QtTest.QTest import mouseMove [as 別名]
def drag_mouse(widget, from_pos, to_pos):
    QTest.mousePress(widget, Qt.LeftButton, Qt.NoModifier, from_pos)
    yield
    QTest.mouseMove(widget, from_pos)
    yield 0.1
    QTest.mouseMove(widget, to_pos)
    yield 0.1
    QTest.mouseRelease(widget, Qt.LeftButton, Qt.NoModifier, to_pos)
    yield 0.1
開發者ID:mantidproject,項目名稱:mantid,代碼行數:11,代碼來源:gui_window_test.py

示例4: mouse_trigger_action

# 需要導入模塊: from qtpy.QtTest import QTest [as 別名]
# 或者: from qtpy.QtTest.QTest import mouseMove [as 別名]
 def mouse_trigger_action(self, name, pause=0):
     menu = self.get_active_popup_widget()
     a, m = self.get_action(name, get_menu=True)
     pos = menu.actionGeometry(a).center()
     QTest.mouseMove(menu, pos)
     yield pause
     self.hover_action(name)
     QTest.mousePress(menu, Qt.LeftButton, Qt.NoModifier, pos)
     yield pause
     QTest.mouseRelease(menu, Qt.LeftButton, Qt.NoModifier, pos)
開發者ID:mantidproject,項目名稱:mantid,代碼行數:12,代碼來源:gui_window_test.py

示例5: view_set_parameter

# 需要導入模塊: from qtpy.QtTest import QTest [as 別名]
# 或者: from qtpy.QtTest.QTest import mouseMove [as 別名]
 def view_set_parameter(self, param_name, value):
     view = self.widget.view()
     rect = view.getVisualRectParameterProperty(param_name)
     pos = rect.center()
     if self.is_multi:
         pos -= QPoint(rect.width() / 5, 0)
     else:
         pos += QPoint(rect.width() / 4, 0)
     tree = view.treeWidget().viewport()
     QTest.mouseMove(tree, pos)
     yield
     QTest.mouseClick(tree, Qt.LeftButton, Qt.NoModifier, pos)
     yield
     editor = QApplication.focusWidget()
     QTest.keyClicks(editor, str(value))
     QTest.keyClick(editor, Qt.Key_Return)
開發者ID:mantidproject,項目名稱:mantid,代碼行數:18,代碼來源:test_functionbrowser.py

示例6: click_on

# 需要導入模塊: from qtpy.QtTest import QTest [as 別名]
# 或者: from qtpy.QtTest.QTest import mouseMove [as 別名]
def click_on(widget, pos, pause=0):
    QTest.mouseMove(widget, pos)
    yield pause
    QTest.mouseClick(widget, Qt.LeftButton, Qt.NoModifier, pos)
    yield pause
開發者ID:mantidproject,項目名稱:mantid,代碼行數:7,代碼來源:gui_window_test.py


注:本文中的qtpy.QtTest.QTest.mouseMove方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。