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

Printing fails when objects are painted with non-solid fill BrushStyle

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 5.15.6, 6.2.0, 6.3
    • GUI: Printing
    • macOS 11.0, XCode 12
    • macOS

    Description

      When printing an object with a non-solid fill brush (e.g. Qt::HorPattern), the print operation fails. The print job is queued up but no print output is generated.
      Printing to a PDF works fine.

      The attached sample project is based on https://doc-snapshots.qt.io/qt6-dev/qtwidgets-widgets-scribble-example.html. The modification is as follows under paintEvent and print()

      
       //    painter.drawImage(dirtyRect, image, dirtyRect);     Disabled
          painter.setBrush(QBrush(0xff0000ff, Qt::HorPattern));   // Added
          painter.drawRect(200,200,200,200);                               // Added 
      
      

      The printing works fine when e.g. Qt::SolidPattern is used.

      Attachments

        1. image-2022-06-15-15-30-50-034.png
          9.48 MB
          Mikołaj Boc
        2. scribble-qtbut97718.zip
          12 kB
          Nahomi Gröhn

        Activity

          People

            mikolaj.boc Mikołaj Boc
            nagrohn Nahomi Gröhn (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            9 Start watching this issue

            Dates

              Created:
              Updated: