Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-13331

Crash when trying to display a missing image as border image with GL widget as graphics view viewport

    XMLWordPrintable

Details

    • 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) {
      

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            kjernase Trond Kjernåsen (Inactive)
            dedietri Gabriel de Dietrich (drgvond)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes