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. resize mdiArea with Mainwindow
QtWS25 Last Chance

resize mdiArea with Mainwindow

Scheduled Pinned Locked Moved Unsolved General and Desktop
resizemdiareamain windowwidget
24 Posts 2 Posters 12.4k Views
  • 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.
  • F Offline
    F Offline
    freevrs
    wrote on 3 Nov 2015, 00:02 last edited by
    #5

    Because i'm new to QT and don't now how to do it proper.

    Could you give me an example on how to do this ?

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 3 Nov 2015, 00:20 last edited by
      #6

      Just take a look at QMainWindow's documentation and the MainWindow Application Example

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • F Offline
        F Offline
        freevrs
        wrote on 3 Nov 2015, 00:34 last edited by
        #7

        I took a look on the documentation and now set everythin up correct, but i still dont get the mdiarea scaled out

        link text

        The program now is fullscreen.
        But i want it to be the same size as the Programm.

        1 Reply Last reply
        0
        • S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 3 Nov 2015, 21:27 last edited by
          #8

          Is the mdiArea empty ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • F Offline
            F Offline
            freevrs
            wrote on 3 Nov 2015, 22:30 last edited by
            #9

            If empty means, that ther is no mdi window inside, then yes.

            the program should start with an empty full screen mid area and then all needed windows should be chosen with the menu

            1 Reply Last reply
            0
            • S Offline
              S Offline
              SGaist
              Lifetime Qt Champion
              wrote on 3 Nov 2015, 22:30 last edited by
              #10

              Can you show your MainWindow constructor ?

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              0
              • F Offline
                F Offline
                freevrs
                wrote on 3 Nov 2015, 22:42 last edited by SGaist 11 Mar 2015, 22:45
                #11

                Als elements has been created with the designer

                This is my Mainwindow.ccp

                
                #include "mainwindow.h"
                #include "ui_mainwindow.h"
                
                #include <QApplication>
                #include <QMdiSubWindow>
                
                MainWindow::MainWindow(QWidget *parent) :
                    QMainWindow(parent),
                    ui(new Ui::MainWindow)
                {
                    ui->setupUi(this);
                
                    //showMaximized();
                    showFullScreen();
                
                    setCentralWidget(ui->mdiArea);
                
                
                }
                
                MainWindow::~MainWindow()
                {
                    delete ui;
                }
                
                void MainWindow::on_actionBeenden_triggered()
                {
                    QApplication::quit();
                }
                
                

                and this is the Mainwindow.h

                
                #ifndef MAINWINDOW_H
                #define MAINWINDOW_H
                
                #include <QMainWindow>
                
                namespace Ui {
                class MainWindow;
                }
                
                class MainWindow : public QMainWindow
                {
                    Q_OBJECT
                
                    void createChild();
                
                public:
                    explicit MainWindow(QWidget *parent = 0);
                    ~MainWindow();
                
                private slots:
                    void on_actionBeenden_triggered();
                
                    void on_actionFader_triggered();
                
                private:
                    Ui::MainWindow *ui;
                };
                
                
                
                #endif // MAINWINDOW_H
                
                

                [edit: Fixed coding tags, use three backticks SGaist]

                1 Reply Last reply
                0
                • S Offline
                  S Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on 3 Nov 2015, 22:46 last edited by
                  #12

                  In that case, why don't you put the mdiArea directly as central widget with designer ?

                  Interested in AI ? www.idiap.ch
                  Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                  1 Reply Last reply
                  0
                  • F Offline
                    F Offline
                    freevrs
                    wrote on 3 Nov 2015, 23:06 last edited by
                    #13

                    I have the auto created QWidget , auto named central widget.
                    For this i have selected vertical layout.

                    Below the QWidget i have the mdiArea.

                    How can i change this ?
                    Or is that correct ?

                    1 Reply Last reply
                    0
                    • S Offline
                      S Offline
                      SGaist
                      Lifetime Qt Champion
                      wrote on 3 Nov 2015, 23:19 last edited by
                      #14

                      Add mdiArea to the vertical layout and you should be good to go.

                      Interested in AI ? www.idiap.ch
                      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                      1 Reply Last reply
                      0
                      • F Offline
                        F Offline
                        freevrs
                        wrote on 3 Nov 2015, 23:22 last edited by
                        #15

                        I think that is what i done, but it still desn't work

                        screenshot

                        1 Reply Last reply
                        0
                        • S Offline
                          S Offline
                          SGaist
                          Lifetime Qt Champion
                          wrote on 4 Nov 2015, 21:07 last edited by
                          #16

                          So what you want is to put all layout margins at 0 so your mdiArea widget will take the whole place

                          Interested in AI ? www.idiap.ch
                          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                          1 Reply Last reply
                          0
                          • F Offline
                            F Offline
                            freevrs
                            wrote on 5 Nov 2015, 00:01 last edited by
                            #17

                            I have done that, but the mdi area still does not scale out

                            1 Reply Last reply
                            0
                            • S Offline
                              S Offline
                              SGaist
                              Lifetime Qt Champion
                              wrote on 5 Nov 2015, 21:12 last edited by
                              #18

                              The question is going to be silly but did you just put it over the QMainWindow or did you explicitly clicked the layout vertically menu entry ?

                              Interested in AI ? www.idiap.ch
                              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                              1 Reply Last reply
                              0
                              • F Offline
                                F Offline
                                freevrs
                                wrote on 8 Nov 2015, 02:15 last edited by
                                #19

                                i clicked the vertical layout manualy on the central widget.
                                Also i cant put the mdi area over it.

                                1 Reply Last reply
                                0
                                • S Offline
                                  S Offline
                                  SGaist
                                  Lifetime Qt Champion
                                  wrote on 8 Nov 2015, 21:19 last edited by
                                  #20

                                  What do you mean by you can't put the mdi area over it ?

                                  Interested in AI ? www.idiap.ch
                                  Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                                  1 Reply Last reply
                                  0
                                  • F Offline
                                    F Offline
                                    freevrs
                                    wrote on 18 Nov 2015, 00:03 last edited by
                                    #21

                                    I thougt i could mabey drag'n drop it

                                    Here are all stepps i have done

                                    Create Project with Widget
                                    Created a mdiArea with designer
                                    try to resize with code

                                    1 Reply Last reply
                                    0
                                    • S Offline
                                      S Offline
                                      SGaist
                                      Lifetime Qt Champion
                                      wrote on 18 Nov 2015, 00:16 last edited by
                                      #22

                                      QWidget or QMainWindow ? In any case, you only need to put the QMdiArea in a layout on the widget

                                      Interested in AI ? www.idiap.ch
                                      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                                      1 Reply Last reply
                                      0
                                      • F Offline
                                        F Offline
                                        freevrs
                                        wrote on 19 Nov 2015, 23:08 last edited by
                                        #23

                                        Its a QT Widged Application

                                        So i think it auto creates a MainWindow ??

                                        I set the layout to vertical (see pictures in last postes)

                                        1 Reply Last reply
                                        0
                                        • S Offline
                                          S Offline
                                          SGaist
                                          Lifetime Qt Champion
                                          wrote on 19 Nov 2015, 23:27 last edited by
                                          #24

                                          MainWindow can be a QMainWindow or a QWidget depending on what parameter you choose

                                          Interested in AI ? www.idiap.ch
                                          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                                          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