Qt World Summit: Register Today!

qmake and the opengl module

  • Hi, yesterday I found interesting behaviour of qmake. I've tried to design such *.pro file that can automatically determine is opengl module used or not. I've used Qt 5.4 msvc10 with opengl and Qt 5.4 mingw_4.9.1 kits and booth can not find opengl on following snippet from qmake documentation:
    CONFIG(opengl) {
    message(Compiles with OpenGL support)
    } else {
    message(Compiles without OpenGL support)
    Documentation says that in Qt 5.4 opengl has been included in gui module, so I try to check CONFIG(gui) and gui and opengl without CONFIG(), but always with the same result "Compiles without OpenGL support". So, how to make this snippet to work properly?


  • Lifetime Qt Champion

    Hi and welcome to devnet,

    gui like e.g. widgets is a Qt module, so you should check the content of the QT variable for it

    Hope it helps

  • It seems that CONFIG(opengl) does not return true anymore. Qt 5.4 docs says about opengl module:

    Warning: This module should not be used anymore for new code. Please use the corresponding OpenGL classes in Qt Gui.

    Since my application use gui module it is already support opengl. So I should specify REPLACE_WIDGET_TO_OPENGLWIDGET manually. Am I right?

  • Lifetime Qt Champion

    Yes, but since you use the gui module, do you really need that check you have ?

Log in to reply