Public Member Functions |
ActionContainer * | actionContainer (const QString &id) const |
| Access function for menus and menu bars.
|
Core::Observer * | actionContainerObserver () |
| Returns the observer managing action containers.
|
Command * | command (const QString &id) const |
| Access function for actions and shortcuts.
|
QWidget * | commandEditor () |
| Creates the command editor/shortcut configuration page.
|
Core::Observer * | commandObserver () |
| Returns the observer managing commands.
|
QList< Command * > | commandsWithKeySequence (QKeySequence shortcut) |
| Returns commands that uses a specific shortcut mapping.
|
ActionContainer * | createMenu (const QString &id, bool &existed) |
| Creates a menu with the given string ID.
|
ActionContainer * | createMenuBar (const QString &id, bool &existed) |
| Creates a menu bar with the given string ID.
|
bool | loadShortcutMapping (const QString &file_name) |
| Imports a previously exported shortcut configuration.
|
ActionContainer * | menu (const QString &id) |
| Function to access a menu.
|
ActionContainer * | menuBar (const QString &id) |
| Function to access a menu bar.
|
Command * | registerAction (const QString &id, QAction *action, const QList< int > &context=QList< int >()) |
| Registers an action with the action manager.
|
Command * | registerActionPlaceHolder (const QString &id, const QString &user_text, const QKeySequence &shortcut=QKeySequence(), const QList< int > &context=QList< int >(), const QIcon &icon=QIcon()) |
| Registers an action placeholder with the action manager.
|
Command * | registerShortcut (const QString &id, const QString &user_text, QShortcut *shortcut, const QList< int > &active_contexts=QList< int >()) |
| Function to register a shortcut in the action manager.
|
void | restoreDefaultShortcuts () |
| Restores the default shortcut configuration.
|
bool | saveShortcutMapping (const QString &file_name, Qtilities::ExportVersion version=Qtilities::Qtilities_Latest) |
| Exports the current shortcut configuraiton.
|
A class which represents an action manager.
For more information see the Action Management article.
Qtilities::CoreGui::Command * Qtilities::CoreGui::ActionManager::registerActionPlaceHolder |
( |
const QString & |
id, |
|
|
const QString & |
user_text, |
|
|
const QKeySequence & |
key_sequence = QKeySequence() , |
|
|
const QList< int > & |
context = QList< int >() , |
|
|
const QIcon & |
icon = QIcon() |
|
) |
| |
|
virtual |
Registers an action placeholder with the action manager.
This function is used to create a placeholder for future action types in the system. This is usefull in cases where the actual backend action is not registered at application startup. An example of this would be actions contained in an object produced by a factory. For these scenarios you must register an place holder for the action at startup (to allow the action to be visible in the command editor, and to allow the action to be set according to a previous shortcut mapping scheme at application startup). If you want to use the registerActionPlaceHolder function in this way, leave the context as default. This will create the action place holder and you can register backend actions at a later time using the registerAction() call.
You can also use this function if you want to create a command which is not a multi-backed proxy action. In that case you connect directly to the command->action() triggered() signal to access the action. If you want to use the registerActionPlaceHolder() function in this way you must provide an context for the action to force the function to create a default backend action for you for the specified context.
- Parameters:
-
id | The internal id used to represent the action. This is the name used to display the action in the command editor. |
user_text | The user visible text that will be used for this command. |
shortcut | A shortcut to be associated with the command. |
context | Pass an empty QList<int>() if you do want to use the action as an mutli backed action, pass the needed context otherwise. |
icon | An icon to use in this placeholder. |
- Returns:
- The command created for the given id. If a command with the given id already exists, the existing command is returned.
Implements Qtilities::CoreGui::Interfaces::IActionManager.