android - Qt 中是否有#ifdef 来确定我们是否正在为 Android 构建

标签 android c++ qt conditional-compilation

我的 Qt 应用程序中有一个特定于 Android 的修复程序,我希望仅在为 Android 构建时编译该代码。

是否有 #if#ifdef 可以做到这一点?

最佳答案

是的,你可以找到它in the documentation ,所以只需使用:

#ifdef Q_OS_ANDROID

关于android - Qt 中是否有#ifdef 来确定我们是否正在为 Android 构建,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23026883/

相关文章:

c++ - 如何在qt中使用带有两个参数的qDebug()?

android - Application 类的 onCreate() 方法无法按预期使用 OneSignal

c++ - OpenCV,C++ : Missing Triangles in Delaunay Triangulation

c++ - 如何创建空的工作 boost::python::dict?

c++ - 无法在 QT ubuntu 上使用 odbc 连接到 sql server

c++ - C++14 中的可变长度数组?

android - START_STICKY 用于 IntentService

java - 在 java 中向 .json URI 发出获取请求并接收其内容

android - 不要在主题中请求 Window.FEATURE_SUPPORT_ACTION_BAR 并将 windowActionBar 设置为 false 以使用工具栏

C++函数转换题