Details
-
Bug
-
Resolution: Done
-
P2: Important
-
6.3.1
-
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.