• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdelibs API Reference
  • KDE Home
  • Contact Us
 

KDEUI

Public Types | Public Slots | Signals | Public Member Functions | List of all members
KShortcutsEditor Class Reference

#include <kshortcutseditor.h>

Inheritance diagram for KShortcutsEditor:
Inheritance graph
[legend]

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

 KShortcutsEditor (KActionCollection *collection, QWidget *parent, ActionTypes actionTypes=AllActions, LetterShortcuts allowLetterShortcuts=LetterShortcutsAllowed)
 
 KShortcutsEditor (QWidget *parent, ActionTypes actionTypes=AllActions, LetterShortcuts allowLetterShortcuts=LetterShortcutsAllowed)
 
virtual ~KShortcutsEditor ()
 
void addCollection (KActionCollection *, const QString &title=QString())
 
void clearCollections ()
 
void clearConfiguration ()
 
void commit ()
 
void exportConfiguration (KConfig *config) const
 
void exportConfiguration (KConfigBase *config) const
 
void importConfiguration (KConfig *config)
 
void importConfiguration (KConfigBase *config)
 
bool isModified () const
 
void save ()
 
void undoChanges ()
 
void writeConfiguration (KConfigGroup *config=0) const
 

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
Author
Nicolas Hadacek hadac.nosp@m.ek@v.nosp@m.ia.ec.nosp@m.p.fr
Hamish Rodda rodda.nosp@m.@kde.nosp@m..org (KDE 4 porting)
Michael Jansen kde@m.nosp@m.icha.nosp@m.el-ja.nosp@m.nsen.nosp@m..biz

Definition at line 60 of file kshortcutseditor.h.

Member Enumeration Documentation

enum KShortcutsEditor::ActionType
Enumerator
WidgetAction 

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

WindowAction 

Actions which are triggered by any keypress in a window which has the action added to it or its child widget(s)

ApplicationAction 

Actions which are triggered by any keypress in the application.

GlobalAction 

Actions which are triggered by any keypress in the windowing system.

AllActions 

All actions.

Definition at line 65 of file kshortcutseditor.h.

enum KShortcutsEditor::LetterShortcuts
Enumerator
LetterShortcutsDisallowed 

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.

LetterShortcutsAllowed 

Letter shortcuts are allowed.

Definition at line 79 of file kshortcutseditor.h.

Constructor & Destructor Documentation

KShortcutsEditor::KShortcutsEditor ( KActionCollection *  collection,
QWidget *  parent,
ActionTypes  actionTypes = AllActions,
LetterShortcuts  allowLetterShortcuts = LetterShortcutsAllowed 
)

Constructor.

Parameters
collectionthe KActionCollection to configure
parentparent widget
actionTypestypes of actions to display in this widget.
allowLetterShortcutsset to LetterShortcutsDisallowed if unmodified alphanumeric keys ('A', '1', etc.) are not permissible shortcuts.

Definition at line 56 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
parentparent widget
actionTypestypes of actions to display in this widget.
allowLetterShortcutsset to LetterShortcutsDisallowed if unmodified alphanumeric keys ('A', '1', etc.) are not permissible shortcuts.

Definition at line 66 of file kshortcutseditor.cpp.

KShortcutsEditor::~KShortcutsEditor ( )
virtual

Destructor.

Definition at line 74 of file kshortcutseditor.cpp.

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
titlesubtree title of this collection of shortcut.

Definition at line 102 of file kshortcutseditor.cpp.

void KShortcutsEditor::allDefault ( )
slot

Set all shortcuts to their default values (bindings).

Definition at line 273 of file kshortcutseditor.cpp.

void KShortcutsEditor::clearCollections ( )

Removes all action collections from the editor.

Definition at line 94 of file kshortcutseditor.cpp.

void KShortcutsEditor::clearConfiguration ( )

Removes all configured shortcuts.

Definition at line 170 of file kshortcutseditor.cpp.

void KShortcutsEditor::commit ( )

Commit the changes without saving.

This commits the changes without saving.

Since
4.2

Definition at line 235 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
configConfig object

Definition at line 191 of file kshortcutseditor.cpp.

void KShortcutsEditor::exportConfiguration ( KConfigBase *  config) const

Definition at line 198 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
configConfig object

Definition at line 177 of file kshortcutseditor.cpp.

void KShortcutsEditor::importConfiguration ( KConfigBase *  config)

Definition at line 184 of file kshortcutseditor.cpp.

bool KShortcutsEditor::isModified ( ) const

Are the unsaved changes?

Definition at line 80 of file kshortcutseditor.cpp.

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 279 of file kshortcutseditor.cpp.

void KShortcutsEditor::resizeColumns ( )
slot

Resize columns to width required.

Definition at line 228 of file kshortcutseditor.cpp.

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 245 of file kshortcutseditor.cpp.

void KShortcutsEditor::undoChanges ( )

Undo all change made since the last commit().

Definition at line 257 of file kshortcutseditor.cpp.

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
configConfig object to save to or, or null to use the applications config object

Definition at line 220 of file kshortcutseditor.cpp.


The documentation for this class was generated from the following files:
  • kshortcutseditor.h
  • kshortcutseditor.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:49:18 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KDEUI

Skip menu "KDEUI"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Modules
  • Related Pages

kdelibs API Reference

Skip menu "kdelibs API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  • kjsembed
  •   WTF
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Nepomuk-Core
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal