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