Type Conversions

Many of Qt's basic data types, such as QString, QPoint, or QImage, provide conversions to and from the native equivalent types.

The following list enumerates all of the available type conversions:

QByteArray::fromCFData()

Constructs a new QByteArray containing a copy of the CFData data

QByteArray::fromNSData()

Constructs a new QByteArray containing a copy of the NSData data

QByteArray::fromRawCFData()

Constructs a QByteArray that uses the bytes of the CFData data

QByteArray::fromRawNSData()

Constructs a QByteArray that uses the bytes of the NSData data

QDateTime::fromCFDate()

Constructs a new QDateTime containing a copy of the CFDate date

QDateTime::fromNSDate()

Constructs a new QDateTime containing a copy of the NSDate date

QImage::fromHBITMAP()

Returns a QImage that is equivalent to the given hbitmap

QImage::fromHICON()

Returns a QImage that is equivalent to the given icon

QPointF::fromCGPoint()

Creates a QRectF from CGPoint point

QRectF::fromCGRect()

Creates a QRectF from CGRect rect

QSizeF::fromCGSize()

Creates a QRectF from size

QString::fromCFString()

Constructs a new QString containing a copy of the string CFString

QString::fromNSString()

Constructs a new QString containing a copy of the string NSString

QTimeZone::fromCFTimeZone()

Constructs a new QTimeZone containing a copy of the CFTimeZone timeZone

QTimeZone::fromNSTimeZone()

Constructs a new QTimeZone containing a copy of the NSTimeZone timeZone

QUrl::fromCFURL()

Constructs a QUrl containing a copy of the CFURL url

QUrl::fromNSURL()

Constructs a QUrl containing a copy of the NSURL url

QUuid::fromCFUUID()

Constructs a new QUuid containing a copy of the uuid CFUUID

QUuid::fromNSUUID()

Constructs a new QUuid containing a copy of the uuid NSUUID

QByteArray::toCFData()

Creates a CFData from a QByteArray

QByteArray::toRawCFData()

Constructs a CFData that uses the bytes of the QByteArray

QDateTime::toCFDate()

Creates a CFDate from a QDateTime

QString::toCFString()

Creates a CFString from a QString

QStringView::toCFString()

Creates a CFString from this QStringView

QTimeZone::toCFTimeZone()

Creates a CFTimeZone from a QTimeZone

QUrl::toCFURL()

Creates a CFURL from a QUrl

QUuid::toCFUUID()

Creates a CFUUID from a QUuid

QImage::toCGImage()

Creates a CGImage equivalent to this QImage

QPointF::toCGPoint()

Creates a CGPoint from a QPointF

QPoint::toCGPoint()

Creates a CGPoint from a QPoint

QRectF::toCGRect()

Creates a CGRect from a QRectF

QRect::toCGRect()

Creates a CGRect from a QRect

QSizeF::toCGSize()

Creates a CGSize from a QSizeF

QSize::toCGSize()

Creates a CGSize from a QSize

QImage::toHBITMAP()

Creates a HBITMAP equivalent of the QImage

QImage::toHICON()

Creates a HICON equivalent of the QPixmap, applying the mask mask

QByteArray::toNSData()

Creates a NSData from a QByteArray

QByteArray::toRawNSData()

Constructs a NSData that uses the bytes of the QByteArray

QDateTime::toNSDate()

Creates an NSDate from a QDateTime

QString::toNSString()

Creates a NSString from a QString

QStringView::toNSString()

Creates an NSString from this QStringView

QTimeZone::toNSTimeZone()

Creates an NSTimeZone from a QTimeZone

QUrl::toNSURL()

Creates a NSURL from a QUrl

QUuid::toNSUUID()

Creates a NSUUID from a QUuid

© The Qt Company Ltd
Licensed under the GNU Free Documentation License, Version 1.3.
https://doc.qt.io/qt-6.0/platform-type-conversions.html