PDA

View Full Version : QMainWindow with QMainWindow



baray98
1st February 2009, 07:16
I have an action in my QMainWindow, mainWindow1, that will show another QMainWindow which is a child of mainWindow1, I wanted to show this second mainwindow in a Non-Modal fashion, but its just wont go away in front of my mainWindow1 . The second QMainWindow is not blocking input on my mainWindow1 in any case but it keeps itself in front of my mainWindow1 even if click my mouse to mainWindow1.



//in my mainwindow 1 i poped the other mainwindow like this

if (m_mainWindow2 == NULL)
{
m_mainWindow2 = new QMainWindow(this);
}

m_mainWindow2 ->show();


I tried playing with the windowFlags and windowModality with no luck .... anybody please help..

baray98

jpn
1st February 2009, 09:31
Don't pass any parent, just like you don't pass any parent for the first window.

baray98
1st February 2009, 17:21
I want to close the second mainwindow whenever the suppose to be parent mainwindow is closed. It seems second window won't listen when I call close in the destructor of mainwindow 1

arjunjain
12th April 2011, 07:07
I have similar problem can you please give the solution