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

How to put / insert copy of another ui form to MainWindow form?



  • Can I get an example of this ?
    (reference woudl be nice )
    All using QtCreator / QtDesigner - no code.

    Build MainWindow form - mainwindow.ui
    That is a standard QtCreator new form / template option.
    No issues.
    build another form - plain QWidget as an example
    again standard QtCreator build new "Form" option
    No issues.

    Now add "Form" as part of "MainWindow" form - graphically - no code .


  • Lifetime Qt Champion

    Hi
    For that you can use Promotion.
    https://doc.qt.io/qt-5/designer-using-custom-widgets.html

    You would insert a plain widget into mainwindow
    then right click and choose promote
    then tell the dialog the real classname and which .h file where it could be found.
    Then Creator will use that type (your class) instead and when run you will see the other class in place on the plain QWidget.


Log in to reply