From 63569a68d2fd5ca90c4660e632fba2f3f3b37d73 Mon Sep 17 00:00:00 2001 From: Sze Howe Koh Date: Sat, 29 Dec 2012 02:09:39 +0800 Subject: Doc: Fix module name format Follow the conventions at http://qt-project.org/wiki/Spelling_Module_Names_in_Qt_Documentation QtCore -> Qt Core QtDBus -> Qt D-Bus QtDesigner -> Qt Designer QtGui -> Qt GUI QtImageFormats -> Qt Image Formats QtNetwork -> Qt Network QtPrintSupport -> Qt Print Support QtScript -> Qt Script QtSql -> Qt SQL QtSvg -> Qt SVG QtTest -> Qt Test QtWebKit -> Qt WebKit QtWidgets -> Qt Widgets QtXml -> Qt XML QtConcurrent -> Qt Concurrent (partial) QtQuick -> Qt Quick (partial) Also, distinguish between "module" and "library" Change-Id: Icb8aa695ae60b0e45920b0c8fce4dc763a12b0cd Reviewed-by: Jerome Pasion --- src/plugins/platforms/cocoa/qcocoaeventdispatcher.mm | 2 +- src/plugins/platforms/cocoa/qcocoamenuloader.mm | 2 +- src/plugins/platforms/cocoa/qcocoanativeinterface.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src/plugins/platforms/cocoa') diff --git a/src/plugins/platforms/cocoa/qcocoaeventdispatcher.mm b/src/plugins/platforms/cocoa/qcocoaeventdispatcher.mm index 305e7ff985..a0734530c5 100644 --- a/src/plugins/platforms/cocoa/qcocoaeventdispatcher.mm +++ b/src/plugins/platforms/cocoa/qcocoaeventdispatcher.mm @@ -881,7 +881,7 @@ void QCocoaEventDispatcherPrivate::cleanupModalSessions() void QCocoaEventDispatcherPrivate::beginModalSession(QWindow *window) { // We need to start spinning the modal session. Usually this is done with - // QDialog::exec() for QtWidgets based applications, but for others that + // QDialog::exec() for Qt Widgets based applications, but for others that // just call show(), we need to interrupt(). We call this here, before // setting currentModalSessionCached to zero, so that interrupt() calls // [NSApp abortModal] if another modal session is currently running diff --git a/src/plugins/platforms/cocoa/qcocoamenuloader.mm b/src/plugins/platforms/cocoa/qcocoamenuloader.mm index 60bcd82aae..2a9dcec64b 100644 --- a/src/plugins/platforms/cocoa/qcocoamenuloader.mm +++ b/src/plugins/platforms/cocoa/qcocoamenuloader.mm @@ -88,7 +88,7 @@ QString qt_mac_applicationmenu_string(int type) The reason for having the nib file is that those can not be created programmatically. To ease deployment the nib files are stored in Qt resources and written to QDir::temp() before loading. (Earlier Qt versions used - to require having the nib file in the QtGui framework.) + to require having the nib file in the Qt GUI framework.) */ void qt_mac_loadMenuNib(QT_MANGLE_NAMESPACE(QCocoaMenuLoader) *qtMenuLoader) { diff --git a/src/plugins/platforms/cocoa/qcocoanativeinterface.h b/src/plugins/platforms/cocoa/qcocoanativeinterface.h index 825f88a269..34e8fb61e2 100644 --- a/src/plugins/platforms/cocoa/qcocoanativeinterface.h +++ b/src/plugins/platforms/cocoa/qcocoanativeinterface.h @@ -82,7 +82,7 @@ private: Q_INVOKABLE QPlatformPrinterSupport *createPlatformPrinterSupport(); /* Function to return the NSPrintInfo * from QMacPaintEnginePrivate. - Needed by the native print dialog in the QtPrintSupport library. + Needed by the native print dialog in the Qt Print Support module. */ Q_INVOKABLE void *NSPrintInfoForPrintEngine(QPrintEngine *printEngine); -- cgit v1.2.3 From f210a8593450049fc366098cab040daea10ca758 Mon Sep 17 00:00:00 2001 From: Rick Stockton Date: Thu, 20 Dec 2012 20:38:45 -0800 Subject: cocoa: Fix Mouse Event tracking of button status MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Within qcocoahelpers, make function cocoaButton2QtButton() handle all button numbers. Within qnsview, call the function in several places (eliminating duplicate, inefficient code). Task-number: QTBUG-28567 Change-Id: Ibae2ae4e8a881b825a8862afb82aa80437751111 Reviewed-by: Morten Johan Sørvig Reviewed-by: Rick Stockton --- src/plugins/platforms/cocoa/qcocoahelpers.mm | 19 ++--- src/plugins/platforms/cocoa/qnsview.mm | 113 +++------------------------ 2 files changed, 21 insertions(+), 111 deletions(-) (limited to 'src/plugins/platforms/cocoa') diff --git a/src/plugins/platforms/cocoa/qcocoahelpers.mm b/src/plugins/platforms/cocoa/qcocoahelpers.mm index c6d6e35794..0c5d26054c 100644 --- a/src/plugins/platforms/cocoa/qcocoahelpers.mm +++ b/src/plugins/platforms/cocoa/qcocoahelpers.mm @@ -623,20 +623,17 @@ CGFloat qt_mac_get_scalefactor() Qt::MouseButton cocoaButton2QtButton(NSInteger buttonNum) { - switch (buttonNum) { - case 0: + if (buttonNum == 0) return Qt::LeftButton; - case 1: + if (buttonNum == 1) return Qt::RightButton; - case 2: - return Qt::MidButton; - case 3: - return Qt::XButton1; - case 4: - return Qt::XButton2; - default: - return Qt::NoButton; + if (buttonNum == 2) + return Qt::MiddleButton; + if (buttonNum >= 3 && buttonNum <= 31) { // handle XButton1 and higher via logical shift + return Qt::MouseButton(uint(Qt::MiddleButton) << (buttonNum - 3)); } + // else error: buttonNum too high, or negative + return Qt::NoButton; } bool qt_mac_execute_apple_script(const char *script, long script_len, AEDesc *ret) { diff --git a/src/plugins/platforms/cocoa/qnsview.mm b/src/plugins/platforms/cocoa/qnsview.mm index a0e76cb452..b822061feb 100644 --- a/src/plugins/platforms/cocoa/qnsview.mm +++ b/src/plugins/platforms/cocoa/qnsview.mm @@ -403,14 +403,19 @@ static QTouchDevice *touchDevice = 0; m_buttons |= Qt::LeftButton; break; case NSLeftMouseUp: - m_buttons &= QFlag(~int(Qt::LeftButton)); + m_buttons &= ~Qt::LeftButton; break; case NSRightMouseDown: m_buttons |= Qt::RightButton; break; case NSRightMouseUp: - m_buttons &= QFlag(~int(Qt::RightButton)); + m_buttons &= ~Qt::RightButton; break; + case NSOtherMouseDown: + m_buttons |= cocoaButton2QtButton([theEvent buttonNumber]); + break; + case NSOtherMouseUp: + m_buttons &= ~cocoaButton2QtButton([theEvent buttonNumber]); default: break; } @@ -465,10 +470,10 @@ static QTouchDevice *touchDevice = 0; - (void)mouseUp:(NSEvent *)theEvent { if (m_sendUpAsRightButton) { - m_buttons &= QFlag(~int(Qt::RightButton)); + m_buttons &= ~Qt::RightButton; m_sendUpAsRightButton = false; } else { - m_buttons &= QFlag(~int(Qt::LeftButton)); + m_buttons &= ~Qt::LeftButton; } [self handleMouseEvent:theEvent]; } @@ -539,59 +544,13 @@ static QTouchDevice *touchDevice = 0; - (void)rightMouseUp:(NSEvent *)theEvent { - m_buttons &= QFlag(~int(Qt::RightButton)); + m_buttons &= ~Qt::RightButton; [self handleMouseEvent:theEvent]; } - (void)otherMouseDown:(NSEvent *)theEvent { - switch ([theEvent buttonNumber]) { - case 3: - m_buttons |= Qt::MiddleButton; - break; - case 4: - m_buttons |= Qt::ExtraButton1; // AKA Qt::BackButton - break; - case 5: - m_buttons |= Qt::ExtraButton2; // AKA Qt::ForwardButton - break; - case 6: - m_buttons |= Qt::ExtraButton3; - break; - case 7: - m_buttons |= Qt::ExtraButton4; - break; - case 8: - m_buttons |= Qt::ExtraButton5; - break; - case 9: - m_buttons |= Qt::ExtraButton6; - break; - case 10: - m_buttons |= Qt::ExtraButton7; - break; - case 11: - m_buttons |= Qt::ExtraButton8; - break; - case 12: - m_buttons |= Qt::ExtraButton9; - break; - case 13: - m_buttons |= Qt::ExtraButton10; - break; - case 14: - m_buttons |= Qt::ExtraButton11; - break; - case 15: - m_buttons |= Qt::ExtraButton12; - break; - case 16: - m_buttons |= Qt::ExtraButton13; - break; - default: - m_buttons |= Qt::MiddleButton; - break; - } + m_buttons |= cocoaButton2QtButton([theEvent buttonNumber]); [self handleMouseEvent:theEvent]; } @@ -604,53 +563,7 @@ static QTouchDevice *touchDevice = 0; - (void)otherMouseUp:(NSEvent *)theEvent { - switch ([theEvent buttonNumber]) { - case 3: - m_buttons &= QFlag(~int(Qt::MiddleButton)); - break; - case 4: - m_buttons &= QFlag(~int(Qt::ExtraButton1)); // AKA Qt::BackButton - break; - case 5: - m_buttons &= QFlag(~int(Qt::ExtraButton2)); // AKA Qt::ForwardButton - break; - case 6: - m_buttons &= QFlag(~int(Qt::ExtraButton3)); - break; - case 7: - m_buttons &= QFlag(~int(Qt::ExtraButton4)); - break; - case 8: - m_buttons &= QFlag(~int(Qt::ExtraButton5)); - break; - case 9: - m_buttons &= QFlag(~int(Qt::ExtraButton6)); - break; - case 10: - m_buttons &= QFlag(~int(Qt::ExtraButton7)); - break; - case 11: - m_buttons &= QFlag(~int(Qt::ExtraButton8)); - break; - case 12: - m_buttons &= QFlag(~int(Qt::ExtraButton9)); - break; - case 13: - m_buttons &= QFlag(~int(Qt::ExtraButton10)); - break; - case 14: - m_buttons &= QFlag(~int(Qt::ExtraButton11)); - break; - case 15: - m_buttons &= QFlag(~int(Qt::ExtraButton12)); - break; - case 16: - m_buttons &= QFlag(~int(Qt::ExtraButton13)); - break; - default: - m_buttons &= QFlag(~int(Qt::MiddleButton)); - break; - } + m_buttons &= ~cocoaButton2QtButton([theEvent buttonNumber]); [self handleMouseEvent:theEvent]; } @@ -1242,7 +1155,7 @@ static QTouchDevice *touchDevice = 0; // keep our state, and QGuiApplication state (buttons member) in-sync, // or future mouse events will be processed incorrectly - m_buttons &= QFlag(~int(Qt::LeftButton)); + m_buttons &= ~Qt::LeftButton; NSPoint windowPoint = [self convertPoint: point fromView: nil]; QPoint qtWindowPoint(windowPoint.x, windowPoint.y); -- cgit v1.2.3 From 0b68fc019bbeedb8b6b59bbbdf31f66596b6d5ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20Johan=20S=C3=B8rvig?= Date: Wed, 2 Jan 2013 20:11:41 +0100 Subject: Cocoa: Correct mime handler prioritization. According to the documentation recently added mime type converters should take precedence over previously added converters. Make it so. Task-number: QTBUG-25951 Change-Id: Ic23ca7cbb93a98711d762b1ef0e0dd2aa1ceaeda Reviewed-by: Gabriel de Dietrich --- src/plugins/platforms/cocoa/qmacmime.mm | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/plugins/platforms/cocoa') diff --git a/src/plugins/platforms/cocoa/qmacmime.mm b/src/plugins/platforms/cocoa/qmacmime.mm index 339559b6a6..89539de331 100644 --- a/src/plugins/platforms/cocoa/qmacmime.mm +++ b/src/plugins/platforms/cocoa/qmacmime.mm @@ -68,7 +68,10 @@ Q_GLOBAL_STATIC(QStringList, globalDraggedTypesList) void qt_mac_addToGlobalMimeList(QMacPasteboardMime *macMime) { - globalMimeList()->append(macMime); + // globalMimeList is in decreasing priority order. Recently added + // converters take prioity over previously added converters: prepend + // to the list. + globalMimeList()->prepend(macMime); } void qt_mac_removeFromGlobalMimeList(QMacPasteboardMime *macMime) @@ -810,6 +813,10 @@ QList QMacPasteboardMimeVCard::convertFromMime(const QString &mime, void QMacPasteboardMime::initializeMimeTypes() { if (globalMimeList()->isEmpty()) { + // Create QMacPasteboardMimeAny first to put it at the end of globalMimeList + // with lowest priority. (the constructor prepends to the list) + new QMacPasteboardMimeAny; + //standard types that we wrap new QMacPasteboardMimeTiff; new QMacPasteboardMimeUnicodeText; @@ -819,8 +826,6 @@ void QMacPasteboardMime::initializeMimeTypes() new QMacPasteboardMimeUrl; new QMacPasteboardMimeTypeName; new QMacPasteboardMimeVCard; - //make sure our "non-standard" types are always last! --Sam - new QMacPasteboardMimeAny; } } -- cgit v1.2.3