QT QTextStream QDataStream 文本与二进制数据操作方式

QTextStream Class

Detailed Description

QTextStream can operate on a QIODevice, a QByteArray or a QString. Using QTextStream's streaming operators, you can conveniently read and write words, lines and numbers. For generating text, QTextStream supports formatting options for field padding and alignment, and formatting of numbers. Example:

QTextStream可以操作在一个QIODevice,一个QByteArray或一个QString上。使用QTextStream的流操作符,您可以方便地读写单词、行和数字。对于生成文本,QTextStream支持字段填充和对齐的格式选项,以及数字的格式。例子:

  QFile data("output.txt");

  if (data.open(QFile::WriteOnly | QFile::Truncate)) {

      QTextStream out(&data);

      out << "Result: " << qSetFieldWidth(10) << left << 3.14 << 2.7;

      // writes "Result: 3.14      2.7       "

  }

It's also common to use QTextStream to read console input and write console output. QTextStream is locale aware, and will automatically decode standard input using the correct codec. Example:

使用QTextStream来读取控制台输入和写入控制台输出也很常见。QTextStream是区域环境感知的,并将使用正确的编解码器自动解码标准输入。样例

  QTextStream stream(stdin);

  QString line;

  while (stream.readLineInto(&line)) {

      ...

  }

Besides using QTextStream's constructors, you can also set the device or string QTextStream operates on by calling setDevice() or setString(). You can seek to a position by calling seek(), and atEnd() will return true when there is no data left to be read. If you call flush(), QTextStream will empty all data from its write buffer into the device and call flush() on the device.

除了使用QTextStream的构造函数,您还可以通过调用setDevice()或setString()来设置QTextStream操作的设备或字符串。您可以通过调用seek()来查找位置,当没有数据可读时,atEnd()将返回true。如果调用flush(), QTextStream将清空其写缓冲区中的所有数据到设备中,并在设备上调用flush()。

Internally, QTextStream uses a Unicode based buffer, and QTextCodec is used by QTextStream to automatically support different character sets. By default, QTextCodec::codecForLocale() is used for reading and writing, but you can also set the codec by calling setCodec(). Automatic Unicode detection is also supported. When this feature is enabled (the default behavior), QTextStream will detect the UTF-16 or the UTF-32 BOM (Byte Order Mark) and switch to the appropriate UTF codec when reading. QTextStream does not write a BOM by default, but you can enable this by calling setGenerateByteOrderMark(true). When QTextStream operates on a QString directly, the codec is disabled.

在内部,QTextStream使用基于Unicode的缓冲区,QTextCodec被QTextStream用来自动支持不同的字符集。默认情况下,QTextCodec::codecForLocale()用于读取和写入,但您也可以通过调用setCodec()来设置编解码器。还支持自动Unicode检测。当该功能被启用(默认行为)时,QTextStream将检测UTF-16或UTF-32 BOM(字节顺序标记),并在读取时切换到适当的UTF编解码器。QTextStream默认情况下不写BOM,但是你可以通过调用setGenerateByteOrderMark(true)来启用它。当QTextStream直接操作QString时,将禁用编解码器。

There are three general ways to use QTextStream when reading text files:

在读取文本文件时,使用QTextStream一般有三种方法:

  • Chunk by chunk, by calling readLine() or readAll().
  • 一个块一个块地调用readLine()或readAll()。
  • Word by word. QTextStream supports streaming into QStrings, QByteArrays and char* buffers. Words are delimited by space, and leading white space is automatically skipped.
  • 逐字逐句地。QTextStream支持流到qstring, QByteArrays和char*缓冲区。单词由空格分隔,前导空白会自动跳过。
  • Character by character, by streaming into QChar or char types. This method is often used for convenient input handling when parsing files, independent of character encoding and end-of-line semantics. To skip white space, call skipWhiteSpace().
  • 逐个字符,通过流到QChar或char类型。此方法通常用于解析文件时方便的输入处理,独立于字符编码和行尾语义。要跳过空白,调用skipWhiteSpace()。

Since the text stream uses a buffer, you should not read from the stream using the implementation of a superclass. For instance, if you have a QFile and read from it directly using QFile::readLine() instead of using the stream, the text stream's internal position will be out of sync with the file's position.

因为文本流使用缓冲区,所以不应该使用超类的实现从流中读取。例如,如果您有一个QFile,并直接使用QFile::readLine()而不是使用流从它中读取,那么文本流的内部位置将与文件的位置不同步。

