类型转换

Qt 的很多基本数据类型,譬如 QString , QPoint ,或 QImage ,提供到/来自本机等效类型的转换。

以下列表枚举所有可用类型转换:

QByteArray::fromCFData()

Constructs a new QByteArray containing a copy of the CFData data

QByteArray::fromEcmaUint8Array()

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()

从 CGPoint 点创建 QRectF

QRectF::fromCGRect()

从 CGRect 矩形创建 QRectF

QRectF::fromDOMRect()

QSizeF::fromCGSize()

从尺寸创建 QRectF

QString::fromCFString()

Constructs a new QString containing a copy of the string CFString

QString::fromEcmaString()

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::toEcmaUint8Array()

QByteArray::toCFData()

从 QByteArray 创建 CFData

QByteArray::toRawCFData()

Constructs a CFData that uses the bytes of the QByteArray

QDateTime::toCFDate()

Creates a CFDate from a QDateTime

QStringView::toCFString()

Creates a CFString from this QStringView

QString::toCFString()

Creates a CFString from a QString

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

QRectF::toDOMRect()

QString::toEcmaString()