Your problem is that moc
is not being run on your files, or its result is not getting linked.
The golden rules are:
- Make sure the
Q_OBJECT
macro is present in the definition of allQObject
-derived classes. - Make sure you declare your
QObject
-derived classes in your header files only. - Make sure all of your header files are listed in your .pro file in the
HEADERS=
list. - Run
qmake
every time you addQ_OBJECT
to one of your classes or modify your.pro
file.
Addendum:
signals:
void ton() {};
Do not implement a signal. moc
will implement it for you.