1
#include <QtCore/QObject>
2
#include <QtCore/QString>
3
#include "nmpropertyhelper.h"
7
FrobObject::FrobObject() : QObject(0)
10
FrobObject::~FrobObject()
14
QString FrobObject::frobozz() const
19
void FrobObject::setFrobozz(const QString& frob)
24
int main(int argc, char**argv)
27
NMPropertyHelper hlp(&obj);
29
QPair<char*,char*> spec;
30
spec.first = "frobozz";
31
spec.second = "frobozzChanged";
32
hlp.registerProperty("frobozz", spec);
33
hlp.registerProperty("othername", QPair<char*,char*>("myname", 0));
36
map.insert(QString("frobozz"), QVariant(42.0));
37
map.insert(QString("othername"), QVariant("pas"));
38
hlp.deserializeProperties(map);
40
qDebug() << "map keys: " << map.keys();
41
qDebug() << "qobj frobozz property (names match): " << obj.property("frobozz");
42
qDebug() << "qobj myname property (mapped from othername): " << obj.property("myname");