Public Types | Public Slots | Signals | Public Member Functions | Public Attributes

# QKeySequenceWidget Class Reference

The QKeySequenceWidget is a widget to input a QKeySequence. More...

`#include <qkeysequencewidget/src/qkeysequencewidget.h>`

List of all members.

## Public Types
enum | ClearButton { NoShow = 0x00, ShowLeft = 0x01, ShowRight = 0x02 }
## Public Slots
void | setKeySequence (const QKeySequence &key)
void | clearKeySequence ()
void | setNoneText (const QString text)
void | setClearButtonIcon (const QIcon &icon)
void | setClearButtonShow (QKeySequenceWidget::ClearButtonShow show)
void | captureKeySequence ()
## Signals
void | keySequenceChanged (const QKeySequence &seq)
void | keySequenceAccepted (const QKeySequence &seq)
void | keyNotSupported ()
## Public Member Functions
| QKeySequenceWidget (QWidget *parent=0)
| QKeySequenceWidget (QKeySequence seq, QWidget *parent=0)
| QKeySequenceWidget (QString noneString, QWidget *parent=0)
| QKeySequenceWidget (QKeySequence seq, QString noneString, QWidget *parent=0)
virtual | ~QKeySequenceWidget ()
QSize | sizeHint () const
void | setToolTip (const QString &tip)
QKeySequence | keySequence () const
QString | noneText () const
QIcon | clearButtonIcon () const
QKeySequenceWidget::ClearButtonShow | clearButtonShow () const
## Public Attributes
| ClearButtonShow

## Detailed Description

The QKeySequenceWidget is a widget to input a QKeySequence.

This widget lets the user choose a QKeySequence, which is usually used as a shortcut key. The recording is initiated by calling captureKeySequence() or the user clicking into the widget.

        // create new QKeySequenceWidget with empty sequence
        QKeySequenceWidget *keyWidget = new QKeySequenceWidget;

        // Set sequence as "Ctrl+Alt+Space"
        keyWidget->setJeySequence(QKeySequence("Ctrl+Alt+Space"));

        // set clear button position is left
        setClearButtonShow(QKeySequenceWidget::ShowLeft);

        // set cutom clear button icon
        setClearButtonIcon(QIcon("/path/to/icon.png"));

        // connecting keySequenceChanged signal to slot
        connect(keyWidget, SIGNAL(keySequenceChanged(QKeySequence)), this, SLOT(slotKeySequenceChanged(QKeySequence)));

## Member Enumeration Documentation

enum ClearButton

Modes of sohow ClearButton.

Enumerator:

  NoShow | Hide ClearButton
  ShowLeft | ClearButton isow is left
  ShowRight | ClearButton isow is left

## Constructor & Destructor Documentation

QKeySequenceWidget | ( | QWidget * | parent = `0` ) | `[explicit]`

Creates a QKeySequenceWidget object wuth parent and empty keySequence

QKeySequenceWidget | ( | QKeySequence | seq,
|  | QWidget * | parent = `0`
| ) |  | `[explicit]`

Creates a QKeySequenceWidget object wuth parent and keysequence keySequence

QKeySequenceWidget | ( | QString | noneString,
|  | QWidget * | parent = `0`
| ) |  | `[explicit]`

Creates a QKeySequenceWidget object wuth parent and string for noneString

QKeySequenceWidget | ( | QKeySequence | seq,
|  | QString | noneString,
|  | QWidget * | parent = `0`
| ) |  | `[explicit]`

Creates a QKeySequenceWidget object wuth parent and keysequence keySequence and string for noneString

~QKeySequenceWidget | ( | ) | `[virtual]`

Destroy a QKeySequenceWidget object

## Member Function Documentation

void captureKeySequence | ( | ) | `[slot]`

Start process capturing key sequence. This slot is designed for software process capturing key sequence.

QIcon clearButtonIcon | ( | ) | const

Get clear buttom icon.

Returns:
  QIcon object

See also:
  setClearButtonIcon

QKeySequenceWidget::ClearButtonShow clearButtonShow | ( | ) | const

Return mode of clear button dosplay.

Parameters:

  show | Display mode of clear button (NoShow, ShowLeft or ShorRight)

See also:
  setClearButtonShow

void clearKeySequence | ( | ) | `[slot]`

Clear key sequence.

See also:
  setKeySequence

QKeySequence keySequence | ( | ) | const

Get current key sequence.

Returns:
  Current key sequence

See also:
  setKeySequence
  clearKeySequence

QString noneText | ( | ) | const

Get string for display when key sequence is undefined.

Returns:
  Text string

See also:
  setNoneText

void setClearButtonIcon | ( | const QIcon & | icon ) | `[slot]`

Set custom icon for clear buttom.

Parameters:

  icon | QIcon object

See also:
  clearButtonIcon

void setClearButtonShow | ( | QKeySequenceWidget::ClearButtonShow | show ) | `[slot]`

Setting mode of Clear Buttorn display.

Parameters:

  show | Position of clear button ClearButtornShow

See also:
  clearButtonShow

void setKeySequence | ( | const QKeySequence & | key ) | `[slot]`

Set the key sequence.

Parameters:

  key | Key sequence

See also:
  clearKeySequence

void setNoneText | ( | const QString | text ) | `[slot]`

Set string for display when key sequence is undefined.

Parameters:

  text | Text string

See also:
  noneText

void setToolTip | ( | const QString & | tip ) |

Setting tooltip text to sequence button

Parameters:

  tip | Text string