Results 1 to 4 of 4

Thread: QMainWindow with QMainWindow

  1. #1
    Join Date
    Aug 2007
    Posts
    275
    Thanks
    28
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default QMainWindow with QMainWindow

    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.

    Qt Code:
    1. //in my mainwindow 1 i poped the other mainwindow like this
    2.  
    3. if (m_mainWindow2 == NULL)
    4. {
    5. m_mainWindow2 = new QMainWindow(this);
    6. }
    7.  
    8. m_mainWindow2 ->show();
    To copy to clipboard, switch view to plain text mode 

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

    baray98

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: QMainWindow with QMainWindow

    Don't pass any parent, just like you don't pass any parent for the first window.
    J-P Nurmi

  3. #3
    Join Date
    Aug 2007
    Posts
    275
    Thanks
    28
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QMainWindow with QMainWindow

    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

  4. #4
    Join Date
    Dec 2009
    Posts
    2
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: QMainWindow with QMainWindow

    I have similar problem can you please give the solution

Similar Threads

  1. QMainWindow modal from non-qt window?
    By hickscorp in forum Qt Programming
    Replies: 3
    Last Post: 21st November 2008, 10:10
  2. QMainWindow setCentralWidget from ui widget, Qt4
    By alan in forum Qt Programming
    Replies: 5
    Last Post: 13th May 2008, 14:00
  3. QMainWindow child of a QDialog
    By brevleq in forum Qt Programming
    Replies: 2
    Last Post: 16th January 2008, 08:16
  4. QMainWindow: problem changing centralWidget
    By Caius Aérobus in forum Qt Programming
    Replies: 6
    Last Post: 4th October 2007, 14:00
  5. Replies: 18
    Last Post: 22nd February 2006, 21:51

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.