ImageWidget: Don't try to paint the widget if painter is not active yet.
When the UI is being instantiated we might trigger some painting. This squashes warnings in the output.
This commit is contained in:
parent
4e1248a18a
commit
95c2b07d1e
|
@ -139,6 +139,8 @@ class ImageWidget(QWidget):
|
|||
|
||||
def paintEvent(self, a0: QPaintEvent) -> None:
|
||||
painter = QPainter(self)
|
||||
if not painter.paintEngine().isActive():
|
||||
return
|
||||
# helps with better image quality
|
||||
painter.setRenderHint(QPainter.SmoothPixmapTransform, self._smooth_transform)
|
||||
self.paint_image(painter, a0)
|
||||
|
|
Loading…
Reference in a new issue