Public Slots | Signals | Public Member Functions | Protected Member Functions | Properties | Friends | List of all members
pqLineEdit Class Reference

pqLineEdit is a specialization of QLineEdit which provide a new property 'text2'. More...

#include <pqLineEdit.h>

Inheritance diagram for pqLineEdit:
Inheritance graph
[legend]

Public Slots

void setTextAndResetCursor (const QString &text)
 Same as QLineEdit::setText() except that it reset the cursor position to 0. More...
 
void setResetCursorPositionOnEditingFinished (bool val)
 To enable/disable whether the cursor position is reset to 0 after editingFinished() is fired, use the resetCursorPositionOnEditingFinished property (default: true). More...
 

Signals

void textChangedAndEditingFinished ()
 Unlike QLineEdit::editingFinished() which gets fired whenever the widget looses focus irrespective of if the text actually was edited, textChangedAndEditingFinished() is fired only when the text was changed as well. More...
 
void blank ()
 This signal is never fired. More...
 

Public Member Functions

 pqLineEdit (QWidget *parent=nullptr)
 
 pqLineEdit (const QString &contents, QWidget *parent=nullptr)
 
 ~pqLineEdit () override
 
bool resetCursorPositionOnEditingFinished () const
 To enable/disable whether the cursor position is reset to 0 after editingFinished() is fired, use the resetCursorPositionOnEditingFinished property (default: true). More...
 

Protected Member Functions

void triggerTextChangedAndEditingFinished ()
 this is called by pqLineEditEventPlayer during event playback to ensure that the textChangedAndEditingFinished() signal is fired when text is changed using setText() in playback. More...
 
void focusInEvent (QFocusEvent *event) override
 

Properties

QString text2
 
bool resetCursorPositionOnEditingFinished
 

Friends

class pqLineEditEventPlayer
 

Detailed Description

pqLineEdit is a specialization of QLineEdit which provide a new property 'text2'.

When the text on the line widget is set using this 'text2' property (or using setTextAndResetCursor()), the after the set, the cursor position is reset to 0.

Additional, this provides a true editingFinished() signal under the name of textChangedAndEditingFinished(). Unlike QLineEdit::editingFinished() which gets fired whenever the widget looses focus irrespective of if the text actually was edited, textChangedAndEditingFinished() is fired only when the text was changed as well.

To enable/disable whether the cursor position is reset to 0 after textChangedAndEditingFinished() if fired, use the resetCursorPositionOnEditingFinished property (default: true).

Definition at line 25 of file pqLineEdit.h.

Constructor & Destructor Documentation

◆ pqLineEdit() [1/2]

pqLineEdit::pqLineEdit ( QWidget *  parent = nullptr)

◆ pqLineEdit() [2/2]

pqLineEdit::pqLineEdit ( const QString &  contents,
QWidget *  parent = nullptr 
)

◆ ~pqLineEdit()

pqLineEdit::~pqLineEdit ( )
override

Member Function Documentation

◆ resetCursorPositionOnEditingFinished()

bool pqLineEdit::resetCursorPositionOnEditingFinished ( ) const
inline

To enable/disable whether the cursor position is reset to 0 after editingFinished() is fired, use the resetCursorPositionOnEditingFinished property (default: true).

Definition at line 45 of file pqLineEdit.h.

◆ textChangedAndEditingFinished

void pqLineEdit::textChangedAndEditingFinished ( )
signal

Unlike QLineEdit::editingFinished() which gets fired whenever the widget looses focus irrespective of if the text actually was edited, textChangedAndEditingFinished() is fired only when the text was changed as well.

◆ blank

void pqLineEdit::blank ( )
signal

This signal is never fired.

It exists so that you can add a unidirectional property link, where an information-only property updates the pqLineEdit contents, but user edits to the pqLineEdit never update the property.

See also
pqCoordinateFramePropertyWidget which uses this so users can enter coordinates for an axis without the property being updated (which would cause other values to be modified, interrupting the user's edit).

◆ setTextAndResetCursor

void pqLineEdit::setTextAndResetCursor ( const QString &  text)
slot

Same as QLineEdit::setText() except that it reset the cursor position to 0.

This is useful with the pqLineEdit is used for showing numbers were the digits on the left are more significant on the right.

◆ setResetCursorPositionOnEditingFinished

void pqLineEdit::setResetCursorPositionOnEditingFinished ( bool  val)
inlineslot

To enable/disable whether the cursor position is reset to 0 after editingFinished() is fired, use the resetCursorPositionOnEditingFinished property (default: true).

Definition at line 84 of file pqLineEdit.h.

◆ triggerTextChangedAndEditingFinished()

void pqLineEdit::triggerTextChangedAndEditingFinished ( )
protected

this is called by pqLineEditEventPlayer during event playback to ensure that the textChangedAndEditingFinished() signal is fired when text is changed using setText() in playback.

◆ focusInEvent()

void pqLineEdit::focusInEvent ( QFocusEvent *  event)
overrideprotected

Friends And Related Function Documentation

◆ pqLineEditEventPlayer

friend class pqLineEditEventPlayer
friend

Definition at line 94 of file pqLineEdit.h.

Property Documentation

◆ text2

QString pqLineEdit::text2
readwrite

Definition at line 28 of file pqLineEdit.h.

◆ resetCursorPositionOnEditingFinished

bool pqLineEdit::resetCursorPositionOnEditingFinished
readwrite

Definition at line 30 of file pqLineEdit.h.


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