Qt 数据类型的序列化
QDataStream 类允许您对本节中列出的Qt数据类型进行序列化。
在读写时,最好将整数强制转换为 Qt 整数类型,例如qint16 或quint32 。这样可以确保无论应用程序运行在何种底层平台和架构上,您都能确切地知道正在读写的整数大小。
- bool
- qint8
- qint16
- qint32
- qint64
- quint8
- quint16
- quint32
- quint64
floatdoubleconst char *- QBitArray
- QBrush
- QByteArray
- QCborArray
- QCborMap
- QCborValue
- QColor
- QColorSpace
- QCursor
- QDate
- QDateTime
- QEasingCurve
- QFont
- QGenericMatrix
- QHash<Key, T>
- QHostAddress
- QHttpHeaders
- QIcon
- QImage
- QJsonArray
- QJsonDocument
- QJsonObject
- QJsonValue
- QKeySequence
- QLine
- QLineF
- QList<T>
- QListWidgetItem
- QLocale
- QMap<Key, T>
- QMargins
- QMarginsF
- QMatrix4x4
- QModelIndex
- QModelIndexList
- QMultiHash<Key
- QMultiMap<Key
- QNetworkCacheMetaData
- QNetworkCacheMetaData::AttributesMap
- QPageRanges
- QPainterPath
- std::pair<T1, T2>
- QPalette
- QPen
- QPicture
- QPixmap
- QPoint
- QPointF
- QPolygon
- QPolygonF
- QQuaternion
- QRect
- QRectF
- QRegularExpression
- QRegion
- QSet
- QSize
- QSizeF
- QSizePolicy
- QStandardItem
- QString
- QTableWidgetItem
- QTextBlockFormat
- QTextCharFormat
- QTextFormat
- QTextFrameFormat
- QTextLength
- QTextListFormat
- QTextTableCellFormat
- QTimeZone
- QTime
- QTransform
- QTreeWidgetItem
- QTypeRevision
- QUrl
- QUuid
- QVariant
- QVector2D
- QVector3D
- QVector4D
- QVersionNumber
另请参阅 Qt 中的 JSON 支持和Qt 中的 CBOR 支持。
© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.