1 // class that can extract values out of a properties map into a QObject's properties
3 #ifndef NM07_PROPERTY_HELPER_H
4 #define NM07_PROPERTY_HELPER_H
8 #include "generic-types.h"
10 class NMPropertyDeserializer
13 virtual ~NMPropertyDeserializer();
14 virtual void deserialize(const QString
& propertyName
, const QVariant
& value
, QObject
* recipient
) = 0;
17 // deserializer for extracting a plain qvariant
18 struct GenericDeserializer
: public NMPropertyDeserializer
21 virtual void deserialize(const QString
& propertyName
, const QVariant
& value
, QObject
* recipient
);
24 typedef QPair
<char*, char*> PropertySignalPair
;
33 class NMPropertyHelper
37 NMPropertyHelper(QObject
* master
);
39 void registerProperty(const QString
&nmPropertyName
, QPair
<char*,char*> spec
);
40 void deserializeProperties(const QVariantMap
&);
43 QMap
<QString
, QPair
<char*,char*> > mRegisteredProperties
;
46 class FrobObject : public QObject
49 Q_PROPERTY(QString frobozz READ frobozz WRITE setFrobozz)
53 QString frobozz() const;
54 void setFrobozz(const QString& frob);
56 void frobozzChanged();