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

Documented way of printing whole document produces warning

    XMLWordPrintable

Details

    • 7988cf25a5 (qt/qtbase/dev) 7988cf25a5 (qt/tqtc-qtbase/dev) 30ddd5874a (qt/qtbase/6.4) 30ddd5874a (qt/tqtc-qtbase/6.4) 30ddd5874a (qt/tqtc-qtbase/tqtc/qtinsight-6.4) 30ddd5874a (qt/tqtc-qtbase/6.4.1)

    Description

      https://doc.qt.io/qt-6/qprinter.html#setFromTo says, "if from and to are both set to 0, the whole document will be printed."

      However, calling printer.setFromTo(0, 0); generates the following warning:

      QPageRanges::addRange: 'from' and 'to' must be greater than 0
      

       

      Workaround

      Call printer.setPageRanges( QPageRanges() ); instead. See https://codereview.qt-project.org/c/qt/qtbase/+/346662 where this is applied.

      Attachments

        For Gerrit Dashboard: QTBUG-105292
        # Subject Branch Project Status CR V

        Activity

          People

            vgt Eirik Aavitsland
            skoh-qt Sze Howe Koh
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes