qt: fix swapping buffer without making correct context current.
When using a debug build of Qt, we would get warning messages like the following:
QOpenGLContext::swapBuffers() called without corresponding makeCurrent()
These popped when resizing the widget, for example. This fixes that issue by ensuring that the context is current before issuing a swapBuffers call.