By default, when reading numbers from a stream of text, QTextStream will automatically detect the number's base representation. For example, if the number starts with "0x", it is assumed to be in hexadecimal form. If it starts with the digits 1-9, it is assumed to be in decimal form, and so on. You can set the integer base, thereby disabling the automatic detection, by calling setIntegerBase(). Example:

默认情况下,当从文本流中读取数字时,QTextStream将自动检测数字的基本表示。例如,如果数字以“0x”开头,则假定它是十六进制形式。如果它以数字1-9开头,则假定它是十进制形式,依此类推。您可以通过调用setIntegerBase()来设置整数基数,从而禁用自动检测。例子:

  QTextStream in("0x50 0x20");

  int firstNumber, secondNumber;

  in >> firstNumber;             // firstNumber == 80

  in >> dec >> secondNumber;     // secondNumber == 0

  char ch;

  in >> ch;                      // ch == 'x'

QTextStream supports many formatting options for generating text. You can set the field width and pad character by calling setFieldWidth() and setPadChar(). Use setFieldAlignment() to set the alignment within each field. For real numbers, call setRealNumberNotation() and setRealNumberPrecision() to set the notation (SmartNotation, ScientificNotation, FixedNotation) and precision in digits of the generated number. Some extra number formatting options are also available through setNumberFlags().

QTextStream支持生成文本的许多格式选项。可以通过调用setFieldWidth()和setPadChar()来设置字段宽度和pad字符。使用setFieldAlignment()来设置每个字段中的对齐方式。对于实数,调用setRealNumberNotation()和setRealNumberPrecision()来设置生成数的符号(SmartNotation、ScientificNotation、FixedNotation)和数字精度。还可以通过setNumberFlags()获得一些额外的数字格式选项。

Like <iostream> in the standard C++ library, QTextStream also defines several global manipulator functions:

像标准c++库中的<iostream>一样,QTextStream也定义了几个全局操作符函数:

Manipulator

Description

Qt::bin

Same as setIntegerBase(2).

Qt::oct

Same as setIntegerBase(8).

Qt::dec

Same as setIntegerBase(10).

Qt::hex

Same as setIntegerBase(16).

Qt::showbase

Same as setNumberFlags(numberFlags() | ShowBase).

Qt::forcesign

Same as setNumberFlags(numberFlags() | ForceSign).

Qt::forcepoint

Same as setNumberFlags(numberFlags() | ForcePoint).

Qt::noshowbase

Same as setNumberFlags(numberFlags() & ~ShowBase).

Qt::noforcesign

Same as setNumberFlags(numberFlags() & ~ForceSign).

Qt::noforcepoint

Same as setNumberFlags(numberFlags() & ~ForcePoint).

Qt::uppercasebase

Same as setNumberFlags(numberFlags() | UppercaseBase).

Qt::uppercasedigits

Same as setNumberFlags(numberFlags() | UppercaseDigits).

Qt::lowercasebase

Same as setNumberFlags(numberFlags() & ~UppercaseBase).

Qt::lowercasedigits

Same as setNumberFlags(numberFlags() & ~UppercaseDigits).

Qt::fixed

Same as setRealNumberNotation(FixedNotation).

Qt::scientific

Same as setRealNumberNotation(ScientificNotation).

Qt::left

Same as setFieldAlignment(AlignLeft).

Qt::right

Same as setFieldAlignment(AlignRight).

Qt::center

Same as setFieldAlignment(AlignCenter).

Qt::endl

Same as operator<<('\n') and flush().

Qt::flush

Same as flush().

Qt::reset

Same as reset().

Qt::ws

Same as skipWhiteSpace().

Qt::bom

Same as setGenerateByteOrderMark(true).

In addition, Qt provides three global manipulators that take a parameter: qSetFieldWidth(), qSetPadChar(), and qSetRealNumberPrecision().

See also QDataStream, QIODevice, QFile, QBuffer, QTcpSocket, and Text Codecs Example.

QDataStream Class

The QDataStream class provides serialization of binary data to a QIODevice. More...

Header:

#include <QDataStream>

qmake:

QT += core

Note: All functions in this class are reentrant. 

Public Types

enum

ByteOrder { BigEndian, LittleEndian }

enum

FloatingPointPrecision { SinglePrecision, DoublePrecision }

