remove now superfluous member from InputField
This commit is contained in:
@@ -164,7 +164,8 @@ void InputField::updateText(const Base::Quantity& quant)
|
||||
}
|
||||
|
||||
double dFactor;
|
||||
QString txt = quant.getUserString(dFactor,actUnitStr);
|
||||
QString unitStr;
|
||||
QString txt = quant.getUserString(dFactor, unitStr);
|
||||
actUnitValue = quant.getValue()/dFactor;
|
||||
setText(txt);
|
||||
}
|
||||
@@ -286,7 +287,8 @@ void InputField::newInput(const QString & text)
|
||||
}
|
||||
|
||||
double dFactor;
|
||||
res.getUserString(dFactor,actUnitStr);
|
||||
QString unitStr;
|
||||
res.getUserString(dFactor, unitStr);
|
||||
actUnitValue = res.getValue()/dFactor;
|
||||
// Preserve previous format
|
||||
res.setFormat(this->actQuantity.getFormat());
|
||||
@@ -512,7 +514,10 @@ void InputField::setUnitText(const QString& str)
|
||||
|
||||
QString InputField::getUnitText(void)
|
||||
{
|
||||
return actUnitStr;
|
||||
double dFactor;
|
||||
QString unitStr;
|
||||
actQuantity.getUserString(dFactor, unitStr);
|
||||
return unitStr;
|
||||
}
|
||||
|
||||
int InputField::getPrecision() const
|
||||
@@ -597,7 +602,7 @@ void InputField::showEvent(QShowEvent * event)
|
||||
selectNumber();
|
||||
}
|
||||
|
||||
void InputField::focusInEvent(QFocusEvent * event)
|
||||
void InputField::focusInEvent(QFocusEvent *event)
|
||||
{
|
||||
if (event->reason() == Qt::TabFocusReason ||
|
||||
event->reason() == Qt::BacktabFocusReason ||
|
||||
|
||||
@@ -95,7 +95,7 @@ public:
|
||||
/// gives the current state of the user input, gives true if it is a valid input with correct quantity
|
||||
/// (shown by the green pixmap), returns false if the input is a unparsable string or has a wrong unit
|
||||
/// (shown by the red pixmap in the gui)
|
||||
bool hasValidInput() { return validInput;};
|
||||
bool hasValidInput() { return validInput;}
|
||||
|
||||
/** sets the Unit this field is working with.
|
||||
* After setting the Unit the field will only accept
|
||||
@@ -210,7 +210,6 @@ private:
|
||||
Base::Quantity actQuantity;
|
||||
Base::Unit actUnit;
|
||||
double actUnitValue;
|
||||
QString actUnitStr;
|
||||
|
||||
double Maximum;
|
||||
double Minimum;
|
||||
|
||||
Reference in New Issue
Block a user