20 const int maxLen = 255;
24 if (*str == QLatin1Char(
'-')) {
27 }
else if (*str == QLatin1Char(
'+')) {
30 while (isDigit(str->unicode()) && pos < maxLen) {
31 temp[pos++] = str->toLatin1();
34 if (*str == QLatin1Char(
'.') && pos < maxLen) {
38 while (isDigit(str->unicode()) && pos < maxLen) {
39 temp[pos++] = str->toLatin1();
42 bool exponent =
false;
43 if ((*str == QLatin1Char(
'e') || *str == QLatin1Char(
'E')) && pos < maxLen) {
47 if ((*str == QLatin1Char(
'-') || *str == QLatin1Char(
'+')) && pos < maxLen) {
48 temp[pos++] = str->toLatin1();
51 while (isDigit(str->unicode()) && pos < maxLen) {
52 temp[pos++] = str->toLatin1();
60 if (!exponent && pos < 10) {
68 while (*t && *t !=
'.') {
82 val = ((qreal)ival)/((qreal)div);
89 val = QByteArray::fromRawData(temp, pos).toDouble();
91 if (qFpClassify(
float(val)) != FP_NORMAL)
109 QStringView numStr = str.trimmed();
111 if (numStr.isEmpty()) {
117 if (numStr.endsWith(QLatin1Char(
'%'))) {
120 }
else if (numStr.endsWith(QLatin1String(
"px"))) {
123 }
else if (numStr.endsWith(QLatin1String(
"pc"))) {
126 }
else if (numStr.endsWith(QLatin1String(
"pt"))) {
129 }
else if (numStr.endsWith(QLatin1String(
"mm"))) {
132 }
else if (numStr.endsWith(QLatin1String(
"cm"))) {
135 }
else if (numStr.endsWith(QLatin1String(
"in"))) {
142 qreal len = toDouble(numStr, ok);