enum

Status { Ok, ReadPastEnd, ReadCorruptData, WriteFailed }

enum

Version { Qt_1_0, Qt_2_0, Qt_2_1, Qt_3_0, Qt_3_1, …, Qt_5_14 }

Public Functions

QDataStream(const QByteArray &a)

QDataStream(QByteArray *a, QIODevice::OpenMode mode)

QDataStream(QIODevice *d)

QDataStream()

~QDataStream()

void

abortTransaction()

bool

atEnd() const

QDataStream::ByteOrder

byteOrder() const

bool

commitTransaction()

QIODevice *

device() const

QDataStream::FloatingPointPrecision

floatingPointPrecision() const

QDataStream &

readBytes(char *&s, uint &l)

int

readRawData(char *s, int len)

void

resetStatus()

void

rollbackTransaction()

void

setByteOrder(QDataStream::ByteOrder bo)

void

setDevice(QIODevice *d)

void

setFloatingPointPrecision(QDataStream::FloatingPointPrecision precision)

void

setStatus(QDataStream::Status status)

void

setVersion(int v)

int

skipRawData(int len)

void

startTransaction()

QDataStream::Status

status() const

int

version() const

QDataStream &

writeBytes(const char *s, uint len)

int

writeRawData(const char *s, int len)

QDataStream &

operator<<(qint8 i)

QDataStream &

operator<<(quint8 i)

QDataStream &

operator<<(qint16 i)

QDataStream &

operator<<(quint16 i)

QDataStream &

operator<<(qint32 i)

QDataStream &

operator<<(quint32 i)

QDataStream &

operator<<(qint64 i)

QDataStream &

operator<<(quint64 i)

QDataStream &

operator<<(std::nullptr_t ptr)

QDataStream &

operator<<(bool i)

QDataStream &

operator<<(qfloat16 f)

QDataStream &

operator<<(float f)

QDataStream &

operator<<(double f)

QDataStream &

operator<<(const char *s)

QDataStream &

operator>>(qint8 &i)

QDataStream &

operator>>(quint8 &i)

QDataStream &

operator>>(qint16 &i)

QDataStream &

operator>>(quint16 &i)

QDataStream &

operator>>(qint32 &i)

QDataStream &

operator>>(quint32 &i)

QDataStream &

operator>>(qint64 &i)

QDataStream &

operator>>(quint64 &i)

QDataStream &

operator>>(std::nullptr_t &ptr)

QDataStream &

operator>>(bool &i)

QDataStream &

operator>>(qfloat16 &f)

QDataStream &

operator>>(float &f)

QDataStream &

operator>>(double &f)

QDataStream &

operator>>(char *&s)

Detailed Description

A data stream is a binary stream of encoded information which is 100% independent of the host computer's operating system, CPU or byte order. For example, a data stream that is written by a PC under Windows can be read by a Sun SPARC running Solaris.

数据流是一种编码信息的二进制流,它100%独立于主机的操作系统、CPU或字节顺序。例如,在Windows下由PC写入的数据流可以由运行Solaris的Sun SPARC读取。

You can also use a data stream to read/write raw unencoded binary data. If you want a "parsing" input stream, see QTextStream.

还可以使用数据流读取/写入原始的未编码二进制数据。如果您想要一个“解析”输入流,请参阅QTextStream。

The QDataStream class implements the serialization of C++'s basic data types, like char, short, int, char *, etc. Serialization of more complex data is accomplished by breaking up the data into primitive units.

QDataStream类实现了C-++的基本数据类型的序列化,如char、短、int、char *等。对更复杂的数据的序列化是通过将数据分解成原始单元来完成的。

A data stream cooperates closely with a QIODevice. A QIODevice represents an input/output medium one can read data from and write data to. The QFile class is an example of an I/O device.

数据流与QIODevice紧密合作。一个QIODevice代表一个可以读取数据和写入数据的输入/输出介质。QFile类是I/O设备的一个例子。

Example (write binary data to a stream):

示例(将二进制数据写入流):

  QFile file("file.dat");

  file.open(QIODevice::WriteOnly);

  QDataStream out(&file);   // we will serialize the data into the file

  out << QString("the answer is");   // serialize a string

  out << (qint32)42;        // serialize an integer

Example (read binary data from a stream):

