Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

What does Moc.exe do?



  • Folks,
    This might be a beginner question but I tried searching the forum and the web for a formal explanation of what Moc.exe does and I couldnt find any information. From what I gather, Moc.exe is used to generate Meta Object Code from header files that define any classes derived from QT objects. That is, if I derive my own class from QTMainWindow or any other such class, moc.exe needs to generate cpp code that is required.
    Questions I have are.

    1. Is my understanding correct that moc.exe is only needed for classes that are derived from QT objects?
    2. What about classes that reference QT objects and dont derive from them?
    3. What is the role of the meta object code that moc.exe generates?
    4. Can anyone provide a link to more information on Moc.exe ?

    Thanks in Advance..



  • Did you find "this docs page?":http://developer.qt.nokia.com/doc/qt-4.7/moc.html



  • I cant believe I couldnt find that page.. Thank you !!


Log in to reply