diff options
author | Liang Qi <liang.qi@qt.io> | 2018-11-10 11:36:18 +0100 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2018-11-10 11:38:40 +0100 |
commit | 58437fb125f60c11ba8e97c914fa8db8c89c7373 (patch) | |
tree | f47ed59073984ec76034155bc04d3d987b192d2e /src/widgets/widgets | |
parent | 76bb804405f424708fffec502788995ea91206b8 (diff) | |
parent | b20c15f2041205a1cab98fbaf9560a3e2e0d6367 (diff) |
Merge remote-tracking branch 'origin/5.12' into dev
Conflicts:
src/corelib/serialization/qcborcommon.h
src/corelib/tools/qlocale_data_p.h
tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp
Done-with: Edward Welbourne <edward.welbourne@qt.io>
Change-Id: Ibed987f6d77a0294f78f67d78625237616082416
Diffstat (limited to 'src/widgets/widgets')
-rw-r--r-- | src/widgets/widgets/qspinbox.cpp | 12 | ||||
-rw-r--r-- | src/widgets/widgets/qtextbrowser.cpp | 4 |
2 files changed, 11 insertions, 5 deletions
diff --git a/src/widgets/widgets/qspinbox.cpp b/src/widgets/widgets/qspinbox.cpp index dcf3906dd7..7624b1ed3c 100644 --- a/src/widgets/widgets/qspinbox.cpp +++ b/src/widgets/widgets/qspinbox.cpp @@ -1134,10 +1134,14 @@ QVariant QSpinBoxPrivate::validateAndInterpret(QString &input, int &pos, num = copy.toInt(&ok, displayIntegerBase); } else { num = locale.toInt(copy, &ok); - if (!ok && copy.contains(locale.groupSeparator()) && (max >= 1000 || min <= -1000)) { - QString copy2 = copy; - copy2.remove(locale.groupSeparator()); - num = locale.toInt(copy2, &ok); + if (!ok && (max >= 1000 || min <= -1000)) { + const QChar sep = locale.groupSeparator(); + const QChar doubleSep[2] = {sep, sep}; + if (copy.contains(sep) && !copy.contains(QString(doubleSep, 2))) { + QString copy2 = copy; + copy2.remove(locale.groupSeparator()); + num = locale.toInt(copy2, &ok); + } } } QSBDEBUG() << __FILE__ << __LINE__<< "num is set to" << num; diff --git a/src/widgets/widgets/qtextbrowser.cpp b/src/widgets/widgets/qtextbrowser.cpp index 1f00adcfe2..bb9a4fed91 100644 --- a/src/widgets/widgets/qtextbrowser.cpp +++ b/src/widgets/widgets/qtextbrowser.cpp @@ -47,7 +47,9 @@ #include <qdebug.h> #include <qabstracttextdocumentlayout.h> #include "private/qtextdocumentlayout_p.h" +#if QT_CONFIG(textcodec) #include <qtextcodec.h> +#endif #include <qpainter.h> #include <qdir.h> #if QT_CONFIG(whatsthis) @@ -293,7 +295,7 @@ void QTextBrowserPrivate::setSource(const QUrl &url) if (data.type() == QVariant::String) { txt = data.toString(); } else if (data.type() == QVariant::ByteArray) { -#ifndef QT_NO_TEXTCODEC +#if QT_CONFIG(textcodec) QByteArray ba = data.toByteArray(); QTextCodec *codec = Qt::codecForHtml(ba); txt = codec->toUnicode(ba); |