It is known that an inherited signal cannot be used as a Q_PROPERTY
NOTIFY
er (https://bugreports.qt.io/browse/QTBUG-7684). As a workaround I'm using an extra signal in the derived class that gets fired when the base signal gets fired. The base class:
class Base : public QObject {
Q_OBJECT
signals:
void mySignal();
};
For the derived class:
class Derived : public Base {
Q_OBJECT
Q_PROPERTY(int myPropery READ getMyProperty NOTIFY mySignal_inherited)
public:
Derived(){
connect(this, SIGNAL(mySignal()), this, SIGNAL(mySignal_inherited()));
}
int getMyProperty(){ return myProperty; }
signals:
void mySignal_inherited(); ///< DO NOT USE EXPLICITLY
private:
int myProperty;
};
Is there a better/more elegant solution to do this?