Skip to content

Commit 44d9005

Browse files
[FIX] wrong handling of border.rectList with PySide6 backend
This appears to fix the problems described in issue #102 . The changes can be made more pythonic, this patch literally came out of my debugging session - feedback regarding cleaning it up and making it ready for merging would be highly appreciated
1 parent 9a6acff commit 44d9005

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

qwt/plot_canvas.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,16 @@ def drawRects(self, rects, count):
7575
# Pyside
7676
if isinstance(rects, (QRect, QRectF)):
7777
self.border.list = [rects]
78+
elif all(isinstance(rects, (QRect, QRectF)):
79+
if isinstance(rects, list):
80+
self.border.rectList += rects
81+
else:
82+
# That may not even be necessary
83+
self.border.rectList += [r for r in rects]
7884
else:
85+
# Should we get here ?
7986
for i in range(count):
80-
self.border.rectList += [rects.getRect().index(i)]
87+
self.border.rectList += [rects[i]]
8188
else:
8289
# PyQt
8390
for i in range(count):

0 commit comments

Comments
 (0)