# class KShortcutsEditor

###

Module | kdeui
Namespace |
Class | KShortcutsEditor
Inherits | QWidget

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 Author Nicolas Hadacek <hadacek@via.ecp.fr> Author Hamish Rodda <rodda@kde.org> (KDE 4 porting) Author Michael Jansen <kde@michael-jansen.biz>

### enums

- ActionType { WidgetAction, WindowAction, ApplicationAction, GlobalAction, AllActions }
  typesafe object: ActionTypes
- LetterShortcuts { LetterShortcutsDisallowed, LetterShortcutsAllowed }

enum details

### methods

- KShortcutsEditor (collection, parent, actionTypes, allowLetterShortcuts)

  returns ctor

  Argument | Type | Default
  --- | --- | ---
  collection | KActionCollection |
  parent | QWidget |
  actionTypes | KShortcutsEditor.ActionTypes | KShortcutsEditor.AllActions
  allowLetterShortcuts | KShortcutsEditor.LetterShortcuts | KShortcutsEditor.LetterShortcutsAllowed

  Constructor.

  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.

- KShortcutsEditor (parent, actionTypes, allowLetterShortcuts)

  returns ctor
  KDE 4.1.0 and later only

  Argument | Type | Default
  --- | --- | ---
  parent | QWidget |
  actionTypes | KShortcutsEditor.ActionTypes | KShortcutsEditor.AllActions
  allowLetterShortcuts | KShortcutsEditor.LetterShortcuts | KShortcutsEditor.LetterShortcutsAllowed

  Creates a key chooser without a starting action collection.

  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.

- KShortcutsEditor (a0)

  returns ctor
  Not implemented

  Argument | Type | Default
  --- | --- | ---
  a0 | KShortcutsEditor |

- KShortcutsEditor (a0, a1, a2)

  returns ctor
  before KDE 4.1.0 only

  Argument | Type | Default
  --- | --- | ---
  a0 | QWidget |
  a1 | KShortcutsEditor.ActionTypes | KShortcutsEditor.AllActions
  a2 | KShortcutsEditor.LetterShortcuts | KShortcutsEditor.LetterShortcutsAllowed

- addCollection (a0, title)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  a0 | KActionCollection |
  title | QString | QString()

  Insert an action collection, i.e. add all its actions to the ones already associated with the KShortcutsEditor object.

  title - subtree title of this collection of shortcut.

- allDefault ( )

  returns Nothing

  Set all shortcuts to their default values (bindings).

- checkGlobalShortcutsConflict (a0, a1, a2)

  returns bool
  Not implemented
  before KDE 4.1.0 only

  Argument | Type | Default
  --- | --- | ---
  a0 | KShortcut |
  a1 | bool |
  a2 | QWidget |

- checkStandardShortcutsConflict (a0, a1, a2)

  returns bool
  Not implemented
  before KDE 4.1.0 only

  Argument | Type | Default
  --- | --- | ---
  a0 | KShortcut |
  a1 | bool |
  a2 | QWidget |

- clearCollections ( )

  returns Nothing

  Removes all action collections from the editor

- exportConfiguration (config)

  returns Nothing
  KDE 4.1.0 and later only

  Argument | Type | Default
  --- | --- | ---
  config | KConfig |

  Export the current setting to configuration config.

  This initializes the configuration object. This will export the global configuration too.

  config - Config object

- importConfiguration (config)

  returns Nothing
  KDE 4.1.0 and later only

  Argument | Type | Default
  --- | --- | ---
  config | KConfig |

  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!

  config - Config object

- isModified ( )

  returns bool
  KDE 4.1.0 and later only

  Are the unsaved changes?

- keyChange ( )

  returns Nothing
  SIGNAL ("keyChange ()")

  Emitted when an action's shortcut has been changed.

- printShortcuts ( )

  returns Nothing
  KDE 4.1.0 and later only

  Opens a printing dialog to print all the shortcuts

- resizeColumns ( )

  returns Nothing

  Resize colums to width required

- save ( )

  returns Nothing

  Save the changes.

  Well this function doesn't save actually for global shortcuts. It makes sure the editor doesn't undo all changes when it is deleted.

  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.

- undoChanges ( )

  returns Nothing

  Undo all change made since the last save().

- writeConfiguration (config)

  returns Nothing
  KDE 4.1.0 and later only

  Argument | Type | Default
  --- | --- | ---
  config | KConfigGroup | 0

  Write the current settings to the config object.

  This does not initialize the config object. It adds the configuration.

  this will not save the global configuration! globalaccel holds that part of the configuration.

  See also writeGlobalConfig()

  config - Config object to save to or, or null to use the applications config object

### enums - detail

- ActionType { WidgetAction, WindowAction, ApplicationAction, GlobalAction, AllActions }

  Actions which are triggered by any keypress in a widget which has the action added to it

  typesafe object: ActionTypes

WidgetAction - Qt::WidgetShortcut -
WindowAction - Qt::WindowShortcut -
ApplicationAction - Qt::ApplicationShortcut -
GlobalAction - 4 -
AllActions - 0xffffffff -

- LetterShortcuts { LetterShortcutsDisallowed, LetterShortcutsAllowed }

  Shortcuts without a modifier are not allowed, so 'A' would not be valid, whereas 'Ctrl+A' would be. This only applies to printable characters, however. 'F1', 'Insert' etc. could still be used.

  | LetterShortcutsDisallowed | - 0 | - |
  | LetterShortcutsAllowed | - | - |