diff options
Diffstat (limited to 'src/gui/kernel')
-rw-r--r-- | src/gui/kernel/qcocoaapplicationdelegate_mac.mm | 5 | ||||
-rw-r--r-- | src/gui/kernel/qcocoamenuloader_mac.mm | 4 | ||||
-rw-r--r-- | src/gui/kernel/qcocoaview_mac.mm | 30 | ||||
-rw-r--r-- | src/gui/kernel/qcocoawindow_mac.mm | 2 | ||||
-rw-r--r-- | src/gui/kernel/qcocoawindowdelegate_mac.mm | 2 | ||||
-rw-r--r-- | src/gui/kernel/qwidget_mac.mm | 7 |
6 files changed, 25 insertions, 25 deletions
diff --git a/src/gui/kernel/qcocoaapplicationdelegate_mac.mm b/src/gui/kernel/qcocoaapplicationdelegate_mac.mm index 9b07d64..036cb3b 100644 --- a/src/gui/kernel/qcocoaapplicationdelegate_mac.mm +++ b/src/gui/kernel/qcocoaapplicationdelegate_mac.mm @@ -78,6 +78,7 @@ #import <private/qcocoaapplicationdelegate_mac_p.h> #import <private/qcocoamenuloader_mac_p.h> +#import <private/qcocoaapplication_mac_p.h> #include <private/qapplication_p.h> #include <private/qt_mac_p.h> #include <private/qt_cocoa_helpers_mac_p.h> @@ -173,7 +174,7 @@ static void cleanupCocoaApplicationDelegate() qtMenuLoader = menuLoader; } -- (QT_MANGLE_NAMESPACE(QCocoaMenuLoader) *)menuLoader; +- (QT_MANGLE_NAMESPACE(QCocoaMenuLoader) *)menuLoader { return [[qtMenuLoader retain] autorelease]; } @@ -256,7 +257,7 @@ static void cleanupCocoaApplicationDelegate() onApplicationChangedActivation(true); } -- (void)applicationDidResignActive:(NSNotification *)notification; +- (void)applicationDidResignActive:(NSNotification *)notification { if (reflectionDelegate && [reflectionDelegate respondsToSelector:@selector(applicationDidResignActive:)]) diff --git a/src/gui/kernel/qcocoamenuloader_mac.mm b/src/gui/kernel/qcocoamenuloader_mac.mm index b963b3c..d351831 100644 --- a/src/gui/kernel/qcocoamenuloader_mac.mm +++ b/src/gui/kernel/qcocoamenuloader_mac.mm @@ -170,12 +170,12 @@ QT_USE_NAMESPACE return [[aboutQtItem retain] autorelease]; } -- (NSMenuItem *)hideMenuItem; +- (NSMenuItem *)hideMenuItem { return [[hideItem retain] autorelease]; } -- (NSMenuItem *)appSpecificMenuItem; +- (NSMenuItem *)appSpecificMenuItem { // Create an App-Specific menu item, insert it into the menu and return // it as an autorelease item. diff --git a/src/gui/kernel/qcocoaview_mac.mm b/src/gui/kernel/qcocoaview_mac.mm index dfcc2e6..d5363bd 100644 --- a/src/gui/kernel/qcocoaview_mac.mm +++ b/src/gui/kernel/qcocoaview_mac.mm @@ -302,7 +302,6 @@ static int qCocoaViewCount = 0; QMimeData *mimeData = dropData; if (QDragManager::self()->source()) mimeData = QDragManager::self()->dragPrivate()->data; - NSPoint globalPoint = [[sender draggingDestinationWindow] convertBaseToScreen:windowPoint]; NSPoint localPoint = [self convertPoint:windowPoint fromView:nil]; QPoint posDrag(localPoint.x, localPoint.y); NSDragOperation nsActions = [sender draggingSourceOperationMask]; @@ -365,7 +364,6 @@ static int qCocoaViewCount = 0; return NSDragOperationNone; } // return last value, if we are still in the answerRect. - NSPoint globalPoint = [[sender draggingDestinationWindow] convertBaseToScreen:windowPoint]; NSPoint localPoint = [self convertPoint:windowPoint fromView:nil]; NSDragOperation nsActions = [sender draggingSourceOperationMask]; QPoint posDrag(localPoint.x, localPoint.y); @@ -434,7 +432,6 @@ static int qCocoaViewCount = 0; dragEnterSequence = -1; [self addDropData:sender]; - NSPoint globalPoint = [[sender draggingDestinationWindow] convertBaseToScreen:windowPoint]; NSPoint localPoint = [self convertPoint:windowPoint fromView:nil]; QPoint posDrop(localPoint.x, localPoint.y); @@ -470,14 +467,14 @@ static int qCocoaViewCount = 0; [super dealloc]; } -- (BOOL)isOpaque; +- (BOOL)isOpaque { if (!qwidgetprivate) return [super isOpaque]; return qwidgetprivate->isOpaque; } -- (BOOL)isFlipped; +- (BOOL)isFlipped { return YES; } @@ -620,8 +617,8 @@ static int qCocoaViewCount = 0; // is the case. This makes sure child widgets are drawn as well, Cocoa does not know about // those and wont send them drawRect calls. if (qwidget->testAttribute(Qt::WA_NativeWindow) && qt_widget_private(qwidget)->hasAlienChildren == false) { - if (engine && !qwidget->testAttribute(Qt::WA_NoSystemBackground) - && (qwidget->isWindow() || qwidget->autoFillBackground()) + if ((engine && !qwidget->testAttribute(Qt::WA_NoSystemBackground) + && (qwidget->isWindow() || qwidget->autoFillBackground())) || qwidget->testAttribute(Qt::WA_TintedBackground) || qwidget->testAttribute(Qt::WA_StyledBackground)) { #ifdef DEBUG_WIDGET_PAINT @@ -978,32 +975,32 @@ static int qCocoaViewCount = 0; } #if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6 -- (void)touchesBeganWithEvent:(NSEvent *)event; +- (void)touchesBeganWithEvent:(NSEvent *)event { bool all = qwidget->testAttribute(Qt::WA_TouchPadAcceptSingleTouchEvents); qt_translateRawTouchEvent(qwidget, QTouchEvent::TouchPad, QCocoaTouch::getCurrentTouchPointList(event, all)); } -- (void)touchesMovedWithEvent:(NSEvent *)event; +- (void)touchesMovedWithEvent:(NSEvent *)event { bool all = qwidget->testAttribute(Qt::WA_TouchPadAcceptSingleTouchEvents); qt_translateRawTouchEvent(qwidget, QTouchEvent::TouchPad, QCocoaTouch::getCurrentTouchPointList(event, all)); } -- (void)touchesEndedWithEvent:(NSEvent *)event; +- (void)touchesEndedWithEvent:(NSEvent *)event { bool all = qwidget->testAttribute(Qt::WA_TouchPadAcceptSingleTouchEvents); qt_translateRawTouchEvent(qwidget, QTouchEvent::TouchPad, QCocoaTouch::getCurrentTouchPointList(event, all)); } -- (void)touchesCancelledWithEvent:(NSEvent *)event; +- (void)touchesCancelledWithEvent:(NSEvent *)event { bool all = qwidget->testAttribute(Qt::WA_TouchPadAcceptSingleTouchEvents); qt_translateRawTouchEvent(qwidget, QTouchEvent::TouchPad, QCocoaTouch::getCurrentTouchPointList(event, all)); } #endif // MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6 -- (void)magnifyWithEvent:(NSEvent *)event; +- (void)magnifyWithEvent:(NSEvent *)event { if (!QApplicationPrivate::tryModalHelper(qwidget, 0)) return; @@ -1018,7 +1015,7 @@ static int qCocoaViewCount = 0; #endif // QT_NO_GESTURES } -- (void)rotateWithEvent:(NSEvent *)event; +- (void)rotateWithEvent:(NSEvent *)event { if (!QApplicationPrivate::tryModalHelper(qwidget, 0)) return; @@ -1033,7 +1030,7 @@ static int qCocoaViewCount = 0; #endif // QT_NO_GESTURES } -- (void)swipeWithEvent:(NSEvent *)event; +- (void)swipeWithEvent:(NSEvent *)event { if (!QApplicationPrivate::tryModalHelper(qwidget, 0)) return; @@ -1055,7 +1052,7 @@ static int qCocoaViewCount = 0; #endif // QT_NO_GESTURES } -- (void)beginGestureWithEvent:(NSEvent *)event; +- (void)beginGestureWithEvent:(NSEvent *)event { if (!QApplicationPrivate::tryModalHelper(qwidget, 0)) return; @@ -1069,7 +1066,7 @@ static int qCocoaViewCount = 0; #endif // QT_NO_GESTURES } -- (void)endGestureWithEvent:(NSEvent *)event; +- (void)endGestureWithEvent:(NSEvent *)event { if (!QApplicationPrivate::tryModalHelper(qwidget, 0)) return; @@ -1609,7 +1606,6 @@ Qt::DropAction QDragManager::drag(QDrag *o) dndParams.localPoint.y + pix.height() - hotspot.y()}; NSSize mouseOffset = {0.0, 0.0}; NSPasteboard *pboard = [NSPasteboard pasteboardWithName:NSDragPboard]; - NSPoint windowPoint = [dndParams.theEvent locationInWindow]; dragPrivate()->executed_action = Qt::ActionMask; // do the drag [dndParams.view retain]; diff --git a/src/gui/kernel/qcocoawindow_mac.mm b/src/gui/kernel/qcocoawindow_mac.mm index f1b642b..8d44003 100644 --- a/src/gui/kernel/qcocoawindow_mac.mm +++ b/src/gui/kernel/qcocoawindow_mac.mm @@ -55,7 +55,7 @@ QT_USE_NAMESPACE @implementation NSWindow (QT_MANGLE_NAMESPACE(QWidgetIntegration)) -- (id)QT_MANGLE_NAMESPACE(qt_initWithQWidget):(QWidget*)widget contentRect:(NSRect)rect styleMask:(NSUInteger)mask; +- (id)QT_MANGLE_NAMESPACE(qt_initWithQWidget):(QWidget*)widget contentRect:(NSRect)rect styleMask:(NSUInteger)mask { self = [self initWithContentRect:rect styleMask:mask backing:NSBackingStoreBuffered defer:YES]; if (self) { diff --git a/src/gui/kernel/qcocoawindowdelegate_mac.mm b/src/gui/kernel/qcocoawindowdelegate_mac.mm index ffba6c2..6ce7b35 100644 --- a/src/gui/kernel/qcocoawindowdelegate_mac.mm +++ b/src/gui/kernel/qcocoawindowdelegate_mac.mm @@ -138,7 +138,7 @@ static void cleanupCocoaWindowDelegate() } } -- (void)dumpMaximizedStateforWidget:(QWidget*)qwidget window:(NSWindow *)window; +- (void)dumpMaximizedStateforWidget:(QWidget*)qwidget window:(NSWindow *)window { if (!window) return; // Nothing to do. diff --git a/src/gui/kernel/qwidget_mac.mm b/src/gui/kernel/qwidget_mac.mm index fc94616..bcddae5 100644 --- a/src/gui/kernel/qwidget_mac.mm +++ b/src/gui/kernel/qwidget_mac.mm @@ -2294,7 +2294,10 @@ void QWidgetPrivate::finishCreateWindow_sys_Cocoa(void * /*NSWindow * */ voidWin } else { [windowRef setHidesOnDeactivate:NO]; } - [windowRef setHasShadow:YES]; + if (q->testAttribute(Qt::WA_MacNoShadow)) + [windowRef setHasShadow:NO]; + else + [windowRef setHasShadow:YES]; Q_UNUSED(parentWidget); Q_UNUSED(dialog); @@ -2931,7 +2934,7 @@ void QWidgetPrivate::setParent_sys(QWidget *parent, Qt::WindowFlags f) // unless this is an alien widget. ) const bool nonWindowWithCreatedParent = !q->isWindow() && parent->testAttribute(Qt::WA_WState_Created); const bool nativeWidget = q->internalWinId() != 0; - if (wasCreated || nativeWidget && nonWindowWithCreatedParent) { + if (wasCreated || (nativeWidget && nonWindowWithCreatedParent)) { createWinId(); if (q->isWindow()) { #ifndef QT_MAC_USE_COCOA |