|
15 | 15 |
|
16 | 16 | import os |
17 | 17 |
|
18 | | -from qtpy import QtCore as QC |
19 | 18 | from qtpy.QtCore import QEvent, QPointF, QRect, QRectF, QSizeF, Qt |
20 | 19 | from qtpy.QtGui import ( |
21 | 20 | QBrush, |
|
35 | 34 | from qwt.null_paintdevice import QwtNullPaintDevice |
36 | 35 | from qwt.painter import QwtPainter |
37 | 36 |
|
38 | | -QT_MAJOR_VERSION = int(QC.__version__.split(".")[0]) |
39 | 37 | QT_API = os.environ["QT_API"] |
40 | 38 |
|
41 | 39 |
|
@@ -491,10 +489,7 @@ def setPaintAttribute(self, attribute, on=True): |
491 | 489 | if self.__data.backingStore is None: |
492 | 490 | self.__data.backingStore = QPixmap() |
493 | 491 | if self.isVisible(): |
494 | | - if QT_MAJOR_VERSION >= 5: |
495 | | - self.__data.backingStore = self.grab(self.rect()) |
496 | | - else: |
497 | | - self.__data.backingStore = QPixmap.grabWidget(self, self.rect()) |
| 492 | + self.__data.backingStore = self.grab(self.rect()) |
498 | 493 | else: |
499 | 494 | self.__data.backingStore = None |
500 | 495 | elif attribute == self.Opaque: |
@@ -593,10 +588,7 @@ def paintEvent(self, event): |
593 | 588 | and self.__data.backingStore is not None |
594 | 589 | ): |
595 | 590 | bs = self.__data.backingStore |
596 | | - if QT_MAJOR_VERSION >= 5: |
597 | | - pixelRatio = bs.devicePixelRatio() |
598 | | - else: |
599 | | - pixelRatio = 1.0 |
| 591 | + pixelRatio = bs.devicePixelRatio() |
600 | 592 | if bs.size() != self.size() * pixelRatio: |
601 | 593 | bs = QwtPainter.backingStore(self, self.size()) |
602 | 594 | if self.testAttribute(Qt.WA_StyledBackground): |
|
0 commit comments