QRemoteObjectAbstractPersistedStore Class

レプリカの PROP 値を、レプリカが最後に使用された時の値に設定するメソッドを提供するクラスです。さらに...

ヘッダ #include <QRemoteObjectAbstractPersistedStore>
CMake: find_package(Qt6 REQUIRED COMPONENTS RemoteObjects)
target_link_libraries(mytarget PRIVATE Qt6::RemoteObjects)
qmake: QT += remoteobjects
継承: QObject

パブリック関数

QRemoteObjectAbstractPersistedStore(QObject *parent = nullptr)
virtual QVariantList restoreProperties(const QString &repName, const QByteArray &repSig) = 0
virtual void saveProperties(const QString &repName, const QByteArray &repSig, const QVariantList &values) = 0

詳細説明

これは、ソースへの接続が確立され、現在の値が利用可能になるまで表示される「妥当な」値を提供するために使用することができます。

PROP 値を保存 (QRemoteObjectAbstractPersistedStore::saveProperties) および復元 (QRemoteObjectAbstractPersistedStore::restoreProperties) するための実装を提供するために、このクラスをオーバーライドする必要があります。そのノードから取得したレプリカは、レプリカのデストラクタが呼び出されると自動的に PERSISTED プロパティを保存し、レプリカがインスタンス化されるとその値を取得します。

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

QRemoteObjectAbstractPersistedStore::QRemoteObjectAbstractPersistedStore(QObject *parent = nullptr)

与えられたparent で QRemoteObjectAbstractPersistedStore を構築する。parent のデフォルト値はnullptr です。

[pure virtual] QVariantList QRemoteObjectAbstractPersistedStore::restoreProperties(const QString &repName, const QByteArray &repSig)

このメソッドは、レプリカが初期化される際に、レプリカクラスのrepNamerepSig に提供されます。QRemoteObjectAbstractPersistedStore::saveProperties によって最後に永続化された値を取得し、それを返すことは継承するクラスの責任です。利用可能な値がない場合は、空のQVariantList が返されるべきです。

QRemoteObjectAbstractPersistedStore::savePropertiesも参照してください

[pure virtual] void QRemoteObjectAbstractPersistedStore::saveProperties(const QString &repName, const QByteArray &repSig, const QVariantList &values)

このメソッドには、レプリカデストラクタが呼ばれた時に、レプリカクラスのrepNamerepSig 、PERSISTEDプロパティが持つvalues のリストが提供されます。この情報をQRemoteObjectAbstractPersistedStore::restoreProperties が取得できるように格納することは、継承するクラスの責任です。

QRemoteObjectAbstractPersistedStore::restorePropertiesも参照してください

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