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

QSvgGenerator QImage QBrush Not Work

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P1: Critical P1: Critical
    • 6.8.1, 6.9.0 FF
    • 5.12
    • SVG Support
    • None
    • VS2017
    • Windows
    • 1e820e62d (dev), 54659f917 (6.8)

      Before I use Qt 5.5.1 to draw some shapes on the QGraphicsView. I used fillRect or fillPath with a QImage brush. and then export to SVG file with the module QSvgGenerator, it works on Qt 5.5.1.

       

      But now i update to Qt 5.12.3, same code, but the svg is not work now. It seems the image or pixmap brush now works when exporting to svg files.

       

      Easy way to test this bug. 

      ..\Examples\Qt-5.12.3\svg\svggenerator\displaywidget.cpp. 

      Function:

      void DisplayWidget::paint(QPainter &painter)

      add only one line to test:

      painter.fillRect(QRect(0, 0, 50, 50), QBrush(QImage("D:
      1.bmp")));

       

      compile, save as svg. svg only draw the raw image, but the the brush part is not there.

       

        1. 1.bmp
          1.bmp
          8 kB
        2. 1.png
          1.png
          7 kB
        3. 1.png
          1.png
          7 kB
        4. 1.png
          1.png
          7 kB
        5. 1.svg
          2 kB
        6. 111.svg
          2 kB
        7. 2020-11-07 204712.png
          2020-11-07 204712.png
          6 kB
        8. image-2020-11-10-12-07-22-749.png
          image-2020-11-10-12-07-22-749.png
          10 kB
        9. Pattern_Qt_5_9_6.svg
          4 kB
        10. Pattern_Qt5_12_10.svg
          4 kB
        11. Pattern_Qt5_6_3.svg
          820 kB
        12. svggenerator.rar
          28 kB
        13. svggenerator.rar
          28 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            vgt Eirik Aavitsland
            allenszk Shen ZhenKai
            Votes:
            3 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes