Salome HOME
projects
/
modules
/
shaper.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Improve multi-selector control to provide items multi-selection and "Delete" context...
[modules/shaper.git]
/
src
/
ModuleBase
/
ModuleBase_WidgetDoubleValue.cpp
diff --git
a/src/ModuleBase/ModuleBase_WidgetDoubleValue.cpp
b/src/ModuleBase/ModuleBase_WidgetDoubleValue.cpp
index 5f6415893281f14eb741e4ff077ab12ca5085310..fbe80ec1897a1c38369dcd1da4b4595c6d209573 100644
(file)
--- a/
src/ModuleBase/ModuleBase_WidgetDoubleValue.cpp
+++ b/
src/ModuleBase/ModuleBase_WidgetDoubleValue.cpp
@@
-45,7
+45,10
@@
ModuleBase_WidgetDoubleValue::ModuleBase_WidgetDoubleValue(QWidget* theParent,
if (!aLabelIcon.isEmpty())
myLabel->setPixmap(QPixmap(aLabelIcon));
if (!aLabelIcon.isEmpty())
myLabel->setPixmap(QPixmap(aLabelIcon));
+ bool aAcceptVariables = theData->getBooleanAttribute(DOUBLE_WDG_ACCEPT_EXPRESSIONS, true);
+
mySpinBox = new ModuleBase_ParamSpinBox(this);
mySpinBox = new ModuleBase_ParamSpinBox(this);
+ mySpinBox->setAcceptVariables(aAcceptVariables);
QString anObjName = QString::fromStdString(attributeID());
mySpinBox->setObjectName(anObjName);
QString anObjName = QString::fromStdString(attributeID());
mySpinBox->setObjectName(anObjName);
@@
-86,10
+89,7
@@
ModuleBase_WidgetDoubleValue::ModuleBase_WidgetDoubleValue(QWidget* theParent,
myLabel->setToolTip(aTTip);
aControlLay->addRow(myLabel, mySpinBox);
myLabel->setToolTip(aTTip);
aControlLay->addRow(myLabel, mySpinBox);
- // Apply widget value change by enter/tab event.
- connect(mySpinBox, SIGNAL(valueStored()), this, SIGNAL(valuesChanged()));
connect(mySpinBox, SIGNAL(valueChanged(const QString&)), this, SIGNAL(valuesModified()));
connect(mySpinBox, SIGNAL(valueChanged(const QString&)), this, SIGNAL(valuesModified()));
- connect(mySpinBox, SIGNAL(focusNextPrev()), this, SIGNAL(focusNextPrev()));
}
ModuleBase_WidgetDoubleValue::~ModuleBase_WidgetDoubleValue()
}
ModuleBase_WidgetDoubleValue::~ModuleBase_WidgetDoubleValue()
@@
-105,7
+105,7
@@
bool ModuleBase_WidgetDoubleValue::resetCustom()
bool isOk;
double aDefValue = QString::fromStdString(getDefaultValue()).toDouble(&isOk);
// reset the value just if there is a default value definition in the XML definition
bool isOk;
double aDefValue = QString::fromStdString(getDefaultValue()).toDouble(&isOk);
// reset the value just if there is a default value definition in the XML definition
- // if the
double
value can not be found by the default value, do nothing
+ // if the value can not be found by the default value, do nothing
if (isOk) {
ModuleBase_Tools::setSpinValue(mySpinBox, aDefValue);
storeValue();
if (isOk) {
ModuleBase_Tools::setSpinValue(mySpinBox, aDefValue);
storeValue();
@@
-147,6
+147,11
@@
bool ModuleBase_WidgetDoubleValue::restoreValueCustom()
return true;
}
return true;
}
+void ModuleBase_WidgetDoubleValue::selectContent()
+{
+ mySpinBox->selectAll();
+}
+
QList<QWidget*> ModuleBase_WidgetDoubleValue::getControls() const
{
QList<QWidget*> aList;
QList<QWidget*> ModuleBase_WidgetDoubleValue::getControls() const
{
QList<QWidget*> aList;
@@
-156,10
+161,9
@@
QList<QWidget*> ModuleBase_WidgetDoubleValue::getControls() const
bool ModuleBase_WidgetDoubleValue::processEnter()
{
bool ModuleBase_WidgetDoubleValue::processEnter()
{
- bool isModified =
mySpinBox->isModified()
;
+ bool isModified =
getValueState() == ModifiedInPP
;
if (isModified) {
emit valuesChanged();
if (isModified) {
emit valuesChanged();
- mySpinBox->clearModified();
mySpinBox->selectAll();
}
return isModified;
mySpinBox->selectAll();
}
return isModified;