Problems with Open-Source Downloads read https://www.qt.io/blog/problem-with-open-source-downloads and https://forum.qt.io/post/638946

Mdi and childe forms



  • Hi.
    I just moved from VS to Qt and have a lot of questions.
    I need to know how create child form that will have the same view and functionality. Those forms just open different files but they are just clones of the same form.
    I use to do like this in VS (VB)
    Public AktivForm As Form //declaration

    AktivForm = New MainForm // create new clone 
    AktivForm.MdiParent = Me
    AktivForm.Text = My.Computer.FileSystem.GetName(File Name)
    AktivForm.Show()  
    

    I already found how create an MDIForm but can't find the information about child forms that I need.
    Thank you



  • for creating a child form . just add a new widget/dialog and make it child of previous form or widget/dialog. If u want to add a form as a MDI form then u have to add a main window first time and then just add a widget . and just make this new widget to child of main window.



  • Thanks it makes sense but how I make dialog child of form. Maybe this is a stupid question but I just started with Qt



  • I add a new form to project mdichild
    and in main.cpp added:

    @QWidget *parent = new QWidget; @
    @ChildForm *mdichild = new mdichild(parent);@

    But I get 2 errors:
    ChildForm undeclared identifier
    mdichild undeclared identifier

    What's wrong?



  • I think I found how to do that
    @void mainwindow::on_pushButton_clicked()@
    @{
    mdichild *w =new mdichild(this);
    w->show();
    }
    @



  • But the problem is that new windows opens outside the parent form. So my solution doesn't work.
    Still need help.


Log in to reply