+QVariantMap SyncableObject::toVariantMap()
+{
+ QVariantMap properties;
+
+ const QMetaObject *meta = metaObject();
+
+ // we collect data from properties
+ QMetaProperty prop;
+ QString propName;
+ for (int i = 0; i < meta->propertyCount(); i++) {
+ prop = meta->property(i);
+ propName = QString(prop.name());
+ if (propName == "objectName")
+ continue;
+ properties[propName] = prop.read(this);
+ }
+
+ // ...as well as methods, which have names starting with "init"
+ for (int i = 0; i < meta->methodCount(); i++) {
+ QMetaMethod method = meta->method(i);
+ QString methodname(SignalProxy::ExtendedMetaObject::methodName(method));
+ if (!methodname.startsWith("init") || methodname.startsWith("initSet") || methodname.startsWith("initDone"))
+ continue;