def _get_crop(self, image: QImage, scan_size: int) -> QRect:
        """Returns a QRect that is scan_size x scan_size in the middle of the resolution"""
        scan_pos_x = (image.width() - scan_size) // 2
        scan_pos_y = (image.height() - scan_size) // 2
        return QRect(scan_pos_x, scan_pos_y, scan_size, scan_size)
Returns a QRect that is scan_size x scan_size in the middle of the resolution
electrum/gui/qml/qeqr.py