Skip to content

Commit

Permalink
Fix calls to QPaintEngine in QwtNullPaintDevice_PaintEngine
Browse files Browse the repository at this point in the history
  • Loading branch information
PierreRaybaut committed Jul 24, 2024
1 parent 7dcb6cc commit 4c40eb4
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions qwt/null_paintdevice.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,10 @@ def drawRects(self, rects, rectCount=None):
if device is None:
return
if device.mode() != QwtNullPaintDevice.NormalMode:
QPaintEngine.drawRects(self, rects, rectCount)
try:
QPaintEngine.drawRects(self, rects, rectCount)
except TypeError:
QPaintEngine.drawRects(self, rects)
return
device.drawRects(rects, rectCount)

Expand All @@ -59,7 +62,10 @@ def drawLines(self, lines, lineCount=None):
if device is None:
return
if device.mode() != QwtNullPaintDevice.NormalMode and QT_API.startswith("pyqt"):
QPaintEngine.drawLines(self, lines, lineCount)
try:
QPaintEngine.drawLines(self, lines, lineCount)
except TypeError:
QPaintEngine.drawLines(self, lines)
return
device.drawLines(lines, lineCount)

Expand All @@ -85,7 +91,10 @@ def drawPoints(self, points, pointCount=None):
if device is None:
return
if device.mode() != QwtNullPaintDevice.NormalMode:
QPaintEngine.drawPoints(self, points, pointCount)
try:
QPaintEngine.drawPoints(self, points, pointCount)
except TypeError:
QPaintEngine.drawPoints(self, points)
return
device.drawPoints(points, pointCount)

Expand Down

0 comments on commit 4c40eb4

Please sign in to comment.