Hi,

My class is not derived from QObject, how can I still use Q_PROPERTY macro? I did the following:

Qt Code:
  1. class MyClass
  2. {
  3. Q_GADGET
  4. Q_PROPERTY( ...... )
  5.  
  6. };
To copy to clipboard, switch view to plain text mode 

The moc system recognizes Q_GADGET tag and generates staticMetaObject, as well as those property names registered with Q_PROPERTY, but I can't use the QMetaProperty::read method to read the property value, as it expects QObject. Is there a way to work around (without sub-class from QObject)?

Thanks!