KDEUI
KShortcutsEditor Class Reference
Widget for configuration of KAccel and KGlobalAccel. More...
#include <kshortcutseditor.h>

Public Types | |
enum | ActionType { WidgetAction = Qt::WidgetShortcut, WindowAction = Qt::WindowShortcut, ApplicationAction = Qt::ApplicationShortcut, GlobalAction = 4, AllActions = 0xffffffff } |
enum | LetterShortcuts { LetterShortcutsDisallowed = 0, LetterShortcutsAllowed } |
Public Slots | |
void | allDefault () |
void | printShortcuts () const |
void | resizeColumns () |
Signals | |
void | keyChange () |
Public Member Functions | |
void | addCollection (KActionCollection *, const QString &title=QString()) |
void | clearCollections () |
void | commit () |
void | exportConfiguration (KConfig *config) const |
void | importConfiguration (KConfig *config) |
bool | isModified () const |
KShortcutsEditor (QWidget *parent, ActionTypes actionTypes=AllActions, LetterShortcuts allowLetterShortcuts=LetterShortcutsAllowed) | |
KShortcutsEditor (KActionCollection *collection, QWidget *parent, ActionTypes actionTypes=AllActions, LetterShortcuts allowLetterShortcuts=LetterShortcutsAllowed) | |
void | save () |
void | undoChanges () |
void | writeConfiguration (KConfigGroup *config=0) const |
virtual | ~KShortcutsEditor () |
Friends | |
class(d, void capturedShortcut(QVariant, const QModelIndex &)) private | KShortcutsEditorPrivate |
Detailed Description
Widget for configuration of KAccel and KGlobalAccel.Configure dictionaries of key/action associations for KActions, including global shortcuts.
The class takes care of all aspects of configuration, including handling key conflicts internally. Connect to the allDefault() slot if you want to set all configurable shortcuts to their default values.
- See also:
- KShortcutsDialog
Definition at line 59 of file kshortcutseditor.h.
Member Enumeration Documentation
- Enumerator:
Definition at line 64 of file kshortcutseditor.h.
- Enumerator:
Definition at line 78 of file kshortcutseditor.h.
Constructor & Destructor Documentation
KShortcutsEditor::KShortcutsEditor | ( | KActionCollection * | collection, | |
QWidget * | parent, | |||
ActionTypes | actionTypes = AllActions , |
|||
LetterShortcuts | allowLetterShortcuts = LetterShortcutsAllowed | |||
) |
Constructor.
- Parameters:
-
collection the KActionCollection to configure parent parent widget actionTypes types of actions to display in this widget. allowLetterShortcuts set to LetterShortcutsDisallowed if unmodified alphanumeric keys ('A', '1', etc.) are not permissible shortcuts.
Definition at line 55 of file kshortcutseditor.cpp.
KShortcutsEditor::KShortcutsEditor | ( | QWidget * | parent, | |
ActionTypes | actionTypes = AllActions , |
|||
LetterShortcuts | allowLetterShortcuts = LetterShortcutsAllowed | |||
) | [explicit] |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Creates a key chooser without a starting action collection.
- Parameters:
-
parent parent widget actionTypes types of actions to display in this widget. allowLetterShortcuts set to LetterShortcutsDisallowed if unmodified alphanumeric keys ('A', '1', etc.) are not permissible shortcuts.
Definition at line 65 of file kshortcutseditor.cpp.
KShortcutsEditor::~KShortcutsEditor | ( | ) | [virtual] |
Member Function Documentation
void KShortcutsEditor::addCollection | ( | KActionCollection * | collection, | |
const QString & | title = QString() | |||
) |
Insert an action collection, i.e.
add all its actions to the ones already associated with the KShortcutsEditor object.
- Parameters:
-
title subtree title of this collection of shortcut.
Definition at line 101 of file kshortcutseditor.cpp.
void KShortcutsEditor::allDefault | ( | ) | [slot] |
Set all shortcuts to their default values (bindings).
Definition at line 258 of file kshortcutseditor.cpp.
void KShortcutsEditor::clearCollections | ( | ) |
void KShortcutsEditor::commit | ( | ) |
Commit the changes without saving.
This commits the changes without saving.
- Since:
- 4.2
Definition at line 220 of file kshortcutseditor.cpp.
void KShortcutsEditor::exportConfiguration | ( | KConfig * | config | ) | const |
Export the current setting to configuration config
.
This initializes the configuration object. This will export the global configuration too.
- Parameters:
-
config Config object
Definition at line 187 of file kshortcutseditor.cpp.
void KShortcutsEditor::importConfiguration | ( | KConfig * | config | ) |
Import the settings from configuration config
.
This will remove all current setting before importing. All shortcuts are set to KShortcut() prior to importing from config!
- Parameters:
-
config Config object
Definition at line 169 of file kshortcutseditor.cpp.
bool KShortcutsEditor::isModified | ( | ) | const |
void KShortcutsEditor::keyChange | ( | ) | [signal] |
Emitted when an action's shortcut has been changed.
void KShortcutsEditor::printShortcuts | ( | ) | const [slot] |
Opens a printing dialog to print all the shortcuts.
Definition at line 264 of file kshortcutseditor.cpp.
void KShortcutsEditor::resizeColumns | ( | ) | [slot] |
void KShortcutsEditor::save | ( | ) |
Save the changes.
Before saving the changes are committed. This saves the actions to disk. Any KActionCollection objects with the xmlFile() value set will be written to an XML file. All other will be written to the application's rc file.
Definition at line 230 of file kshortcutseditor.cpp.
void KShortcutsEditor::undoChanges | ( | ) |
void KShortcutsEditor::writeConfiguration | ( | KConfigGroup * | config = 0 |
) | const |
Write the current settings to the config
object.
This does not initialize the config
object. It adds the configuration.
- Note:
- this will not save the global configuration! globalaccel holds that part of the configuration.
- See also:
- writeGlobalConfig()
- Parameters:
-
config Config object to save to or, or null to use the applications config object
Definition at line 205 of file kshortcutseditor.cpp.
Friends And Related Function Documentation
friend class (d, void capturedShortcut(QVariant, const QModelIndex &)) private KShortcutsEditorPrivate [friend] |
Definition at line 216 of file kshortcutseditor.h.
The documentation for this class was generated from the following files: