Details
-
Bug
-
Resolution: Won't Do
-
P3: Somewhat important
-
4.8.5, 5.2.1
-
None
-
MacBook Air 2011, HP LaserJet CP1515n
Description
Using QPrinter on Mac always prints in color, even if I use QPrinter::setColorMode to force it to GrayScale. I am using a HP LaserJet CP1515n printer, but some of my customers reported the same problem on other printers.
I managed to reproduce the problem in a widget based sample application by inserting the below paint code into the widget. When using the native print dialog changing the color mode in the dialog works as expected.
Is there any way to work around this problem?
void Widget::paintEvent(QPaintEvent *event) { QPainter painter(this); painter.fillRect(0, 0, 200, 200, Qt::red); static bool printed = false; if (!printed) { printed = true; // Forcing printing in GrayScale, but still prints in color on Mac QPrinter printer(QPrinterInfo::availablePrinters()[1]); printer.setColorMode(QPrinter::GrayScale); QPainter painter; painter.begin(&printer); painter.fillRect(0, 0, 200, 200, Qt::red); painter.end(); } }
Attachments
Issue Links
- is required for
-
QTBUG-25383 QtPrintSupport - macOS Issues
- Closed