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

Print preview scaling depends on screen resolution

    XMLWordPrintable

Details

    • Bug
    • Resolution: Cannot Reproduce
    • P2: Important
    • Some future release
    • 4.4.2
    • GUI: Printing
    • None

    Description

      When implementing a slot connected to QPrintPreviewWidget::paintRequested(), you would assume that you can use the same painting commands you use to create printed output. However, for some reason, the scale of graphics in the print preview depends on the resolution of the screen: output shown on a low resolution screen will overflow the page boundaries, for example.

      See this thread for more information:

      http://lists.trolltech.com/pipermail/qt-interest/2008-December/000305.html

      The user's implementation of the slot:

      void ReportTest::print(QPrinter *printer)
      {
      QPainter painter(printer);
      painter.setRenderHints(QPainter::Antialiasing |
      QPainter::TextAntialiasing |
      QPainter::SmoothPixmapTransform, true);

      QRect rect(QPoint(30, 30), QSize(750, 30));
      painter.drawRect(rect);

      //printer->newPage();
      }

      Attachments

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

        Activity

          People

            kjernase Trond Kjernåsen (Inactive)
            boddie David Boddie (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes