aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/macextras/qmacfunctions.h28
-rw-r--r--src/macextras/qmacfunctions.mm2
-rw-r--r--src/macextras/qmacfunctions_ios.mm2
-rw-r--r--src/macextras/qmacfunctions_mac.mm4
-rw-r--r--src/macextras/qmactoolbaritem.mm3
5 files changed, 31 insertions, 8 deletions
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];
}
}