一个用户自定义的子类可以Parent
有QObject
多个Q_PROPERTY
同名的s(可能有不同的类型)吗?如果我子类化为,并给Parent
它一个类似的名称呢?像这样:Child
Q_PROPERTY
#include <QObject>
class Parent : public QObject {
Q_OBJECT
Q_PROPERTY(int something MEMBER m_something)
Q_PROPERTY(double something MEMBER m_somethingElse)
Q_PROPERTY(QString third MEMBER m_third)
int m_something;
double m_somethingElse;
QString m_third;
};
class Child : public Parent {
Q_OBJECT
Q_PROPERTY(QString third MEMBER m_fourth)
QString m_fourth;
};