QCocoaEventDispatcher: Remove Carbon dependency

QCoreApplication::hasPendingEvents() is deprecated, and so is
the event dispatchers' eponymous function. (A subsequent patch
will remove all of the event dispatchers' function, and add a
warning in QCoreApplication.)

The replacing logic is based upon QEventDispatcherCoreFoundation.

Change-Id: If2c1920148dc6d910e77c1dc8ac5b4459c149e2b
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
This commit is contained in:
Gabriel de Dietrich 2017-04-04 10:12:10 -07:00
parent aeb3f9d168
commit a433614bec

View File

@ -86,7 +86,6 @@
#include <qdebug.h>
#include <AppKit/AppKit.h>
#include <Carbon/Carbon.h>
QT_BEGIN_NAMESPACE
@ -285,7 +284,7 @@ bool QCocoaEventDispatcher::hasPendingEvents()
{
extern uint qGlobalPostedEventsCount();
extern bool qt_is_gui_used; //qapplication.cpp
return qGlobalPostedEventsCount() || (qt_is_gui_used && GetNumEventsInQueue(GetMainEventQueue()));
return qGlobalPostedEventsCount() || (qt_is_gui_used && !CFRunLoopIsWaiting(CFRunLoopGetMain()));
}
static bool IsMouseOrKeyEvent( NSEvent* event )