當前位置: 首頁>>代碼示例>>Python>>正文


Python QKeySequence.Save方法代碼示例

本文整理匯總了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 
開發者ID:FrancescoCeruti,項目名稱:linux-show-player,代碼行數:22,代碼來源:mainwindow.py

示例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) 
開發者ID:autokey,項目名稱:autokey,代碼行數:20,代碼來源:configwindow.py

示例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) 
開發者ID:fre-sch,項目名稱:mhw_armor_edit,代碼行數:10,代碼來源:suite.py

示例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) 
開發者ID:jopohl,項目名稱:urh,代碼行數:17,代碼來源:EpicGraphicView.py

示例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')) 
開發者ID:FrancescoCeruti,項目名稱:linux-show-player,代碼行數:45,代碼來源:mainwindow.py

示例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
        ] 
開發者ID:fre-sch,項目名稱:mhw_armor_edit,代碼行數:47,代碼來源:suite.py


注:本文中的PyQt5.QtGui.QKeySequence.Save方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。