Version: 9.12.0
QtxShortcutEdit Class Reference

#include <QtxShortcutEdit.h>

Inheritance diagram for QtxShortcutEdit:
Inheritance graph

Public Member Functions

 QtxShortcutEdit (QWidget *=0)
 Constructor. More...
 
virtual ~QtxShortcutEdit ()
 Destructor. More...
 
void setShortcut (const QKeySequence &)
 Sets custom shortcut. More...
 
QKeySequence shortcut ()
 Gets custom shortcut. More...
 

Static Public Member Functions

static QString parseEvent (QKeyEvent *)
 Gets the key sequence from keys that were pressed. More...
 
static bool isValidKey (int)
 Check if the key event contains a 'valid' key. More...
 

Protected Member Functions

virtual bool eventFilter (QObject *, QEvent *)
 Custom event filter. More...
 

Private Slots

void onCliked ()
 Called when "Clear" button is clicked. More...
 
void onEditingFinished ()
 Called when myShortcut loses focus. More...
 

Private Member Functions

void initialize ()
 

Private Attributes

QLineEditmyShortcut
 
QString myPrevShortcutText
 

Constructor & Destructor Documentation

◆ QtxShortcutEdit()

QtxShortcutEdit::QtxShortcutEdit ( QWidget parent = 0)

Constructor.

Parameters
parentparent widget

References initialize(), and myShortcut.

◆ ~QtxShortcutEdit()

QtxShortcutEdit::~QtxShortcutEdit ( )
virtual

Destructor.

Member Function Documentation

◆ eventFilter()

bool QtxShortcutEdit::eventFilter ( QObject obj,
QEvent event 
)
protectedvirtual

Custom event filter.

Parameters
objevent receiver object
eventevent
Returns
true if further event processing should be stopped

References myPrevShortcutText, myShortcut, onCliked(), and parseEvent().

◆ initialize()

void QtxShortcutEdit::initialize ( )
private

◆ isValidKey()

bool QtxShortcutEdit::isValidKey ( int  aKey)
static

Check if the key event contains a 'valid' key.

Parameters
aKeythe code of the key
Returns
true if the key is 'valid'

◆ onCliked

void QtxShortcutEdit::onCliked ( )
privateslot

Called when "Clear" button is clicked.

References myShortcut.

◆ onEditingFinished

void QtxShortcutEdit::onEditingFinished ( )
privateslot

Called when myShortcut loses focus.

References myPrevShortcutText, and myShortcut.

◆ parseEvent()

QString QtxShortcutEdit::parseEvent ( QKeyEvent *  e)
static

Gets the key sequence from keys that were pressed.

Parameters
ea key event
Returns
a string representation of the key sequence

References isValidKey().

◆ setShortcut()

void QtxShortcutEdit::setShortcut ( const QKeySequence &  seq)

Sets custom shortcut.

Parameters
seqa key sequence describes a combination of keys
See also
shortcut()

References myPrevShortcutText, and myShortcut.

◆ shortcut()

QKeySequence QtxShortcutEdit::shortcut ( )

Gets custom shortcut.

Returns
a key sequence describes a combination of keys
See also
setShortcut()

References myShortcut.

Member Data Documentation

◆ myPrevShortcutText

QString QtxShortcutEdit::myPrevShortcutText
private

◆ myShortcut

QLineEdit* QtxShortcutEdit::myShortcut
private

The documentation for this class was generated from the following files: