Congratulations to our 2022 Qt Champions!

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

    For that you can use Promotion.

    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