diff options
author | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2018-09-15 03:03:21 +0200 |
---|---|---|
committer | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2018-09-15 03:03:21 +0200 |
commit | d3d7c3cd9276f268a3a25354600c519d96710c05 (patch) | |
tree | e750ad5b665a312244c300b67054cfd09ac6e4ee | |
parent | ff8a3384726a9e54fb7cd815e10235b9351cd288 (diff) | |
parent | b8b7809d2a08c190f493393119626c53da13094a (diff) |
Merge remote-tracking branch 'origin/5.12' into dev
Change-Id: I0db88e32c19edf15111599888874a2261dc9a5fc
-rw-r--r-- | dist/changes-5.11.2 | 24 | ||||
-rw-r--r-- | src/macextras/qmacextrasglobal.h | 17 | ||||
-rw-r--r-- | src/macextras/qmacfunctions.h | 28 | ||||
-rw-r--r-- | src/macextras/qmacfunctions.mm | 2 | ||||
-rw-r--r-- | src/macextras/qmacfunctions_ios.mm | 2 | ||||
-rw-r--r-- | src/macextras/qmacfunctions_mac.mm | 4 | ||||
-rw-r--r-- | src/macextras/qmactoolbaritem.mm | 3 |
7 files changed, 55 insertions, 25 deletions
diff --git a/dist/changes-5.11.2 b/dist/changes-5.11.2 new file mode 100644 index 0000000..8efdf5e --- /dev/null +++ b/dist/changes-5.11.2 @@ -0,0 +1,24 @@ +Qt 5.11.2 is a bug-fix release. It maintains both forward and backward +compatibility (source and binary) with Qt 5.11.0 through 5.11.1. + +For more details, refer to the online documentation included in this +distribution. The documentation is also available online: + +http://doc.qt.io/qt-5/index.html + +The Qt version 5.11 series is binary compatible with the 5.10.x series. +Applications compiled for 5.10 will continue to run with 5.11. + +Some of the changes listed in this file include issue tracking numbers +corresponding to tasks in the Qt Bug Tracker: + +https://bugreports.qt.io/ + +Each of these identifiers can be entered in the bug tracker to obtain more +information about a particular change. + +**************************************************************************** +* Qt 5.11.2 Changes * +**************************************************************************** + + - This release contains only minor code improvements. diff --git a/src/macextras/qmacextrasglobal.h b/src/macextras/qmacextrasglobal.h index 86ad534..af0f0c4 100644 --- a/src/macextras/qmacextrasglobal.h +++ b/src/macextras/qmacextrasglobal.h @@ -50,23 +50,6 @@ QT_BEGIN_NAMESPACE # define Q_MACEXTRAS_EXPORT Q_DECL_IMPORT #endif - -// ### remove when merged to QtCore -/*! - * \macro Q_FORWARD_DECLARE_OBJC_CLASS(classname) - * - * Forward-declares an Objective-C class name in a manner such that it can be - * compiled as either Objective-C or C++. - * - * This is primarily intended for use in header files that may be included by - * both Objective-C and C++ source files. - */ -#ifdef __OBJC__ -#define Q_FORWARD_DECLARE_OBJC_CLASS(classname) @class classname -#else -#define Q_FORWARD_DECLARE_OBJC_CLASS(classname) typedef struct objc_object classname -#endif - QT_END_NAMESPACE #endif // QMACEXTRASGLOBAL_H diff --git a/src/macextras/qmacfunctions.h b/src/macextras/qmacfunctions.h index ccdbd6e..88be13c 100644 --- a/src/macextras/qmacfunctions.h +++ b/src/macextras/qmacfunctions.h @@ -65,20 +65,32 @@ class QWindow; namespace QtMac { #if QT_DEPRECATED_SINCE(5,3) -QT_DEPRECATED Q_MACEXTRAS_EXPORT NSData *toNSData(const QByteArray &data); -QT_DEPRECATED Q_MACEXTRAS_EXPORT QByteArray fromNSData(const NSData *data); +QT_DEPRECATED_X("Use QByteArray::toNSData") Q_MACEXTRAS_EXPORT NSData *toNSData(const QByteArray &data); +QT_DEPRECATED_X("Use QByteArray::fromNSData") Q_MACEXTRAS_EXPORT QByteArray fromNSData(const NSData *data); #endif -Q_MACEXTRAS_EXPORT CGImageRef toCGImageRef(const QPixmap &pixmap); +#if QT_DEPRECATED_SINCE(5, 12) +QT_DEPRECATED_X("Use QPixmap::toImage and QImage::toCGImage") Q_MACEXTRAS_EXPORT CGImageRef toCGImageRef(const QPixmap &pixmap); +#endif Q_MACEXTRAS_EXPORT QPixmap fromCGImageRef(CGImageRef image); +#if QT_DEPRECATED_SINCE(5, 12) +# if defined(QT_PLATFORM_UIKIT) +QT_DEPRECATED_X("Use UIGraphicsGetCurrentContext()") +# else +QT_DEPRECATED_X("Use NSGraphicsContext.currentContext.CGContext") +# endif Q_MACEXTRAS_EXPORT CGContextRef currentCGContext(); +#endif #ifdef Q_OS_OSX -Q_MACEXTRAS_EXPORT void setBadgeLabelText(const QString &text); -Q_MACEXTRAS_EXPORT QString badgeLabelText(); +#if QT_DEPRECATED_SINCE(5, 12) +QT_DEPRECATED_X("Use NSApp.dockTile.badgeLabel") Q_MACEXTRAS_EXPORT void setBadgeLabelText(const QString &text); +QT_DEPRECATED_X("Use NSApp.dockTile.badgeLabel") Q_MACEXTRAS_EXPORT QString badgeLabelText(); +QT_DEPRECATED_X("Use QPixmap::toImage, QImage::toCGImage, and -[NSImage initWithCGImage:size:]") Q_MACEXTRAS_EXPORT NSImage *toNSImage(const QPixmap &pixmap); +#endif #if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) Q_MACEXTRAS_EXPORT bool isMainWindow(QWindow *window); @@ -86,8 +98,10 @@ Q_MACEXTRAS_EXPORT bool isMainWindow(QWindow *window); #endif // Q_OS_OSX #if defined(QT_PLATFORM_UIKIT) && !defined(Q_OS_WATCHOS) -Q_MACEXTRAS_EXPORT void setApplicationIconBadgeNumber(int number) __attribute__((availability(ios_app_extension,unavailable))); -Q_MACEXTRAS_EXPORT int applicationIconBadgeNumber() __attribute__((availability(ios_app_extension,unavailable))); +#if QT_DEPRECATED_SINCE(5, 12) +QT_DEPRECATED_X("Use UIApplication.sharedApplication.applicationIconBadgeNumber") Q_MACEXTRAS_EXPORT void setApplicationIconBadgeNumber(int number) __attribute__((availability(ios_app_extension,unavailable))); +QT_DEPRECATED_X("Use UIApplication.sharedApplication.applicationIconBadgeNumber") Q_MACEXTRAS_EXPORT int applicationIconBadgeNumber() __attribute__((availability(ios_app_extension,unavailable))); +#endif #endif // defined(QT_PLATFORM_UIKIT) && !defined(Q_OS_WATCHOS) } diff --git a/src/macextras/qmacfunctions.mm b/src/macextras/qmacfunctions.mm index 1171598..60cb733 100644 --- a/src/macextras/qmacfunctions.mm +++ b/src/macextras/qmacfunctions.mm @@ -98,6 +98,7 @@ QByteArray fromNSData(const NSData *data) } #endif // QT_DEPRECATED_SINCE +#if QT_DEPRECATED_SINCE(5, 12) /*! \fn CGImageRef QtMac::toCGImageRef(const QPixmap &pixmap) @@ -124,6 +125,7 @@ CGImageRef toCGImageRef(const QPixmap &pixmap) return pixmap.toCGImageRef(); #endif } +#endif /*! \fn QPixmap QtMac::fromCGImageRef(CGImageRef image) diff --git a/src/macextras/qmacfunctions_ios.mm b/src/macextras/qmacfunctions_ios.mm index f2b8e57..0aaada8 100644 --- a/src/macextras/qmacfunctions_ios.mm +++ b/src/macextras/qmacfunctions_ios.mm @@ -47,6 +47,7 @@ QT_BEGIN_NAMESPACE namespace QtMac { +#if QT_DEPRECATED_SINCE(5, 12) CGContextRef currentCGContext() { return UIGraphicsGetCurrentContext(); @@ -77,6 +78,7 @@ int applicationIconBadgeNumber() { return [[UIApplication sharedApplication] applicationIconBadgeNumber]; } +#endif } // namespace QtMac diff --git a/src/macextras/qmacfunctions_mac.mm b/src/macextras/qmacfunctions_mac.mm index 076f269..2e66e23 100644 --- a/src/macextras/qmacfunctions_mac.mm +++ b/src/macextras/qmacfunctions_mac.mm @@ -57,6 +57,7 @@ QT_BEGIN_NAMESPACE namespace QtMac { +#if QT_DEPRECATED_SINCE(5, 12) /*! \fn NSImage* QtMac::toNSImage(const QPixmap &pixmap) @@ -77,6 +78,7 @@ NSImage* toNSImage(const QPixmap &pixmap) CFRelease(cgimage); return image; } +#endif #if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) /*! @@ -95,6 +97,7 @@ bool isMainWindow(QWindow *window) } #endif +#if QT_DEPRECATED_SINCE(5, 12) CGContextRef currentCGContext() { return reinterpret_cast<CGContextRef>([[NSGraphicsContext currentContext] graphicsPort]); @@ -125,6 +128,7 @@ QString badgeLabelText() { return QString::fromNSString([[[NSApplication sharedApplication] dockTile] badgeLabel]); } +#endif } // namespace QtMac diff --git a/src/macextras/qmactoolbaritem.mm b/src/macextras/qmactoolbaritem.mm index b215bd8..3bb3a5a 100644 --- a/src/macextras/qmactoolbaritem.mm +++ b/src/macextras/qmactoolbaritem.mm @@ -169,7 +169,8 @@ void QMacToolBarItem::setIcon(const QIcon &icon) return; if (pixmap.isNull() == false) { - [d->toolbarItem setImage: QtMac::toNSImage(pixmap)]; + NSImage *image = [[NSImage alloc] initWithCGImage:pixmap.toImage().toCGImage() size:NSZeroSize]; + d->toolbarItem.image = [image autorelease]; } } |