Skip to content

Commit 0e6ea01

Browse files
committed
Fixed QPrinter.HighResolution AttributeError on Linux/Qt6
1 parent 68a61ff commit 0e6ea01

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

qwt/tests/test_bodedemo.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,12 @@ def __init__(self, *args):
243243
self.print_(unattended=True)
244244

245245
def print_(self, unattended=False):
246-
printer = QPrinter(QPrinter.HighResolution)
246+
try:
247+
mode = QPrinter.HighResolution
248+
except AttributeError:
249+
# Some PySide6 / PyQt6 versions do not have this attribute on Linux
250+
mode = QPrinter.ScreenResolution
251+
printer = QPrinter(mode)
247252

248253
printer.setCreator("Bode example")
249254
printer.setOrientation(QPrinter.Landscape)

0 commit comments

Comments
 (0)