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. Determine which modules were loaded in the .pro file, using preprocessor #ifdef
Forum Updated to NodeBB v4.3 + New Features

Determine which modules were loaded in the .pro file, using preprocessor #ifdef

Scheduled Pinned Locked Moved General and Desktop
modulemacroifdefpreprocessor
2 Posts 2 Posters 1.4k Views 2 Watching
  • 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.
  • D Offline
    D Offline
    DerManu
    wrote on 28 Jun 2015, 11:55 last edited by
    #1

    Hi,

    I'm trying to determine which QT modules are loaded in the .pro file, e.g.:
    QT += svg printsupport
    and either include or exclude own code sections with preprocessor macros, depending on that.
    Do they define some convenient flags that could be tested with #ifdef? I only know of QT_NO_PRINTER, which roughly corresponds to what I'm looking for, for the printsupport module. But is there a general way that works also for other modules, e.g. svg?

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 28 Jun 2015, 21:28 last edited by
      #2

      Hi,

      QT_NO_PRINTER is (or not) defined when compiling Qt, not when loading or not a module.
      One thing you could is the qtHaveModule() function in your pro file and create the defines you need there.

      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
      1

      2/2

      28 Jun 2015, 21:28

      • Login

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