A class which represents a proxy action which triggers different actions for different contexts. More...
#include <Command.h>
Public Member Functions | |
QAction * | action () const |
The action associated with this command. If the command is a wrapper for a shortcut, 0 is returned. | |
QPointer< QAction > | activeBackendAction () const |
Provides the active backend action. | |
void | addAction (QAction *action, QList< int > context_ids) |
Add the action under the specified contexts. | |
QHash< int, QPointer< QAction > > | contextIDActionMap () const |
Provides a list of all the backend actions for this ProxyAction. | |
void | handleKeySequenceChange (const QKeySequence &old_key) |
Called when the key sequence changes. | |
bool | isActive () |
Returns true if the action is active in any of the current active contexts. | |
bool | setCurrentContext (QList< int > context_ids) |
Let this action know what contexts are currently active. | |
QShortcut * | shortcut () const |
The shortcut associated with this command. If the command is a wrapper for an action, 0 is returned. | |
QString | text () const |
Returns the text which appears as user friendly text to the user. | |
void | unregisterContext (int context_id) |
Removes all backend actions from the command which were registered for the specified context. | |
Public Member Functions inherited from Qtilities::CoreGui::Command | |
Qtilities::Core::QtilitiesCategory | category () const |
Gets the command's category. | |
QKeySequence | defaultKeySequence () const |
Returns the default key sequence. | |
QString | defaultText () const |
Gets the default text (id) associated with this command. | |
QKeySequence | keySequence () const |
Returns the current key sequence. | |
void | setCategory (Qtilities::Core::QtilitiesCategory category) |
Sets the command's category. | |
void | setDefaultKeySequence (const QKeySequence &key) |
Sets the default key sequence. | |
void | setDefaultText (const QString &text) |
Sets the default text (id) associated with this command. | |
void | setKeySequence (const QKeySequence &key) |
Sets the current key sequence. |
A class which represents a proxy action which triggers different actions for different contexts.
The ProxyAction class represents an action which has a proxy action which is triggered when the shortcut of the ProxyAction is used, and any number of backend actions which each represent a different context. When context changes happen in the application, the multi context action will make the correct backend action for the set of active contexts active. Thus, when the frontend action trigger, the active backend action will also trigger.
When the active backend action changes, the proxy action inherts the properties of the backend action.
For more information see the Action Management article.
|
virtual |
Removes all backend actions from the command which were registered for the specified context.
context_id | The applicable context. |
This function was added in Qtilities v1.2.
Implements Qtilities::CoreGui::Command.
Qtilities : Reference Documentation | Back to top |
Copyright © 2009-2013, Jaco Naudé
|