|
15 | 15 |
|
16 | 16 | import os |
17 | 17 |
|
18 | | -from qtpy.QtCore import QEvent, QPointF, QRect, QRectF, QSizeF, Qt |
| 18 | +from qtpy.QtCore import QEvent, QPoint, QPointF, QRect, QRectF, QSize, Qt |
19 | 19 | from qtpy.QtGui import ( |
20 | 20 | QBrush, |
21 | 21 | QGradient, |
@@ -280,12 +280,12 @@ def qwtFillBackground(*args): |
280 | 280 | r = canvas.rect() |
281 | 281 | radius = canvas.borderRadius() |
282 | 282 | if radius > 0.0: |
283 | | - sz = QSizeF(radius, radius) |
| 283 | + sz = QSize(radius, radius) |
284 | 284 | rects += [ |
285 | | - QRectF(r.topLeft(), sz), |
286 | | - QRectF(r.topRight() - QPointF(radius, 0), sz), |
287 | | - QRectF(r.bottomRight() - QPointF(radius, radius), sz), |
288 | | - QRectF(r.bottomLeft() - QPointF(0, radius), sz), |
| 285 | + QRect(r.topLeft(), sz), |
| 286 | + QRect(r.topRight() - QPoint(radius, 0), sz), |
| 287 | + QRect(r.bottomRight() - QPoint(radius, radius), sz), |
| 288 | + QRect(r.bottomLeft() - QPoint(0, radius), sz), |
289 | 289 | ] |
290 | 290 |
|
291 | 291 | qwtFillBackground(painter, canvas, rects) |
@@ -586,6 +586,7 @@ def paintEvent(self, event): |
586 | 586 | if ( |
587 | 587 | self.testPaintAttribute(self.BackingStore) |
588 | 588 | and self.__data.backingStore is not None |
| 589 | + and not self.__data.backingStore.isNull() |
589 | 590 | ): |
590 | 591 | bs = self.__data.backingStore |
591 | 592 | pixelRatio = bs.devicePixelRatio() |
|
0 commit comments