summaryrefslogtreecommitdiffstats
path: root/src/widgets/widgets
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2018-10-02 12:59:24 +0200
committerLiang Qi <liang.qi@qt.io>2018-11-07 13:19:54 +0000
commit825f98815683faea06144ab0262129b0367798ee (patch)
tree48b10de0d86c6312d07700eb4e690dbd87ab8db0 /src/widgets/widgets
parentb5d249f9538bf3dc44f11879c2244deb5a37bf97 (diff)
Modernize the "textcodec" feature
Also clean up QTextCodec usage in qmake build and some includes of qtextcodec.h. Change-Id: I0475b82690024054add4e85a8724c8ea3adcf62a Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Diffstat (limited to 'src/widgets/widgets')
-rw-r--r--src/widgets/widgets/qtextbrowser.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/widgets/widgets/qtextbrowser.cpp b/src/widgets/widgets/qtextbrowser.cpp
index fa4dd14c92..29fd07edc1 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)
@@ -290,7 +292,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);