#include <memory>
#include <string>
+/**
+* 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 )
{
{
}
+ /// Redefiniotion of virtual method
+ /// \param theEvent a paint event
virtual void paintEvent( QPaintEvent* theEvent )
{
QLineEdit::paintEvent( theEvent );
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()
return result;
}
-void ModuleBase_WidgetLineEdit::onTextChanged()
+bool ModuleBase_WidgetLineEdit::processEnter()
{
- storeValue();
+ bool isModified = getValueState() == ModifiedInPP;
+ if (isModified) {
+ emit valuesChanged();
+ myLineEdit->selectAll();
+ }
+ return isModified;
}