PDA

View Full Version : Linux issue: Cannot Bring QMainwindow to Front if QDialog is active



nbkhwjm
28th October 2008, 15:45
I have a situation where i show a dialog by menu action from mainwindow. the dialog shows fine, but will always be on top of mainwindow.

In windows xp, the mainwindow can move to the top, but in linux it does not.
I have tried many different constructors, and i can get a couple to work right in windows, but never linux.

my constructor look like this


extlogwindow = new ExtLogWindow( 0 );
extlogwindow = new ExtLogWindow();


Attached is a sample application

There is an additional issue that is somewhat related, since i want this dialog to be closed when the mainwindow is closed, i made the mainwindow the parent of the dialog. by this constructor:

extlogwindow = new ExtLogWindow( this );

If I use this constructor, the dialog is closed properly when the mainwindow is closed. If i use the above methods to solve the issue in windows, then the dialog remains open after i close mainwindow... so i think dialog needs to have mainwindow as its parent.

Thanks in advance.

nbkhwjm
28th October 2008, 16:29
We solved it by using the following constructor / option



extlogwindow = new ExtLogWindow( );

extlogwindow->setWindowFlags(Qt::SubWindow);