Version: 9.15.0
SalomeApp_EntityEdit Class Reference

#include <SalomeApp_ListView.h>

Inheritance diagram for SalomeApp_EntityEdit:
Inheritance graph

Public Types

enum  { etLineEdit , etComboBox , etComboEdit }
 
enum  { vtString , vtInteger , vtDouble }
 
enum  { atBottom , atTop , atBeforeCurrent , atAfterCurrent }
 
enum  { btApply = 0x0001 , btCancel = 0x0002 }
 

Signals

void returnPressed ()
 
void escapePressed ()
 

Public Member Functions

 SalomeApp_EntityEdit (QWidget *parent, int controlType=etLineEdit, int valueType=vtString, bool butApply=false, bool butCancel=false)
 
 ~SalomeApp_EntityEdit ()
 
void finishEditing ()
 
void clear ()
 
QString getText ()
 
void setText (const QString &theText)
 
void insertItem (const QString &theValue, bool theSetCurrent=false, int theOrder=atBottom)
 
void insertList (const QStringList &theList, const int theCurrent=-1)
 
void insertItem (const int theValue, bool theSetCurrent=false)
 
void insertList (const TColStd_ListOfInteger &theList, const int theCurrent=-1)
 
void insertItem (const double theValue, bool theSetCurrent=false)
 
void insertList (const TColStd_ListOfReal &theList, const int theCurrent=-1)
 
QWidgetgetControl ()
 
void setFocus ()
 
void setValidator (const QValidator *)
 
void showButtons (bool show)
 
void setDuplicatesEnabled (bool enabled)
 

Protected Member Functions

void keyPressEvent (QKeyEvent *e)
 

Private Slots

void onComboActivated (const QString &)
 
void onTextChanged (const QString &)
 
void onApply ()
 
void onCancel ()
 

Private Attributes

SalomeApp_EditBoxmyEdit
 
SalomeApp_ComboBoxmyCombo
 
QToolButtonmyApplyBtn
 
QToolButtonmyCancelBtn
 
QString myString
 

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
etLineEdit 
etComboBox 
etComboEdit 

◆ anonymous enum

anonymous enum
Enumerator
vtString 
vtInteger 
vtDouble 

◆ anonymous enum

anonymous enum
Enumerator
atBottom 
atTop 
atBeforeCurrent 
atAfterCurrent 

◆ anonymous enum

anonymous enum
Enumerator
btApply 
btCancel 

Constructor & Destructor Documentation

◆ SalomeApp_EntityEdit()

◆ ~SalomeApp_EntityEdit()

SalomeApp_EntityEdit::~SalomeApp_EntityEdit ( )

Destructor

Member Function Documentation

◆ clear()

void SalomeApp_EntityEdit::clear ( )

Clears edit/combo box

References myCombo, and myEdit.

◆ escapePressed

void SalomeApp_EntityEdit::escapePressed ( )
signal

◆ finishEditing()

void SalomeApp_EntityEdit::finishEditing ( )

◆ getControl()

QWidget * SalomeApp_EntityEdit::getControl ( )
Returns
actual widget

References myCombo, and myEdit.

◆ getText()

QString SalomeApp_EntityEdit::getText ( )
Returns
current text in edit box or combo box

References myCombo, and myEdit.

◆ insertItem() [1/3]

void SalomeApp_EntityEdit::insertItem ( const double  theValue,
bool  theSetCurrent = false 
)

Adds item in combo box, sets it current if theSetCurrent is true

References SalomeApp_ComboBox::insertItem(), myCombo, and setText().

◆ insertItem() [2/3]

void SalomeApp_EntityEdit::insertItem ( const int  theValue,
bool  theSetCurrent = false 
)

Adds item in combo box, sets it current if theSetCurrent is true

References SalomeApp_ComboBox::insertItem(), myCombo, and setText().

◆ insertItem() [3/3]

void SalomeApp_EntityEdit::insertItem ( const QString &  theValue,
bool  theSetCurrent = false,
int  theOrder = atBottom 
)

Adds item in combo box, sets it current if theSetCurrent is true

References atAfterCurrent, atBeforeCurrent, atTop, SalomeApp_ComboBox::insertItem(), myCombo, and setText().

◆ insertList() [1/3]

void SalomeApp_EntityEdit::insertList ( const QStringList &  theList,
const int  theCurrent = -1 
)

Adds items in combo box, sets item theCurrent as current

References SalomeApp_ComboBox::insertList(), myCombo, and setText().

◆ insertList() [2/3]

void SalomeApp_EntityEdit::insertList ( const TColStd_ListOfInteger &  theList,
const int  theCurrent = -1 
)

Adds items in combo box, sets item theCurrent as current

< TODO: mismatch signed/unsigned

References SalomeApp_ComboBox::insertList(), myCombo, and setText().

◆ insertList() [3/3]

void SalomeApp_EntityEdit::insertList ( const TColStd_ListOfReal &  theList,
const int  theCurrent = -1 
)

Adds items in combo box, sets item theCurrent as current

< TODO: mismatch signed/unsigned

References SalomeApp_ComboBox::insertList(), myCombo, and setText().

◆ keyPressEvent()

void SalomeApp_EntityEdit::keyPressEvent ( QKeyEvent *  e)
protected

Event filter for KeyPress event

References onApply(), and onCancel().

◆ onApply

void SalomeApp_EntityEdit::onApply ( )
privateslot

Slot, called when user presses Apply button

References getText(), myApplyBtn, myCancelBtn, myString, and returnPressed().

◆ onCancel

void SalomeApp_EntityEdit::onCancel ( )
privateslot

Slot, called when user presses Cancel button

References escapePressed(), myApplyBtn, myCancelBtn, myString, and setText().

◆ onComboActivated

void SalomeApp_EntityEdit::onComboActivated ( const QString &  theText)
privateslot

Called when item activated in combo box

References onTextChanged().

◆ onTextChanged

void SalomeApp_EntityEdit::onTextChanged ( const QString &  theText)
privateslot

Slot, called when text changed in line edit

References myApplyBtn, myCancelBtn, and myString.

◆ returnPressed

void SalomeApp_EntityEdit::returnPressed ( )
signal

◆ setDuplicatesEnabled()

void SalomeApp_EntityEdit::setDuplicatesEnabled ( bool  enabled)

Enables/disables data duplication (for combo box)

References myCombo.

◆ setFocus()

void SalomeApp_EntityEdit::setFocus ( )

redirect focus to corresponding widget

References myCombo, and myEdit.

◆ setText()

void SalomeApp_EntityEdit::setText ( const QString &  theText)

◆ setValidator()

void SalomeApp_EntityEdit::setValidator ( const QValidator theValidator)

Sets validator for the control

References myCombo, and myEdit.

◆ showButtons()

void SalomeApp_EntityEdit::showButtons ( bool  show)

Shows/hides buttons

References myApplyBtn, and myCancelBtn.

Member Data Documentation

◆ myApplyBtn

QToolButton* SalomeApp_EntityEdit::myApplyBtn
private

◆ myCancelBtn

QToolButton* SalomeApp_EntityEdit::myCancelBtn
private

◆ myCombo

SalomeApp_ComboBox* SalomeApp_EntityEdit::myCombo
private

◆ myEdit

SalomeApp_EditBox* SalomeApp_EntityEdit::myEdit
private

◆ myString

QString SalomeApp_EntityEdit::myString
private

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