Qt 6.11 is out! See what's new in the release
blog
Macro definition at runtime
General and Desktop
5
Posts
3
Posters
3.4k
Views
3
Watching
-
Hi,
I'd like to define macros used in #ifdefs statements at runtime (environment variables) instead of compilation time. Is there a way to do that in Qt?
Thanks
-
@Jessica Do you mean reading environment variables at runtime and acting accordingly in your code? If so, I guess you may want to take a look at qgetenv function.
-
Thank you guys,
qgetenv worked :)
-
@Jessica you're welcomed. Please don't forget to mark the post as solved.