summaryrefslogtreecommitdiffstats
path: root/src/gui/text/qtexthtmlparser.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/text/qtexthtmlparser.cpp')
-rw-r--r--src/gui/text/qtexthtmlparser.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/gui/text/qtexthtmlparser.cpp b/src/gui/text/qtexthtmlparser.cpp
index b867f42480..f003544391 100644
--- a/src/gui/text/qtexthtmlparser.cpp
+++ b/src/gui/text/qtexthtmlparser.cpp
@@ -463,7 +463,7 @@ static const QTextHtmlElement *lookupElementHelper(const QString &element)
const QTextHtmlElement *end = &elements[Html_NumElements];
const QTextHtmlElement *e = std::lower_bound(start, end, element);
if ((e == end) || (element < *e))
- return 0;
+ return nullptr;
return e;
}
@@ -519,7 +519,7 @@ void QTextHtmlParser::dumpHtml()
QTextHtmlParserNode *QTextHtmlParser::newNode(int parent)
{
QTextHtmlParserNode *lastNode = &nodes.last();
- QTextHtmlParserNode *newNode = 0;
+ QTextHtmlParserNode *newNode = nullptr;
bool reuseLastNode = true;
@@ -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());
}
@@ -2123,7 +2123,7 @@ QVector<QCss::Declaration> QTextHtmlParser::declarationsForNode(int node) const
QCss::StyleSelector::NodePtr n;
n.id = node;
- const char *extraPseudo = 0;
+ const char *extraPseudo = nullptr;
if (nodes.at(node).id == Html_a && nodes.at(node).hasHref)
extraPseudo = "link";
// Ensure that our own style is taken into consideration