• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
NSWorkspaceWillPowerOffNotification not working with Qt Cocoa Mac Application
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSWorkspaceWillPowerOffNotification not working with Qt Cocoa Mac Application


  • Subject: NSWorkspaceWillPowerOffNotification not working with Qt Cocoa Mac Application
  • From: manoj <email@hidden>
  • Date: Thu, 07 Apr 2011 20:08:27 +0530

Hi,

I am working on Mac application using Qt Cocoa. I want to track log out/shut down event. I looked at Qt for some solution however it seems to be more at OS level so Qt doesn't provide anything.

So I switched to NSWorkspace and registered to get Sleep (NSWorkspaceWillSleepNotification) and Log out (NSWorkspaceWillPowerOffNotification). I am able to get Sleep notification but not able to get Log Out/shut down notifications in Qt App.

To verify registration code, I created a simple Cocoa application and both sleep and log out notification works in this case.

Below is the code which works with cocoa application (receiveLogOutShutDownNote gets called) and not with Qt App.

[[[NSWorkspace sharedWorkspace] notificationCenter] addObserver: self
											selector: @selector(receiveLogOutShutDownNote:)
											name: NSWorkspaceWillPowerOffNotification object: NULL];
- (void) receiveLogOutShutDownNote: (NSNotification*) note
{
	NSLog(@"receiveLogOutShutDownNote: %@", [note name]);
}
Please help me to figure out what is the difference between two.

-Manoj
DISCLAIMER
==========
This e-mail may contain privileged and confidential information which is the property of Persistent Systems Ltd. It is intended only for the use of the individual or entity to which it is addressed. If you are not the intended recipient, you are not authorized to read, retain, copy, print, distribute or use this message. If you have received this communication in error, please notify the sender and delete all copies of this message. Persistent Systems Ltd. does not accept any liability for virus infected mails.

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • NSWorkspaceWillPowerOffNotification not working with Qt Cocoa Mac Application
      • From: manoj <email@hidden>
  • Prev by Date: Re: Best way to find files
  • Next by Date: Access main window of other Applications
  • Previous by thread: Re: Class UITableViewCellContentView is implemented in both <here> and <there>. One of the two will be used. Which one is undefined.
  • Next by thread: NSWorkspaceWillPowerOffNotification not working with Qt Cocoa Mac Application
  • Index(es):
    • Date
    • Thread