Results 1 to 2 of 2

Thread: Linux issue: Cannot Bring QMainwindow to Front if QDialog is active

  1. #1
    Join Date
    Mar 2007
    Posts
    59
    Thanks
    7

    Default Linux issue: Cannot Bring QMainwindow to Front if QDialog is active

    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
    Qt Code:
    1. extlogwindow = new ExtLogWindow( 0 );
    2. extlogwindow = new ExtLogWindow();
    To copy to clipboard, switch view to plain text mode 

    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:
    Qt Code:
    1. extlogwindow = new ExtLogWindow( this );
    To copy to clipboard, switch view to plain text mode 

    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.
    Attached Files Attached Files

  2. #2
    Join Date
    Mar 2007
    Posts
    59
    Thanks
    7

    Default Re: Linux issue: Cannot Bring QMainwindow to Front if QDialog is active

    We solved it by using the following constructor / option

    Qt Code:
    1. extlogwindow = new ExtLogWindow( );
    2.  
    3. extlogwindow->setWindowFlags(Qt::SubWindow);
    To copy to clipboard, switch view to plain text mode 

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.