Where is ui_mainwindow.h in Qt designer



  • Hello,

    It seems that not all generated file are part of project files which are viewed with designer.
    , for example: ui_mainwindow.h .
    Is there any way to add these files , or is it on purpose ?

    Thank you,
    Ran


  • Qt Champions 2017

    It's a generated file, and as such it's not shown in Creator. As for the Designer it has no ability to open C++ source files, only it's own .ui XML format.


  • Qt Champions 2017

    Hi
    The ui_xxx files are generated by the uic.exe tool
    by reading UI files. they are not included into the project file but
    referenced from the cpp file. Like
    #include "ui_MainWindow.h"

    This is as intended. You should have no need to add or alter them.



  • ohh ok so behind the scenes QT is creating this header and UI object for us?


  • Qt Champions 2017

    @adamchalkley2018 said in Where is ui_mainwindow.h in Qt designer:

    ohh ok so behind the scenes QT is creating this header and UI object for us?

    The .ui file is generated by a wizard (it's a template) and can be edited later with QtDesigner (also integrated in QtCreator).

    From the .ui file a ui_object.h file is generated by uic and later compiled by the C++ compiler and linked to your executable.

    Hope that explains it a bit :)


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.