本文整理汇总了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)
示例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))
示例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))
示例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))
示例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
示例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