On segunda-feira, 5 de agosto de 2013 22:18:43, Chris Meyer wrote:
> I'm understanding more... but there is still something I don't understand.
> Don't the moc_*.cpp files get compiled directly too? How does qmake know
> not to generate Makefile instructions to directly compile the moc_*.cpp
> files that use Q_PRIVATE_SLOT? If it were to compile them directly, it
> would be missing the private headers, which was the error I was seeing.

qmake scans all source files to see what they #include. If a A.cpp has #include 
"B.cpp", then B.cpp is removed from the list of files to compile.

So this is what happens:
 - qmake scans all files in HEADERS for Q_OBJECT
 - those files get moc'ed and the resulting file is added to SOURCES
 - then qmake scans SOURCES again and finds the #include
 - the moc_*.cpp file in question is removed from SOURCES

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center

Attachment: signature.asc
Description: This is a digitally signed message part.

_______________________________________________
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development

Reply via email to