OSX: Fix build with QT_NO_OPENGL

Task-number: QTBUG-31151

Change-Id: I7ed8117ae05ba0eebaf85731c7fdd2bb51d6ed04