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. [SOLVED]Qt - check module availability in code
Forum Update on Monday, May 27th 2025

[SOLVED]Qt - check module availability in code

Scheduled Pinned Locked Moved General and Desktop
4 Posts 2 Posters 5.8k 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
    Peppy
    wrote on 24 Jul 2011, 21:03 last edited by
    #1

    How to check in C++ code, if there is added in project file required module, I mean:
    @
    #if QT_MODULE_ADDED(Gui)
    #include <QtGui>
    #endif
    @

    Exists similar macro?

    1 Reply Last reply
    0
    • A Offline
      A Offline
      alexisdm
      wrote on 25 Jul 2011, 00:17 last edited by
      #2

      If you compile with qmake, the macros: QT_CORE_LIB, QT_GUI_LIB, QT_NETWORK_LIB... are defined for each module you put in the QT variable in your .pro file.

      1 Reply Last reply
      2
      • P Offline
        P Offline
        Peppy
        wrote on 25 Jul 2011, 15:23 last edited by
        #3

        Yes, that works.

        1 Reply Last reply
        0
        • P Offline
          P Offline
          Peppy
          wrote on 25 Jul 2011, 20:27 last edited by
          #4

          But, there is else way (I found it through IntelliSense): QT_MODULE_GUI? QT_MODULE_CORE?

          1 Reply Last reply
          0

          1/4

          24 Jul 2011, 21:03

          • Login

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