PDA

View Full Version : No such slot in subclass?



codemonkey
14th January 2010, 15:12
This is a cry for general help in finding what I've done wrong.

I have a


class A:public QSomeClass
{
public:
dostuff();
public slots:
void foo();
}

and in dostuff() I have the line:

connect(this,SIGNAL(some_signal_from_base_class),t his,SLOT(foo()));

but it reports:


Object::connect: No such slot QSomeClass::foo()

Why does it not detect the slot in my class?

jpn
14th January 2010, 15:14
You forgot the required Q_OBJECT macro.

codemonkey
14th January 2010, 15:16
Yes, that was it. Thank you.