summaryrefslogtreecommitdiffstats
path: root/src/gui/text/qtexthtmlparser.cpp
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2020-01-29 16:57:12 +0100
committerAlexandru Croitor <alexandru.croitor@qt.io>2020-01-29 16:57:27 +0100
commita1dbdcbd6e818118f5fc28cdd39e47a02380adbd (patch)
tree0d813d9d72baeb1b5f7be048e775896c73f134f5 /src/gui/text/qtexthtmlparser.cpp
parent67ea445f09db9feea4e863faa12c45fb007f53a4 (diff)
parent4cbadf699838406d14366ce61deec03cf45113f7 (diff)
Merge remote-tracking branch 'origin/dev' into wip/cmake
Conflicts: src/corelib/Qt5CoreConfigExtras.cmake.in src/corelib/Qt5CoreMacros.cmake src/dbus/Qt5DBusConfigExtras.cmake.in src/widgets/Qt5WidgetsConfigExtras.cmake.in Change-Id: Ib782f3b177c38b2cce83beebe15be9c0baa578f7
Diffstat (limited to 'src/gui/text/qtexthtmlparser.cpp')
-rw-r--r--src/gui/text/qtexthtmlparser.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/gui/text/qtexthtmlparser.cpp b/src/gui/text/qtexthtmlparser.cpp
index 3b9f2d253e..f003544391 100644
--- a/src/gui/text/qtexthtmlparser.cpp
+++ b/src/gui/text/qtexthtmlparser.cpp
@@ -1451,19 +1451,19 @@ void QTextHtmlParserNode::applyBackgroundImage(const QString &url, const QTextDo
if (QCoreApplication::instance()->thread() != QThread::currentThread()) {
// must use images in non-GUI threads
- if (val.type() == QVariant::Image) {
+ if (val.userType() == QMetaType::QImage) {
QImage image = qvariant_cast<QImage>(val);
charFormat.setBackground(image);
- } else if (val.type() == QVariant::ByteArray) {
+ } else if (val.userType() == QMetaType::QByteArray) {
QImage image;
if (image.loadFromData(val.toByteArray())) {
charFormat.setBackground(image);
}
}
} else {
- if (val.type() == QVariant::Image || val.type() == QVariant::Pixmap) {
+ if (val.userType() == QMetaType::QImage || val.userType() == QMetaType::QPixmap) {
charFormat.setBackground(qvariant_cast<QPixmap>(val));
- } else if (val.type() == QVariant::ByteArray) {
+ } else if (val.userType() == QMetaType::QByteArray) {
QPixmap pm;
if (pm.loadFromData(val.toByteArray())) {
charFormat.setBackground(pm);
@@ -1907,9 +1907,9 @@ void QTextHtmlParser::importStyleSheet(const QString &href)
QVariant res = resourceProvider->resource(QTextDocument::StyleSheetResource, href);
QString css;
- if (res.type() == QVariant::String) {
+ if (res.userType() == QMetaType::QString) {
css = res.toString();
- } else if (res.type() == QVariant::ByteArray) {
+ } else if (res.userType() == QMetaType::QByteArray) {
// #### detect @charset
css = QString::fromUtf8(res.toByteArray());
}