QGIS/python/gui/qgsshortcutsmanager.sip

306 lines
9.0 KiB
Plaintext
Raw Normal View History

2017-06-08 11:26:03 +02:00
/************************************************************************
* This file has been generated automatically from *
* *
* src/gui/qgsshortcutsmanager.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
class QgsShortcutsManager : QObject
{
2017-06-08 11:26:03 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
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
2017-12-19 11:43:52 -04:00
:py:func:`QgsGui.shortcutsManager()`
2017-06-08 11:26:03 +02:00
.. versionadded:: 2.16
%End
2017-06-08 11:26:03 +02:00
%TypeHeaderCode
#include "qgsshortcutsmanager.h"
%End
public:
QgsShortcutsManager( QObject *parent /TransferThis/ = 0, const QString &settingsRoot = "/shortcuts/" );
2017-06-08 11:26:03 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Constructor for QgsShortcutsManager.
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param parent: parent object
:param settingsRoot: root QgsSettings path for storing settings, e.g., "/myplugin/shortcuts". Leave
as the default value to store settings alongside built in QGIS shortcuts, but care must be
taken to not register actions which conflict with the built in QGIS actions.
2017-06-08 11:26:03 +02:00
%End
void registerAllChildren( QObject *object, bool recursive = false );
2017-06-08 11:26:03 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Automatically registers all QActions and QShortcuts which are children of the
passed object.
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param object: parent object containing actions and shortcuts to register
:param recursive: set to true to recursively add child actions and shortcuts
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`registerAllChildActions()`
2017-12-15 10:36:55 -04:00
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`registerAllChildShortcuts()`
2017-06-08 11:26:03 +02:00
%End
void registerAllChildActions( QObject *object, bool recursive = false );
2017-06-08 11:26:03 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Automatically registers all QActions which are children of the passed object.
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param object: parent object containing actions to register
:param recursive: set to true to recursively add child actions
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`registerAction()`
2017-12-15 10:36:55 -04:00
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`registerAllChildren()`
2017-12-15 10:36:55 -04:00
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`registerAllChildShortcuts()`
2017-06-08 11:26:03 +02:00
%End
void registerAllChildShortcuts( QObject *object, bool recursive = false );
2017-06-08 11:26:03 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Automatically registers all QShortcuts which are children of the passed object.
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param object: parent object containing shortcuts to register
:param recursive: set to true to recursively add child shortcuts
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`registerShortcut()`
2017-12-15 10:36:55 -04:00
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`registerAllChildren()`
2017-12-15 10:36:55 -04:00
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`registerAllChildActions()`
2017-06-08 11:26:03 +02:00
%End
bool registerAction( QAction *action, const QString &defaultShortcut = QString() );
2017-06-08 11:26:03 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Registers an action with the manager so the shortcut can be configured in GUI.
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param action: action to register. The action must have a unique text string for
identification.
:param defaultShortcut: default key sequence for action
:return: true if action was successfully registered
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`registerShortcut()`
2017-12-15 10:36:55 -04:00
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`unregisterAction()`
2017-12-15 10:36:55 -04:00
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`registerAllChildActions()`
2017-06-08 11:26:03 +02:00
%End
bool registerShortcut( QShortcut *shortcut, const QString &defaultSequence = QString() );
2017-06-08 11:26:03 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Registers a QShortcut with the manager so the shortcut can be configured in GUI.
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param shortcut: QShortcut to register. The shortcut must have a unique QObject.objectName() for
identification.
:param defaultSequence: default key sequence for shortcut
:return: true if shortcut was successfully registered
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`registerAction()`
2017-12-15 10:36:55 -04:00
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`registerAllChildShortcuts()`
2017-06-08 11:26:03 +02:00
%End
bool unregisterAction( QAction *action );
2017-06-08 11:26:03 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Removes an action from the manager.
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param action: action to remove
:return: true if action was previously registered in manager and has been removed, or
false if action was not previously registered in manager
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`registerAction()`
2017-12-15 10:36:55 -04:00
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`unregisterShortcut()`
2017-06-08 11:26:03 +02:00
%End
bool unregisterShortcut( QShortcut *shortcut );
2017-06-08 11:26:03 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Removes a shortcut from the manager.
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param shortcut: shortcut to remove
:return: true if shortcut was previously registered in manager and has been removed, or
false if shortcut was not previously registered in manager
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`registerShortcut()`
2017-12-15 10:36:55 -04:00
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`unregisterAction()`
2017-06-08 11:26:03 +02:00
%End
QList<QAction *> listActions() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns a list of all actions in the manager.
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`listShortcuts()`
2017-12-15 10:36:55 -04:00
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`listAll()`
2017-06-08 11:26:03 +02:00
%End
QList<QShortcut *> listShortcuts() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns a list of shortcuts in the manager.
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`listActions()`
2017-12-15 10:36:55 -04:00
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`listAll()`
2017-06-08 11:26:03 +02:00
%End
QList<QObject *> listAll() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns a list of both actions and shortcuts in the manager.
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`listAction()`
2017-12-15 10:36:55 -04:00
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`listShortcuts()`
2017-06-08 11:26:03 +02:00
%End
QString objectDefaultKeySequence( QObject *object ) const;
2017-06-08 11:26:03 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Returns the default sequence for an object (either a QAction or QShortcut).
An empty return string indicates no shortcut.
2017-12-15 21:36:08 -04:00
:param object: QAction or QShortcut to return default key sequence for
2017-12-15 10:36:55 -04:00
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`defaultKeySequence()`
2017-06-08 11:26:03 +02:00
%End
QString defaultKeySequence( QAction *action ) const;
2017-06-08 11:26:03 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Returns the default sequence for an action. An empty return string indicates
no default sequence.
2017-12-15 21:36:08 -04:00
:param action: action to return default key sequence for
2017-12-15 10:36:55 -04:00
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`objectDefaultKeySequence()`
2017-06-08 11:26:03 +02:00
%End
QString defaultKeySequence( QShortcut *shortcut ) const;
2017-06-08 11:26:03 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Returns the default sequence for a shortcut. An empty return string indicates
no default sequence.
2017-12-15 21:36:08 -04:00
:param shortcut: shortcut to return default key sequence for
2017-12-15 10:36:55 -04:00
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`objectDefaultKeySequence()`
2017-06-08 11:26:03 +02:00
%End
bool setKeySequence( const QString &name, const QString &sequence );
2017-06-08 11:26:03 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Modifies an action or shortcut's key sequence.
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param 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
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`setObjectKeySequence()`
2017-06-08 11:26:03 +02:00
%End
bool setObjectKeySequence( QObject *object, const QString &sequence );
2017-06-08 11:26:03 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Modifies an object's (either a QAction or a QShortcut) key sequence.
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param object: QAction or QShortcut to modify
:param sequence: new shortcut key sequence
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`setKeySequence()`
2017-06-08 11:26:03 +02:00
%End
bool setKeySequence( QAction *action, const QString &sequence );
2017-06-08 11:26:03 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Modifies an action's key sequence.
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param action: action to modify
:param sequence: new shortcut key sequence
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`setObjectKeySequence()`
2017-06-08 11:26:03 +02:00
%End
bool setKeySequence( QShortcut *shortcut, const QString &sequence );
2017-06-08 11:26:03 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Modifies a shortcuts's key sequence.
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param shortcut: QShortcut to modify
:param sequence: new shortcut key sequence
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`setObjectKeySequence()`
2017-06-08 11:26:03 +02:00
%End
QObject *objectForSequence( const QKeySequence &sequence ) const;
2017-06-08 11:26:03 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Returns the object (QAction or QShortcut) matching the specified key sequence,
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param sequence: key sequence to find
:return: object with matching sequence, or None if not found
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`actionForSequence()`
2017-12-15 10:36:55 -04:00
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`shortcutForSequence()`
2017-06-08 11:26:03 +02:00
%End
QAction *actionForSequence( const QKeySequence &sequence ) const;
2017-06-08 11:26:03 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Returns the action which is associated for a shortcut sequence, or None if no action is associated.
2017-12-15 21:36:08 -04:00
:param sequence: shortcut key sequence
2017-12-15 10:36:55 -04:00
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`objectForSequence()`
2017-12-15 10:36:55 -04:00
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`shortcutForSequence()`
2017-06-08 11:26:03 +02:00
%End
QShortcut *shortcutForSequence( const QKeySequence &sequence ) const;
2017-06-08 11:26:03 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Returns the shortcut which is associated for a key sequence, or None if no shortcut is associated.
2017-12-15 21:36:08 -04:00
:param sequence: shortcut key sequence
2017-12-15 10:36:55 -04:00
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`objectForSequence()`
2017-12-15 10:36:55 -04:00
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`actionForSequence()`
2017-06-08 11:26:03 +02:00
%End
QAction *actionByName( const QString &name ) const;
2017-06-08 11:26:03 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Returns an action by its name, or None if nothing found.
2017-12-15 21:36:08 -04:00
:param name: action name. Must match QAction's text.
2017-12-15 10:36:55 -04:00
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`shortcutByName()`
2017-06-08 11:26:03 +02:00
%End
QShortcut *shortcutByName( const QString &name ) const;
2017-06-08 11:26:03 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Returns a shortcut by its name, or None if nothing found
2017-12-15 21:36:08 -04:00
:param name: shortcut name. Must match QShortcut's QObject.objectName() property.
2017-12-15 10:36:55 -04:00
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`actionByName()`
2017-06-08 11:26:03 +02:00
%End
QString settingsPath() const;
2017-06-08 11:26:03 +02:00
%Docstring
Returns the root settings path used to store shortcut customisation.
%End
};
2017-06-08 11:26:03 +02:00
2017-09-25 14:20:39 +10:00
2017-06-08 11:26:03 +02:00
/************************************************************************
* This file has been generated automatically from *
* *
* src/gui/qgsshortcutsmanager.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/