I inherited a class from QObject :
class Parent: public QObject
{
Q_OBJECT
QObject* cl;
public:
Parent(QObject *parent=0):QObject(parent) {
My problem was that one of my files that used a Qt macro didn't get moc'ed. I found out, that the Qt Plugin for Visual Studio doesn't recognize the Q_NAMESPACE macro and therefore doesn't add the file to the moc'ing list.
So I used the solution from this answer to add the file to the mic'ing list:
You should find a .h file which has successfully generated "moc_*", and copy all the contents in "Custom Build Tool -> General" to the new .h file setting page.
Be careful with the different options for Debug and Release-Mode.
After that, build your project.
Build it once each in Debug and Release-Mode
Finally, add the generated "moc_*" file to your project.
Now, "moc_filename.cpp" should be in Generated Files\Debug and Generated Files\Release.
Right click on each of them and change thair properties:
Debug: Change configuration to Release and then change General->Excluded from build to yes.Release: Change configuration to Debug and then change General->Excluded from build to yes.