Environment Variables Used by Qt for Android

Enabling or disabling workarounds

Qt Android uses some environment variables to enable/disable certain workarounds:

Commonly used variables

  • QT_ANDROID_NO_EXIT_CALL: In some cases, an Android app might not be able to safely clean all threads while calling exit() and crash. This is because there are C++ threads running and destroying these without joining them terminates an application. These threads cannot be joined because it's not possible to know if they are running. This flag avoids calling exit() and lets the Android system handle this, at the cost of not attempting to run global destructors.
  • QT_ANDROID_ENABLE_WORKAROUND_TO_DISABLE_PREDICTIVE_TEXT: Allows the hiding of predictive text suggestions, mainly from password fields. Certain devices don’t handle this properly.
  • QT_ANDROID_ENABLE_RIGHT_MOUSE_FROM_LONG_PRESS: Interprets a long touch press as a right mouse click event.
  • QT_ANDROID_DISABLE_ACCESSIBILITY: Disable 可访问性 . This prevents the processing of accessibility events.

Less commonly used variables

  • QT_ANDROID_FONT_LOCATION: Sets a custom path for system fonts.
  • QT_ANDROID_MAX_ASSETS_CACHE_SIZE: cache size for assets under the assets folder.
  • QT_ANDROID_DISABLE_GLYPH_CACHE_WORKAROUND
  • QT_ANDROID_RASTER_IMAGE_DEPTH
  • QT_ANDROID_MINIMUM_MOUSE_DOUBLE_CLICK_DISTANCE

注意: Though related, these are not the same as CMake commands or variables used by Qt For Android, see Qt for Android: CMake