Results 1 to 5 of 5

Thread: Close all windows

  1. #1
    Join Date
    Jun 2007
    Posts
    28
    Thanks
    7
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Close all windows

    Hi,

    I have this problem: when I start my program, I have a main window, after I open a new window (QDialog and QMainWindow), and I have two or more windows on my screen.
    I want to close all windows when I close the main window...

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Close all windows

    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  3. #3
    Join Date
    Jun 2007
    Posts
    28
    Thanks
    7
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Close all windows

    Hi high_flyer,

    I not have a MDI application....

  4. #4
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Close all windows

    in that case you need to re implement closeEvent() of your main window.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  5. The following user says thank you to high_flyer for this useful post:

    nowire75 (31st October 2007)

  6. #5
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Close all windows

    What about calling QApplication::closeAllWindows? It is a static slot.

  7. The following user says thank you to marcel for this useful post:

    nowire75 (31st October 2007)

Similar Threads

  1. Windows not appearing in XP.
    By beardybloke in forum Qt Programming
    Replies: 7
    Last Post: 24th October 2007, 17:32
  2. Windows focus / Windows Shutdown Problems
    By December in forum Qt Programming
    Replies: 6
    Last Post: 22nd October 2007, 14:10
  3. Replies: 2
    Last Post: 5th February 2007, 17:42
  4. How to close all windows that were created in main()?
    By Mister_Crac in forum Qt Programming
    Replies: 6
    Last Post: 13th November 2006, 10:57
  5. windows code troubling Qt
    By munna in forum Qt Programming
    Replies: 9
    Last Post: 9th November 2006, 19:52

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.