Details
-
Bug
-
Resolution: Done
-
P1: Critical
-
4.7.0
-
None
-
dcb98430f6add24c9d54253bd35d35010cc75c23
Description
Long title says it all. Setting the graphics view viewport to a QWidget doesn't crash. Sample app attached.
The reason is twofold. The first one is probably fixed with the following patch. Probably the same kind of fix should be applied to other classes.
--- a/src/declarative/graphicsitems/qdeclarativeborderimage.cpp +++ b/src/declarative/graphicsitems/qdeclarativeborderimage.cpp @@ -424,7 +424,7 @@ void QDeclarativeBorderImage::doUpdate() void QDeclarativeBorderImage::paint(QPainter *p, const QStyleOptionGraphicsItem *, QWidget *) { Q_D(QDeclarativeBorderImage); - if (d->pix.isNull()) + if (!d->pix.isReady()) return; bool oldAA = p->testRenderHint(QPainter::Antialiasing);
The second reason is fixed with this patch, that mimics QPaintEngineEx::drawPixmapFragments()
--- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp +++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp @@ -1673,6 +1673,8 @@ void QGL2PaintEngineExPrivate::drawCachedGlyphs(QFontEngineGlyphCache::Type glyp void QGL2PaintEngineEx::drawPixmapFragments(const QPainter::PixmapFragment *fragments, int fragmentCount, con QPainter::PixmapFragmentHints hints) { + if (pixmap.isNull()) + return; Q_D(QGL2PaintEngineEx); // Use fallback for extended composition modes. if (state()->composition_mode > QPainter::CompositionMode_Plus) {