summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/android/qandroidplatformaccessibility.h
diff options
context:
space:
mode:
authorIvan Solovev <ivan.solovev@qt.io>2022-02-01 17:17:12 +0100
committerIvan Solovev <ivan.solovev@qt.io>2022-02-09 16:48:26 +0100
commite0c61193ea8f6462192d2ef7f1d48d8fa3e38c99 (patch)
tree3b71787443839c847ddbcab966f57f2d04d23124 /src/plugins/platforms/android/qandroidplatformaccessibility.h
parent6d00aac1092d813446a44fbb234995733233f003 (diff)
Android A11Y: execute C++ code on main Qt thread
The C++ code, which is called from Java, was executed on Java thread. However Qt has its own main GUI thread, where all GUI elements and their accessibility instances are created. As a result we have threading issues when accessing A11Y objects from Java thread. This patch uses QMetaObject::invokeMethod calls to dispatch all the critical parts of the C++ code to the main thread. It uses BlockingQueuedConnection, so that Java thread can still use these methods synchronously. The proper context is based on the m_accessibilityContext object, which is created as a child of the base accessibility QObject of the application (which is the QGuiApplication instance in most cases). Task-number: QTBUG-95764 Pick-to: 6.3 6.2 5.15 Change-Id: Iff4f3f2645657f6aca426fa19ccc86a2cbe4d4d0 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io> Reviewed-by: Jarkko Koivikko <jarkko.koivikko@code-q.fi>
Diffstat (limited to 'src/plugins/platforms/android/qandroidplatformaccessibility.h')
-rw-r--r--src/plugins/platforms/android/qandroidplatformaccessibility.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/plugins/platforms/android/qandroidplatformaccessibility.h b/src/plugins/platforms/android/qandroidplatformaccessibility.h
index 8216c05fa6..df3fe43a04 100644
--- a/src/plugins/platforms/android/qandroidplatformaccessibility.h
+++ b/src/plugins/platforms/android/qandroidplatformaccessibility.h
@@ -52,6 +52,7 @@ public:
~QAndroidPlatformAccessibility();
void notifyAccessibilityUpdate(QAccessibleEvent *event) override;
+ void setRootObject(QObject *obj) override;
};
QT_END_NAMESPACE