#define to distinguish between widget and console app
Solved
General and Desktop
-
Hi,
i have some classes that i wan to use in both applications (widget and console),
but i need to deactivate some code parts like this:#ifdef WIDGET_APP
code for WIDGET_APP
#else
code for CONSOLE_APP
#endifDoes Qt provide such a define? Didn't found anything in QtGlobal or how can this be done?
-
@JonB said in #define to distinguish between widget and console app:
If you are using qmake/
.pro
file and it hasQT += widgets
in it then see ifQT_WIDGETS_LIB
is defined? If you haveQT += gui
, then see ifQT_GUI_LIB
is defined? I am not sure about these.Thx JonB, that's what i needed.
-