PDA

View Full Version : QMdiArea and adding sub window



sajis997
28th April 2011, 18:54
Hello Forum,


I have a instantiated an QMdiArea and i also have an widget - subclass of QGraphicsView

which has been added as a subwindow of the mdi area. The mdi area object is set as a central widget in the main window. I want to have the QGraphicsView object maximized when the main window is loaded. I am trying to achieve it as follows:



Editor = new NemoEditor(this,NULL,NULL);
Editor->setWindowTitle(tr("Scene Hierarchy"));

Editor->setWindowState(Editor->windowState() | Qt::WindowFullScreen);

m_mdiArea->addSubWindow(m_h3dSceneEditor);

//!add the scene editor to the MDI area
m_mdiArea->addSubWindow(Editor);





Is there anything missing from above since i do not get the subwindow maximized.

By the way i am initializing the mdi area as follows:



m_mdiArea = new QMdiArea(this);
m_mdiArea->setOption(QMdiArea::DontMaximizeSubWindowOnActivat ion,false);

//!set the mdi area as the central widget
//!and this is how it is used in the main window
setCentralWidget(m_mdiArea);




Any hint would be very helpful.


Thanks
Sajjad

high_flyer
29th April 2011, 18:16
try using setWindowState(Qt::WindowMaximized) on the sub window instance it self :


m_mdiArea->addSubWindow(Editor)->setWindowState(Qt::WindowMaximized) ;