#include <iostream>
#endif
-#define APPLY_BY_ENTER_OR_TAB
-
ModuleBase_WidgetDoubleValue::ModuleBase_WidgetDoubleValue(QWidget* theParent,
const Config_WidgetAPI* theData,
const std::string& theParentId)
myLabel->setToolTip(aTTip);
aControlLay->addRow(myLabel, mySpinBox);
-#ifdef APPLY_BY_ENTER_OR_TAB
- // Apply widget value change by enter/tab event.
- connect(mySpinBox, SIGNAL(editingFinished()), this, SIGNAL(valuesChanged()));
connect(mySpinBox, SIGNAL(valueChanged(const QString&)), this, SIGNAL(valuesModified()));
-
-#else
- connect(mySpinBox, SIGNAL(valueChanged(const QString&)), this, SIGNAL(valuesChanged()));
-#endif
}
ModuleBase_WidgetDoubleValue::~ModuleBase_WidgetDoubleValue()
{
}
-bool ModuleBase_WidgetDoubleValue::reset()
+bool ModuleBase_WidgetDoubleValue::resetCustom()
{
bool aDone = false;
if (!isUseReset() || isComputedDefault() || mySpinBox->hasVariable()) {
return true;
}
+void ModuleBase_WidgetDoubleValue::selectContent()
+{
+ mySpinBox->selectAll();
+}
+
QList<QWidget*> ModuleBase_WidgetDoubleValue::getControls() const
{
QList<QWidget*> aList;
return aList;
}
-bool ModuleBase_WidgetDoubleValue::isEventProcessed(QKeyEvent* theEvent)
+bool ModuleBase_WidgetDoubleValue::processEnter()
{
- return mySpinBox->isEventProcessed(theEvent);
+ bool isModified = mySpinBox->isModified();
+ if (isModified) {
+ emit valuesChanged();
+ mySpinBox->clearModified();
+ mySpinBox->selectAll();
+ }
+ return isModified;
}