| Subject: | Re: Mac OS X Hide QWidget on close rather than exit |
|---|---|
| From: | "Matteo Bertozzi" |
| Date: | Wed, 23 Jul 2008 06:21:26 +0200 |
|
#ifdef Q_WS_MAC
static OSStatus appleEventProcessor(const AppleEvent *ae, AppleEvent *event, long handlerRefCon) { MyApplication *app = (QfApplication *) handlerRefCon; OSType aeID = typeWildCard; OSType aeClass = typeWildCard; AEGetAttributePtr(ae, keyEventClassAttr, typeType, 0, &aeClass, sizeof(aeClass), 0); AEGetAttributePtr(ae, keyEventIDAttr, typeType, 0, &aeID, sizeof(aeID), 0); if (aeClass == kCoreEventClass) { if (aeID == kAEReopenApplication) { app->mainWindow()->show(); } return noErr; } return eventNotHandledErr; } #endif #ifdef Q_WS_MAC bool MyApplication::macEventFilter (EventHandlerCallRef caller, EventRef event) { emit macEvent(caller, event); UInt32 eKind = GetEventKind(event); UInt32 eClass = GetEventClass(event); if (eClass == kEventClassApplication && eKind == kEventAppActivated) { mainWindow()->show(); } return(QApplication::macEventFilter(caller, event)); } #endif in MyApplication constructor... #ifdef Q_WS_MAC // Install Reopen Application Event (Dock Clicked) d->appleEventProcessorUPP = AEEventHandlerUPP(appleEventProcessor); AEInstallEventHandler(kCoreEventClass, kAEReopenApplication, d->appleEventProcessorUPP, (long) this, true); #endif On Wed, Jul 23, 2008 at 4:20 AM, Keith Esau <keith.esau@xxxxxxx> wrote: Clicking on the application's dock icon (on Mac) shows the application, not -- Matteo Bertozzi |
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | Re: Problem with connect., Rohan McGovern |
|---|---|
| Next by Date: | Re: Problem with connect., Mike Adolf |
| Previous by Thread: | Re: Mac OS X Hide QWidget on close rather than exit, Keith Esau |
| Next by Thread: | OT: Cannot install SDK for Phonon on Windows, Matthias Pospiech |
| Indexes: | [Date] [Thread] [Top] [All Lists] |