Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Call for Presentations - Qt World Summit

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

    General and Desktop
    2
    2
    419
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • A
      AnneRanch last edited by

      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 .

      1 Reply Last reply Reply Quote 0
      • mrjj
        mrjj Lifetime Qt Champion last edited by

        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.

        1 Reply Last reply Reply Quote 1
        • First post
          Last post