示例(从流中读取二进制数据)

  QFile file("file.dat");

  file.open(QIODevice::ReadOnly);

  QDataStream in(&file);    // read the data serialized from the file

  QString str;

  qint32 a;

  in >> str >> a;           // extract "the answer is" and 42

Each item written to the stream is written in a predefined binary format that varies depending on the item's type. Supported Qt types include QBrush, QColor, QDateTime, QFont, QPixmap, QString, QVariant and many others. For the complete list of all Qt types supporting data streaming see Serializing Qt Data Types.

写入流的每个项都是用预定义的二进制格式写入的,该格式根据项的类型而不同。支持的Qt类型包括QBrush, QColor, QDateTime, QFont, QPixmap, QString, QVariant和许多其他。有关支持数据流的所有Qt类型的完整列表,请参阅序列化Qt数据类型。

For integers it is best to always cast to a Qt integer type for writing, and to read back into the same Qt integer type. This ensures that you get integers of the size you want and insulates you from compiler and platform differences.

对于整数,最好始终转换为Qt整数类型进行写入,并读回相同的Qt整数类型。这确保您得到您想要的大小的整数,并使您远离编译器和平台的差异

Enumerations can be serialized through QDataStream without the need of manually defining streaming operators. Enum classes are serialized using the declared size.

枚举可以通过QDataStream进行序列化,而不需要手动定义流式操作符。枚举类使用声明的大小进行序列化。

To take one example, a char * string is written as a 32-bit integer equal to the length of the string including the '\0' byte, followed by all the characters of the string including the '\0' byte. When reading a char * string, 4 bytes are read to create the 32-bit length value, then that many characters for the char * string including the '\0' terminator are read.

举个例子,一个char *字符串被写成32位整数,等于包含'\0'字节的字符串长度,后面跟着包含'\0'字节的字符串的所有字符。在读取char *字符串时,将读取4个字节来创建32位的长度值,然后读取包括'\0'终止符在内的char *字符串的许多字符。

The initial I/O device is usually set in the constructor, but can be changed with setDevice(). If you've reached the end of the data (or if there is no I/O device set) atEnd() will return true. 

初始I/O设备通常在构造函数中设置,但可以使用setDevice()进行更改。如果已经到达数据的末尾(或者没有I/O设备设置),atEnd()将返回true。

Versioning

版本控制

QDataStream's binary format has evolved since Qt 1.0, and is likely to continue evolving to reflect changes done in Qt. When inputting or outputting complex types, it's very important to make sure that the same version of the stream (version()) is used for reading and writing. If you need both forward and backward compatibility, you can hardcode the version number in the application:

QDataStream的二进制格式从Qt 1.0开始发展,并且很可能会继续发展,以反映Qt中所做的变化。当输入或输出复杂类型时,确保使用相同版本的流(version())进行读写是非常重要的。如果你需要向前和向后兼容,你可以在应用程序中硬编码版本号:

  stream.setVersion(QDataStream::Qt_4_0);

If you are producing a new binary data format, such as a file format for documents created by your application, you could use a QDataStream to write the data in a portable format. Typically, you would write a brief header containing a magic string and a version number to give yourself room for future expansion. For example:

如果要生成新的二进制数据格式,例如应用程序创建的文档的文件格式,则可以使用QDataStream以可移植格式写入数据。通常,您会编写一个简短的头文件,其中包含一个神奇的字符串和一个版本号,以便为将来的扩展提供空间。例如:

  QFile file("file.xxx");

  file.open(QIODevice::WriteOnly);

  QDataStream out(&file);

  // Write a header with a "magic number" and a version

  out << (quint32)0xA0B0C0D0;

  out << (qint32)123;

  out.setVersion(QDataStream::Qt_4_0);

  // Write the data

  out << lots_of_interesting_data;

Then read it in with:

然后,请阅读以下内容:

  QFile file("file.xxx");

  file.open(QIODevice::ReadOnly);

  QDataStream in(&file);

  // Read and check the header

  quint32 magic;

  in >> magic;

  if (magic != 0xA0B0C0D0)

      return XXX_BAD_FILE_FORMAT;

  // Read the version

  qint32 version;

  in >> version;

  if (version < 100)

      return XXX_BAD_FILE_TOO_OLD;

  if (version > 123)

      return XXX_BAD_FILE_TOO_NEW;

  if (version <= 110)

      in.setVersion(QDataStream::Qt_3_2);

  else

      in.setVersion(QDataStream::Qt_4_0);

  // Read the data

  in >> lots_of_interesting_data;

  if (version >= 120)

      in >> data_new_in_XXX_version_1_2;

  in >> other_interesting_data;

