Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. System menu close button(X) pressing interception
Forum Updated to NodeBB v4.3 + New Features

System menu close button(X) pressing interception

Scheduled Pinned Locked Moved General and Desktop
3 Posts 3 Posters 2.9k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • I Offline
    I Offline
    ixSci
    wrote on 18 Apr 2011, 09:20 last edited by
    #1

    Hi all!

    I need to distinguish somehow whether the X button was pressed or application is requested to be closed by some other method. I need it because I've overloaded closeEvent() and ignored the event inside. But it prevents an OS from the graceful logout. So I need the method to not close the application by the X button pressing and don't mess with the logout mechanism at the same time. Is there a way to accomplish that in Qt?

    Thank in advance!

    1 Reply Last reply
    0
    • D Offline
      D Offline
      dangelog
      wrote on 18 Apr 2011, 13:06 last edited by
      #2

      See the QSessionManager and QApplication::commitData documentation. You could set a flag there which will lead your windows to accept the closeEvent.

      Software Engineer
      KDAB (UK) Ltd., a KDAB Group company

      1 Reply Last reply
      0
      • G Offline
        G Offline
        goetz
        wrote on 18 Apr 2011, 13:12 last edited by
        #3

        See "this thread":http://developer.qt.nokia.com/forums/viewthread/5223 too.

        http://www.catb.org/~esr/faqs/smart-questions.html

        1 Reply Last reply
        0

        1/3

        18 Apr 2011, 09:20

        • Login

        • Login or register to search.
        1 out of 3
        • First post
          1/3
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved