Does it possible to resize QMdiSubWindow by resizing internal window.
The code is illustrate that resizing works wrong except if you try to resize whole QMdiSubWindow.
Thanks a lot.
mwindow::mwindow()
{
workspace=new QMdiArea;
setCentralWidget(workspace);
setMenuBar(menubar);
taction=menubar->addAction("test");
connect(taction, SIGNAL(triggered( bool )), this, SLOT(action()));
}
mwindow::~mwindow()
{}
void mwindow::action()
{
tlayout->addWidget(button);
// resizing working good here
workspace->addSubWindow(tw)->resize(200,200);
tw->show();
// Trying to resize internal window. No effect. does it possible?
tw->resize(100,100);
}
mwindow::mwindow()
: QMainWindow()
{
workspace=new QMdiArea;
setCentralWidget(workspace);
menubar=new QMenuBar(this);
setMenuBar(menubar);
taction=menubar->addAction("test");
connect(taction, SIGNAL(triggered( bool )), this, SLOT(action()));
}
mwindow::~mwindow()
{}
void mwindow::action()
{
QWidget *tw=new QWidget(this);
QVBoxLayout *tlayout=new QVBoxLayout(tw);
QPushButton *button=new QPushButton(tw);
tlayout->addWidget(button);
// resizing working good here
workspace->addSubWindow(tw)->resize(200,200);
tw->show();
// Trying to resize internal window. No effect. does it possible?
tw->resize(100,100);
}
To copy to clipboard, switch view to plain text mode
Bookmarks