本文整理汇总了Python中PyQt5.QtGui.QKeySequence.Save方法的典型用法代码示例。如果您正苦于以下问题:Python QKeySequence.Save方法的具体用法?Python QKeySequence.Save怎么用?Python QKeySequence.Save使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt5.QtGui.QKeySequence
的用法示例。
在下文中一共展示了QKeySequence.Save方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _check_saved
# 需要导入模块: from PyQt5.QtGui import QKeySequence [as 别名]
# 或者: from PyQt5.QtGui.QKeySequence import Save [as 别名]
def _check_saved(self):
if not MainActionsHandler.is_saved():
msgBox = QMessageBox(self)
msgBox.setIcon(QMessageBox.Warning)
msgBox.setWindowTitle(translate('MainWindow', 'Close session'))
msgBox.setText(
translate('MainWindow', 'The current session is not saved.'))
msgBox.setInformativeText(
translate('MainWindow', 'Discard the changes?'))
msgBox.setStandardButtons(QMessageBox.Save | QMessageBox.Discard |
QMessageBox.Cancel)
msgBox.setDefaultButton(QMessageBox.Save)
result = msgBox.exec_()
if result == QMessageBox.Cancel:
return False
elif result == QMessageBox.Save:
self._save()
return True
示例2: _set_platform_specific_keyboard_shortcuts
# 需要导入模块: from PyQt5.QtGui import QKeySequence [as 别名]
# 或者: from PyQt5.QtGui.QKeySequence import Save [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)
示例3: save_base_content_file
# 需要导入模块: from PyQt5.QtGui import QKeySequence [as 别名]
# 或者: from PyQt5.QtGui.QKeySequence import Save [as 别名]
def save_base_content_file(self, ws_file):
result = QMessageBox.question(
self, "Save base content file?",
"Do you really want to update this chunk file?",
QMessageBox.Ok | QMessageBox.Cancel, QMessageBox.Cancel)
if result == QMessageBox.Ok:
with show_error_dialog(self, "Error writing file"):
self.save_workspace_file(ws_file)
示例4: __init__
# 需要导入模块: from PyQt5.QtGui import QKeySequence [as 别名]
# 或者: from PyQt5.QtGui.QKeySequence import Save [as 别名]
def __init__(self, parent=None):
super().__init__(parent)
self.save_enabled = True
self.create_new_signal_enabled = True
self.participants_assign_enabled = True
self.cache_qad = True
self.y_sep = 0
self.save_action = QAction(self.tr("Save"), self) # type: QAction
self.save_action.setIcon(QIcon.fromTheme("document-save"))
self.save_action.setShortcut(QKeySequence.Save)
self.save_action.triggered.connect(self.on_save_action_triggered)
self.save_action.setShortcutContext(Qt.WidgetWithChildrenShortcut)
self.addAction(self.save_action)
示例5: retranslateUi
# 需要导入模块: from PyQt5.QtGui import QKeySequence [as 别名]
# 或者: from PyQt5.QtGui.QKeySequence import Save [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'))
示例6: init_actions
# 需要导入模块: from PyQt5.QtGui import QKeySequence [as 别名]
# 或者: from PyQt5.QtGui.QKeySequence import Save [as 别名]
def init_actions(self):
self.open_chunk_directory_action = create_action(
self.get_icon(QStyle.SP_DirOpenIcon),
"Open chunk_directory ...",
self.handle_open_chunk_directory,
None)
self.open_mod_directory_action = create_action(
self.get_icon(QStyle.SP_DirOpenIcon),
"Open mod directory ...",
self.handle_open_mod_directory,
QKeySequence.Open)
self.save_file_action = create_action(
self.get_icon(QStyle.SP_DriveHDIcon),
"Save file",
self.handle_save_file_action,
QKeySequence.Save)
self.save_file_action.setDisabled(True)
self.export_action = create_action(
self.get_icon(QStyle.SP_FileIcon),
"Export file ...",
self.handle_export_file_action)
self.export_action.setDisabled(True)
self.import_action = create_action(
self.get_icon(QStyle.SP_FileIcon),
"Import file ...",
self.handle_import_file_action)
self.import_action.setDisabled(True)
self.help_action = create_action(
None, "Show help",
self.handle_show_help_action
)
self.about_action = create_action(
None, "About", self.handle_about_action)
self.lang_actions = {
lang: create_action(
None, name, partial(self.handle_set_lang_action, lang),
checkable=True)
for lang, name in LANG
}
self.quick_access_actions = [
create_action(
None, title,
partial(self.workspace.open_file_any_dir, file_rel_path))
for title, file_rel_path in QUICK_ACCESS_ITEMS
]