1
0
Fork 0
mirror of synced 2024-06-02 10:44:40 +12:00

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:
loathingKernel 2023-03-12 12:19:46 +02:00
parent 4e1248a18a
commit 95c2b07d1e
No known key found for this signature in database
GPG key ID: CE0C72D0B53821FD

View file

@ -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)