The QKeySequenceWidget is a widget to input a QKeySequence. More...
#include <qkeysequencewidget/src/qkeysequencewidget.h>
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) |
Signals | |
void | keySequenceChanged (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 |
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)));
enum ClearButton |
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
QIcon clearButtonIcon | ( | ) | const |
Get clear buttom icon.
QKeySequenceWidget::ClearButtonShow clearButtonShow | ( | ) | const |
Return mode of clear button dosplay.
show | Dysplay mode of clear button (NoShow, ShowLeft or ShorRight) |
void clearKeySequence | ( | ) | [slot] |
Clear key sequence.
QKeySequence keySequence | ( | ) | const |
Get current key sequence.
QString noneText | ( | ) | const |
Get string for display when key sequence is undefined.
void setClearButtonIcon | ( | const QIcon & | icon | ) | [slot] |
Set custom icon for clear buttom.
icon | QIcon object |
void setClearButtonShow | ( | QKeySequenceWidget::ClearButtonShow | show | ) | [slot] |
Setting mode of Clear Buttorn display.
show | Position of clear button ClearButtornShow |
void setKeySequence | ( | const QKeySequence & | key | ) | [slot] |
void setNoneText | ( | const QString | text | ) | [slot] |
Set string for display when key sequence is undefined.
text | Text string |