3

Using QMetaObject I am able to browse all properties defined at compile-time using Q_PROPERTY macro...

Now I would be able to browse all dynamic properties added at run-time using setProperty()...

Is it possible?

Morix Dev
  • 2,700
  • 1
  • 28
  • 49

1 Answers1

8

You can get the list of all dynamic properties using QObject::dynamicPropertyNames(). For example:

QList<QByteArray> dynamicProperties = object->dynamicPropertyNames();

To get the property value use the same QObject::property(const char * name ) function:

QVariant val = object->property(name );
vahancho
  • 20,808
  • 3
  • 47
  • 55