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

KDEUI

KKeySequenceWidget Class Reference

#include <kkeysequencewidget.h>

Inheritance diagram for KKeySequenceWidget:

Inheritance graph
[legend]

List of all members.


Detailed Description

A widget to input a QKeySequence.

This widget lets the user choose a QKeySequence, which is usually used as a shortcut key, by pressing the keys just like to trigger a shortcut. Calling captureKeySequence(), or the user clicking into the widget, start recording.

A check for conflict with shortcut of this application can also be performed. call setCheckActionCollections() to set the list of action collections to check with, and applyStealShortcut when applying changes.

Author:
Mark Donohoe <donohoe@kde.org>

For internal use only.

Definition at line 48 of file kkeysequencewidget.h.


Public Types

enum  Validation { Validate = 0, NoValidate = 1 }

Public Slots

void applyStealShortcut ()
void captureKeySequence ()
void clearKeySequence ()
void setKeySequence (const QKeySequence &seq, Validation val=NoValidate)

Signals

void keySequenceChanged (const QKeySequence &seq)

Public Member Functions

bool isModifierlessAllowed ()
QKeySequence keySequence () const
 KKeySequenceWidget (QWidget *parent=0)
void setCheckActionCollections (const QList< KActionCollection * > &actionCollections)
void setCheckActionList (const QList< QAction * > &checkList)
void setClearButtonShown (bool show)
void setModifierlessAllowed (bool allow)
virtual ~KKeySequenceWidget ()

Member Enumeration Documentation

enum KKeySequenceWidget::Validation

An enum about validation when setting a key sequence.

See also:
setKeySequence()
Enumerator:
Validate  Validate key sequence.
NoValidate  Use key sequence without validation.

Definition at line 55 of file kkeysequencewidget.h.


Constructor & Destructor Documentation

KKeySequenceWidget::KKeySequenceWidget ( QWidget *  parent = 0  )  [explicit]

Constructor.

Definition at line 144 of file kkeysequencewidget.cpp.

KKeySequenceWidget::~KKeySequenceWidget (  )  [virtual]

Destructs the widget.

Definition at line 183 of file kkeysequencewidget.cpp.


Member Function Documentation

void KKeySequenceWidget::applyStealShortcut (  )  [slot]

Actually remove the shortcut that the user wanted to steal, from the action that was using it.

To be called before you apply your changes. No shortcuts are stolen until this function is called.

Definition at line 252 of file kkeysequencewidget.cpp.

void KKeySequenceWidget::captureKeySequence (  )  [slot]

Capture a shortcut from the keyboard.

This call will only return once a key sequence has been captured or input was aborted. If a key sequence was input, keySequenceChanged() will be emitted.

See also:
setModifierlessAllowed()

Definition at line 218 of file kkeysequencewidget.cpp.

void KKeySequenceWidget::clearKeySequence (  )  [slot]

Clear the key sequence.

Definition at line 246 of file kkeysequencewidget.cpp.

bool KKeySequenceWidget::isModifierlessAllowed (  ) 

See also:
setModifierlessAllowed()

Definition at line 195 of file kkeysequencewidget.cpp.

QKeySequence KKeySequenceWidget::keySequence (  )  const

Return the currently selected key sequence.

Definition at line 224 of file kkeysequencewidget.cpp.

void KKeySequenceWidget::keySequenceChanged ( const QKeySequence &  seq  )  [signal]

This signal is emitted when the current key sequence has changed, be it by user input or programmatically.

void KKeySequenceWidget::setCheckActionCollections ( const QList< KActionCollection * > &  actionCollections  ) 

Set a list of action collections to check against for conflictuous shortcut.

If there is a conflictuous shortcut with a KAction, and its shortcut can be configured (KAction::isShortcutConfigurable() returns true) the user will be prompted whether to steal the shortcut from this action.

Global shortcuts are automatically checked for conflicts

Don't forget to call applyStealShortcut to actually steal the shortcut.

Since:
4.1

Definition at line 212 of file kkeysequencewidget.cpp.

void KKeySequenceWidget::setCheckActionList ( const QList< QAction * > &  checkList  ) 

Deprecated:
since 4.1 use setCheckActionCollections so that KKeySequenceWidget knows in which action collection to call the writeSettings method after stealing a shortcut from an action.

Definition at line 206 of file kkeysequencewidget.cpp.

void KKeySequenceWidget::setClearButtonShown ( bool  show  ) 

Set whether a small button to set an empty key sequence should be displayed next to the main input widget.

The default is to show the clear button.

Definition at line 201 of file kkeysequencewidget.cpp.

void KKeySequenceWidget::setKeySequence ( const QKeySequence &  seq,
Validation  val = NoValidate 
) [slot]

Set the key sequence.

If val == Validate, and the call is actually changing the key sequence, conflictuous shortcut will be checked.

Definition at line 231 of file kkeysequencewidget.cpp.

void KKeySequenceWidget::setModifierlessAllowed ( bool  allow  ) 

This only applies to user input, not to setShortcut().

Set whether to accept "plain" keys without modifiers (like Ctrl, Alt, Meta). Plain keys by our definition include letter and symbol keys and text editing keys (Return, Space, Tab, Backspace, Delete). "Special" keys like F1, Cursor keys, Insert, PageDown will always work.

Definition at line 189 of file kkeysequencewidget.cpp.


The documentation for this class was generated from the following files:
  • kkeysequencewidget.h
  • kkeysequencewidget.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
  • Kross
  • KUtils
  • Nepomuk
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.5.4
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