add more spacing
[personal-kdebase.git] / workspace / solid / networkmanager-0.7 / nmpropertytest.cpp
bloba4be5449e4e07e61dc68c22a207c37b05039d431
1 #include <QtCore/QObject>
2 #include <QtCore/QString>
3 #include "nmpropertyhelper.h"
5 #include <QDebug>
7 FrobObject::FrobObject() : QObject(0)
10 FrobObject::~FrobObject()
14 QString FrobObject::frobozz() const
16 return mFrobozz;
19 void FrobObject::setFrobozz(const QString& frob)
21 mFrobozz = frob;
24 int main(int argc, char**argv)
26 FrobObject obj;
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));
35 QVariantMap map;
36 map.insert(QString("frobozz"), QVariant(42.0));
37 map.insert(QString("othername"), QVariant("pas"));
38 hlp.deserializeProperties(map);
39 qDebug("Hello mom");
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");
43 return 0;