10 changed files with 189 additions and 5 deletions
			
			
		@ -0,0 +1,72 @@ | 
				
			|||
/*! | 
				
			|||
@class QtMvvm::DataSyncSettingsAccessor | 
				
			|||
 | 
				
			|||
The data is stored by using the DataSyncSettingsEntry class to wrap the key value pairs into a | 
				
			|||
serializable datatype. | 
				
			|||
 | 
				
			|||
@sa DataSyncSettingsEntry | 
				
			|||
*/ | 
				
			|||
 | 
				
			|||
 | 
				
			|||
 | 
				
			|||
/*! | 
				
			|||
@class QtMvvm::DataSyncSettingsEntry | 
				
			|||
 | 
				
			|||
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. | 
				
			|||
 | 
				
			|||
@sa DataSyncSettingsAccessor | 
				
			|||
*/ | 
				
			|||
 | 
				
			|||
/*! | 
				
			|||
@property QtMvvm::DataSyncSettingsEntry::key | 
				
			|||
 | 
				
			|||
@default{<i>empty</i>} | 
				
			|||
 | 
				
			|||
The key is simply the settings key used to identify the entry. Thus, it is set as the user | 
				
			|||
property. | 
				
			|||
 | 
				
			|||
@accessors{ | 
				
			|||
	@readAc{key()} | 
				
			|||
	@writeAc{setKey()} | 
				
			|||
	@userAc{`true`} | 
				
			|||
} | 
				
			|||
 | 
				
			|||
@sa DataSyncSettingsEntry::variantValue | 
				
			|||
*/ | 
				
			|||
 | 
				
			|||
/*! | 
				
			|||
@property QtMvvm::DataSyncSettingsEntry::dataVersion | 
				
			|||
 | 
				
			|||
@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{ | 
				
			|||
	@readAc{dataVersion()} | 
				
			|||
	@writeAc{setDataVersion()} | 
				
			|||
} | 
				
			|||
 | 
				
			|||
@sa DataSyncSettingsEntry::value | 
				
			|||
*/ | 
				
			|||
 | 
				
			|||
/*! | 
				
			|||
@property QtMvvm::DataSyncSettingsEntry::value | 
				
			|||
 | 
				
			|||
@default{<i>invalid</i>} | 
				
			|||
 | 
				
			|||
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{ | 
				
			|||
	@readAc{value()} | 
				
			|||
	@writeAc{setValue()} | 
				
			|||
	@storedAc{`false`} | 
				
			|||
} | 
				
			|||
 | 
				
			|||
@sa DataSyncSettingsEntry::valueData | 
				
			|||
*/ | 
				
			|||
@ -0,0 +1,76 @@ | 
				
			|||
/*! | 
				
			|||
@var QtMvvm::DataSyncSettingsViewModel::paramSetup | 
				
			|||
 | 
				
			|||
<b>Value:</b> `"setup"` | 
				
			|||
 | 
				
			|||
@sa DataSyncSettingsViewModel::showParams | 
				
			|||
*/ | 
				
			|||
 | 
				
			|||
/*! | 
				
			|||
@var QtMvvm::DataSyncSettingsViewModel::paramDataStore | 
				
			|||
 | 
				
			|||
<b>Value:</b> `"dataStore"` | 
				
			|||
 | 
				
			|||
@sa DataSyncSettingsViewModel::showParams | 
				
			|||
*/ | 
				
			|||
 | 
				
			|||
/*! | 
				
			|||
@var QtMvvm::DataSyncSettingsViewModel::paramDataTypeStore | 
				
			|||
 | 
				
			|||
<b>Value:</b> `"dataTypeStore"` | 
				
			|||
 | 
				
			|||
@sa DataSyncSettingsViewModel::showParams | 
				
			|||
*/ | 
				
			|||
 | 
				
			|||
/*! | 
				
			|||
@fn QtMvvm::DataSyncSettingsViewModel::showParams(const QString &, const QString &) | 
				
			|||
 | 
				
			|||
@param setup The name of the QtDataSync::Setup to be passed to the internally used | 
				
			|||
DataSyncSettingsAccessor | 
				
			|||
@param setupFile The path to a file to be used to create the settings. Can be empty to use the | 
				
			|||
default path | 
				
			|||
@return A paramater hash to be passed to ViewModel::show | 
				
			|||
 | 
				
			|||
It's a shortcut to generate parameters for the show methods to show a settings viewmodel. | 
				
			|||
 | 
				
			|||
@note Unless you need to explicitly set the settings or setup file a normal show without any | 
				
			|||
parameters will just do fine. | 
				
			|||
 | 
				
			|||
@sa ViewModel::show, DataSyncSettingsViewModel::paramSetup, SettingsViewModel::paramSetupFile, | 
				
			|||
DataSyncSettingsAccessor | 
				
			|||
*/ | 
				
			|||
 | 
				
			|||
/*! | 
				
			|||
@fn QtMvvm::DataSyncSettingsViewModel::showParams(QtDataSync::DataStore*, const QString &) | 
				
			|||
 | 
				
			|||
@param dataStore The store to be passed to the internally used DataSyncSettingsAccessor | 
				
			|||
@param setupFile The path to a file to be used to create the settings. Can be empty to use the | 
				
			|||
default path | 
				
			|||
@return A paramater hash to be passed to ViewModel::show | 
				
			|||
 | 
				
			|||
It's a shortcut to generate parameters for the show methods to show a settings viewmodel. | 
				
			|||
 | 
				
			|||
@note Unless you need to explicitly set the settings or setup file a normal show without any | 
				
			|||
parameters will just do fine. | 
				
			|||
 | 
				
			|||
@sa ViewModel::show, DataSyncSettingsViewModel::paramDataStore, | 
				
			|||
SettingsViewModel::paramSetupFile, DataSyncSettingsAccessor | 
				
			|||
*/ | 
				
			|||
 | 
				
			|||
/*! | 
				
			|||
@fn QtMvvm::DataSyncSettingsViewModel::showParams(QtDataSync::DataTypeStore<DataSyncSettingsEntry>*, const QString &) | 
				
			|||
 | 
				
			|||
@param dataStore The store to be passed to the internally used DataSyncSettingsAccessor | 
				
			|||
@param setupFile The path to a file to be used to create the settings. Can be empty to use the | 
				
			|||
default path | 
				
			|||
@return A paramater hash to be passed to ViewModel::show | 
				
			|||
 | 
				
			|||
It's a shortcut to generate parameters for the show methods to show a settings viewmodel. | 
				
			|||
 | 
				
			|||
@note Unless you need to explicitly set the settings or setup file a normal show without any | 
				
			|||
parameters will just do fine. | 
				
			|||
 | 
				
			|||
@sa ViewModel::show, DataSyncSettingsViewModel::paramDataTypeStore, | 
				
			|||
SettingsViewModel::paramSetupFile, DataSyncSettingsAccessor | 
				
			|||
*/ | 
				
			|||
 | 
				
			|||
					Loading…
					
					
				
		Reference in new issue