small cleanups
This commit is contained in:
parent
c418f5ce8d
commit
b9798615b4
@ -1406,7 +1406,7 @@ void QTextHtmlParserNode::applyBackgroundImage(const QString &url, const QTextDo
|
||||
if (!url.isEmpty() && resourceProvider) {
|
||||
QVariant val = resourceProvider->resource(QTextDocument::ImageResource, url);
|
||||
|
||||
if (qApp->thread() != QThread::currentThread()) {
|
||||
if (QCoreApplication::instance()->thread() != QThread::currentThread()) {
|
||||
// must use images in non-GUI threads
|
||||
if (val.type() == QVariant::Image) {
|
||||
QImage image = qvariant_cast<QImage>(val);
|
||||
|
@ -42,7 +42,7 @@
|
||||
|
||||
#include "qtextimagehandler_p.h"
|
||||
|
||||
#include <qapplication.h>
|
||||
#include <qcoreapplication.h>
|
||||
#include <qtextformat.h>
|
||||
#include <qpainter.h>
|
||||
#include <qdebug.h>
|
||||
@ -210,7 +210,7 @@ QSizeF QTextImageHandler::intrinsicSize(QTextDocument *doc, int posInDocument, c
|
||||
Q_UNUSED(posInDocument)
|
||||
const QTextImageFormat imageFormat = format.toImageFormat();
|
||||
|
||||
if (qApp->thread() != QThread::currentThread())
|
||||
if (QCoreApplication::instance()->thread() != QThread::currentThread())
|
||||
return getImageSize(doc, imageFormat);
|
||||
return getPixmapSize(doc, imageFormat);
|
||||
}
|
||||
@ -220,7 +220,7 @@ void QTextImageHandler::drawObject(QPainter *p, const QRectF &rect, QTextDocumen
|
||||
Q_UNUSED(posInDocument)
|
||||
const QTextImageFormat imageFormat = format.toImageFormat();
|
||||
|
||||
if (qApp->thread() != QThread::currentThread()) {
|
||||
if (QCoreApplication::instance()->thread() != QThread::currentThread()) {
|
||||
const QImage image = getImage(doc, imageFormat);
|
||||
p->drawImage(rect, image, image.rect());
|
||||
} else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user