+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
+
// File: ModuleBase_DoubleSpinBox.cxx
// Author: Sergey TELKOV
//
a step value of 1.0 and a precision of 2 decimal places.
The value is initially set to 0.00.
- \param parent parent object
+ \param theParent parent object
+ \param thePrecision precision of values input
*/
-ModuleBase_DoubleSpinBox::ModuleBase_DoubleSpinBox(QWidget* parent, int thePrecision)
- : QDoubleSpinBox(parent),
+ModuleBase_DoubleSpinBox::ModuleBase_DoubleSpinBox(QWidget* theParent, int thePrecision)
+ : QDoubleSpinBox(theParent),
myCleared(false)
{
// VSR 01/07/2010: Disable thousands separator for spin box
loc.setNumberOptions(loc.numberOptions() | QLocale::OmitGroupSeparator | QLocale::RejectGroupSeparator);
setLocale(loc);
+ // MPV 15/09/2014: this must be set before setDecimals; otherwise in release mode setDecimals may crash
+ myPrecision = thePrecision;
+
// Use precision equal to default Qt decimals
// it's necessary to set decimals before the range setting,
// by default Qt rounds boundaries to 2 decimals at setRange
setDecimals(thePrecision);
- myPrecision = thePrecision;
connect(lineEdit(), SIGNAL(textChanged( const QString& )), this,
SLOT(onTextChanged( const QString& )));
/*!
\brief Return source string with removed leading and trailing zeros.
- \param str source string
+ \param src source string
\return resulting string
*/
QString ModuleBase_DoubleSpinBox::removeTrailingZeroes(const QString& src) const
/*!
\brief Called when user enters the text in the spin box.
- \param txt current spin box text (not used)
*/
-void ModuleBase_DoubleSpinBox::onTextChanged(const QString& /*txt*/)
+void ModuleBase_DoubleSpinBox::onTextChanged(const QString& )
{
myCleared = false;
}