You can select which byte order to use when serializing data. The default setting is big endian (MSB first). Changing it to little endian breaks the portability (unless the reader also changes to little endian). We recommend keeping this setting unless you have special requirements. 

可以选择在序列化数据时使用的字节顺序。默认设置为大端序(MSB优先)。将其更改为小端序会破坏可移植性(除非读取器也更改为小端序)。我们建议保持此设置,除非您有特殊要求。

Reading and Writing Raw Binary Data

读写原始二进制数据

You may wish to read/write your own raw binary data to/from the data stream directly. Data may be read from the stream into a preallocated char * using readRawData(). Similarly data can be written to the stream using writeRawData(). Note that any encoding/decoding of the data must be done by you.

您可能希望直接在数据流中读写自己的原始二进制数据。可以使用readRawData()将数据从流读入预分配的

char *。类似地,可以使用writeRawData()将数据写入流。注意,数据的任何编码/解码都必须由您完成。

A similar pair of functions is readBytes() and writeBytes(). These differ from their raw counterparts as follows: readBytes() reads a quint32 which is taken to be the length of the data to be read, then that number of bytes is read into the preallocated char *; writeBytes() writes a quint32 containing the length of the data, followed by the data. Note that any encoding/decoding of the data (apart from the length quint32) must be done by you. 

类似的一对函数是readBytes()和writeBytes()。它们与原始版本的区别如下:readBytes()读取一个quint32,它被认为是要读取的数据的长度,然后这个字节数被读入预分配的char *;writeBytes()写入一个包含数据长度和后跟数据的quint32。注意,数据的任何编码/解码(长度quint32除外)都必须由您完成。

Reading and Writing Qt Collection Classes

读与写Qt类集合

The Qt container classes can also be serialized to a QDataStream. These include QList, QLinkedList, QVector, QSet, QHash, and QMap. The stream operators are declared as non-members of the classes.

Qt容器类也可以被序列化到QDataStream中。这些包括QList, QLinkedList, QVector, QSet, QHash和QMap。流操作符被声明为类的非成员。 

Reading and Writing Other Qt Classes

读与写Qt其他类

In addition to the overloaded stream operators documented here, any Qt classes that you might want to serialize to a QDataStream will have appropriate stream operators declared as non-member of the class:除了这里记录的重载流操作符,任何你可能想要序列化到QDataStream的Qt类都将有适当的流操作符声明为类的非成员:

      QDataStream &operator<<(QDataStream &, const QXxx &);

      QDataStream &operator>>(QDataStream &, QXxx &);

For example, here are the stream operators declared as non-members of the QImage class:

例如,下面是声明为QImage类的非成员的流操作符:

      QDataStream & operator<< (QDataStream& stream, const QImage& image);

      QDataStream & operator>> (QDataStream& stream, QImage& image);

To see if your favorite Qt class has similar stream operators defined, check the Related Non-Members section of the class's documentation page. 

要查看您最喜欢的Qt类是否定义了类似的流操作符,请检查该类的文档页面中的“Related Non-Members”部分。

Using Read Transactions

使用读取事务

When a data stream operates on an asynchronous device, the chunks of data can arrive at arbitrary points in time. The QDataStream class implements a transaction mechanism that provides the ability to read the data atomically with a series of stream operators. As an example, you can handle incomplete reads from a socket by using a transaction in a slot connected to the readyRead() signal:

当数据流在异步设备上运行时,数据块可以在任意时间点到达。QDataStream类实现了一种事务机制,该机制提供了通过一系列流操作符原子地读取数据的能力。例如,你可以通过使用连接到readyRead()信号的插槽中的事务来处理从套接字的未完成读取:

  in.startTransaction();

  QString str;

  qint32 a;

  in >> str >> a; // try to read packet atomically

  if (!in.commitTransaction())

      return;     // wait for more data

If no full packet is received, this code restores the stream to the initial position, after which you need to wait for more data to arrive.

如果没有收到完整的数据包,这段代码将流恢复到初始位置,之后需要等待更多的数据到达。

See also QTextStream and QVariant.

Member Type Documentation

enum QDataStream::ByteOrder

The byte order used for reading/writing the data.

用于读取/写入数据的字节顺序。

