Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Mdi and childe forms
Forum Updated to NodeBB v4.3 + New Features

Mdi and childe forms

Scheduled Pinned Locked Moved General and Desktop
6 Posts 2 Posters 1.7k Views 1 Watching
  • 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.
  • M Offline
    M Offline
    mastinosoft
    wrote on last edited by
    #1

    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

    1 Reply Last reply
    0
    • A Offline
      A Offline
      ankursaxena
      wrote on last edited by
      #2

      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.

      1 Reply Last reply
      0
      • M Offline
        M Offline
        mastinosoft
        wrote on last edited by
        #3

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

        1 Reply Last reply
        0
        • M Offline
          M Offline
          mastinosoft
          wrote on last edited by
          #4

          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?

          1 Reply Last reply
          0
          • M Offline
            M Offline
            mastinosoft
            wrote on last edited by
            #5

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

            1 Reply Last reply
            0
            • M Offline
              M Offline
              mastinosoft
              wrote on last edited by
              #6

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

              1 Reply Last reply
              0

              • Login

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved