このページでは

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)

このメソッドには、レプリカが初期化される際に、レプリカクラスのrepName およびrepSig が渡されます。QRemoteObjectAbstractPersistedStore::saveProperties によって永続化された最新の値を取得し、それらを返すのは、継承クラスの責任です。利用可能な値がない場合は、空のQVariantList を返す必要があります。

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

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

このメソッドには、レプリカクラスのrepName 、repSig 、およびレプリカのデストラクタが呼び出された時点でPERSISTEDプロパティが持つvalues のリストが渡されます。QRemoteObjectAbstractPersistedStore::restoreProperties が取得できるように、一貫性のある方法で情報を保存するのは、継承クラスの責任です。

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

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