All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
Public Member Functions
Qtilities::CoreGui::CommandEditor Class Reference

A widget which allows the user to edit command shortcuts for actions registered in the action manager class. More...

#include <CommandEditor.h>

Inheritance diagram for Qtilities::CoreGui::CommandEditor:
Inheritance graph
[legend]

List of all members.

Public Member Functions

ObserverWidgetcommandWidget () const
 Returns the observer widget used to display commands.
void configPageApply ()
QtilitiesCategory configPageCategory () const
 Gets the category of the config page.
QIcon configPageIcon () const
 Gets the icon used for the page in the configuration widget.
void configPageInitialize ()
 Initialization function where you can do any initialization required by your page.
QString configPageTitle () const
 Gets the title of the config page.
QWidget * configPageWidget ()
 Gets widget used in the configuration page area.
QObject * objectBase ()
 Returns the QObject* base of the interface.
const QObject * objectBase () const
 Returns a const QObject* base of the interface.
bool supportsApply () const
 Indicates if the page supports apply operations. When a page only displays information, ExtensionSystemConfig, we don't want the apply button to be active. This function thus controls the activity of the apply button.
- Public Member Functions inherited from Qtilities::CoreGui::Interfaces::IConfigPage
virtual QString configPageHelpID () const
 Gets the help ID of the config page.
virtual void configPageRestoreDefaults ()
 Indicates that the defaults of the page must be restored.
virtual void setConfigPageCategory (const QtilitiesCategory &category)
 Sets the category of the config page.
virtual void setConfigPageHelpID (const QString &config_help_id)
 Sets the help ID of the config page.
virtual void setConfigPageIcon (const QIcon &icon)
 Sets the icon used for the page in the configuration widget.
virtual bool supportsRestoreDefaults () const
 Indicates if the page supports restoration of default settings.
- Public Member Functions inherited from Qtilities::Core::Interfaces::IObjectBase
QString objectOriginID () const
 Allows interfaces to provide some sort of source identification.
void setObjectOriginID (const QString &object_origin_id)
 Allows setting of the object source ID of this interface implementation.

Detailed Description

A widget which allows the user to edit command shortcuts for actions registered in the action manager class.

The command editor widget gives a overview of all the commands registered in the application and their shortcuts. It allows shortcuts to be edited and allows you to save, load and restore default configurations.

command_editor.jpg
Command Editor

To add this page to your application's ConfigurationWidget, do the following:

// The shortcuts editor for commands in your application:
OBJECT_MANAGER->registerObject(ACTION_MANAGER->commandEditor());

For more information see the Action Management article.


Member Function Documentation

Qtilities::CoreGui::ObserverWidget * Qtilities::CoreGui::CommandEditor::commandWidget ( ) const

Returns the observer widget used to display commands.

Through the observer widget you can get access to the selected objects and be notified when the selection changes.

void Qtilities::CoreGui::CommandEditor::configPageApply ( )
virtual

By default the settings are saved to:

QString shortcut_mapping_file = QString("%1%3%2").arg(QtilitiesApplication::applicationSessionPath()).arg(qti_def_PATH_SHORTCUTS_FILE).arg(QDir::separator());

Implements Qtilities::CoreGui::Interfaces::IConfigPage.

QtilitiesCategory Qtilities::CoreGui::CommandEditor::configPageCategory ( ) const
virtual

Gets the category of the config page.

If you want other parts of your code to be able to modify the category of your page, implement configPageCategory() like this:

return QtilitiesCategory("Your Category");
else

If not, just return your caregory.

See also:
setConfigPageCategory()

Reimplemented from Qtilities::CoreGui::Interfaces::IConfigPage.

QIcon Qtilities::CoreGui::CommandEditor::configPageIcon ( ) const
virtual

Gets the icon used for the page in the configuration widget.

See also:
setConfigPageIcon()

Implements Qtilities::CoreGui::Interfaces::IConfigPage.

void Qtilities::CoreGui::CommandEditor::configPageInitialize ( )
virtual

Initialization function where you can do any initialization required by your page.

This function will be called when the configuration widget searches the object pool for config pages. The function will be called on all found pages before adding them to the configuration widget.

In big applications where many configuration pages exists, it makes sense to make use of this function in order to speed up the launch time of your application. Without this function, you will typically initialize your config pages in their constructors. Thus, all the pages will be set up during application launch even if the user never goes to the configuration page. This function provides a solution to that problem where pages will only be initialized when the configuration widget is actually used.

Note:
The default implementation does nothing.

This function was added in Qtilities v1.2.

Reimplemented from Qtilities::CoreGui::Interfaces::IConfigPage.

const QObject* Qtilities::CoreGui::CommandEditor::objectBase ( ) const
inlinevirtual

Returns a const QObject* base of the interface.

This function can be used in const methods, but make sure that you don't modify things that should stay const. An example where this is used is when we want to get a property on an object in a const method. This is a const operation.

Implements Qtilities::Core::Interfaces::IObjectBase.



Qtilities : Reference Documentation Back to top Copyright © 2009-2013, Jaco Naudé