Qt5: enable OpenGL support

Known limitations:

- only one Qt window can use OpenGL at this time
- window resizing using the resize handle does not work

Fixes #975.