このページでは

QAndroidServiceConnection Class

AndroidのServiceConnectionクラスの最も重要なメソッドをラップしています。詳細...

ヘッダー: #include <QtCore/private/qandroidextras_p.h>
CMake: find_package(Qt6 REQUIRED COMPONENTS CorePrivate)
target_link_libraries(mytarget PRIVATE Qt6::CorePrivate)
qmake: QT += core-private
以下のように: Qt 6.2
ステータス: テクノロジープレビュー

このクラスはテクノロジープレビュー段階にあり、変更される可能性があります。

パブリック関数

QAndroidServiceConnection()
QAndroidServiceConnection(const QJniObject &serviceConnection)
QJniObject handle() const
virtual void onServiceConnected(const QString &name, const QAndroidBinder &serviceBinder) = 0
virtual void onServiceDisconnected(const QString &name) = 0

詳細な説明

QAndroidServiceConnection は、AndroidServiceConnectionインターフェースをラップする、利便性を高めるための抽象クラスです。

QtAndroidPrivate::bindService 操作を実行する際に役立ちます。

メンバ関数のドキュメント

QAndroidServiceConnection::QAndroidServiceConnection()

新しいオブジェクトを作成します

[explicit] QAndroidServiceConnection::QAndroidServiceConnection(const QJniObject &serviceConnection)

既存のserviceConnection から新しいオブジェクトを作成します。

独自のJava実装がある場合に便利です。もちろん、onServiceConnected() やonServiceDisconnected() は呼び出されなくなります。

QJniObject QAndroidServiceConnection::handle() const

下線を返すQJniObject

[pure virtual] void QAndroidServiceConnection::onServiceConnected(const QString &name, const QAndroidBinder &serviceBinder)

この通知は、クライアントがサービスへの接続に成功した際に呼び出されます。name にはサーバー名が含まれており、serviceBinder はクライアントがIPC操作を実行するために使用するバインダーです。

警告:この メソッドは、このオブジェクトが作成されたスレッドとは異なる、Binderのスレッドから呼び出されます。

アンダラインを返しますQJniObject

[pure virtual] void QAndroidServiceConnection::onServiceDisconnected(const QString &name)

サービスへの接続が切断されたときに呼び出されます。name パラメータは、どの接続が切断されたかを指定します。

警告:この メソッドは、このオブジェクトが作成されたスレッドとは異なる、Binderのスレッドから呼び出されます。

アンダーラインを返します。QJniObject

© 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.