QRemoteObjectAbstractPersistedStore 類

提供用於將復製 PROP 值設為最後一次使用復製時的值的方法的類。 更多...

頭: #include <QRemoteObjectAbstractPersistedStore>
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

詳細描述

This can be used to provide a "reasonable" value to be displayed until the connection to the source is established and current values are available.

This class must be overridden to provide an implementation for saving ( QRemoteObjectAbstractPersistedStore::saveProperties ) and restoring ( QRemoteObjectAbstractPersistedStore::restoreProperties ) PROP values. The derived type can then be set for a node, and any replica acquired from that node will then automatically store PERSISTED properties when the replica destructor is called, and retrieve the values when the replica is instantiated.

成員函數文檔編製

QRemoteObjectAbstractPersistedStore:: QRemoteObjectAbstractPersistedStore ( QObject * parent = nullptr)

構造 QRemoteObjectAbstractPersistedStore 采用給定 parent 。默認值對於 parent is nullptr .

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

This method will be provided the replica class's repName and repSig when the replica is being initialized. It is the responsibility of the inheriting class to get the last values persisted by QRemoteObjectAbstractPersistedStore::saveProperties and return them. An empty QVariantList should be returned if no values are available.

另請參閱 QRemoteObjectAbstractPersistedStore::saveProperties .

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

This method will be provided the replica class's repName , repSig and the list of values that PERSISTED properties have when the replica destructor was called. It is the responsibility of the inheriting class to store the information in a manner consistent for QRemoteObjectAbstractPersistedStore::restoreProperties to retrieve.

另請參閱 QRemoteObjectAbstractPersistedStore::restoreProperties .