From 00539c245cd740157cfe2258d3e17337c86c963c Mon Sep 17 00:00:00 2001 From: mpv Date: Mon, 15 Sep 2014 17:43:30 +0400 Subject: [PATCH] Fix for crash in Release mode --- src/ModuleBase/ModuleBase_DoubleSpinBox.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ModuleBase/ModuleBase_DoubleSpinBox.cpp b/src/ModuleBase/ModuleBase_DoubleSpinBox.cpp index 8f807737f..d85ad9897 100644 --- a/src/ModuleBase/ModuleBase_DoubleSpinBox.cpp +++ b/src/ModuleBase/ModuleBase_DoubleSpinBox.cpp @@ -62,11 +62,13 @@ ModuleBase_DoubleSpinBox::ModuleBase_DoubleSpinBox(QWidget* parent, int thePreci 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& ))); -- 2.39.2