ModuleBase_WidgetLineEdit::ModuleBase_WidgetLineEdit(QWidget* theParent,
const Config_WidgetAPI* theData,
- const std::string& theParentId,
const std::string& thePlaceHolder )
- : ModuleBase_ModelWidget(theParent, theData, theParentId)
+: ModuleBase_ModelWidget(theParent, theData)
{
QFormLayout* aMainLay = new QFormLayout(this);
ModuleBase_Tools::adjustMargins(aMainLay);
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()
{
}
-bool ModuleBase_WidgetLineEdit::storeValueCustom() const
+bool ModuleBase_WidgetLineEdit::storeValueCustom()
{
// A rare case when plugin was not loaded.
if(!myFeature)
return result;
}
-void ModuleBase_WidgetLineEdit::onTextChanged()
+bool ModuleBase_WidgetLineEdit::processEnter()
{
- storeValue();
+ bool isModified = getValueState() == ModifiedInPP;
+ if (isModified) {
+ emit valuesChanged();
+ myLineEdit->selectAll();
+ }
+ return isModified;
}