Generating MOC for new QOBJECT files in visual studio 2010
c++, qt, user-interface, visual-studio-2010
Solution
If your custom classes are not moc'ed automatically, you could have forgotten to add a Q_OBJECT macro in class declarations or to put QObject as the first class that is inherited from in case of multiple inheritance (the order of classes from which your derived class inherits matters). If it's not your case, you may want to read this:
http://truth2.wordpress.com/2010/09/04/custom-build-rules-for-qt-under-visual-studio-2010/
BTW: QT versions have their nuances and thus it is helpful if you inform about which version you use.
Problem
I created a project using qmake and it automatically generated moc files for classes that inherit QObject either directly or indirectly. However, if I add a new class that inherits the QObject the QT plugin doesn't generate MOC files during the build process. What settings should I tweak so that I can do this automatically each time I add a new QObject file?