Details
-
Bug
-
Resolution: Moved
-
P3: Somewhat important
-
None
-
4.5.0, 4.5.1, 4.5.2, 4.5.3
-
None
Description
I am creating this bug because there is a very serious issue with printing. I think the problem is much more obvious in North America because the default paper size is Letter and QT has a hardcoded default of A4 and outside of North America this will likely also be your CUPS default.
My CUPS settings are set to Letter and by default QT prints A4. When I click "Properties" QT shows the default of Letter but if I leave it like that it will print A4. If I pick a different paper size in the print dialog and then change it back to Letter, then it will print Letter.
If the default isn't A4 then what is displayed in Properties as the default won't actually be used unless it was changed to be that in the Properties before printing.
QT obviously reads settings from CUPS because if CUPS is set to be Letter then the Properties will show Letter. QT doesn't print with Letter though... you have to pick Letter in Properties.
Someone opened QTBUG-3567 because of the same underlying problem but I have no idea why the bug seems to be calling for operators.
This is also the cause of KDE bug https://bugs.kde.org/show_bug.cgi?id=174354.
Someone has posted a work around for overcoming QT defaults which involves patching and compiling QT using the new library. He did this for getting a default of Duplex but I suspect that it would work for Letter too.
void QPrintDialogPrivate::applyPrinterProperties(QPrinter *p)
{
+ // Force some decent defaults, e.g. for Duplex printing !!!
+ p->setDoubleSidedPrinting(true);
+ p->setColorMode(QPrinter::GrayScale);
+ p->setPageSize(QPrinter::Letter);
+
It seems as though things appear to work as desired if QT is hard coded to be the same default as the CUPS default. Picking a new size in properties always works so there isn't any problem.
If I picked A4 as a CUPS default I would only have change the paper size in the QPrintDialog every time to "Letter". With Letter as the CUPS default I have to change the paper size to something else first (because it is already Letter) and then change it back to Letter every single time before printing.
While QT does load CUPS settings and what QT displays in "Properties" appear to use CUPS settings. When QT prints it only seems to use the settings that you've picked in the print dialog or what QT was hard coded with. If CUPS is configured with Letter as the default and you don't do anything else QT will print A4.
If I print from a KDE4 application like Okular or Kate which uses QT for printing I have to remember to this or it will actually make our office printers block since they aren't stocked with A4 paper.
If print from something that doesn't use QT (OpenOffice for example) it will work using the system (CUPS) default of Letter.
I bet you that if QT starting building with p->setPageSize(QPrinter::Letter) this bug would become a lot more obvious to European users/developers because their CUPS settings would no longer match what QT prints with by default. My guess is that the print dialog would show you A4 (assuming that what your default in CUPS) and still print as Letter.
Here are just some KDE bugs that were opened because of this issue:
https://bugs.kde.org/show_bug.cgi?id=174354
https://bugs.kde.org/show_bug.cgi?id=177000
https://bugs.kde.org/show_bug.cgi?id=184188
https://bugs.kde.org/show_bug.cgi?id=180051
https://bugs.kde.org/show_bug.cgi?id=185296
https://bugs.kde.org/show_bug.cgi?id=180280
....
PLEASE! Whey can't QT actually print with the settings that it shows me in the print dialog it seems to know what the CUPS settings are when it shows them to me.
I don't really know the code so please excuse me if I made any false statements about what the code is actually doing but this is a very common bug experienced by all the "Letter" printing KDE users I know.
Attachments
Issue Links
- is replaced by
-
QTBUG-6471 QPrintDialog for unix does not correctly read CUPS settings
- Closed