Reputation: 30885
i have Qmainwindow that opens with show() method another QMainWindow the problem is that when the second QMainwindow is on top the first one , when i click with the mouse on the first QMainWindow it doesn't return to be on top of the second windows. its getting the focus but doesn't go on top .. so its looks funny and not natural windowing behavior.
update ..
im using 2 QMainWindows . i know its not standard but i need the toolbar+ status bar of the
window via the Designer.
any way in the 2 QMainWindows i don't have any properties set , i suspect this is where the solution .
the code is simple in the main window i have member of another QMainWindow
and in the main window i just do :
....
ListWindow* m_pListWindow; // the second qmainwindow
......
void MainWindow::actionViewlistHandler()
{
m_pListWindow->show();
}
Upvotes: 1
Views: 1604
Reputation: 155
This happens when you give the 2nd MainWindow the first one as its parent
//This will cause the problem
MainWindow2 *m2 = new MainWindow2(this);
m2->show();
//This will solve your problem
MainWindow2 *m2 = new MainWindow2();
m2->show();
Upvotes: 2