Is there an #ifdef in Qt to determine if we're building for Android
Asked Answered
W

1

14

I have an Android-specific fix in my Qt application, and I want that code to be compiled only when building for Android.

Is there an #if or #ifdef that will do that?

Whinchat answered 12/4, 2014 at 6:19 Comment(0)
R
18

Yes, you can find it in the documentation, so just use:

#ifdef Q_OS_ANDROID
Randolf answered 12/4, 2014 at 6:23 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.