I have a standalone pyqgis program and it uses QgsMapCanvas as map display. I would like to set its extent to be empty. How do I do that?

I tried the following but it is not working, in the sense that the canvas's extent is not empty after setting an empty rect:

r = QgsRectangle()
if r.isEmpty():


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.