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


Python QKeySequence.Copy方法代碼示例

本文整理匯總了Python中PyQt5.QtGui.QKeySequence.Copy方法的典型用法代碼示例。如果您正苦於以下問題:Python QKeySequence.Copy方法的具體用法?Python QKeySequence.Copy怎麽用?Python QKeySequence.Copy使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在PyQt5.QtGui.QKeySequence的用法示例。


在下文中一共展示了QKeySequence.Copy方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: _set_platform_specific_keyboard_shortcuts

# 需要導入模塊: from PyQt5.QtGui import QKeySequence [as 別名]
# 或者: from PyQt5.QtGui.QKeySequence import Copy [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

示例2: keyReleaseEvent

# 需要導入模塊: from PyQt5.QtGui import QKeySequence [as 別名]
# 或者: from PyQt5.QtGui.QKeySequence import Copy [as 別名]
def keyReleaseEvent(self, event):
        if not self.is_read_only():
            if event.matches(QKeySequence.Copy):
                self.copy_clicked.emit()
            elif event.matches(QKeySequence.Cut):
                self.cut_clicked.emit()
            elif event.matches(QKeySequence.Paste):
                if not self.paste_disabled:
                    self.paste_clicked.emit() 
開發者ID:Scille,項目名稱:parsec-cloud,代碼行數:11,代碼來源:file_table.py

示例3: keyPressEvent

# 需要導入模塊: from PyQt5.QtGui import QKeySequence [as 別名]
# 或者: from PyQt5.QtGui.QKeySequence import Copy [as 別名]
def keyPressEvent(self,event):
        key = int(event.key())
        if event.matches(QKeySequence.Copy):
            if self.TabWidget.currentIndex() == 3: # datatable
                self.aw.copy_cells_to_clipboard(self.datatable,adjustment=1)
                self.aw.sendmessage(QApplication.translate("Message","Data table copied to clipboard",None))
        if key == 16777220 and self.aw.scale.device is not None and self.aw.scale.device != "" and self.aw.scale.device != "None": # ENTER key pressed and scale connected
            if self.weightinedit.hasFocus():
                self.inWeight(True,overwrite=True) # we don't add to current reading but overwrite
            elif self.weightoutedit.hasFocus():
                self.outWeight(True,overwrite=True) # we don't add to current reading but overwrite 
開發者ID:artisan-roaster-scope,項目名稱:artisan,代碼行數:13,代碼來源:roast_properties.py

示例4: keyPressEvent

# 需要導入模塊: from PyQt5.QtGui import QKeySequence [as 別名]
# 或者: from PyQt5.QtGui.QKeySequence import Copy [as 別名]
def keyPressEvent(self,event):
        if event.matches(QKeySequence.Copy):
            if self.TabWidget.currentIndex() == 2: # datatable
                self.aw.copy_cells_to_clipboard(self.datatable)
                self.aw.sendmessage(QApplication.translate("Message","Data table copied to clipboard",None))
        else:
            super(backgroundDlg,self).keyPressEvent(event) 
開發者ID:artisan-roaster-scope,項目名稱:artisan,代碼行數:9,代碼來源:background.py

示例5: __init__

