IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)

QtMac Namespace

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

This namespace was introduced in Qt 5.2.

Article lu   fois.

L'auteur

Liens sociaux

Viadeo Twitter Facebook Share on Google+   

QtMac Namespace

  • Header: QtMac

  • Since: Qt 5.2

  • qmake: QT += macextras

Detailed Description

 

Function Documentation

 

int QtMac::applicationIconBadgeNumber()

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

See Also

QString QtMac::badgeLabelText()

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

See Also

See also setBadgeLabelText()

CGContextRef QtMac::currentCGContext()

Returns the current CoreGraphics context.

QPixmap QtMac::fromCGImageRef(CGImageRef image)

Returns a QPixmap that is equivalent to the given image.

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

See Also

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.

See Also

void QtMac::setBadgeLabelText(const QString &text)

Sets the 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.

See Also

See also badgeLabelText()

CGImageRef QtMac::toCGImageRef(const QPixmap &pixmap)

Creates a CGImageRef equivalent to the QPixmap pixmap. Returns the CGImageRef handle.

It is the caller's responsibility to release the CGImageRef data after use.

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

See Also

See also fromCGImageRef()

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

Creates an NSImage equivalent to the QPixmap pixmap. Returns the NSImage handle.

It is the caller's responsibility to release the NSImage data after use.

Obsolete Members for QtMac

The following members of class QtMac are deprecated. We strongly advise against using them in new code.

Obsolete Function Documentation

 
QByteArray QtMac::fromNSData(const NSData *data)

This function is deprecated. We strongly advise against using it in new code.

Use QByteArray::fromNSData() instead.

NSData *QtMac::toNSData(const QByteArray &data)

This function is deprecated. We strongly advise against using it in new code.

Use QByteArray::toNSData() instead.

Vous avez aimé ce tutoriel ? Alors partagez-le en cliquant sur les boutons suivants : Viadeo Twitter Facebook Share on Google+