PDA

View Full Version : QMdiSubWindow resizing in 4.3



kalpa
4th June 2007, 14:39
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()
: 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);
}