I have a question - how to connect base class signal to inherited class slot. I`ve got a code like this
class A: public QObject
{
Q_OBJECT
public:
A(){}
void EmitSignal()
{
emit(Asignal());
}
signals:
void Asignal();
};
class B: public A
{
public:
B();
public slots:
void Bslot()
{
//dosmth
}
};
B::B()
{
connect(this, SIGNAL(Asignal()), this, SLOT(Bslot()));
}
int main(int argc, char *argv[])
{
B Bobject;
B.EmitSignal();
}
and when I call B.EmitSignal()
I suppose to have Bslot()
called, but I got a message in output window
QObject::connect: No such slot A::Bslot().
How can I achieve Bslot()
execution?