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

KDEUI

KShortcutsDialog Class Reference

Dialog for configuration of KActionCollection and KGlobalAccel. More...

#include <kshortcutsdialog.h>

Inheritance diagram for KShortcutsDialog:
KDialog QDialog

List of all members.

Signals

void saved ()

Public Member Functions

QList< KActionCollection * > actionCollections () const
void addCollection (KActionCollection *, const QString &title=QString())
bool configure (bool saveSettings=true)
 KShortcutsDialog (KShortcutsEditor::ActionTypes types=KShortcutsEditor::AllActions, KShortcutsEditor::LetterShortcuts allowLetterShortcuts=KShortcutsEditor::LetterShortcutsAllowed, QWidget *parent=0)
virtual QSize sizeHint () const
virtual ~KShortcutsDialog ()

Static Public Member Functions

static int configure (KActionCollection *collection, KShortcutsEditor::LetterShortcuts allowLetterShortcuts=KShortcutsEditor::LetterShortcutsAllowed, QWidget *parent=0, bool bSaveSettings=true)

Detailed Description

Dialog for configuration of KActionCollection and KGlobalAccel.

The KShortcutsDialog class is used for configuring dictionaries of key/action associations for KActionCollection and KGlobalAccel. It uses the KShortcutsEditor widget and offers buttons to set all keys to defaults and invoke on-line help.

Several static methods are supplied which provide the most convenient interface to the dialog. The most common and most encouraged use is with KActionCollection.

 KShortcutsDialog::configure( actionCollection() );
Since:
4.3 By default this dialog is modal. If you don't want that, setModal(false) and then the non-static configure() will show the dialog. If you want to do anything extra when the dialog is done, connect to okClicked() and/or cancelClicked(). However, if your extra stuff depends on the changed settings already being saved, connect to saved() instead to be safe; if you connect to okClicked() your function might be called before the save happens.

example:

 KShortcutsDialog dlg;
 dlg.addCollection(myActions);
 dlg.setModal(false);
 connect(&dlg, SIGNAL(saved()), this, SLOT(doExtraStuff()));
 dlg.configure();
Author:
Nicolas Hadacek <hadacek@via.ecp.fr>
Hamish Rodda <rodda@kde.org> (KDE 4 porting)
Michael Jansen <kde@michael-jansen.biz>

Definition at line 67 of file kshortcutsdialog.h.


Constructor & Destructor Documentation

KShortcutsDialog::KShortcutsDialog ( KShortcutsEditor::ActionTypes  types = KShortcutsEditor::AllActions,
KShortcutsEditor::LetterShortcuts  allowLetterShortcuts = KShortcutsEditor::LetterShortcutsAllowed,
QWidget *  parent = 0 
) [explicit]

Constructs a KShortcutsDialog as a child of parent.

Set allowLetterShortcuts to false if unmodified alphanumeric keys ('A', '1', etc.) are not permissible shortcuts.

Definition at line 115 of file kshortcutsdialog.cpp.

KShortcutsDialog::~KShortcutsDialog (  )  [virtual]

Destructor.

Deletes all resources used by a KShortcutsDialog object.

Definition at line 141 of file kshortcutsdialog.cpp.


Member Function Documentation

QList< KActionCollection * > KShortcutsDialog::actionCollections (  )  const
Returns:
the list of action collections that are available for configuration in the dialog.

Definition at line 156 of file kshortcutsdialog.cpp.

void KShortcutsDialog::addCollection ( KActionCollection *  collection,
const QString &  title = QString() 
)

Add all actions of the collection to the ones displayed and configured by the dialog.

Parameters:
title the title associated with the collection (if null, the KAboutData::progName() of the collection's componentData is used)

Definition at line 149 of file kshortcutsdialog.cpp.

int KShortcutsDialog::configure ( KActionCollection *  collection,
KShortcutsEditor::LetterShortcuts  allowLetterShortcuts = KShortcutsEditor::LetterShortcutsAllowed,
QWidget *  parent = 0,
bool  bSaveSettings = true 
) [static]

Pops up a modal dialog for configuring key settings.

The new shortcut settings will become active if the user presses OK.

Parameters:
collection the KActionCollection to configure
allowLetterShortcuts set to KShortcutsEditor::LetterShortcutsDisallowed if unmodified alphanumeric keys ('A', '1', etc.) are not permissible shortcuts.
parent the parent widget to attach to
bSaveSettings if true, the settings will also be saved back by calling writeSettings() on the action collections that were added.
Returns:
Accept if the dialog was closed with OK, Reject otherwise.

Definition at line 182 of file kshortcutsdialog.cpp.

bool KShortcutsDialog::configure ( bool  saveSettings = true  ) 

Run the dialog and call writeSettings() on the action collections that were added if bSaveSettings is true.

Definition at line 162 of file kshortcutsdialog.cpp.

void KShortcutsDialog::saved (  )  [signal]

emitted after ok is clicked and settings are saved

QSize KShortcutsDialog::sizeHint (  )  const [virtual]
See also:
QWidget::sizeHint()

Reimplemented from KDialog.

Definition at line 177 of file kshortcutsdialog.cpp.


The documentation for this class was generated from the following files:
  • kshortcutsdialog.h
  • kshortcutsdialog.cpp

KDEUI

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

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.6.1
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal