Would `QgsRectangle::isEmpty()` be a better way to check?