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


Python QTest.mouseMove方法代码示例

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


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

示例1: toggle_fold_trigger

# 需要导入模块: from pyqode.qt.QtTest import QTest [as 别名]
# 或者: from pyqode.qt.QtTest.QTest import mouseMove [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

示例2: test_mouse_move

# 需要导入模块: from pyqode.qt.QtTest import QTest [as 别名]
# 或者: from pyqode.qt.QtTest.QTest import mouseMove [as 别名]
def test_mouse_move(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.mouseMove(panel, QtCore.QPoint(3, y_pos))
    QTest.qWait(1000)
    QTest.mouseMove(panel, QtCore.QPoint(1000, 1000))
开发者ID:dtonal,项目名称:pyqode.core,代码行数:12,代码来源:test_marker.py

示例3: test_mouse_move

# 需要导入模块: from pyqode.qt.QtTest import QTest [as 别名]
# 或者: from pyqode.qt.QtTest.QTest import mouseMove [as 别名]
def test_mouse_move(editor):
    panel = get_panel(editor)
    y_pos = TextHelper(editor).line_pos_from_number(0)
    panel._selecting = True
    QTest.mouseMove(panel, QtCore.QPoint(3, y_pos))
    QTest.qWait(1000)
    QTest.mouseMove(panel, QtCore.QPoint(1000, 1000))
    panel.mouseMoveEvent(QtGui.QMouseEvent(
        QtCore.QEvent.MouseMove, QtCore.QPoint(10, 10),
        QtCore.Qt.RightButton, QtCore.Qt.RightButton, QtCore.Qt.NoModifier))
开发者ID:SirmoGames,项目名称:pyqode.core,代码行数:12,代码来源:test_line_nbr.py

示例4: test_events

# 需要导入模块: from pyqode.qt.QtTest import QTest [as 别名]
# 或者: from pyqode.qt.QtTest.QTest import mouseMove [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))
    QTest.mouseMove(editor, pt)
    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:dtonal,项目名称:pyqode.core,代码行数:20,代码来源:test_word_click.py

示例5: test_mouse_press

# 需要导入模块: from pyqode.qt.QtTest import QTest [as 别名]
# 或者: from pyqode.qt.QtTest.QTest import mouseMove [as 别名]
def test_mouse_press(editor):
    panel = get_panel(editor)
    panel.highlight_caret_scope = False
    # fold child block
    toggle_fold_trigger(editor, 15, panel)
    block = editor.document().findBlockByNumber(14)
    assert TextBlockHelper.is_fold_trigger(block) is True
    assert TextBlockHelper.is_collapsed(block) is True
    block = block.next()
    while block.blockNumber() < 21:
        assert block.isVisible() is False
        block = block.next()
    # fold top level block
    toggle_fold_trigger(editor, 9, panel)
    block = editor.document().findBlockByNumber(8)
    assert TextBlockHelper.is_fold_trigger(block)
    block = block.next()
    while block.blockNumber() < 27:
        if block.blockNumber() == 14:
            assert TextBlockHelper.is_fold_trigger(block) is True
            assert TextBlockHelper.is_collapsed(block) is True
        assert block.isVisible() is False
        block = block.next()
    # unfold it top level block
    toggle_fold_trigger(editor, 9, panel)
    block = editor.document().findBlockByNumber(8)
    assert TextBlockHelper.is_fold_trigger(block)
    block = block.next()
    while block.blockNumber() < 27:
        if 14 < block.blockNumber() < 22:
            assert block.isVisible() is False
        else:
            assert block.isVisible() is True
        block = block.next()

    # cleanup
    QTest.mouseMove(panel, QtCore.QPoint(0, 0))
    panel.leaveEvent(None)
    editor.setFocus()
    panel.highlight_caret_scope = True
开发者ID:must40,项目名称:pyqode.core,代码行数:42,代码来源:test_folding.py

示例6: test_mouse_move

# 需要导入模块: from pyqode.qt.QtTest import QTest [as 别名]
# 或者: from pyqode.qt.QtTest.QTest import mouseMove [as 别名]
def test_mouse_move(editor):
    panel = get_panel(editor)
    panel.highlight_caret_scope = False
    nb_decos = len(editor.decorations)
    y_pos = TextHelper(editor).line_pos_from_number(8)
    QTest.mouseMove(panel, QtCore.QPoint(3, y_pos + 5))
    QTest.qWait(1000)
    assert len(editor.decorations) >= 2
    y_pos = TextHelper(editor).line_pos_from_number(14)
    QTest.mouseMove(panel, QtCore.QPoint(3, y_pos + 5))
    QTest.qWait(1000)
    assert len(editor.decorations) >= 4
    QTest.mouseMove(panel, QtCore.QPoint(0, 0))
    panel.leaveEvent(None)
    editor.setFocus()
    panel.highlight_caret_scope = True
开发者ID:must40,项目名称:pyqode.core,代码行数:18,代码来源:test_folding.py


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