本文整理汇总了Python中PyQt5.QtGui.QKeySequence.New方法的典型用法代码示例。如果您正苦于以下问题:Python QKeySequence.New方法的具体用法?Python QKeySequence.New怎么用?Python QKeySequence.New使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt5.QtGui.QKeySequence
的用法示例。
在下文中一共展示了QKeySequence.New方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _define_shortcuts
# 需要导入模块: from PyQt5.QtGui import QKeySequence [as 别名]
# 或者: from PyQt5.QtGui.QKeySequence import New [as 别名]
def _define_shortcuts(self):
self.shortcut_close = QShortcut(QKeySequence(QKeySequence.Close), self)
self.shortcut_close.activated.connect(self._shortcut_proxy(self.close_current_tab))
self.shortcut_new_tab = QShortcut(QKeySequence(QKeySequence.AddTab), self)
self.shortcut_new_tab.activated.connect(self._shortcut_proxy(self._on_add_instance_clicked))
self.shortcut_settings = QShortcut(QKeySequence(_("Ctrl+K")), self)
self.shortcut_settings.activated.connect(self._shortcut_proxy(self._show_settings))
self.shortcut_menu = QShortcut(QKeySequence(_("Alt+E")), self)
self.shortcut_menu.activated.connect(self._shortcut_proxy(self._show_menu))
self.shortcut_help = QShortcut(QKeySequence(QKeySequence.HelpContents), self)
self.shortcut_help.activated.connect(self._shortcut_proxy(self._on_show_doc_clicked))
self.shortcut_quit = QShortcut(QKeySequence(QKeySequence.Quit), self)
self.shortcut_quit.activated.connect(self._shortcut_proxy(self.close_app))
self.shortcut_create_org = QShortcut(QKeySequence(QKeySequence.New), self)
self.shortcut_create_org.activated.connect(
self._shortcut_proxy(self._on_create_org_clicked)
)
self.shortcut_join_org = QShortcut(QKeySequence(QKeySequence.Open), self)
self.shortcut_join_org.activated.connect(self._shortcut_proxy(self._on_join_org_clicked))
shortcut = QShortcut(QKeySequence(QKeySequence.NextChild), self)
shortcut.activated.connect(self._shortcut_proxy(self._cycle_tabs(1)))
shortcut = QShortcut(QKeySequence(QKeySequence.PreviousChild), self)
shortcut.activated.connect(self._shortcut_proxy(self._cycle_tabs(-1)))
示例2: _create_action_create
# 需要导入模块: from PyQt5.QtGui import QKeySequence [as 别名]
# 或者: from PyQt5.QtGui.QKeySequence import New [as 别名]
def _create_action_create(self) -> QAction:
"""
The action_create action contains a menu with all four "new" actions. It is inserted into the main window
tool bar and lets the user create new items in the file tree.
QtCreator currently does not support defining such actions that open a menu with choices, so do it in code.
"""
icon = QIcon.fromTheme("document-new")
action_create = QAction(icon, "New…", self)
create_menu = QMenu(self)
create_menu.insertActions(None, ( # "Insert before None", so append all items to the (empty) action list
self.action_new_top_folder,
self.action_new_sub_folder,
self.action_new_phrase,
self.action_new_script
))
action_create.setMenu(create_menu)
return action_create
示例3: _set_platform_specific_keyboard_shortcuts
# 需要导入模块: from PyQt5.QtGui import QKeySequence [as 别名]
# 或者: from PyQt5.QtGui.QKeySequence import New [as 别名]
def _set_platform_specific_keyboard_shortcuts(self):
"""
QtDesigner does not support QKeySequence::StandardKey enum based default keyboard shortcuts.
This means that all default key combinations ("Save", "Quit", etc) have to be defined in code.
"""
self.action_new_phrase.setShortcuts(QKeySequence.New)
self.action_save.setShortcuts(QKeySequence.Save)
self.action_close_window.setShortcuts(QKeySequence.Close)
self.action_quit.setShortcuts(QKeySequence.Quit)
self.action_undo.setShortcuts(QKeySequence.Undo)
self.action_redo.setShortcuts(QKeySequence.Redo)
self.action_cut_item.setShortcuts(QKeySequence.Cut)
self.action_copy_item.setShortcuts(QKeySequence.Copy)
self.action_paste_item.setShortcuts(QKeySequence.Paste)
self.action_delete_item.setShortcuts(QKeySequence.Delete)
self.action_configure_autokey.setShortcuts(QKeySequence.Preferences)
示例4: on_message_received
# 需要导入模块: from PyQt5.QtGui import QKeySequence [as 别名]
# 或者: from PyQt5.QtGui.QKeySequence import New [as 别名]
def on_message_received(self, gateway, message):
title = "New message from {}".format(gateway.name)
self.gui.show_message(
title, strip_html_tags(message.replace("<p>", "\n\n"))
)
self._maybe_show_news_message(gateway, title, message)
示例5: retranslateUi
# 需要导入模块: from PyQt5.QtGui import QKeySequence [as 别名]
# 或者: from PyQt5.QtGui.QKeySequence import New [as 别名]
def retranslateUi(self):
self.setWindowTitle('Linux Show Player')
# menuFile
self.menuFile.setTitle(translate('MainWindow', '&File'))
self.newSessionAction.setText(translate('MainWindow', 'New session'))
self.newSessionAction.setShortcut(QKeySequence.New)
self.openSessionAction.setText(translate('MainWindow', 'Open'))
self.openSessionAction.setShortcut(QKeySequence.Open)
self.saveSessionAction.setText(translate('MainWindow', 'Save session'))
self.saveSessionAction.setShortcut(QKeySequence.Save)
self.editPreferences.setText(translate('MainWindow', 'Preferences'))
self.editPreferences.setShortcut(QKeySequence.Preferences)
self.saveSessionWithName.setText(translate('MainWindow', 'Save as'))
self.saveSessionWithName.setShortcut(QKeySequence.SaveAs)
self.fullScreenAction.setText(translate('MainWindow', 'Full Screen'))
self.fullScreenAction.setShortcut(QKeySequence.FullScreen)
self.exitAction.setText(translate('MainWindow', 'Exit'))
# menuEdit
self.menuEdit.setTitle(translate('MainWindow', '&Edit'))
self.actionUndo.setText(translate('MainWindow', 'Undo'))
self.actionUndo.setShortcut(QKeySequence.Undo)
self.actionRedo.setText(translate('MainWindow', 'Redo'))
self.actionRedo.setShortcut(QKeySequence.Redo)
self.selectAll.setText(translate('MainWindow', 'Select all'))
self.selectAllMedia.setText(
translate('MainWindow', 'Select all media cues'))
self.selectAll.setShortcut(QKeySequence.SelectAll)
self.deselectAll.setText(translate('MainWindow', 'Deselect all'))
self.deselectAll.setShortcut(translate('MainWindow', 'CTRL+SHIFT+A'))
self.invertSelection.setText(
translate('MainWindow', 'Invert selection'))
self.invertSelection.setShortcut(translate('MainWindow', 'CTRL+I'))
self.multiEdit.setText(translate('MainWindow', 'Edit selected'))
self.multiEdit.setShortcut(translate('MainWindow', 'CTRL+SHIFT+E'))
# menuLayout
self.menuLayout.setTitle(translate('MainWindow', '&Layout'))
# menuTools
self.menuTools.setTitle(translate('MainWindow', '&Tools'))
self.multiEdit.setText(translate('MainWindow', 'Edit selection'))
# menuAbout
self.menuAbout.setTitle(translate('MainWindow', '&About'))
self.actionAbout.setText(translate('MainWindow', 'About'))
self.actionAbout_Qt.setText(translate('MainWindow', 'About Qt'))