QtMvvm  1.1.0
A mvvm oriented library for Qt, to create Projects for Widgets and Quick in parallel
Public Member Functions | Properties | List of all members
QtMvvm::DataSyncSettingsEntry Class Reference

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.
 
DataSyncSettingsEntryoperator= (const DataSyncSettingsEntry &other)
 Copy assignment operator.
 
DataSyncSettingsEntryoperator= (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 >
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.
 

Detailed Description

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.

See also
DataSyncSettingsAccessor

Definition at line 14 of file datasyncsettingsentry.h.

Property Documentation

◆ dataVersion

QtMvvm::DataSyncSettingsEntry::dataVersion
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
READdataVersion()
WRITEsetDataVersion()
See also
DataSyncSettingsEntry::value

Definition at line 21 of file datasyncsettingsentry.h.

◆ key

QtMvvm::DataSyncSettingsEntry::key
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
READkey()
WRITEsetKey()
USERtrue
See also
DataSyncSettingsEntry::variantValue

Definition at line 19 of file datasyncsettingsentry.h.

◆ value

QtMvvm::DataSyncSettingsEntry::value
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
READvalue()
WRITEsetValue()
STOREDfalse
See also
DataSyncSettingsEntry::valueData

Definition at line 23 of file datasyncsettingsentry.h.


The documentation for this class was generated from the following files: