I want to have a simple ui loader and the posibility to connect signals from ui to slots stored in MyClass. (wrun)

For example, I would can connect them with this code .
Qt Code:
  1. QList<QPushButton *> pbto = formWidget->findChildren<QPushButton *>();
  2. for (int i=0;i<pbto.count();i++)
  3. {
  4. connect(pbto.at(i), SIGNAL(clicked()), this, SLOT(button_click));
  5. }
To copy to clipboard, switch view to plain text mode 

To do this :
1.- I have to use Q_Object macro
2.- I have to subclass Qobject

When I compile I have get errors : 'undefined reference to `vtable for wrun' ' at the lines (in cpp) where is placed :
wrun.cpp:11: undefined reference to `vtable for wrun'
wrun.cpp:11: undefined reference to `vtable for wrun'
debug/wrun.o: In function `~wrun':
wrun.cpp:13: undefined reference to `vtable for wrun'
wrun.cpp:13: undefined reference to `vtable for wrun'
wrun.cpp:13: undefined reference to `vtable for wrun'

Can anyone help me ?

wrun.h
Qt Code:
  1. class wrun : public QObject
  2. {
  3. Q_OBJECT
  4.  
  5. public:
  6. wrun();
  7. ~wrun();
  8. ....
To copy to clipboard, switch view to plain text mode 

wrun.cpp
Qt Code:
  1. #include "wrun.h"
  2. #include <QUiLoader>
  3.  
  4. wrun::wrun(){}
  5.  
  6. wrun::~wrun(){}
  7. ....
To copy to clipboard, switch view to plain text mode 




Any idea ?