lni
4th January 2013, 07:49
Hi,
My class is not derived from QObject, how can I still use Q_PROPERTY macro? I did the following:
class MyClass
{
Q_GADGET
Q_PROPERTY( ...... )
};
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!
My class is not derived from QObject, how can I still use Q_PROPERTY macro? I did the following:
class MyClass
{
Q_GADGET
Q_PROPERTY( ...... )
};
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!