69 case M:
return _fdValue;
70 case KM:
return _fdValue / 1000.0;
71 case FT:
return _fdValue / 0.3048;
72 case MI:
return _fdValue / 1609.344;
73 case NM:
return _fdValue / 1852.0;
99 static const QRegExp __qRegExp(
"^\\s*(-?\\d+(\\.\\d+)?)\\s*([^\\d\\s]*)?\\s*$" );
101 if( _pbOK ) *_pbOK =
false;
102 if( !__qRegExp.exactMatch( _rqString ) )
return 0.0;
104 double __fdValue = __qRegExp.cap(1).toDouble( &__bOK );
105 if( !__bOK )
return 0.0;
106 QString __qsUnit = __qRegExp.cap(3);
110 case KM: __fdValue = __fdValue * 1000.0;
break;
111 case FT: __fdValue = __fdValue * 0.3048;
break;
112 case MI: __fdValue = __fdValue * 1609.344;
break;
113 case NM: __fdValue = __fdValue * 1852.0;
break;
116 if( _pbOK ) *_pbOK =
true;
[UI] Container for the application's settings
int getPrecisionDistance()
[Precision] Returns the distance decimal precision
CUnitDistance::EUnit getUnitDistance()
[Unit] Returns the distance format/unit
Container class for supported human-readable format/unit symbols.
QMap< CUnitDistance::EUnit, QString > qMapSymbols
static QString toCode(EUnit _eUnit)
Returns the machine-friendly code corresponding to the given format/unit ID.
static EUnit fromCode(const QString &_rqsCode)
Returns the format/unit ID corresponding to the given machine-friendly code.
@ UNDEFINED
undefined format/unit
static QString toSymbol(EUnit _eUnit)
Returns the human-readable symbol corresponding to the given format/unit ID.
static const QMap< EUnit, QString > & symbols()
Returns the list of supported human-readable format/unit symbols.
static EUnit fromSymbol(const QString &_rqsSymbol)
Returns the format/unit ID corresponding to the given human-readable symbol.
static const CUnitDistanceSymbols oUnitDistanceSymbols
Container for supported human-readable format/unit symbols.
static const QMap< EUnit, QString > & codes()
Returns the list of supported machine-friendly format/unit codes.
static double fromString(const QString &_rqString, EUnit _eUnit=UNDEFINED, bool *_pbOK=0)
Returns the numeric value corresponding (parsed) from the string.
static double toValue(double _fdValue, EUnit _eUnit)
Returns the converted value, using the specified format/unit.
static QString toString(double _fdValue, EUnit _eUnit, int _iPrecision=0)
Returns the formatted represention of the given value, using the specified format/unit and decimal pr...
static CSettings * useSettings()