VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Protected Member Functions | Protected Attributes
makVrv::DtLineEdit Class Reference

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.

Inheritance diagram for makVrv::DtLineEdit:
Inheritance graph
[legend]

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< intmyKeyList
 

Constructor & Destructor Documentation

makVrv::DtLineEdit::DtLineEdit ( QWidget *  parent = 0)

Default CTOR Construct a line edit with no text.

Parameters
[in]parentis 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.

Parameters
[in]contentsis the initial string to display.
[in]parentis a parent widget for this object.
virtual makVrv::DtLineEdit::~DtLineEdit ( )
virtual

Virtual DTOR.

Member Function Documentation

virtual void makVrv::DtLineEdit::keyPressEvent ( QKeyEvent *  event)
protectedvirtual

Key-Press event handler. Record which key has been pressed to later suppress its release event.

Parameters
[in]eventis the key-event to handle.
virtual void makVrv::DtLineEdit::keyReleaseEvent ( QKeyEvent *  event)
protectedvirtual

Key-Release event handler. Suppress a release event if a press event was handled.

Parameters
[in]eventis the key-event to handle.
virtual void makVrv::DtLineEdit::focusOutEvent ( QFocusEvent *  event)
protectedvirtual

Focus-Lost event handler. Clears the list of key presses when focus is lost.

Parameters
[in]eventis the focus-event to handle.

Member Data Documentation

QList<int> makVrv::DtLineEdit::myKeyList
protected

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

Document ID: Generated on Wed Mar 27 22:49:11 EDT 2024 from SVN revision 264633
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)