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

How Qt translates ui to c++ code?



  • I'm trying to find .cpp file which one is used for ui to c++ code translation. Have found QWidgetFactory, but this one is for an older version. So which one Qt uses now?


  • Lifetime Qt Champion

    The code for uic is in qtbase\src\tools\uic



  • The code for translating your project's ui into c++ code is in your project's build directory, initially set to something like build-myProject-Desktop_Qt_5_15_2_* in the directory containing your project. The Form header file, such as, mainwindow.h, widget.h, dialog.h, myForm.h, contains the class definition for your ui Form.



  • @OxiD Christian Ehrlicher mentioned where the source is. But I am curious why you want to know? Is there some underlying problem you are trying to solve? Perhaps someone could give you more useful information if you mentioned why you are trying to dig into uic. It's not something developers generally need to touch.


Log in to reply