To make it work you have to add Q_OBJECT macro like this:
Qt Code:
  1. class mojClass : public QWidget
  2. {
  3. Q_OBJECT
  4. public:
  5. ...
To copy to clipboard, switch view to plain text mode 
Each class that defines new slots or signals must contain Q_OBJECT macro. Also remember to rerun qmake if you add that macro somewhere.

If you have placed everything in a single file, say somefile.cpp, you have to add #include "somefile.moc" at the end and rerun qmake. This isn't necessary if you have placed class definition in a header file.