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

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 53 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 73 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.

◆ 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 100 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 110 of file pqLineEdit.h.

Property Documentation

◆ text2

QString pqLineEdit::text2
readwrite

Definition at line 56 of file pqLineEdit.h.

◆ resetCursorPositionOnEditingFinished

bool pqLineEdit::resetCursorPositionOnEditingFinished
readwrite

Definition at line 58 of file pqLineEdit.h.


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