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

QPainter crash when drawing image

    XMLWordPrintable

Details

    • Windows
    • 7c6be5e88 (dev), 78a45e4a6 (6.6), 636874759 (6.5)

    Description

      QPainter crashes when trying to draw a QImage onto another QImage via QTransform. Sample project where it crashes included.

       

      #include <QCoreApplication>
      #include <QImage>
      #include <QTransform>
      #include <QPainter>
      
      int main(int argc, char *argv[])
      {
          QCoreApplication a(argc, argv);
      
          QImage image(31, 33, QImage::Format_ARGB32_Premultiplied);
          image.fill(Qt::transparent);
      
          QTransform transform;
          transform.setMatrix(-0.021615598885793876,  0.0000000000000000, 0.0000000000000000,
                               0.0000000000000000,   -0.021666666666666674, 0.0000000000000000,
                              88.645571030640681,    29.336666666666677,    1.0000000000000000);  
      
          QImage surf(97, 78, QImage::Format_ARGB32_Premultiplied);
          surf.fill(Qt::transparent);
      
          QPainter painter(&surf);
          painter.setWorldTransform(transform);
          painter.drawImage(0, 0, image);
          return a.exec();
      }
       

      Attachments

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

        Activity

          People

            allan.jensen Allan Sandfeld Jensen
            jakub_melka Jakub Melka
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes