Repository navigation
Commit 13e0a0f
committed
fix(graphic): record clipped paint operations
Painting into a QwtGraphic with clipping enabled raised "TypeError:
unsupported operand type(s) for &=: 'QRectF' and 'QRect'" on each paint
operation. As the exception is raised in a Qt virtual method (paint engine
drawPath, drawPixmap and drawImage), PyQt aborts the process with its
default exception hook.
QwtGraphic.updateBoundingRect intersects the bounding rectangle with the
bounding rectangle of the clip region, which is a QRect. The Qwt C++ code
converts it implicitly to a QRectF; the Python port did not.
- Convert the clip region bounding rectangle to a QRectF before mapping
and intersecting it.
- Regression test: clipped path, pixmap and image recorded with a
translated painter; control point rectangle not clipped, bounding
rectangle clipped. Exceptions raised in Qt virtual methods are collected
so that the test fails instead of aborting the process.
- Changelog entry.
Found while writing the tests for the painter command copy.
Refs #115
Assisted-by: Claude Opus 5.51 parent e8a2570 commit 13e0a0f
3 files changed
Lines changed: 55 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
757 | 757 | | |
758 | 758 | | |
759 | 759 | | |
760 | | - | |
| 760 | + | |
761 | 761 | | |
762 | 762 | | |
763 | 763 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
| 15 | + | |
| 16 | + | |
14 | 17 | | |
15 | 18 | | |
16 | 19 | | |
| |||
46 | 49 | | |
47 | 50 | | |
48 | 51 | | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
49 | 72 | | |
50 | 73 | | |
51 | 74 | | |
| |||
115 | 138 | | |
116 | 139 | | |
117 | 140 | | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
118 | 170 | | |
119 | 171 | | |
120 | 172 | | |
| |||
373 | 425 | | |
374 | 426 | | |
375 | 427 | | |
| 428 | + | |
376 | 429 | | |
377 | 430 | | |
378 | 431 | | |
| |||
0 commit comments