class KActionCollection |
|
A container for a set of QAction objects.
KActionCollection manages a set of QAction objects. It allows them to be grouped for organized presentation of configuration to the user, saving + loading of configuration, and optionally for automatic plugging into specified widget(s). Additionally, KActionCollection provides several convenience functions for locating named actions, and actions grouped by QActionGroup. If you create your own action collection and need to assign shortcuts to the actions within, you have to call associateWidget() or addAssociatedWidget() to have them working. |
|
Constructor. Allows specification of a KComponentData other than the default global KComponentData, where needed. |
|
|
|
Return the QAction* at position "index" in the action collection.
This is equivalent to actions().value(index); |
|
Get the action with the given name from the action collection.
name - Name of the KAction Returns A pointer to the KAction in the collection which matches the parameters or null if nothing matches. |
|
Returns the list of all QActionGroups associated with actions in this action collection. |
|
Indicates that action was highlighted (hovered over). Deprecated Replaced by actionHovered(QAction* action); |
|
Indicates that action was hovered. |
|
Indicates that action was triggered |
|
Returns the list of KActions which belong to this action collection. |
|
Returns the list of KActions without an QAction.actionGroup() which belong to this action collection. |
|
Add an action under the given name to the collection.
Inserting an action that was previously inserted under a different name will replace the old entry, i.e. the action will not be available under the old name anymore but only under the new one. Inserting an action under a name that is already used for another action will replace the other action in the collection. name - The name by which the action be retrieved again from the collection. action - The action to add. |
|
|
Creates a new standard action, adds it to the collection and connects the action's triggered() signal to the
specified receiver/member. The newly created action is also returned.
The action can be retrieved later from the collection by its standard name as per KStandardAction.stdName. |
|
Creates a new standard action, adds to the collection under the given name and connects the action's triggered() signal to the
specified receiver/member. The newly created action is also returned.
The action can be retrieved later from the collection by the specified name. |
|
Creates a new action under the given name to the collection and connects the action's triggered()
signal to the specified receiver/member. The newly created action is returned.
Inserting an action that was previously inserted under a different name will replace the old entry, i.e. the action will not be available under the old name anymore but only under the new one. Inserting an action under a name that is already used for another action will replace the other action in the collection. name - The name by which the action be retrieved again from the collection. action - The action to add. |
|
Associate all actions in this collection to the given widget, including any actions
added after this association is made.
This does not change the action's shortcut context, so if you need to have the actions only trigger when the widget has focus, you'll need to set the shortcut context on each action to Qt.WidgetShortcut (or better still, Qt.WidgetWithChildrenShortcut with Qt 4.4+) |
|
Access the list of all action collections in existence for this app |
|
Associate all actions in this collection to the given widget. Unlike addAssociatedWidget, this method only adds all current actions in the collection to the given widget. Any action added after this call will not be added to the given widget automatically. So this is just a shortcut for a foreach loop and a widget->addAction call. |
|
Return a list of all associated widgets. |
|
Clears the entire action collection, deleting all actions. |
|
Clear all associated widgets and remove the actions from those widgets. |
|
The KComponentData with which this class is associated. |
|
Returns the KConfig group with which settings will be loaded and saved. |
|
Returns whether this action collection's configuration should be global to KDE ( true ), or specific to the application ( false ). |
|
Overridden to perform connections when someone wants to know whether an action was highlighted or triggered |
|
Returns the number of actions in the collection.
This is equivalent to actions().count(). |
|
Export the current configurable global key associations to config.
\since 4.1 config - Config object to save to writeDefaults - set to true to write settings which are already at defaults. |
|
Import from config all configurable global key associations.
\since 4.1 config - Config object to read from |
|
Indicates that action was inserted into this action collection. |
|
Returns whether the action collection is empty or not. |
|
The parent KXMLGUIClient, or null if not available. |
|
Read all key associations from config.
If config is zero, read all key associations from the application's configuration file KGlobal.config(), in the group set by setConfigGroup(). |
|
Removes an action from the collection and deletes it.
action - The action to remove. |
|
Remove an association between all actions in this collection and the given widget, i.e. remove those actions from the widget, and stop associating newly added actions as well. |
|
Indicates that action was removed from this action collection. Deprecated |
|
Set the componentData associated with this action collection.
Don't call this method on a KActionCollection that contains actions. This is not supported. componentData - the KComponentData which is to be associated with this action collection, or an invalid KComponentData instance to indicate the default KComponentData. |
|
Set whether this action collection's configuration should be global to KDE ( true ), or specific to the application ( false ). |
|
Sets group as the KConfig group with which settings will be loaded and saved. |
|
Internal Deprecated Replaced by slotActionHovered(); |
|
|
Removes an action from the collection.
action - the action to remove. |
|
Write the current configurable key associations to config. What the
function does if config is zero depends. If this action collection
belongs to a KXMLGuiClient the setting are saved to the kxmlgui
definition file. If not the settings are written to the applications
config file.
oneAction() and writeDefaults() have no meaning for the kxmlgui configuration file. config - Config object to save to, or null (see above) writeDefaults - set to true to write settings which are already at defaults. oneAction - pass an action here if you just want to save the values for one action, eg. if you know that action is the only one which has changed. |