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

How to see MOC and UI generatd C++ code?



  • Hi! Now I am working on my first Qt project in Qt Creator. I use Qt Designer to make UI. Now I am a little bit confused about the way how MOC, Qt Designer and my C++ code are interacting with each other. So I want to see C++ code generated by UIC and MOC for better understandig, what really go on behinde the scene. So the question is how I can see these source files?



  • You can simply open those files with your favourite text editor and get a look...


  • Lifetime Qt Champion

    They are located in the build folder. for say mainwindow, there will be a ui_mainwindow.h



  • Thanks, I just should have checked build folder :)


  • Lifetime Qt Champion

    @Harb
    Well I assumed it would be something secret hiding away in dark corner of the toolchain until someday
    i stumbled upon the ui_* files.
    Its a great way to learn how to hook things up from code.
    And since its just normal c++ and objects, you can mix both UI files and
    code setup.


Log in to reply