If you want to resize the MdiSubWindow then you should call resize() on that object, not the widget it contains:
#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 );
}
#include "MainWindow.h"
#include "ui_MainWindow.h"
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(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 );
}
To copy to clipboard, switch view to plain text mode
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.
Bookmarks