Fixed crashes when using QImage in combination with QCoreApplication.
As long as fonts weren't used we supported using QImage in combination with QCoreApplication in 4.x, and there's no reason we can't continue doing so. Task-number: QTBUG-29643 Change-Id: I2cf351d3c93f1c175bbf624e45024d39ab913111 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>bb10
parent
17e8286fef
commit
733430636d
|
|
@ -4944,7 +4944,10 @@ QPaintEngine *QImage::paintEngine() const
|
|||
|
||||
if (!d->paintEngine) {
|
||||
QPaintDevice *paintDevice = const_cast<QImage *>(this);
|
||||
QPaintEngine *paintEngine = QGuiApplicationPrivate::platformIntegration()->createImagePaintEngine(paintDevice);
|
||||
QPaintEngine *paintEngine = 0;
|
||||
QPlatformIntegration *platformIntegration = QGuiApplicationPrivate::platformIntegration();
|
||||
if (platformIntegration)
|
||||
paintEngine = platformIntegration->createImagePaintEngine(paintDevice);
|
||||
d->paintEngine = paintEngine ? paintEngine : new QRasterPaintEngine(paintDevice);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -672,7 +672,7 @@ void QFontPrivate::detachButKeepEngineData(QFont *font)
|
|||
\sa QGuiApplication::setFont(), QGuiApplication::font()
|
||||
*/
|
||||
QFont::QFont()
|
||||
: d(QGuiApplication::font().d.data()), resolve_mask(0)
|
||||
: d(QGuiApplicationPrivate::instance() ? QGuiApplication::font().d.data() : new QFontPrivate()), resolve_mask(0)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2115,5 +2115,5 @@ void tst_QImage::cleanupFunctions()
|
|||
|
||||
}
|
||||
|
||||
QTEST_MAIN(tst_QImage)
|
||||
QTEST_GUILESS_MAIN(tst_QImage)
|
||||
#include "tst_qimage.moc"
|
||||
|
|
|
|||
Loading…
Reference in New Issue