In questa pagina

QAndroidService Class

Racchiude i metodi più importanti della classe Service di Android. Altro...

Intestazione: #include <QtCore/private/qandroidextras_p.h>
CMake: find_package(Qt6 REQUIRED COMPONENTS CorePrivate)
target_link_libraries(mytarget PRIVATE Qt6::CorePrivate)
qmake: QT += core-private
A partire da: Qt 6.2
Eredita da: QCoreApplication
Stato: Anteprima tecnologica

Questa classe è in anteprima tecnologica ed è soggetta a modifiche.

Funzioni pubbliche

QAndroidService(int &argc, char **argv)
QAndroidService(int &argc, char **argv, const std::function<QAndroidBinder *(const QAndroidIntent &)> &binder)
virtual QAndroidBinder *onBind(const QAndroidIntent &intent)

Descrizione dettagliata

QAndroidService è una classe di utilità che racchiude i metodi più importanti del servizio Android.

Documentazione delle funzioni membro

QAndroidService::QAndroidService(int &argc, char **argv)

Crea un nuovo servizio Android, passando come parametri argc e argv.

Vedi anche QCoreApplication.

QAndroidService::QAndroidService(int &argc, char **argv, const std::function<QAndroidBinder *(const QAndroidIntent &)> &binder)

Crea un nuovo servizio Android, passando come parametri argc e argv.

binder Viene utilizzato per creare un binder quando necessario.

Vedi anche QCoreApplication.

[virtual] QAndroidBinder *QAndroidService::onBind(const QAndroidIntent &intent)

L'utente deve sovrascrivere questo metodo e restituire un binder.

Il parametro ` intent ` contiene tutte le informazioni relative al chiamante.

Il binder restituito viene utilizzato dal chiamante per eseguire chiamate IPC.

Attenzione: questo metodo viene chiamato dal thread di Binder, che è diverso dal thread in cui è stato creato questo oggetto.

Vedi anche QAndroidBinder::onTransact e QAndroidBinder::transact.

© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.