summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard Moe Gustavsen <richard.gustavsen@nokia.com>2010-05-21 13:41:37 (GMT)
committerRichard Moe Gustavsen <richard.gustavsen@nokia.com>2010-05-21 13:52:32 (GMT)
commitf65a036ff7c4023a0603d2887b29bfe7e182034a (patch)
treedfc3dd5ff923d8cf8420e7fe23041332187d0f69 /src
parentf86eadaecbf5937638e035aa21eacf8a5d45ec5c (diff)
downloadQt-f65a036ff7c4023a0603d2887b29bfe7e182034a.zip
Qt-f65a036ff7c4023a0603d2887b29bfe7e182034a.tar.gz
Qt-f65a036ff7c4023a0603d2887b29bfe7e182034a.tar.bz2
Mac: fix bic breakage
Diffstat (limited to 'src')
-rw-r--r--src/gui/kernel/qapplication.h1
-rw-r--r--src/gui/kernel/qapplication_mac.mm35
-rw-r--r--src/gui/kernel/qcocoaapplication_mac.mm2
3 files changed, 11 insertions, 27 deletions
diff --git a/src/gui/kernel/qapplication.h b/src/gui/kernel/qapplication.h
index ebb329b..c21b982 100644
--- a/src/gui/kernel/qapplication.h
+++ b/src/gui/kernel/qapplication.h
@@ -233,7 +233,6 @@ public:
#if defined(Q_WS_MAC)
virtual bool macEventFilter(EventHandlerCallRef, EventRef);
- virtual bool macEventFilter(void *);
#endif
#if defined(Q_WS_X11)
virtual bool x11EventFilter(XEvent *);
diff --git a/src/gui/kernel/qapplication_mac.mm b/src/gui/kernel/qapplication_mac.mm
index 4cd14df..afd7c4b 100644
--- a/src/gui/kernel/qapplication_mac.mm
+++ b/src/gui/kernel/qapplication_mac.mm
@@ -2613,43 +2613,28 @@ OSStatus QApplicationPrivate::globalAppleEventProcessor(const AppleEvent *ae, Ap
/*!
\fn bool QApplication::macEventFilter(EventHandlerCallRef caller, EventRef event)
- \warning This virtual function is only used under Mac OS X when Qt is based on Carbon.
+ \warning This virtual function is only used under Mac OS X, and behaves different
+ depending on if Qt is based on Carbon or Cocoa.
- If you create an application that inherits QApplication and reimplement
+ For the Carbon port, If you create an application that inherits QApplication and reimplement
this function, you get direct access to all Carbon Events that Qt registers
for from Mac OS X with this function being called with the \a caller and
the \a event.
- Return true if you want to stop the event from being processed.
- Return false for normal event dispatching. The default
- implementation returns false.
-
- \sa macEventFilter(void *nsevent)
-*/
-bool QApplication::macEventFilter(EventHandlerCallRef, EventRef)
-{
- return false;
-}
-
-/*!
- \fn bool QApplication::macEventFilter(void *nsevent)
+ For the Cocoa port, If you create an application that inherits QApplication and reimplement
+ this function, you get direct access to all Cocoa Events that Qt receives
+ from Mac OS X with this function being called with the \a caller being 0 and
+ the \a event being an NSEvent pointer:
- \warning This virtual function is only used under Mac OS X when Qt is based on Cocoa.
-
- If you create an application that inherits QApplication and reimplement
- this function, you get direct access to all NSEvents that Qt receives
- from Cocoa.
- \a nsevent is of type NSEvent *:
-
- NSEvent *e = static_cast<NSEvent *>(nsevent);
+ NSEvent *e = reinterpret_cast<NSEvent *>(event);
Return true if you want to stop the event from being processed.
Return false for normal event dispatching. The default
implementation returns false.
- \sa macEventFilter(EventHandlerCallRef caller, EventRef event)
+ \sa macEventFilter(void *nsevent)
*/
-bool QApplication::macEventFilter(void * /*NSEvent*/)
+bool QApplication::macEventFilter(EventHandlerCallRef, EventRef)
{
return false;
}
diff --git a/src/gui/kernel/qcocoaapplication_mac.mm b/src/gui/kernel/qcocoaapplication_mac.mm
index 5cd32a1..238b96b 100644
--- a/src/gui/kernel/qcocoaapplication_mac.mm
+++ b/src/gui/kernel/qcocoaapplication_mac.mm
@@ -134,7 +134,7 @@ QT_USE_NAMESPACE
- (BOOL)qt_filterEvent:(NSEvent *)event
{
- if (qApp->macEventFilter(event))
+ if (qApp->macEventFilter(0, reinterpret_cast<EventRef>(event)))
return true;
if ([event type] == NSApplicationDefined) {