code: def view_rect(self) -> QRectF:
          
          top_left = self.mapToScene(0, 0)
          bottom_right = self.mapToScene(self.viewport().width() - 1, self.viewport().height() - 1)
          return QRectF(top_left, bottom_right)
docs: Return the boundaries of the view in scene coordinates