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
          8 kB
          Shen ZhenKai
        2. 2020-11-07 204712.png
          6 kB
          Shen ZhenKai
        3. 1.svg
          2 kB
          Shen ZhenKai
        4. svggenerator.rar
          28 kB
          Shen ZhenKai
        5. 1.png
          7 kB
          Shen ZhenKai
        6. image-2020-11-10-12-07-22-749.png
          10 kB
          Shen ZhenKai
        7. svggenerator.rar
          28 kB
          Shen ZhenKai
        8. 1.png
          7 kB
          Shen ZhenKai
        9. 111.svg
          2 kB
          Shen ZhenKai
        10. 1.png
          7 kB
          Shen ZhenKai
        11. Pattern_Qt5_12_10.svg
          4 kB
          Adam Light
        12. Pattern_Qt_5_9_6.svg
          4 kB
          Adam Light
        13. Pattern_Qt5_6_3.svg
          820 kB
          Adam Light
        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