Use the resize event to update screen size on Qt.

Fixes #5491.