QtMac Namespace

The QtMac namespace contains miscellaneous functionality specific to the macOS and iOS operating systems. 更多...

頭: #include <QtMac>
qmake: QT += macextras
Since: Qt 5.2

函數

int applicationIconBadgeNumber ()
QString badgeLabelText ()
CGContextRef currentCGContext ()
QPixmap fromCGImageRef (CGImageRef image )
bool isMainWindow (QWindow * window )
void setApplicationIconBadgeNumber (int number )
void setBadgeLabelText (const QString & text )
CGImageRef toCGImageRef (const QPixmap & pixmap )
NSImage * toNSImage (const QPixmap & pixmap )

詳細描述

The QtMac namespace contains miscellaneous functionality specific to the macOS and iOS operating systems.

函數文檔編製

int QtMac:: applicationIconBadgeNumber ()

Returns the value of the application icon a.k.a badge.

另請參閱 setApplicationIconBadgeNumber () 和 badgeLabelText ().

QString QtMac:: badgeLabelText ()

Returns the text of the application icon a.k.a badge.

另請參閱 setBadgeLabelText ().

CGContextRef QtMac:: currentCGContext ()

Returns the current CoreGraphics context.

QPixmap QtMac:: fromCGImageRef ( CGImageRef image )

返迴 QPixmap 相當於給定 image .

This function is not available in Qt 5.x until 5.0.2 and will return a null pixmap in earlier versions.

另請參閱 toCGImageRef () 和 像素圖轉換 .

bool QtMac:: isMainWindow ( QWindow * window )

Returns whether the given QWindow window is the application's main window

void QtMac:: setApplicationIconBadgeNumber ( int number )

Sets the value shown on the application icon a.k.a badge to number .

Unlike its macOS counterpart, only numbers can be used.

另請參閱 applicationIconBadgeNumber () 和 setBadgeLabelText ().

void QtMac:: setBadgeLabelText (const QString & text )

設置 text shown on the application icon a.k.a badge.

This is generally used with numbers (e.g. number of unread emails); it can also show a string.

另請參閱 badgeLabelText ().

CGImageRef QtMac:: toCGImageRef (const QPixmap & pixmap )

創建 CGImageRef equivalent to the QPixmap pixmap 。返迴 CGImageRef 句柄。

It is the caller's responsibility to release the CGImageRef 數據在使用後。

This function is not available in Qt 5.x until 5.0.2 and will return NULL in earlier versions.

另請參閱 fromCGImageRef ().

NSImage *QtMac:: toNSImage (const QPixmap & pixmap )

創建 NSImage equivalent to the QPixmap pixmap 。返迴 NSImage 句柄。

It is the caller's responsibility to release the NSImage 數據在使用後。