fix build with QT_NO_OPENGL

This has been broken since 82d8a5c81d79e0c38e4f593c1424f8b212cb750f,
as that and future commits assumed that OpenGL was always enabled.

Change-Id: Icbb048a44744e0f0c9efbad8cd6cc6935da8a362