Slot in inherited class is not working...
-
I have an inherited class from a base class that is derived from QObject. Can someone tell me why my inherited class slot is not being invoked..
@
class cls_A : public QObject
{
Q_OBJECTprivate:
explicit cls_A(QObject *parent = 0);// etc......
}
class cls_B : public cls_A
{
private:
cls_B()
{
// instantiate Serial Device Enumerator and get available serial ports
m_sde = new SerialDeviceEnumerator(this);
connect(m_sde, SIGNAL(hasChanged(QStringList)), this, SLOT(GetDevices(QStringList)));
m_sde->setEnabled(true);
}private slots:
void GetDevices(const QStringList &list)
{
// do something....
}
//......
}
@I run the application but GetDevices is not being invoked... Does cls_B have to have the Q_OBJECT declaration?
-
Also, if you declare and implement classes in the same file filename, you'll need a
@
#include "filename.moc"
@