Skip to content

Commit ffe1032

Browse files
committed
Fixed QPrinter.setColorMode for PyQt6/Linux
1 parent 3ead7f9 commit ffe1032

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

qwt/plot_renderer.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,11 @@ def renderDocument(
249249
printer.setPrinterName("")
250250
else:
251251
printer.setOutputFormat(QPrinter.PostScriptFormat)
252-
printer.setColorMode(QPrinter.Color)
252+
try:
253+
printer.setColorMode(QPrinter.Color)
254+
except AttributeError:
255+
# PyQt6 on Linux
256+
pass
253257
printer.setFullPage(True)
254258
printer.setPageSize(QPageSize(sizeMM, QPageSize.Millimeter))
255259
printer.setDocName(title)

0 commit comments

Comments
 (0)