![]() |
VR-Forces 5.0.1 Developer's Guide
|
A custom QLineEdit for suppressing key-release events. QLineEdit widgets normally consume key-press events while handling text modification, however, key-release events are propagated to their parent for handling. This widget suppresses both key-press and key-release events from being propagated to the parent. Suppressing both event types prevents the root-ancestor from handling either event while this widget is actively being modified. For instance, this prevents key-release events from being handled as keyboard short-cut events while the user is editing text.

Public Member Functions | |
| DtLineEdit (QWidget *parent=0) | |
| DtLineEdit (const QString &contents, QWidget *parent=0) | |
| virtual | ~DtLineEdit () |
Protected Member Functions | |
| virtual void | keyPressEvent (QKeyEvent *event) |
| virtual void | keyReleaseEvent (QKeyEvent *event) |
| virtual void | focusOutEvent (QFocusEvent *event) |
Protected Attributes | |
| QList< int > | myKeyList |
| makVrv::DtLineEdit::DtLineEdit | ( | QWidget * | parent = 0 | ) |
Default CTOR Construct a line edit with no text.
| [in] | parent | is a parent widget for this object. |
| makVrv::DtLineEdit::DtLineEdit | ( | const QString & | contents, |
| QWidget * | parent = 0 |
||
| ) |
Initialize CTOR Construct a line edit containing the text contents.
| [in] | contents | is the initial string to display. |
| [in] | parent | is a parent widget for this object. |
|
virtual |
Virtual DTOR.
|
protectedvirtual |
Key-Press event handler. Record which key has been pressed to later suppress its release event.
| [in] | event | is the key-event to handle. |
|
protectedvirtual |
Key-Release event handler. Suppress a release event if a press event was handled.
| [in] | event | is the key-event to handle. |
|
protectedvirtual |
Focus-Lost event handler. Clears the list of key presses when focus is lost.
| [in] | event | is the focus-event to handle. |