SHAPER  9.12.0
ExpressionEditor Class Reference

A multi-line text editor which lets to input formula and provides a list of completion strings. More...

Inheritance diagram for ExpressionEditor:
Inheritance graph

Public Slots

void insertCompletion (const QString &theCompletion, bool isSingleWord=false)
 Insert additional string for completion. More...
 
void performCompletion ()
 Perform completion. More...
 
void onTextChanged ()
 A slot for processing text changed event. More...
 

Signals

void valueModified ()
 The signal about text change in the text editor. More...
 
void keyReleased (QObject *theObject, QKeyEvent *theEvent)
 The signal about key release on the control, that corresponds to the attribute. More...
 

Public Member Functions

 ExpressionEditor (QWidget *theParent=0)
 Constructor. More...
 
void setCompletionList (QStringList &)
 Set list of completion strings. More...
 
void setPlaceHolderText (const QString &)
 Set a text which will be shown when the listr is empty. More...
 
QString placeHolderText () const
 Returns placeholder list. More...
 

Protected Member Functions

void performCompletion (const QString &theCompletionPrefix)
 Perform completion by prefix. More...
 
virtual void keyPressEvent (QKeyEvent *theEvent)
 Redefinition of virtual method. More...
 
bool handledCompletedAndSelected (QKeyEvent *theEvent)
 Key events processing theEvent a key event. More...
 
virtual void paintEvent (QPaintEvent *)
 Redefinition of virtual method. More...
 

Detailed Description

A multi-line text editor which lets to input formula and provides a list of completion strings.

Constructor & Destructor Documentation

◆ ExpressionEditor()

ExpressionEditor::ExpressionEditor ( QWidget theParent = 0)
explicit

Constructor.

Parameters
theParenta parent widget

Member Function Documentation

◆ setCompletionList()

void ExpressionEditor::setCompletionList ( QStringList &  theList)

Set list of completion strings.

◆ setPlaceHolderText()

void ExpressionEditor::setPlaceHolderText ( const QString &  thePlaceHolderText)

Set a text which will be shown when the listr is empty.

◆ placeHolderText()

QString ExpressionEditor::placeHolderText ( ) const

Returns placeholder list.

◆ insertCompletion

void ExpressionEditor::insertCompletion ( const QString &  theCompletion,
bool  isSingleWord = false 
)
slot

Insert additional string for completion.

Parameters
theCompletiona string to insert
isSingleWorda flag shows that inserted string is single word or not

◆ performCompletion [1/2]

void ExpressionEditor::performCompletion ( )
slot

Perform completion.

◆ onTextChanged

void ExpressionEditor::onTextChanged ( )
slot

A slot for processing text changed event.

◆ valueModified

void ExpressionEditor::valueModified ( )
signal

The signal about text change in the text editor.

◆ keyReleased

void ExpressionEditor::keyReleased ( QObject theObject,
QKeyEvent *  theEvent 
)
signal

The signal about key release on the control, that corresponds to the attribute.

Parameters
theObjecta sender of the event
theEventkey release event

◆ performCompletion() [2/2]

void ExpressionEditor::performCompletion ( const QString &  theCompletionPrefix)
protected

Perform completion by prefix.

Parameters
theCompletionPrefixa prefix for looking for completion

◆ keyPressEvent()

void ExpressionEditor::keyPressEvent ( QKeyEvent *  theEvent)
protectedvirtual

Redefinition of virtual method.

Parameters
theEventa key press event

◆ handledCompletedAndSelected()

bool ExpressionEditor::handledCompletedAndSelected ( QKeyEvent *  theEvent)
protected

Key events processing theEvent a key event.

◆ paintEvent()

void ExpressionEditor::paintEvent ( QPaintEvent *  theEvent)
protectedvirtual

Redefinition of virtual method.