SMTK  @SMTK_VERSION@
Simulation Modeling Tool Kit
Public Slots | Signals | Public Member Functions | Protected Member Functions | Properties | Friends | List of all members
smtk::extension::qtLineEdit Class Reference

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

#include <qtLineEdit.h>

Inheritance diagram for smtk::extension::qtLineEdit:
[legend]
Collaboration diagram for smtk::extension::qtLineEdit:
[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).
 

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.
 

Public Member Functions

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

Protected Member Functions

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

Properties

QString text2
 
bool resetCursorPositionOnEditingFinished
 

Friends

class qtLineEditEventPlayer
 

Detailed Description

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

This is from ParaView's pqLineEdit class.

Member Function Documentation

◆ setTextAndResetCursor

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

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

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


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