{
connect(this, SIGNAL(valueChanged(const QString&)),
this, SLOT(onTextChanged(const QString&)));
-
- //connect(lineEdit(), SIGNAL(textChanged(const QString&)),
- // this, SLOT(onTextChanged(const QString&)));
-
- //connect(lineEdit(), SIGNAL(textChanged(const QString&)),
- // this, SIGNAL(textChanged(const QString&)));
}
/*!
void ModuleBase_ParamSpinBox::onTextChanged(const QString& text)
{
myTextValue = text;
-
- double value = 0;
- if (isValid(text, value) == Acceptable) {
- myCorrectValue = text;
- }
}
/*!
return aValue;
}
+QString ModuleBase_ParamSpinBox::textFromValue (double theValue) const
+{
+ if (hasVariable(myTextValue)){
+ return myTextValue;
+ }
+ return ModuleBase_DoubleSpinBox::textFromValue(theValue);
+}
+
/*!
\brief This function is used to determine whether input is valid.
\param str currently entered value
{
ModuleBase_DoubleSpinBox::setValue(value);
- myCorrectValue = ModuleBase_DoubleSpinBox::textFromValue(value);
- myTextValue = myCorrectValue;
+ myTextValue = ModuleBase_DoubleSpinBox::textFromValue(value);
}
/*!
bool ModuleBase_ParamSpinBox::hasVariable() const
{
- return hasVariable(text());
+ return hasVariable(myTextValue);
}
bool ModuleBase_ParamSpinBox::hasVariable(const QString& theText) const
virtual void stepBy(int);
virtual double valueFromText(const QString&) const;
+ virtual QString textFromValue (double value) const;
virtual QValidator::State validate(QString&, int&) const;
void connectSignalsAndSlots();
private:
- QString myCorrectValue;
QString myTextValue;
bool myAcceptVariables;