diff options
-rw-r--r-- | .qmake.conf | 2 | ||||
-rw-r--r-- | LGPL_EXCEPTION.txt | 22 | ||||
-rw-r--r-- | src/macextras/doc/qtmacextras.qdocconf | 3 | ||||
-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 | ||||
-rw-r--r-- | src/src.pro | 1 |
10 files changed, 34 insertions, 50 deletions
diff --git a/.qmake.conf b/.qmake.conf index 5becd3e..d4aef77 100644 --- a/.qmake.conf +++ b/.qmake.conf @@ -2,4 +2,4 @@ load(qt_build_config) DEFINES += QT_NO_FOREACH -MODULE_VERSION = 5.11.3 +MODULE_VERSION = 5.12.0 diff --git a/LGPL_EXCEPTION.txt b/LGPL_EXCEPTION.txt deleted file mode 100644 index 5cdacb9..0000000 --- a/LGPL_EXCEPTION.txt +++ /dev/null @@ -1,22 +0,0 @@ -The Qt Company Qt LGPL Exception version 1.1 - -As an additional permission to the GNU Lesser General Public License version -2.1, the object code form of a "work that uses the Library" may incorporate -material from a header file that is part of the Library. You may distribute -such object code under terms of your choice, provided that: - (i) the header files of the Library have not been modified; and - (ii) the incorporated material is limited to numerical parameters, data - structure layouts, accessors, macros, inline functions and - templates; and - (iii) you comply with the terms of Section 6 of the GNU Lesser General - Public License version 2.1. - -Moreover, you may apply this exception to a modified version of the Library, -provided that such modification does not involve copying material from the -Library into the modified Library's header files unless such material is -limited to (i) numerical parameters; (ii) data structure layouts; -(iii) accessors; and (iv) small macros, templates and inline functions of -five lines or less in length. - -Furthermore, you are not required to apply this additional permission to a -modified version of the Library. diff --git a/src/macextras/doc/qtmacextras.qdocconf b/src/macextras/doc/qtmacextras.qdocconf index 7bb599f..b9a9d77 100644 --- a/src/macextras/doc/qtmacextras.qdocconf +++ b/src/macextras/doc/qtmacextras.qdocconf @@ -18,8 +18,7 @@ moduleheader = QtMacExtrasDoc # pass include paths to clang includepaths += -I . \ -I .. \ - -I ./QtMacExtras \ - -I $QT_INSTALL_HEADERS + -I ./QtMacExtras clangdefines += Q_OS_OSX Q_OS_MACOS QT_PLATFORM_UIKIT 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]; } } diff --git a/src/src.pro b/src/src.pro index fd1ffb1..1993687 100644 --- a/src/src.pro +++ b/src/src.pro @@ -5,5 +5,6 @@ mac { else { # fake project for creating the documentation TEMPLATE = aux + CONFIG += force_qt QMAKE_DOCS = $$PWD/macextras/doc/qtmacextras.qdocconf } |