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


Python Qt.Key_Home方法代码示例

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


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

示例1: keyPressEvent

# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import Key_Home [as 别名]
def keyPressEvent(self, event):
        """Reimplemented."""
        # Override the default QComboBox behavior
        if event.key() == Qt.Key_Down and event.modifiers() & Qt.AltModifier:
            self.showPopup()
            return

        ignored = {Qt.Key_Up, Qt.Key_Down,
                   Qt.Key_PageDown, Qt.Key_PageUp,
                   Qt.Key_Home, Qt.Key_End}

        if event.key() in ignored:
            event.ignore()
            return

        super(CheckComboBox, self).keyPressEvent(event) 
开发者ID:artisan-roaster-scope,项目名称:artisan,代码行数:18,代码来源:qcheckcombobox.py

示例2: test_PythonProcessPane_parse_input_home

# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import Key_Home [as 别名]
def test_PythonProcessPane_parse_input_home(qtapp):
    """
    Home moves cursor to the start of the input line.
    """
    ppp = mu.interface.panes.PythonProcessPane()
    ppp.toPlainText = mock.MagicMock(return_value="hello")
    mock_cursor = mock.MagicMock()
    ppp.start_of_current_line = 0
    ppp.textCursor = mock.MagicMock(return_value=mock_cursor)
    ppp.setTextCursor = mock.MagicMock()
    key = Qt.Key_Home
    text = ""
    modifiers = None
    ppp.parse_input(key, text, modifiers)
    # Move to the end of the line, then move left len of 'hello'.
    assert mock_cursor.movePosition.call_count == 6
    ppp.setTextCursor.assert_called_once_with(mock_cursor) 
开发者ID:mu-editor,项目名称:mu,代码行数:19,代码来源:test_panes.py

示例3: top

# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import Key_Home [as 别名]
def top(self):
        self._key_press(Qt.Key_Home) 
开发者ID:qutebrowser,项目名称:qutebrowser,代码行数:4,代码来源:webkittab.py

示例4: test_MicroPythonREPLPane_keyPressEvent_home

# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import Key_Home [as 别名]
def test_MicroPythonREPLPane_keyPressEvent_home(qtapp):
    """
    Ensure home key in the REPL is handled correctly.
    """
    mock_serial = mock.MagicMock()
    rp = mu.interface.panes.MicroPythonREPLPane(mock_serial)
    data = mock.MagicMock
    data.key = mock.MagicMock(return_value=Qt.Key_Home)
    data.text = mock.MagicMock(return_value="1b")
    data.modifiers = mock.MagicMock(return_value=None)
    rp.keyPressEvent(data)
    mock_serial.write.assert_called_once_with(b"\x1B[H") 
开发者ID:mu-editor,项目名称:mu,代码行数:14,代码来源:test_panes.py


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