# 需要導入模塊: from PyQt5.QtGui import QKeySequence [as 別名]
# 或者: from PyQt5.QtGui.QKeySequence import Copy [as 別名]
def __init__(self, parent=None):
        super().__init__(parent)

        self.context_menu_pos = None  # type: QPoint

        self.copy_action = QAction("Copy selection", self)
        self.copy_action.setShortcut(QKeySequence.Copy)
        self.copy_action.setIcon(QIcon.fromTheme("edit-copy"))
        self.copy_action.triggered.connect(self.on_copy_action_triggered)

        self.use_header_colors = False

        self.original_font_size = self.font().pointSize()
        self.original_header_font_sizes = {"vertical": self.verticalHeader().font().pointSize(),
                                           "horizontal": self.horizontalHeader().font().pointSize()}

        self.zoom_in_action = QAction(self.tr("Zoom in"), self)
        self.zoom_in_action.setShortcut(QKeySequence.ZoomIn)
        self.zoom_in_action.triggered.connect(self.on_zoom_in_action_triggered)
        self.zoom_in_action.setShortcutContext(Qt.WidgetWithChildrenShortcut)
        self.zoom_in_action.setIcon(QIcon.fromTheme("zoom-in"))
        self.addAction(self.zoom_in_action)

        self.zoom_out_action = QAction(self.tr("Zoom out"), self)
        self.zoom_out_action.setShortcut(QKeySequence.ZoomOut)
        self.zoom_out_action.triggered.connect(self.on_zoom_out_action_triggered)
        self.zoom_out_action.setShortcutContext(Qt.WidgetWithChildrenShortcut)
        self.zoom_out_action.setIcon(QIcon.fromTheme("zoom-out"))
        self.addAction(self.zoom_out_action)

        self.zoom_original_action = QAction(self.tr("Zoom original"), self)
        self.zoom_original_action.setShortcut(QKeySequence(Qt.CTRL + Qt.Key_0))
        self.zoom_original_action.triggered.connect(self.on_zoom_original_action_triggered)
        self.zoom_original_action.setShortcutContext(Qt.WidgetWithChildrenShortcut)
        self.zoom_original_action.setIcon(QIcon.fromTheme("zoom-original"))
        self.addAction(self.zoom_original_action)

        self.horizontalHeader().setMinimumSectionSize(0) 
開發者ID:jopohl,項目名稱:urh,代碼行數:40,代碼來源:TableView.py

示例6: __init__

# 需要導入模塊: from PyQt5.QtGui import QKeySequence [as 別名]
# 或者: from PyQt5.QtGui.QKeySequence import Copy [as 別名]
def __init__(self, parent=None):
        super().__init__(parent)

        self.setDragMode(QGraphicsView.RubberBandDrag)

        self.proto_analyzer = None
        self.context_menu_item = None
        self.copied_items = []

        self.delete_action = QAction(self.tr("Delete selected items"), self)
        self.delete_action.setShortcut(QKeySequence.Delete)
        self.delete_action.triggered.connect(self.on_delete_action_triggered)
        self.delete_action.setShortcutContext(Qt.WidgetWithChildrenShortcut)
        self.delete_action.setIcon(QIcon.fromTheme("edit-delete"))
        self.addAction(self.delete_action)

        self.select_all_action = QAction(self.tr("Select all"), self)
        self.select_all_action.setShortcut(QKeySequence.SelectAll)
        self.select_all_action.triggered.connect(self.on_select_all_action_triggered)
        self.delete_action.setShortcutContext(Qt.WidgetWithChildrenShortcut)
        self.addAction(self.select_all_action)

        self.copy_action = QAction(self.tr("Copy selected items"), self)  # type: QAction
        self.copy_action.setShortcut(QKeySequence.Copy)
        self.copy_action.triggered.connect(self.on_copy_action_triggered)
        self.copy_action.setShortcutContext(Qt.WidgetWithChildrenShortcut)
        self.copy_action.setIcon(QIcon.fromTheme("edit-copy"))
        self.addAction(self.copy_action)

        self.paste_action = QAction(self.tr("Paste"), self)  # type: QAction
        self.paste_action.setShortcut(QKeySequence.Paste)
        self.paste_action.triggered.connect(self.on_paste_action_triggered)
        self.paste_action.setShortcutContext(Qt.WidgetWithChildrenShortcut)
        self.paste_action.setIcon(QIcon.fromTheme("edit-paste"))
        self.addAction(self.paste_action) 
開發者ID:jopohl,項目名稱:urh,代碼行數:37,代碼來源:SimulatorGraphicsView.py


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