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


Python QTest.mousePress方法代码示例

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


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

示例1: test_mouse_press

# 需要导入模块: from pyqode.qt.QtTest import QTest [as 别名]
# 或者: from pyqode.qt.QtTest.QTest import mousePress [as 别名]
def test_mouse_press(editor):
    panel = get_panel(editor)
    y_pos = TextHelper(editor).line_pos_from_number(0)
    QTest.mousePress(panel, QtCore.Qt.RightButton, QtCore.Qt.NoModifier,
                     QtCore.QPoint(1000, 1000))
    QTest.mousePress(panel, QtCore.Qt.RightButton, QtCore.Qt.NoModifier,
                     QtCore.QPoint(3, y_pos))
开发者ID:SirmoGames,项目名称:pyqode.core,代码行数:9,代码来源:test_line_nbr.py

示例2: toggle_fold_trigger

# 需要导入模块: from pyqode.qt.QtTest import QTest [as 别名]
# 或者: from pyqode.qt.QtTest.QTest import mousePress [as 别名]
def toggle_fold_trigger(editor, line, panel):
    y_pos = TextHelper(editor).line_pos_from_number(line) + 5
    QTest.mouseMove(panel, QtCore.QPoint(3, y_pos))
    QTest.qWait(1000)
    QTest.mousePress(panel, QtCore.Qt.RightButton, QtCore.Qt.NoModifier,
                     QtCore.QPoint(3, y_pos))
    QTest.qWait(1000)
开发者ID:must40,项目名称:pyqode.core,代码行数:9,代码来源:test_folding.py

示例3: test_mouse_press

# 需要导入模块: from pyqode.qt.QtTest import QTest [as 别名]
# 或者: from pyqode.qt.QtTest.QTest import mousePress [as 别名]
def test_mouse_press(editor):
    panel = get_panel(editor)
    panel.clear_markers()
    marker = panels.Marker(1, icon=':/pyqode-icons/rc/edit-undo.png',
                           description='Marker description')
    panel.add_marker(marker)
    y_pos = TextHelper(editor).line_pos_from_number(0)
    QTest.mousePress(panel, QtCore.Qt.RightButton, QtCore.Qt.NoModifier,
                     QtCore.QPoint(1000, 1000))
    QTest.mousePress(panel, QtCore.Qt.RightButton, QtCore.Qt.NoModifier,
                     QtCore.QPoint(3, y_pos))
开发者ID:dtonal,项目名称:pyqode.core,代码行数:13,代码来源:test_marker.py

示例4: test_events

# 需要导入模块: from pyqode.qt.QtTest import QTest [as 别名]
# 或者: from pyqode.qt.QtTest.QTest import mousePress [as 别名]
def test_events(editor):
    mode = get_mode(editor)
    mode._add_decoration(editor.textCursor())
    pt = QtCore.QPoint(10, TextHelper(editor).line_pos_from_number(0))
    if os.environ['QT_API'] == 'pyqt5':
        QTest.mouseMove(editor, pt)
        QTest.mousePress(editor, QtCore.Qt.LeftButton,
                         QtCore.Qt.ControlModifier, pt)
        QTest.mouseMove(editor, pt)
    else:
        editor.mouseMoveEvent(QtGui.QMouseEvent(
            QtCore.QEvent.MouseMove, pt,
            QtCore.Qt.RightButton, QtCore.Qt.RightButton,
            QtCore.Qt.ControlModifier))
        # here we have a deco, try to click on it.
        editor.mousePressEvent(QtGui.QMouseEvent(
            QtCore.QEvent.MouseButtonPress, pt,
            QtCore.Qt.LeftButton, QtCore.Qt.RightButton, QtCore.Qt.NoModifier))
        # move window without control -> remove deco
        editor.mouseMoveEvent(QtGui.QMouseEvent(
            QtCore.QEvent.MouseMove, pt,
            QtCore.Qt.RightButton, QtCore.Qt.RightButton,
            QtCore.Qt.NoModifier))
开发者ID:SirmoGames,项目名称:pyqode.core,代码行数:25,代码来源:test_word_click.py


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