A class used with the DataSyncSettingsAccessor to store and sync generic settings. More...
#include <datasyncsettingsentry.h>
Public Member Functions | |
DataSyncSettingsEntry (const DataSyncSettingsEntry &other) | |
Copy constructor. | |
DataSyncSettingsEntry (DataSyncSettingsEntry &&other) noexcept | |
Move constructor. | |
DataSyncSettingsEntry & | operator= (const DataSyncSettingsEntry &other) |
Copy assignment operator. | |
DataSyncSettingsEntry & | operator= (DataSyncSettingsEntry &&other) noexcept |
Move assignment operator. | |
DataSyncSettingsEntry (QString key, QVariant value) | |
Constructor, takes a key and value. | |
template<typename T > | |
DataSyncSettingsEntry (QString key, const T &value) | |
Constructor, takes a key and value. | |
QString | key () const |
READ accessor for key. | |
int | dataVersion () const |
READ accessor for dataVersion. | |
QVariant | value () const |
READ accessor for variantValue. | |
template<typename T > | |
T | value () const |
READ accessor for variantValue. | |
void | setKey (QString key) |
WRITE accessor for key. | |
void | setDataVersion (int dataVersion) |
WRITE accessor for dataVersion. | |
void | setValue (QVariant value) |
WRITE accessor for variantValue. | |
Properties | |
QString | key |
They key of the entry stored. More... | |
int | dataVersion |
The QDataStream::Version that was used to serialize the entry. More... | |
QVariant | value |
The raw (deserialized) value stored. More... | |
QByteArray | valueData |
Internal property. | |
A class used with the DataSyncSettingsAccessor to store and sync generic settings.
In order to be consistend with other settings implementations and the requirements of ISettingsAccessor, the actual value stored in this class is serialized not via the json serializer, but using QDataStream. The resulting binary data is stored as the valueData property in base64 format. When loaded, you can access the data in the QVariant format using the DataSyncSettingsEntry::value property.
Definition at line 14 of file datasyncsettingsentry.h.
|
readwrite |
The QDataStream::Version that was used to serialize the entry.
Default: QDataStream::Qt_DefaultCompiledVersion
The version is needed to identify the format used for the serialization to be able to properly deserialize the data again. It is used internally to set up the internal QDataStream
Accessors | |
---|---|
READ | dataVersion() |
WRITE | setDataVersion() |
Definition at line 21 of file datasyncsettingsentry.h.
|
readwrite |
They key of the entry stored.
Default: empty
The key is simply the settings key used to identify the entry. Thus, it is set as the user property.
Accessors | |
---|---|
READ | key() |
WRITE | setKey() |
USER | true |
Definition at line 19 of file datasyncsettingsentry.h.
|
readwrite |
The raw (deserialized) value stored.
Default: invalid
The data of the entry. This property does not get stored directly, but instead gets serialized to a QByteArray and then stored via the internal valueData property.
Accessors | |
---|---|
READ | value() |
WRITE | setValue() |
STORED | false |
Definition at line 23 of file datasyncsettingsentry.h.