GUI: Fixes, when pixmap_item doesn't exist at the beginning
This commit is contained in:
@@ -77,6 +77,8 @@ class SampleCameraImageLabel(QGraphicsView):
|
||||
pixmap = QPixmap("/home/leonarski_f/loop200.jpg")
|
||||
self.pixmap_item = QGraphicsPixmapItem(pixmap)
|
||||
self.scene.addItem(self.pixmap_item)
|
||||
else:
|
||||
self.pixmap_item = None
|
||||
|
||||
self.setFrameShape(QFrame.Shape.NoFrame)
|
||||
self.setRenderHints(QPainter.RenderHint.Antialiasing)
|
||||
@@ -220,6 +222,9 @@ class SampleCameraImageLabel(QGraphicsView):
|
||||
self.setTransform(QTransform())
|
||||
return
|
||||
|
||||
if self.pixmap_item is None:
|
||||
return
|
||||
|
||||
if self.pixmap_item.boundingRect().width() == 0:
|
||||
ratio = 1.0
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user