diff --git a/src/corelib/io/qdatastream.cpp b/src/corelib/io/qdatastream.cpp index 713b5a2f55da2899397d1face231023d5e01c337..675178ea8077726bdb79bfc758d4ca0dc0ac0575 100644 --- a/src/corelib/io/qdatastream.cpp +++ b/src/corelib/io/qdatastream.cpp @@ -526,7 +526,7 @@ void QDataStream::setByteOrder(ByteOrder bo) \value Qt_5_3 Same as Qt_5_2 \value Qt_5_4 Version 16 (Qt 5.4) \value Qt_5_5 Same as Qt_5_4 - \value Qt_5_6 Same as Qt_5_4 + \value Qt_5_6 Version 17 (Qt 5.6) \omitvalue Qt_DefaultCompiledVersion \sa setVersion(), version() diff --git a/src/corelib/io/qdatastream.h b/src/corelib/io/qdatastream.h index b87dbe4784df80a97c85a8d4680f4d6949fffbb9..5730c12907157c73b623c348989a4e7990401e68 100644 --- a/src/corelib/io/qdatastream.h +++ b/src/corelib/io/qdatastream.h @@ -83,7 +83,7 @@ public: Qt_5_3 = Qt_5_2, Qt_5_4 = 16, Qt_5_5 = Qt_5_4, - Qt_5_6 = Qt_5_5, + Qt_5_6 = 17, #if QT_VERSION >= 0x050700 #error Add the datastream version for this Qt version and update Qt_DefaultCompiledVersion #endif diff --git a/src/gui/text/qfont.cpp b/src/gui/text/qfont.cpp index 796f22379741c3fea6110bfaf3e8ee72ee4a1cc6..7d9d00713c7d0eccdbaf89b0e96e487152879766 100644 --- a/src/gui/text/qfont.cpp +++ b/src/gui/text/qfont.cpp @@ -2218,6 +2218,8 @@ QDataStream &operator<<(QDataStream &s, const QFont &font) } if (s.version() >= QDataStream::Qt_5_4) s << (quint8)font.d->request.hintingPreference; + if (s.version() >= QDataStream::Qt_5_6) + s << (quint8)font.d->capital; return s; } @@ -2308,7 +2310,11 @@ QDataStream &operator>>(QDataStream &s, QFont &font) s >> value; font.d->request.hintingPreference = QFont::HintingPreference(value); } - + if (s.version() >= QDataStream::Qt_5_6) { + quint8 value; + s >> value; + font.d->capital = QFont::Capitalization(value); + } return s; } diff --git a/tests/auto/corelib/io/qdatastream/tst_qdatastream.cpp b/tests/auto/corelib/io/qdatastream/tst_qdatastream.cpp index 2cf93e1c459624b00a3d5cfcab9d53097251d58b..d9d3f55d4ae33ec5d30e6fa0fb968370c994049d 100644 --- a/tests/auto/corelib/io/qdatastream/tst_qdatastream.cpp +++ b/tests/auto/corelib/io/qdatastream/tst_qdatastream.cpp @@ -264,7 +264,9 @@ static int NColorRoles[] = { QPalette::ToolTipText + 1, // Qt_5_2 QPalette::ToolTipText + 1, // Qt_5_3 QPalette::ToolTipText + 1, // Qt_5_4 - 0 // add the correct value for Qt_5_5 here later + QPalette::ToolTipText + 1, // Qt_5_5 + QPalette::ToolTipText + 1, // Qt_5_6 + 0 // add the correct value for Qt_5_7 here later }; // Testing get/set functions diff --git a/tests/auto/gui/text/qfont/tst_qfont.cpp b/tests/auto/gui/text/qfont/tst_qfont.cpp index 462e5115b497eb8067c10d01cef34e9642b7bf88..84109441b90bc05e107e25c38f604d7cff864455 100644 --- a/tests/auto/gui/text/qfont/tst_qfont.cpp +++ b/tests/auto/gui/text/qfont/tst_qfont.cpp @@ -608,6 +608,11 @@ void tst_QFont::serialize_data() font.setStyleName("Regular Black Condensed"); // This wasn't read until 5.4. QTest::newRow("styleName") << font << QDataStream::Qt_5_4; + + font = basicFont; + font.setCapitalization(QFont::AllUppercase); + // This wasn't read until 5.6. + QTest::newRow("capitalization") << font << QDataStream::Qt_5_6; } void tst_QFont::serialize()