Adding selectNumber handling of locale, this wont work with groupseparators
This commit is contained in:
parent
5cfdabb45a
commit
83a5f1547f
|
@ -450,16 +450,17 @@ void InputField::setHistorySize(int i)
|
|||
|
||||
void InputField::selectNumber(void)
|
||||
{
|
||||
QByteArray str = text().toLatin1();
|
||||
QString input = text();
|
||||
fixup(input);
|
||||
QByteArray str = input.toLatin1();
|
||||
unsigned int i = 0;
|
||||
Base::Console().Message("%i", locale().negativeSign().toAscii());
|
||||
|
||||
for (QByteArray::iterator it = str.begin(); it != str.end(); ++it) {
|
||||
if (*it >= '0' && *it <= '9')
|
||||
i++;
|
||||
else if (*it == ',' || *it == '.')
|
||||
i++;
|
||||
else if (*it == '-' || *it == locale().negativeSign().toAscii())
|
||||
else if (*it == '-' )
|
||||
i++;
|
||||
else // any non-number character
|
||||
break;
|
||||
|
|
|
@ -326,7 +326,9 @@ void QuantitySpinBox::clear()
|
|||
|
||||
void QuantitySpinBox::selectNumber()
|
||||
{
|
||||
QByteArray str = lineEdit()->text().toLatin1();
|
||||
QString input = lineEdit()->text();
|
||||
fixup(input);
|
||||
QByteArray str = input.toLatin1();
|
||||
unsigned int i = 0;
|
||||
|
||||
for (QByteArray::iterator it = str.begin(); it != str.end(); ++it) {
|
||||
|
@ -334,7 +336,7 @@ void QuantitySpinBox::selectNumber()
|
|||
i++;
|
||||
else if (*it == ',' || *it == '.')
|
||||
i++;
|
||||
else if (*it == '-' || *it == locale().negativeSign().toAscii())
|
||||
else if (*it == '-' )
|
||||
i++;
|
||||
else // any non-number character
|
||||
break;
|
||||
|
|
Loading…
Reference in New Issue
Block a user