ARTICLE AD BOX
Asked today
Viewed 61 times
The issue: You create an Android Qt C++ app. When the user has any accessibility features enabled, the app lags, it's so slow that it's unusable and finally crashes.
In the associated Android log you find entries like that:
[2025-12-28 13:42:43.177 Uid(value=10021):11177:11177 W/Qt A11Y] Accessibility: populateNode for Invalid ID [2025-12-28 13:42:43.178 Uid(value=10021):11177:11177 W/Qt A11Y] AccessibilityEvent with empty descriptionThe issue is present in Qt bug logs since Qt 5.2 up to Qt 6.8, I'm now using Qt 6.10 and it appeared again.
Possible solutions:
There was a solution in Qt 6.8 which was rather simple. You use the following code in your C++ main() function to define an environment variable before instantiating your QApplication class:
qputenv("QT_ANDROID_DISABLE_ACCESSIBILITY", "1");You may also rebuild all Qt libraries from source by specifying the -no-feature-accessibility configure option during build:
https://doc.qt.io/qt-6/configure-options.html
Solution (1) does not work anymore in Qt 6.10 although the Java code to read the "QT_ANDROID_DISABLE_ACCESSIBILITY" env. variable is still present (file: QtAccessibilityDelegate.java)
Solution (2) seems too extreme and complicated for an issue like this (and you must repeat it at every Qt 6.x update).
I've also tried to disable Accessibility Features in AndroidManifest.xml or by calling some associated Android Java functions but nothing fixed the issue: The app still lags and crashes, the log entries are still present.
Are there any simple fixes without rebuilding the Qt libraries each time?
5,52416 gold badges88 silver badges64 bronze badges
2
The simplest (and only) solution I found for Qt 6.10 is to copy and modify the following function in e.g. my main.cpp file:
#ifdef Q_OS_ANDROID // !! It disables all accessibility features. Copied from the following file // and modified to always return false: // c:\Qt6\6.10.1\Src\qtbase\src\plugins\platforms\android\qandroidplatformintegration.cpp extern "C" { JNIEXPORT bool JNICALL Java_org_qtproject_qt_android_QtNativeAccessibility_accessibilitySupported(JNIEnv *, jobject) { // #if QT_CONFIG(accessibility) // return true; // #endif // QT_CONFIG(accessibility) return false; } } #endifPS1: I was afraid that the linker will throw a duplicate symbol error, but nothing like that happened. My version of the function takes presentence over the original Qt native libraries function and everything works fine with the Accessibility Features disabled!
PS2: You don't have to call directly this function, it's called from the Qt Java libraries to know if accessibility is supported.
Explore related questions
See similar questions with these tags.
