BuildmLearn Toolkit  2.0.4
BuildmLearn Toolkit is an easy-to-use program that helps users make mobile apps without any knowledge of application development.
 All Classes Functions Enumerations Groups Pages
DynamicShortcuts Class Reference

Access for methods for loading/saving keyboard shortcuts to/from settings. More...

#include <dynamicshortcuts.h>

Collaboration diagram for DynamicShortcuts:
Collaboration graph

Static Public Member Functions

static void load (const QList< QAction * > &actions)
 Checks the application settings and then initializes shortcut of each action from actions from the settings. More...
 
static void save (const QList< QAction * > &actions)
 Stores shortcut of each action from actions into the application settings. More...
 

Detailed Description

Access for methods for loading/saving keyboard shortcuts to/from settings.

See also
DynamicShortcutsWidget, ShortcutButton, ShortcutCatcher

Definition at line 42 of file dynamicshortcuts.h.

Member Function Documentation

void DynamicShortcuts::load ( const QList< QAction * > &  actions)
static

Checks the application settings and then initializes shortcut of each action from actions from the settings.

Parameters
actionsList of actions for which we want to load shortcuts.

Definition at line 52 of file dynamicshortcuts.cpp.

52  {
53  Settings *settings = qApp->settings();
54 
55  foreach (QAction *action, actions) {
56  QString shortcut_for_action = settings->value(APP_CFG_SHORTCUTS,
57  action->objectName(),
58  action->shortcut().toString(QKeySequence::PortableText)).toString();
59  action->setShortcut(QKeySequence::fromString(shortcut_for_action,
60  QKeySequence::PortableText));
61  }
62 }
Application-wide settings mechanism.
Definition: settings.h:40
QVariant value(const QString &section, const QString &key, const QVariant &default_value=QVariant())
Getter/setter for settings values.
Definition: settings.h:64

Here is the call graph for this function:

void DynamicShortcuts::save ( const QList< QAction * > &  actions)
static

Stores shortcut of each action from actions into the application settings.

Parameters
actionsList of actions for which we want to save shortcuts.

Definition at line 42 of file dynamicshortcuts.cpp.

42  {
43  Settings *settings = qApp->settings();
44 
45  foreach (QAction *action, actions) {
46  settings->setValue(APP_CFG_SHORTCUTS,
47  action->objectName(),
48  action->shortcut().toString(QKeySequence::PortableText));
49  }
50 }
void setValue(const QString &section, const QString &key, const QVariant &value)
Sets new value into settings.
Definition: settings.h:74
Application-wide settings mechanism.
Definition: settings.h:40

Here is the call graph for this function:


The documentation for this class was generated from the following files: