Skip to content

Commit

Permalink
Fixed QPrinter.setColorMode for PyQt6/Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
PierreRaybaut committed Oct 16, 2023
1 parent 3ead7f9 commit ffe1032
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion qwt/plot_renderer.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,11 @@ def renderDocument(
printer.setPrinterName("")
else:
printer.setOutputFormat(QPrinter.PostScriptFormat)
printer.setColorMode(QPrinter.Color)
try:
printer.setColorMode(QPrinter.Color)
except AttributeError:
# PyQt6 on Linux
pass
printer.setFullPage(True)
printer.setPageSize(QPageSize(sizeMM, QPageSize.Millimeter))
printer.setDocName(title)
Expand Down

0 comments on commit ffe1032

Please sign in to comment.