Determine which modules were loaded in the .pro file, using preprocessor #ifdef
General and Desktop
2
Posts
2
Posters
1.4k
Views
2
Watching
-
wrote on 28 Jun 2015, 11:55 last edited by
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? -
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
2/2