Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. qmake and the opengl module
QtWS25 Last Chance

qmake and the opengl module

Scheduled Pinned Locked Moved General and Desktop
qmakeopengl
4 Posts 2 Posters 1.1k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    pi-null-mezon
    wrote on last edited by pi-null-mezon
    #1

    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) {
    DEFINES += REPLACE_WIDGET_TO_OPENGLWIDGET
    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?

    ...

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      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

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • P Offline
        P Offline
        pi-null-mezon
        wrote on last edited by
        #3

        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?

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

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

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved