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

Fix QGraphicsView related functions of QPrintPreviewWidget in order to only consider PageItem private instances

    XMLWordPrintable

Details

    • All

    Description

      While not officially documented, QPrintPreviewWidget internally uses a relatively publicly available QGraphicsView.

      This makes it possible to implement custom behavior on the preview widget (for instance, to add custom child items that improve performance of page previews, or other graphical elements that show page margins).

      Unfortunately, this presents some indirect issues with existing behavior, specifically those that iterate through the graphics view items (see calcCurrentPage and _q_fit), since they always rely on the fact that only "PageItem" instances exist.

      This can be easily fixed by ignoring items that are not PageItem instances in the above functions, should not affect performance that much, and could allow further extensibility of the print preview API.

      Attachments

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

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            musicamante Maurizio Berti
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes