-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Android: Fix QtAbstractItemModel proxy threading problem
This change sets the thread affinity of the QAndroidItemModelProxy instance to the Qt main thread, enabling its APIs to be called from both the Qt main thread and Android threads. Synchronization between threads is ensured by using the newly introduced QAndroidItemModelProxy::safeCall(), which utilizes QMetaObject::invokeMethod() with the appropriate connection type based on the calling thread. For void functions, Qt::AutoConnection can be used. Functions returning values will either use a Qt::DirectConnection if invoked from the same thread as the QAndroidItemModelProxy instance, or a Qt::BlockingQueuedConnection if called from a different thread. Pick-to: 6.8 6.8.0 Fixes: QTBUG-127701 Change-Id: I214bc43d20d8bdf301fc97920493415d503d26d8 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
- Loading branch information
Showing
2 changed files
with
42 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters