Cocoa: rename IsMouseOrKeyEvent -> isUserInputEvent
This matches the intended use of this function. Reformat to modern Qt style. Change-Id: I076d2bdb3ac14b346f0dc6934f7a47765badc6b0 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
This commit is contained in:
parent
58a67e4e0a
commit
b56e856d21
@ -293,12 +293,9 @@ bool QCocoaEventDispatcher::hasPendingEvents()
|
||||
return qGlobalPostedEventsCount() || (qt_is_gui_used && !CFRunLoopIsWaiting(CFRunLoopGetMain()));
|
||||
}
|
||||
|
||||
static bool IsMouseOrKeyEvent( NSEvent* event )
|
||||
static bool isUserInputEvent(NSEvent* event)
|
||||
{
|
||||
bool result = false;
|
||||
|
||||
switch( [event type] )
|
||||
{
|
||||
switch ([event type]) {
|
||||
case NSEventTypeLeftMouseDown:
|
||||
case NSEventTypeLeftMouseUp:
|
||||
case NSEventTypeRightMouseDown:
|
||||
@ -326,13 +323,12 @@ static bool IsMouseOrKeyEvent( NSEvent* event )
|
||||
case NSEventTypeBeginGesture:
|
||||
case NSEventTypeEndGesture:
|
||||
#endif // QT_NO_GESTURES
|
||||
result = true;
|
||||
return true;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return result;
|
||||
return false;
|
||||
}
|
||||
|
||||
static inline void qt_mac_waitForMoreEvents(NSString *runLoopMode = NSDefaultRunLoopMode)
|
||||
@ -465,7 +461,7 @@ bool QCocoaEventDispatcher::processEvents(QEventLoop::ProcessEventsFlags flags)
|
||||
dequeue: YES];
|
||||
|
||||
if (event) {
|
||||
if (IsMouseOrKeyEvent(event)) {
|
||||
if (isUserInputEvent(event)) {
|
||||
[event retain];
|
||||
d->queuedUserInputEvents.append(event);
|
||||
continue;
|
||||
@ -485,7 +481,7 @@ bool QCocoaEventDispatcher::processEvents(QEventLoop::ProcessEventsFlags flags)
|
||||
|
||||
if (event) {
|
||||
if (flags & QEventLoop::ExcludeUserInputEvents) {
|
||||
if (IsMouseOrKeyEvent(event)) {
|
||||
if (isUserInputEvent(event)) {
|
||||
[event retain];
|
||||
d->queuedUserInputEvents.append(event);
|
||||
continue;
|
||||
|
Loading…
x
Reference in New Issue
Block a user