KShortcutsEditor Class
Header: | #include <KShortcutsEditor> |
Public Types
enum | ActionType { WidgetAction, WindowAction, ApplicationAction, GlobalAction, AllActions } |
flags | ActionTypes |
enum | LetterShortcuts { LetterShortcutsDisallowed, LetterShortcutsAllowed } |
Public Functions
KShortcutsEditor(KActionCollection *collection, QWidget *parent, KShortcutsEditor::ActionTypes actionTypes = AllActions, KShortcutsEditor::LetterShortcuts allowLetterShortcuts = LetterShortcutsAllowed) | |
KShortcutsEditor(QWidget *parent, KShortcutsEditor::ActionTypes actionTypes = AllActions, KShortcutsEditor::LetterShortcuts allowLetterShortcuts = LetterShortcutsAllowed) | |
KShortcutsEditor::ActionTypes | actionTypes() const |
void | addCollection(KActionCollection *, const QString &title = QString()) |
void | clearCollections() |
bool | isModified() const |
void | save() |
void | setActionTypes(KShortcutsEditor::ActionTypes actionTypes) |
void | undo() |
Public Slots
void | allDefault() |
Signals
void | keyChange() |
Detailed Description
@class KShortcutsEditor kshortcutseditor.h KShortcutsEditor
@short Widget for configuration of KAccel and KGlobalAccel.
Configure dictionaries of key/action associations for QActions, 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 KShortcutsDialog @author Nicolas Hadacek <hadacek@via.ecp.fr> @author Hamish Rodda <rodda@kde.org> (KDE 4 porting) @author Michael Jansen <kde@michael-jansen.biz>
Member Type Documentation
enum KShortcutsEditor::ActionType
flags KShortcutsEditor::ActionTypes
@see ActionTypes
The ActionTypes type is a typedef for QFlags<ActionType>. It stores an OR combination of ActionType values.
enum KShortcutsEditor::LetterShortcuts
Stores a combination of #ActionType values.
Member Function Documentation
KShortcutsEditor::KShortcutsEditor(KActionCollection *collection, QWidget *parent, KShortcutsEditor::ActionTypes actionTypes = AllActions, KShortcutsEditor::LetterShortcuts allowLetterShortcuts = LetterShortcutsAllowed)
Constructor.
@param collection the KActionCollection to configure @param parent parent widget @param actionTypes types of actions to display in this widget. @param allowLetterShortcuts set to LetterShortcutsDisallowed if unmodified alphanumeric keys ('A', '1', etc.) are not permissible shortcuts.
[explicit]
KShortcutsEditor::KShortcutsEditor(QWidget *parent, KShortcutsEditor::ActionTypes actionTypes = AllActions, KShortcutsEditor::LetterShortcuts allowLetterShortcuts = LetterShortcutsAllowed)
This is an overloaded function.
Creates a key chooser without a starting action collection.
@param parent parent widget @param actionTypes types of actions to display in this widget. @param allowLetterShortcuts set to LetterShortcutsDisallowed if unmodified alphanumeric keys ('A', '1', etc.) are not permissible shortcuts.
KShortcutsEditor::ActionTypes KShortcutsEditor::actionTypes() const
@return The types of actions currently displayed in this widget. @since 5.0
Note: Getter function for property actionTypes.
See also setActionTypes().
void KShortcutsEditor::addCollection(KActionCollection *, const QString &title = QString())
Insert an action collection, i.e. add all its actions to the ones already associated with the KShortcutsEditor object. @param title subtree title of this collection of shortcut.
[slot]
void KShortcutsEditor::allDefault()
Set all shortcuts to their default values (bindings).
void KShortcutsEditor::clearCollections()
Removes all action collections from the editor
bool KShortcutsEditor::isModified() const
Are the unsaved changes?
[signal]
void KShortcutsEditor::keyChange()
Emitted when an action's shortcut has been changed.
void KShortcutsEditor::save()
Save the changes.
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.
void KShortcutsEditor::setActionTypes(KShortcutsEditor::ActionTypes actionTypes)
Sets the types of actions to display in this widget.
@param actionTypes New types of actions @since 5.0
Note: Setter function for property actionTypes.
See also actionTypes().
void KShortcutsEditor::undo()
Undo all change made since the last save().
@since 5.75