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.
Attachments
For Gerrit Dashboard: QTBUG-105292 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
438983,2 | Avoid warning from QPrinter::setFromTo() in the documented 0,0 case | dev | qt/qtbase | Status: MERGED | +2 | 0 |
439110,2 | Avoid warning from QPrinter::setFromTo() in the documented 0,0 case | 6.4 | qt/qtbase | Status: MERGED | +2 | 0 |