#include <SalomeApp_ListView.h>

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) |
| QWidget * | getControl () |
| 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_EditBox * | myEdit |
| SalomeApp_ComboBox * | myCombo |
| QToolButton * | myApplyBtn |
| QToolButton * | myCancelBtn |
| QString | myString |
| SalomeApp_EntityEdit::SalomeApp_EntityEdit | ( | QWidget * | parent, |
| int | controlType = etLineEdit, |
||
| int | valueType = vtString, |
||
| bool | butApply = false, |
||
| bool | butCancel = false |
||
| ) |
Constructor
References SUIT_Session.activeApplication(), escapePressed(), etComboBox, etComboEdit, etLineEdit, QtxResourceMgr.loadPixmap(), MIN_COMBO_WIDTH, MIN_EDIT_WIDTH, myApplyBtn, myCancelBtn, myCombo, myEdit, onApply(), onCancel(), onComboActivated(), onTextChanged(), SUIT_Application.resourceMgr(), returnPressed(), SUIT_Session.session(), setValidator(), vtDouble, vtInteger, and vtString.
| SalomeApp_EntityEdit::~SalomeApp_EntityEdit | ( | ) |
Destructor
| void SalomeApp_EntityEdit.finishEditing | ( | ) |
| QString SalomeApp_EntityEdit::getText | ( | ) |
| void SalomeApp_EntityEdit::setText | ( | const QString & | theText | ) |
Sets text
References SalomeApp_ComboBox.findItem(), myCombo, myEdit, myString, and onTextChanged().
| 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().
| 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().
| 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().
| void SalomeApp_EntityEdit::insertList | ( | const TColStd_ListOfInteger & | theList, |
| const int | theCurrent = -1 |
||
| ) |
Adds items in combo box, sets item theCurrent as current
References SalomeApp_ComboBox.insertList(), myCombo, and setText().
| 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().
| void SalomeApp_EntityEdit::insertList | ( | const TColStd_ListOfReal & | theList, |
| const int | theCurrent = -1 |
||
| ) |
Adds items in combo box, sets item theCurrent as current
References SalomeApp_ComboBox.insertList(), myCombo, and setText().
| QWidget * SalomeApp_EntityEdit::getControl | ( | ) |
| void SalomeApp_EntityEdit::setFocus | ( | ) |
| void SalomeApp_EntityEdit::setValidator | ( | const QValidator * | theValidator | ) |
| void SalomeApp_EntityEdit::showButtons | ( | bool | show | ) |
Shows/hides buttons
References myApplyBtn, and myCancelBtn.
| void SalomeApp_EntityEdit::setDuplicatesEnabled | ( | bool | enabled | ) |
Enables/disables data duplication (for combo box)
References myCombo.
| void SalomeApp_EntityEdit::keyPressEvent | ( | QKeyEvent * | e | ) | [protected] |
Event filter for KeyPress event
References onApply(), and onCancel().
| void SalomeApp_EntityEdit::onComboActivated | ( | const QString & | theText | ) | [private, slot] |
Called when item activated in combo box
References onTextChanged().
| void SalomeApp_EntityEdit::onTextChanged | ( | const QString & | theText | ) | [private, slot] |
Slot, called when text changed in line edit
References myApplyBtn, myCancelBtn, and myString.
| void SalomeApp_EntityEdit::onApply | ( | ) | [private, slot] |
Slot, called when user presses Apply button
References getText(), myApplyBtn, myCancelBtn, myString, and returnPressed().
| void SalomeApp_EntityEdit::onCancel | ( | ) | [private, slot] |
Slot, called when user presses Cancel button
References escapePressed(), myApplyBtn, myCancelBtn, myString, and setText().
| void SalomeApp_EntityEdit.returnPressed | ( | ) | [signal] |
| void SalomeApp_EntityEdit.escapePressed | ( | ) | [signal] |
SalomeApp_EditBox* SalomeApp_EntityEdit.myEdit [private] |
SalomeApp_ComboBox* SalomeApp_EntityEdit.myCombo [private] |
QToolButton* SalomeApp_EntityEdit.myApplyBtn [private] |
QToolButton* SalomeApp_EntityEdit.myCancelBtn [private] |
QString SalomeApp_EntityEdit.myString [private] |