Parent
QObject
的用户自制子类是否可以有多个同名的Q_PROPERTY
(可能有不同的类型)?如果我将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;
};