Try adding "QT += opengl" to your .pro file.