1 #include "nmpropertyhelper.h"
3 NMPropertyHelper::NMPropertyHelper(QObject
*master
) : mMaster(master
)
7 NMPropertyHelper::~NMPropertyHelper()
11 void NMPropertyHelper::registerProperty(const QString
& nmPropertyName
, QPair
<char*, char*> propSpec
)
13 mRegisteredProperties
.insert(nmPropertyName
, propSpec
);
16 void NMPropertyHelper::deserializeProperties(const QVariantMap
& propertiesMap
)
18 QMapIterator
<QString
,QVariant
> i(propertiesMap
);
21 if (mRegisteredProperties
.contains(i
.key())) {
22 QPair
<char*,char*> spec
= mRegisteredProperties
[i
.key()];
23 mMaster
->setProperty(spec
.first
, i
.value());
24 //spec.deserializer->deserialize( spec.propertyName, i.value(), mMaster);
25 // emit signal if one was registered
26 if ( spec
.second
!= 0 )
27 QMetaObject::invokeMethod( mMaster
, spec
.second
);
32 NMPropertyDeserializer::~NMPropertyDeserializer()
36 void GenericDeserializer::deserialize(const QString
& propertyName
, const QVariant
& value
, QObject
* recipient
)
39 recipient->setProperty(propertyName, value);
40 QMetaObject::invokeMethod(recipient, signalName);
41 emit recipient->propertyChanged(propertyName);*/