Salome HOME
Merge commit '4bda6c883bff2af152b1de8d7f6d4820780c2cd2'
[modules/gui.git] / src / Qtx / QtxDoubleSpinBox.cxx
index ab0d796915f8a10927a62772a7b1236b434bdcac..d4ed567ce79d1431d052add1195295ad47acf3ea 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2023  CEA, EDF, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -75,11 +75,14 @@ QtxDoubleSpinBox::QtxDoubleSpinBox( QWidget* parent )
 : QDoubleSpinBox( parent ),
   myCleared( false )
 {
+#if !defined(GLOBAL_DOUBLE_CONVERSION)
   // VSR 01/07/2010: Disable thousands separator for spin box
   // (to avoid incosistency of double-2-string and string-2-double conversion)
+  // see issue 14540 (old id 21219)
   QLocale loc;
   loc.setNumberOptions(loc.numberOptions() | QLocale::OmitGroupSeparator | QLocale::RejectGroupSeparator);
   setLocale(loc);
+#endif
 
   // Use precision equal to default Qt decimals
   myPrecision = decimals();
@@ -104,11 +107,14 @@ QtxDoubleSpinBox::QtxDoubleSpinBox( double min, double max, double step, QWidget
 : QDoubleSpinBox( parent ),
   myCleared( false )
 {
+#if !defined(GLOBAL_DOUBLE_CONVERSION)
   // VSR 01/07/2010: Disable thousands separator for spin box
   // (to avoid incosistency of double-2-string and string-2-double conversion)
+  // see issue 14540 (old id 21219)
   QLocale loc;
   loc.setNumberOptions(loc.numberOptions() | QLocale::OmitGroupSeparator | QLocale::RejectGroupSeparator);
   setLocale(loc);
+#endif
 
   // Use precision equal to default Qt decimals
   myPrecision = decimals();
@@ -141,11 +147,14 @@ QtxDoubleSpinBox::QtxDoubleSpinBox( double min, double max, double step, int pre
   myCleared( false ),
   myPrecision( prec )
 {
+#if !defined(GLOBAL_DOUBLE_CONVERSION)
   // VSR 01/07/2010: Disable thousands separator for spin box
   // (to avoid incosistency of double-2-string and string-2-double conversion)
+  // see issue 14540 (old id 21219)
   QLocale loc;
   loc.setNumberOptions(loc.numberOptions() | QLocale::OmitGroupSeparator | QLocale::RejectGroupSeparator);
   setLocale(loc);
+#endif
 
   setDecimals( dec );
   setMinimum( min );
@@ -306,7 +315,7 @@ QValidator::State QtxDoubleSpinBox::validate( QString& str, int& pos ) const
 {
   QString pref = this->prefix();
   QString suff = this->suffix();
-  uint overhead = pref.length() + suff.length();
+  int overhead = pref.length() + suff.length();
   QValidator::State state = QValidator::Invalid;
   
   QDoubleValidator v (NULL);