X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;ds=inline;f=src%2FModuleBase%2FModuleBase_WidgetLineEdit.cpp;h=7f7e187b8319149030c1d77e65de0b407dfec026;hb=a6d1e8be5db1d94fdee39c412b8393d74bfcca2f;hp=273cc902016246860653d4168e7fa0b56e0fc197;hpb=7c64e78dcaac1421bc865a5c99694a7701e17ee6;p=modules%2Fshaper.git diff --git a/src/ModuleBase/ModuleBase_WidgetLineEdit.cpp b/src/ModuleBase/ModuleBase_WidgetLineEdit.cpp index 273cc9020..7f7e187b8 100644 --- a/src/ModuleBase/ModuleBase_WidgetLineEdit.cpp +++ b/src/ModuleBase/ModuleBase_WidgetLineEdit.cpp @@ -28,9 +28,15 @@ #include #include +/** +* Customization of Line edit control +*/ class CustomLineEdit : public QLineEdit { public: + /// Constructor + /// \param theParent a parent widget + /// \param thePlaceHolder a string which is shown when text is empty CustomLineEdit( QWidget* theParent, const QString& thePlaceHolder ) : QLineEdit( theParent ), myPlaceHolder( thePlaceHolder ) { @@ -40,6 +46,8 @@ public: { } + /// Redefiniotion of virtual method + /// \param theEvent a paint event virtual void paintEvent( QPaintEvent* theEvent ) { QLineEdit::paintEvent( theEvent ); @@ -91,7 +99,7 @@ ModuleBase_WidgetLineEdit::ModuleBase_WidgetLineEdit(QWidget* theParent, aMainLay->addRow(aLabel, myLineEdit); this->setLayout(aMainLay); - connect(myLineEdit, SIGNAL(textChanged(const QString&)), this, SLOT(onTextChanged())); + connect(myLineEdit, SIGNAL(textChanged(const QString&)), this, SIGNAL(valuesModified())); } ModuleBase_WidgetLineEdit::~ModuleBase_WidgetLineEdit() @@ -133,7 +141,12 @@ QList ModuleBase_WidgetLineEdit::getControls() const return result; } -void ModuleBase_WidgetLineEdit::onTextChanged() +bool ModuleBase_WidgetLineEdit::processEnter() { - storeValue(); + bool isModified = getValueState() == ModifiedInPP; + if (isModified) { + emit valuesChanged(); + myLineEdit->selectAll(); + } + return isModified; }