X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FDlgRef%2FDlgRef.cxx;h=8a19c0b29d13d0d60ca2a57258bb95325a912538;hb=c1d63ef1f803d255b61ee99fb618bf471add07f4;hp=b5043a2158bb4f29aa41de612e8b1638a01e97e1;hpb=407cadd372e3b984e4edf56e5898d57c129432ef;p=modules%2Fgeom.git diff --git a/src/DlgRef/DlgRef.cxx b/src/DlgRef/DlgRef.cxx index b5043a215..8a19c0b29 100644 --- a/src/DlgRef/DlgRef.cxx +++ b/src/DlgRef/DlgRef.cxx @@ -1,9 +1,9 @@ -// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2023 CEA/DEN, EDF R&D, OPEN CASCADE // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2.1 of the License. +// version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -470,6 +470,20 @@ DlgRef_2Sel2Spin2Push::~DlgRef_2Sel2Spin2Push() { } +////////////////////////////////////////// +// DlgRef_2Sel3Spin1Check +////////////////////////////////////////// + +DlgRef_2Sel3Spin1Check::DlgRef_2Sel3Spin1Check( QWidget* parent, Qt::WindowFlags f ) +: QWidget( parent, f ) +{ + setupUi( this ); +} + +DlgRef_2Sel3Spin1Check::~DlgRef_2Sel3Spin1Check() +{ +} + ////////////////////////////////////////// // DlgRef_2Sel3Spin2Rb ////////////////////////////////////////// @@ -756,6 +770,20 @@ DlgRef_3Spin1Check::~DlgRef_3Spin1Check() { } +////////////////////////////////////////// +// DlgRef_3Spin1CheckCyl +////////////////////////////////////////// + +DlgRef_3Spin1CheckCyl::DlgRef_3Spin1CheckCyl( QWidget* parent, Qt::WindowFlags f ) +: QWidget( parent, f ) +{ + setupUi( this ); +} + +DlgRef_3Spin1CheckCyl::~DlgRef_3Spin1CheckCyl() +{ +} + ////////////////////////////////////////// // DlgRef_3Spin ////////////////////////////////////////// @@ -870,20 +898,6 @@ DlgRef_6Sel::~DlgRef_6Sel() { } -////////////////////////////////////////// -// DlgRef_Skeleton -////////////////////////////////////////// - -DlgRef_Skeleton::DlgRef_Skeleton( QWidget* parent, Qt::WindowFlags f ) -: QWidget( parent, f ) -{ - setupUi( this ); -} - -DlgRef_Skeleton::~DlgRef_Skeleton() -{ -} - ////////////////////////////////////////// // Utility functions ////////////////////////////////////////// @@ -895,12 +909,14 @@ QString DlgRef::PrintDoubleValue( double theValue, int thePrecision ) if ( qAbs(theValue) < prec ) return "0"; - QString aRes = QLocale().toString( theValue, thePrecision >= 0 ? 'f' : 'g', qAbs( thePrecision ) ); + QLocale loc = QLocale(); // default locale + if ( loc.name() == "C" ) loc.setNumberOptions( QLocale::OmitGroupSeparator ); + QString aRes = loc.toString( theValue, thePrecision >= 0 ? 'f' : 'g', qAbs( thePrecision ) ); if ( prec > 0 ) { int p = 0; while ( p < thePrecision ) { - QString aRes = QLocale().toString( theValue, thePrecision >= 0 ? 'f' : 'g', qAbs( p++ ) ); + QString aRes = loc.toString( theValue, thePrecision >= 0 ? 'f' : 'g', qAbs( p++ ) ); double v = aRes.toDouble(); double err = qAbs( theValue - v ); if ( err > 0 && err <= prec ) @@ -910,8 +926,8 @@ QString DlgRef::PrintDoubleValue( double theValue, int thePrecision ) // remove trailing zeroes - QRegExp expre( QString( "(%1|%2)[+-]?[0-9]+$" ).arg( QLocale().exponential().toLower(), - QLocale().exponential().toUpper() ) ); + QRegExp expre( QString( "(%1|%2)[+-]?[0-9]+$" ).arg( loc.exponential().toLower(), + loc.exponential().toUpper() ) ); int idx = aRes.indexOf( expre ); QString aResExp = ""; @@ -920,7 +936,7 @@ QString DlgRef::PrintDoubleValue( double theValue, int thePrecision ) aRes = aRes.left( idx ); } - if ( aRes.contains( QLocale().decimalPoint() ) ) + if ( aRes.contains( loc.decimalPoint() ) ) aRes.remove( QRegExp( QString( "(\\%1|0)0*$" ).arg( QLocale().decimalPoint() ) ) ); return aRes == "-0" ? QString( "0" ) : aRes + aResExp;