Moc not invoked
If I declare a class in a cpp file -
class NewTest : public QObject
The moc compiler is not invoked
However, if I declare a constructor for NewTest it is
Can anyone explain why this is?
I am writing some unit tests and do not need the constructor.
Once the moc has been invoked I can remove the constructor and then everything works as expected
Qt Objects needs a constructor where you declare a parent object;
Anyway I suggest to follow the rules:
[C++] Declare classes in .H files
[Qt] If you inherits from QObject and want use Q_OBJECT macro, declare at least a constructor that accept a QObject*
If you're writing QTestLib unit tests, your code is correct but you missed to insert
before include moc file