Subgroup: other
Class: QgsShortcutsManager¶
-
class
qgis.gui.
QgsShortcutsManager
¶ Bases:
PyQt5.QtCore.QObject
Shortcuts manager is a class that contains a list of QActions and QShortcuts that have been registered and their shortcuts can be changed.
QgsShortcutsManager is not usually directly created, but rather accessed through
QgsGui.shortcutsManager()
New in version 2.16: Methods
actionByName
Returns an action by its name, or None if nothing found. actionForSequence
Returns the action which is associated for a shortcut sequence, or None if no action is associated. blockSignals
childEvent
children
connectNotify
customEvent
defaultKeySequence
Returns the default sequence for an action. deleteLater
disconnect
disconnectNotify
dumpObjectInfo
dumpObjectTree
dynamicPropertyNames
event
eventFilter
findChild
findChild(self, Tuple, name: str = ‘’, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> QObject findChildren
findChildren(self, Tuple, name: str = ‘’, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] inherits
installEventFilter
isSignalConnected
isWidgetType
isWindowType
killTimer
listActions
Returns a list of all actions in the manager. listAll
Returns a list of both actions and shortcuts in the manager. listShortcuts
Returns a list of shortcuts in the manager. metaObject
moveToThread
objectDefaultKeySequence
Returns the default sequence for an object (either a QAction or QShortcut). objectForSequence
Returns the object (QAction or QShortcut) matching the specified key sequence, objectName
parent
property
pyqtConfigure
Each keyword argument is either the name of a Qt property or a Qt signal. receivers
registerAction
Registers an action with the manager so the shortcut can be configured in GUI. registerAllChildActions
Automatically registers all QActions which are children of the passed object. registerAllChildShortcuts
Automatically registers all QShortcuts which are children of the passed object. registerAllChildren
Automatically registers all QActions and QShortcuts which are children of the passed object. registerShortcut
Registers a QShortcut with the manager so the shortcut can be configured in GUI. removeEventFilter
sender
senderSignalIndex
setKeySequence
Modifies an action or shortcut’s key sequence. setObjectKeySequence
Modifies an object’s (either a QAction or a QShortcut) key sequence. setObjectName
setParent
setProperty
settingsPath
Returns the root settings path used to store shortcut customisation. shortcutByName
Returns a shortcut by its name, or None if nothing found shortcutForSequence
Returns the shortcut which is associated for a key sequence, or None if no shortcut is associated. signalsBlocked
startTimer
thread
timerEvent
tr
unregisterAction
Removes an action from the manager. unregisterShortcut
Removes a shortcut from the manager. Attributes
destroyed
destroyed(self, QObject = None) [signal] objectNameChanged
objectNameChanged(self, str) [signal] staticMetaObject
-
actionByName
(self, name: str) → QAction¶ Returns an action by its name, or None if nothing found.
Parameters: name – action name. Must match QAction’s text. See also
-
actionForSequence
(self, sequence: Union[QKeySequence, QKeySequence.StandardKey, str, int]) → QAction¶ Returns the action which is associated for a shortcut sequence, or None if no action is associated.
Parameters: sequence – shortcut key sequence See also
See also
-
childEvent
()¶
-
connectNotify
()¶
-
customEvent
()¶
-
defaultKeySequence
(self, action: QAction) → str¶ Returns the default sequence for an action. An empty return string indicates no default sequence.
Parameters: action – action to return default key sequence for See also
defaultKeySequence(self, shortcut: QShortcut) -> str Returns the default sequence for a shortcut. An empty return string indicates no default sequence.
Parameters: shortcut – shortcut to return default key sequence for See also
-
disconnectNotify
()¶
-
isSignalConnected
()¶
-
listActions
(self) → List[QAction]¶ Returns a list of all actions in the manager.
See also
See also
-
listAll
(self) → List[QObject]¶ Returns a list of both actions and shortcuts in the manager.
See also
listAction()
See also
-
listShortcuts
(self) → object¶ Returns a list of shortcuts in the manager.
See also
See also
-
objectDefaultKeySequence
(self, object: QObject) → str¶ Returns the default sequence for an object (either a QAction or QShortcut). An empty return string indicates no shortcut.
Parameters: object – QAction or QShortcut to return default key sequence for See also
-
objectForSequence
(self, sequence: Union[QKeySequence, QKeySequence.StandardKey, str, int]) → QObject¶ Returns the object (QAction or QShortcut) matching the specified key sequence,
Parameters: sequence – key sequence to find Returns: object with matching sequence, or None if not found See also
See also
-
receivers
()¶
-
registerAction
(self, action: QAction, defaultShortcut: str = '') → bool¶ Registers an action with the manager so the shortcut can be configured in GUI.
Parameters: action – action to register. The action must have a unique text string for identification. :param defaultShortcut: default key sequence for action
Returns: true if action was successfully registered See also
See also
See also
-
registerAllChildActions
(self, object: QObject, recursive: bool = False)¶ Automatically registers all QActions which are children of the passed object.
Parameters: - object – parent object containing actions to register
- recursive – set to true to recursively add child actions
See also
See also
See also
-
registerAllChildShortcuts
(self, object: QObject, recursive: bool = False)¶ Automatically registers all QShortcuts which are children of the passed object.
Parameters: - object – parent object containing shortcuts to register
- recursive – set to true to recursively add child shortcuts
See also
See also
See also
-
registerAllChildren
(self, object: QObject, recursive: bool = False)¶ Automatically registers all QActions and QShortcuts which are children of the passed object.
Parameters: - object – parent object containing actions and shortcuts to register
- recursive – set to true to recursively add child actions and shortcuts
See also
See also
-
registerShortcut
(self, shortcut: QShortcut, defaultSequence: str = '') → bool¶ Registers a QShortcut with the manager so the shortcut can be configured in GUI.
Parameters: shortcut – QShortcut to register. The shortcut must have a unique QObject.objectName() for identification. :param defaultSequence: default key sequence for shortcut
Returns: true if shortcut was successfully registered See also
See also
-
sender
()¶
-
senderSignalIndex
()¶
-
setKeySequence
(self, name: str, sequence: str) → bool¶ Modifies an action or shortcut’s key sequence.
Parameters: name – name of action or shortcut to modify. Must match the action’s QAction.text() or the shortcut’s QObject.objectName() :param sequence: new shortcut key sequence
See also
setKeySequence(self, action: QAction, sequence: str) -> bool Modifies an action’s key sequence.
Parameters: - action – action to modify
- sequence – new shortcut key sequence
See also
setKeySequence(self, shortcut: QShortcut, sequence: str) -> bool Modifies a shortcuts’s key sequence.
Parameters: - shortcut – QShortcut to modify
- sequence – new shortcut key sequence
See also
-
setObjectKeySequence
(self, object: QObject, sequence: str) → bool¶ Modifies an object’s (either a QAction or a QShortcut) key sequence.
Parameters: - object – QAction or QShortcut to modify
- sequence – new shortcut key sequence
See also
-
settingsPath
(self) → str¶ Returns the root settings path used to store shortcut customisation.
-
shortcutByName
(self, name: str) → QShortcut¶ Returns a shortcut by its name, or None if nothing found
Parameters: name – shortcut name. Must match QShortcut’s QObject.objectName() property. See also
-
shortcutForSequence
(self, sequence: Union[QKeySequence, QKeySequence.StandardKey, str, int]) → QShortcut¶ Returns the shortcut which is associated for a key sequence, or None if no shortcut is associated.
Parameters: sequence – shortcut key sequence See also
See also
-
timerEvent
()¶
-
unregisterAction
(self, action: QAction) → bool¶ Removes an action from the manager.
Parameters: action – action to remove Returns: true if action was previously registered in manager and has been removed, or false if action was not previously registered in manager
See also
See also
-
unregisterShortcut
(self, shortcut: QShortcut) → bool¶ Removes a shortcut from the manager.
Parameters: shortcut – shortcut to remove Returns: true if shortcut was previously registered in manager and has been removed, or false if shortcut was not previously registered in manager
See also
See also
-