iOS: Work around a11y crash in TableView

This commit is contained in:
Robert Griebl
2024-12-26 23:03:30 +01:00
parent 90acb23e17
commit 6c35ef6c47
+9
View File
@@ -33,6 +33,9 @@ static struct DisableA11YOnAndroid // clazy:exclude=non-pod-global-static
qputenv("QT_ANDROID_DISABLE_ACCESSIBILITY", "1");
}
} disableA11YOnAndroid;
#elif defined(Q_OS_IOS)
# include <QtGui/QAccessible>
#endif
@@ -61,6 +64,12 @@ MobileApplication::MobileApplication(int &argc, char **argv)
{}, qApp));
}
#endif
#if defined(Q_OS_IOS)
// QML's TableView crashes when empty, if a11y features are enabled
// (e.g. "Full Keyboard Access" in the simulator)
QAccessible::installUpdateHandler([](QAccessibleEvent *) { });
QAccessible::installRootObjectHandler([](QObject *) { });
#endif
}
void MobileApplication::init()