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& )));
if (overhead == 0)
state = v.validate(str, pos);
else {
- if (str.length() >= overhead && str.startsWith(pref) && str.right(suff.length()) == suff) {
+ if ((uint)(str.length()) >= overhead && str.startsWith(pref) && str.right(suff.length()) == suff) {
QString core = str.mid(pref.length(), str.length() - overhead);
int corePos = pos - pref.length();
state = v.validate(core, corePos);