Results 1 to 10 of 10

Thread: close window but do not exit application

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    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

    there is a way, but what would be the point?
    Is there another way to communicate with the application?
    ==========================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.

  2. #2
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,327
    Thanks
    317
    Thanked 871 Times in 858 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: close

    how to close window without close application
    Are you sure mean "close" and not "minimize"? Clicking the "X" at the top right of the window frame (in Windows, anyway) closes the window. If it is the application's main window, the application will exit. You can override this behavior by calling setQuitOnLastWindowClosed( false ) or by overriding the closeEvent() handler and calling ignore() on the event.

    But why would you want to do that? When a user clicks the "X", he expects the application to exit. You are trying to implement something that goes against the normal behavior that every other application follows.

    And like high_flyer says, if you do override this behavior, how will the use be able to exit the application? Will you force him to kill it with Task Manager?

Similar Threads

  1. Replies: 3
    Last Post: 26th May 2011, 13:29
  2. How to close (exit) a dialog properly
    By cooper in forum Newbie
    Replies: 6
    Last Post: 9th March 2011, 19:19
  3. Replies: 2
    Last Post: 17th December 2010, 19:01
  4. close application window
    By seltra in forum Newbie
    Replies: 5
    Last Post: 8th October 2010, 19:12
  5. Replies: 11
    Last Post: 15th July 2008, 13:11

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
  •  
Qt is a trademark of The Qt Company.