printing: Why have you disabeled "reverse order" in "QTextDocument::print" ?
-
Not sure, if this is the right place to ask this. Please let me know, where would be the right place for this.
Are you aware, of this QT issue:
When we want to print in "reverse mode" in a QT program, then it nevertheless prints in normal order. It does not print pages 4,3,2,1, but 1,2,3,4 .This is always the case, when a particular QT program has not implemented any workaround for this.
For example with Kate we have this wrong behaviour.
Here is an example of a QT printing dialog:
https://www.bilder-upload.eu/bild-310380-1606730172.png.htmlIt has the function "reverse" activated, but it does not work.
Why does it not work?
Here is the answer:
It does not work, because the reverse order is disabled in "QTextDocument::print" .I consider this issue important. Why is it important?
How should anybody print his documents on both sides, if he has a printer that does not support duplex mode?So here is my question:
Why is "QTextDocument::print" disabeled in QT ?
Are you aware of this?Thank you.
-
@Drure You should check Qt bug tracker and file a bug if there is nothing yet for this issue.
https://bugreports.qt.io/secure/Dashboard.jspa -
@Drure
I presume you are referring to code at https://code.woboq.org/qt5/qtbase/src/gui/text/qtextdocument.cpp.html#2045// bool ascending = true; // if (printer->pageOrder() == QPrinter::LastPageFirst) { // int tmp = fromPage; // fromPage = toPage; // toPage = tmp; // ascending = false; // }
Note that it is commented out. I don't know why, and I don't whether given this it ought disable the option. The only related Qt Bug I could find is https://bugreports.qt.io/browse/QTBUG-84016, where the user may be falling foul of this issue.
Also, https://community.kde.org/Printing/Missing_Features notes:
Reverse Page Order (4)
Choose to print last page first, currently X11 only.
Add Windows support, and possibly set-only Mac support.
I don't know whether this is in any way related to the issue. Doesn't seem so, because we are looking at
QTextDocument::print()
only.I think you'd need to raise a bug report referring to the commented-out code and ask why that is so, given that there are no comments against it!
-
@JonB said in printing: Why have you disabeled "reverse order" in "QTextDocument::print" ?:
Note that it is commented out. I don't know why
I think it is probably related to
QPagedPaintDevice
not having an "order" option.pageOrder
isQPrinter
only.
And in the documentation of QPrinter,setPageOrder
is also stated that:This function is only supported under X11.
and
The application is responsible for reading the page order and printing accordingly.
(I also find there is a pageOrderAscending in QPagedPaintDevicePrivate, but it is useless)
-
Thank you all.
and
The application is responsible for reading the page order and printing accordingly.
Not all developers of QT programs are aware of this.
Many of them think something like: "My program has no control over the print process. It only calls Qt's print dialog; the rest is done by Qt (and CUPS)."See here:
https://github.com/tsujan/FeatherPad/issues/455#issuecomment-731603828