Re: Resize MDI subwindows
If you want to resize the MdiSubWindow then you should call resize() on that object, not the widget it contains:
Code:
#include "MainWindow.h"
#include "ui_MainWindow.h"
MainWindow
::MainWindow(QWidget *parent
) : ui(new Ui::MainWindow)
{
ui->setupUi(this);
m_firstWindow = new FirstWindow;
m_secondWindow = new SecondWindow;
m_thirdWindow = new ThirdWindow;
QMdiSubWindow *w1 = ui->mdiArea->addSubWindow( m_firstWindow );
ui->mdiArea->addSubWindow( m_secondWindow );
ui->mdiArea->addSubWindow( m_thirdWindow );
w1->resize( 500, 500 );
}
If your widgets actually contained anything then the containing QMdiSubWindow would get a preferred size from the layout and you probably would not need to resize at all.
Re: Resize MDI subwindows
1 Attachment(s)
Re: Resize MDI subwindows
I've created my first useful MDI application :D
Matrix Operations
Attachment 10563
Source code: https://github.com/8Observer8/MatrixOperations
2 Attachment(s)
Re: Resize MDI subwindows
When I run my MDI application I see:
Attachment 10564
But I want to see:
Attachment 10565
Source code: https://github.com/8Observer8/SingleTriangleEditor
How will I be able to do it? Where can I read about layout the MdiSubWindows on the mdiArea?
Thank you!
Re: Resize MDI subwindows
MDI sub windows are basically like windows, they are not layouted among themselved other than the simple things that QMdiArea::WindowOrder does.
Which is one of the reasons why this sort of MDI applications is not used very often anymore.
Cheers,
_
Re: Resize MDI subwindows
There are also tileSubwindows() and cascadeSubWindows() slots to arrange the windows. If you want a layout that is generally fixed then you are better off doing that yourself with a layout inside a widget rather than with QMdiArea.
Re: Resize MDI subwindows
Agreed.
The screenshot does not look like multiple documents at all, more like a single document and editing tool.
Which would more likely be served better by using QDockWidget
Cheers,
_