Constant

Value

Description

QDataStream::BigEndian

QSysInfo::BigEndian

Most significant byte first (the default)

QDataStream::LittleEndian

QSysInfo::LittleEndian

Least significant byte first

enum QDataStream::FloatingPointPrecision

The precision of floating point numbers used for reading/writing the data. This will only have an effect if the version of the data stream is Qt_4_6 or higher.

用于读取/写入数据的浮点数的精度。只有当数据流的版本为Qt_4_6或更高时,这才会有效果。

Warning: The floating point precision must be set to the same value on the object that writes and the object that reads the data stream.

警告:在写入数据流的对象和读取数据流的对象上,浮点精度必须设置为相同的值。

Constant

Value

Description

QDataStream::SinglePrecision

0

All floating point numbers in the data stream have 32-bit precision.数据流中的所有浮点数都具有32位精度。

QDataStream::DoublePrecision

1

All floating point numbers in the data stream have 64-bit precision.数据流中的所有浮点数都具有64位精度

See also setFloatingPointPrecision() and floatingPointPrecision().

enum QDataStream::Status

This enum describes the current status of the data stream.

该枚举描述数据流的当前状态。

Constant

Value

Description

QDataStream::Ok

0

The data stream is operating normally.

QDataStream::ReadPastEnd

1

The data stream has read past the end of the data in the underlying device.

QDataStream::ReadCorruptData

2

The data stream has read corrupt data.

QDataStream::WriteFailed

3

The data stream cannot write to the underlying device.

enum QDataStream::Version

This enum provides symbolic synonyms for the data serialization format version numbers.

此枚举为数据序列化格式版本号提供符号同义词。

Constant

Value

Description

QDataStream::Qt_1_0

1

Version 1 (Qt 1.x)

QDataStream::Qt_2_0

2

Version 2 (Qt 2.0)

QDataStream::Qt_2_1

3

Version 3 (Qt 2.1, 2.2, 2.3)

QDataStream::Qt_3_0

4

Version 4 (Qt 3.0)

QDataStream::Qt_3_1

5

Version 5 (Qt 3.1, 3.2)

QDataStream::Qt_3_3

6

Version 6 (Qt 3.3)

QDataStream::Qt_4_0

7

Version 7 (Qt 4.0, Qt 4.1)

QDataStream::Qt_4_1

Qt_4_0

Version 7 (Qt 4.0, Qt 4.1)

QDataStream::Qt_4_2

8

Version 8 (Qt 4.2)

QDataStream::Qt_4_3

9

Version 9 (Qt 4.3)

QDataStream::Qt_4_4

10

Version 10 (Qt 4.4)

QDataStream::Qt_4_5

11

Version 11 (Qt 4.5)

QDataStream::Qt_4_6

12

Version 12 (Qt 4.6, Qt 4.7, Qt 4.8)

QDataStream::Qt_4_7

Qt_4_6

Same as Qt_4_6.

QDataStream::Qt_4_8

Qt_4_7

Same as Qt_4_6.

QDataStream::Qt_4_9

Qt_4_8

Same as Qt_4_6.

QDataStream::Qt_5_0

13

Version 13 (Qt 5.0)

QDataStream::Qt_5_1

14

Version 14 (Qt 5.1)

QDataStream::Qt_5_2

15

Version 15 (Qt 5.2)

QDataStream::Qt_5_3

Qt_5_2

Same as Qt_5_2

QDataStream::Qt_5_4

16

Version 16 (Qt 5.4)

QDataStream::Qt_5_5

Qt_5_4

Same as Qt_5_4

QDataStream::Qt_5_6

17

Version 17 (Qt 5.6)

QDataStream::Qt_5_7

Qt_5_6

Same as Qt_5_6

QDataStream::Qt_5_8

Qt_5_7

Same as Qt_5_6

QDataStream::Qt_5_9

Qt_5_8

Same as Qt_5_6

QDataStream::Qt_5_10

Qt_5_9

Same as Qt_5_6

QDataStream::Qt_5_11

Qt_5_10

Same as Qt_5_6

QDataStream::Qt_5_12

18

Version 18 (Qt 5.12)

QDataStream::Qt_5_13

19

Version 19 (Qt 5.13)

QDataStream::Qt_5_14

Qt_5_13

Same as Qt_5_13

See also setVersion() and version().

本文为出自qt官方文档的翻译

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值