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

QGraphicsView some items are clipped too aggressively when printing

    XMLWordPrintable

Details

    Description

      When printing QGraphicsView to a PDF some of the items seem to be clipped quite aggressively to the point that they're missing completely from the print output. As seen in the attached image sample.png, items and text that should've been included in the PDF but be clipped are completely gone.

      The clipView (QGraphicsView) on the screen clips correctly (regardless of the QGraphicsItem::ItemClipsChildrenToShape flag). It only shows the correctly clipped sub rect of the drawingScene (QGraphicsScene).
      It is only when QGraphicsView::render is run on the layoutView that clipping to the QGraphicsView rect is completely ignored. I am not sure what the new behavior of the QGraphicsItem::ItemClipsChildrenToShape flag in 5.15.8 really does as suddenly complete items are gone instead of clipped. And if you look at the texts for each of the items, some of them are cut off at various points while others are completely removed even if they are not close to the view boundary

      Steps to reproduce the problem:

      1. Run the attached project.

      Attachments

        1. main.cpp
          4 kB
        2. PDF clipping with 5.15.8.png
          PDF clipping with 5.15.8.png
          117 kB
        3. qtbug100031.zip
          5 kB
        4. sample.png
          sample.png
          102 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            vgt Eirik Aavitsland
            miikapernu Miika Pernu
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes