summaryrefslogtreecommitdiffstats
path: root/src/corelib/serialization/qdatastream.cpp
Commit message (Collapse)AuthorAgeFilesLines
* QDataStream::readBytes: guard against integer overflowIvan Solovev11 days1-1/+3
| | | | | | | | | | | | | | | The step variable changes in the geometric progression, which means that it may overflow at some point. Since it is a qsizetype (signed 64 or 32 bit integer), the overflow would be UB, so we need to avoid it. Add an extra check that the step is lower than the safe threshold before increasing it. Amends a1bfac287ee5d3719646d68dc91dc8e8e4cec04e. Pick-to: 6.7 Change-Id: I6097986e614937fa88b31b3dd1e53ecff22533d7 Reviewed-by: Marc Mutz <marc.mutz@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QDataStream::readBytes: do not leak the memory in case of bad_allocIvan Solovev11 days1-12/+6
| | | | | | | | | | | | | | | | | The algorithm was leaking the previous buffer if the attempt to allocate a new one failed with std::bad_alloc. Wrap the buffer allocations into std::unique_ptr, so that we do not leak the buffer in case of bad_alloc. This patch is not changing the behavior of QDataStream, so it's NOT handling the bad_alloc exception, and also does not change the state of the buffer in case the exception occurs. Pick-to: 6.7 6.5 Change-Id: I5558a6d03768094e4ee83ca47cacf4e09c36f1cf Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* Doc: QDataStream doc exampleJaishree Vyas2024-04-231-7/+20
| | | | | | | | | Updated the example description Fixes: QTBUG-123035 Pick-to: 6.7 Change-Id: I3dc953b02297e6e6bd9aecbc2e8831f13cf48715 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
* QDataStream: don't store the byteorder member in Qt 7Thiago Macieira2024-03-121-2/+5
| | | | | | | | | | | It's redundant with the noswap member: we swap if the stream byte order is the opposite of the CPU's and don't swap if it is the same. That the default is to swap is another reason why people should stop using QDataStream (though CBOR also stores numbers in big-endian). Change-Id: I50e2158aeade4256ad1dfffd17b29adc2b698ead Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QDataStream: use NSDMIThiago Macieira2024-03-121-19/+0
| | | | | | | | Just a little clean-up to avoid repetition. Change-Id: I50e2158aeade4256ad1dfffd17b29a5b36c71ddc Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QDataStream: Move trasactionDepth to the main classThiago Macieira2024-03-121-8/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The q_status member has too much space dedicated to it: 32 bits. So we can shrink it to a mere 8 bits and move it up to the 1-byte padding hole and repurpose the space it used to use. This only works because the q_status member was not accessed by any inline function before Qt 6.8 (see commit fc23fa459c5924bf1cc4564c7bce1fd59d7c972b). After this, pahole says: class QScopedPointer<QDataStreamPrivate> d; /* 0 8 */ class QIODevice * dev; /* 8 8 */ bool owndev; /* 16 1 */ bool noswap; /* 17 1 */ quint8 fpPrecision; /* 18 1 */ quint8 q_status; /* 19 1 */ enum ByteOrder byteorder; /* 20 4 */ int ver; /* 24 4 */ quint16 transactionDepth; /* 28 2 */ /* size: 32, cachelines: 1, members: 10 */ That leaves 16 bits of tail padding unused, so reduces the maximum number of nested transactions to 65536. That is to support a Qt 7 layout in an upcoming commit. Change-Id: I50e2158aeade4256ad1dfffd17b29d75fd13f472 Reviewed-by: Marc Mutz <marc.mutz@qt.io> Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* QDataStream: inline floatingPointPrecision()Thiago Macieira2024-03-121-7/+3
| | | | | | | | | | | | | | | | | | | | | | There is a 2-byte padding in all architectures between the noswap member and byteorder, because the latter requires a 32-bit alignment. So we can use this space to store this little-used field and avoid one more reason for QDataStreamPrivate. Now: class QScopedPointer<QDataStreamPrivate> d; /* 0 8 */ class QIODevice * dev; /* 8 8 */ bool owndev; /* 16 1 */ bool noswap; /* 17 1 */ quint8 fpPrecision; /* 18 1 */ /* XXX 1 byte hole, try to pack */ enum ByteOrder byteorder; /* 20 4 */ int ver; /* 24 4 */ enum Status q_status; /* 28 4 */ /* size: 32, cachelines: 1, members: 9 */ Change-Id: I50e2158aeade4256ad1dfffd17b29c2c5db02c12 Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* QDataStream: Turn QDataStreamSizes enum into static contexpr quint32Øystein Heskestad2024-02-231-0/+3
| | | | | | | | | | The special sizes NullCode and ExtendedSize does not need to be part of an enum. Turning them into constants removes the need for some casts. Task-number: QTBUG-119952 Pick-to: 6.7 Change-Id: Ie7835c52f4642ab907b91f0eceac2ea7650e81da Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* QDataStream: reimplement and constrain operator<<(bool)Giuseppe D'Angelo2024-02-201-8/+3
| | | | | | | | | | | | | | | | | Instead of offering it as a plain overload, make it a template and constrain the argument to be precisely bool. This removes the danger of accidentally streaming things that are convertible to bool, such as pointers, by, indeed, converting them to bool. This allows us to remove the deleted overloads for pointers to objects and pointers to members. The existing operator<<(bool) is exported, hence I moved it into removed_api.cpp. Since the implementation required private QDataStream APIs, I've just "inlined" the implementation that simply routed through the operator<<(qint8) overload. Change-Id: I3c0a9811bf5c9e734e28514b37bcaaddb09ada25 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QDataStream: inline status()Marc Mutz2024-02-121-5/+2
| | | | | | | | | | | | | The implementation is trivial, and unchanged since the beginning of the public project history, so I'd venture that it's safe to commit to it not changing until Qt 7 at this point. The reason to make it inline is that a good stream operator implementation should be checking the stream state quite often, so we shouldn't make that an expensive DLL entry point. Change-Id: Iba8cbfbaf02326c86ab95be17b603cd2e785f78c Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
* Deprecate QDataStream::readBytes(char *&, uint &) instead of removing itIvan Solovev2024-02-071-0/+22
| | | | | | | | | | | | | | | | | | | | | | We cannot remove the overload using QT_REMOVED_SINCE, because a qint64 lvalue in the new overload will not bind to an uint& parameter, so the old code would not compile. Deprecate the old overload, and add a unit-test that makes sure that it still behaves correctly. This commit also introduces the new deprecation macros that are required to do the deprecation in Qt 6.11. Amends fd48ce0b73c74dafd5db27bc1f2752ef665df7ef Found in 6.7 API review Pick-to: 6.7 Change-Id: I02893bfbe040df736f8e746384e0261a0f0041d3 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix QDataStream::operator<<(const char *) to handle 64-bit lengthIvan Solovev2024-02-071-7/+3
| | | | | | | | | | | | | | | The operator was not converted to using a new streaming version, so it supported only 32-bit length. Fix it and add a manual test for serialization/deserialization of large c-style strings. Amends fd48ce0b73c74dafd5db27bc1f2752ef665df7ef Pick-to: 6.7 Change-Id: I83704edec021d400b992de810feba5da52d5ffe1 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QDataStream::readBytes(): only chunk when data is not all availableIvan Solovev2024-02-071-1/+1
| | | | | | | | | | | | | | If the underlying QDataStream's device already contains all data that we want to read, we can optimize the allocation algorithm, and try to allocate all needed memory at once. Use bytesAvailable() to determine if the underlying device can provide all requested data, and adjust the initial block size based on the result. If not all data is available, fall back to the geometric growth algorithm. Change-Id: I6384d2caa16c238c2dbb77b2ad761cbd8a44df6c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QDataStream::readBytes(): make the growth of the buffer geometricIvan Solovev2024-02-071-2/+3
| | | | | | | | | | | | | The algorithm tries to allocate the memory using 1 Mb blocks. When the input data is large, this results in a lot of reallocations, which is slow and inefficient. This patch modifies the algorithm in such way that the allocation size increases at each step, resulting in geometric growth of the buffer. Pick-to: 6.7 6.6 6.5 Change-Id: I071df68d51ba1dbd8b2eb5f94eb078a33223505f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QDataStream: use SizeLimitExceeded status in write operationsIvan Solovev2024-02-071-2/+2
| | | | | | | | | | | | | | | | | | | | | | Set this status when the stream tries to write more data than the current serialization format supports. Update the methods that write containers to return early if they fail to write the container size, and do not try to serialize the elements. Convert the manual tst_manualqdatastream test into a data-driven test, allowing us to specify various stream versions. Adjust the test code to check that the SizeLimitExceeded status is set when the stream version is <= Qt_6_6. Amends fd48ce0b73c74dafd5db27bc1f2752ef665df7ef Found in 6.7 API review Pick-to: 6.7 Change-Id: If4c62ea53ac9bccd423f00f0f03afd6ba6bdc4f5 Reviewed-by: Marc Mutz <marc.mutz@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QDataStream: use qint64 to represent size while reading and writingIvan Solovev2024-02-071-9/+9
| | | | | | | | | | | | Do that to avoid narrowing at the call site on 32-bit platforms. Amends fd48ce0b73c74dafd5db27bc1f2752ef665df7ef Found in 6.7 API review Pick-to: 6.7 Change-Id: I31142399385521d973b2ed3789745569e44d5d63 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QDataStream: add a new SizeLimitExceeded status codeIvan Solovev2024-01-261-1/+6
| | | | | | | | | | | | | | | | | | This status is supposed to be used when the stream tries to read or write more data than it is supported by the current platform. For example, reading more than 2 GiB of data on a 32-bit platform will result into this status, but it will work fine on a 64-bit platform. This patch uses the new status in read operations. Amends fd48ce0b73c74dafd5db27bc1f2752ef665df7ef Found in 6.7 API review Pick-to: 6.7 Change-Id: I675b1ee25fafba174ce8f94c3470dbb7893d6d9e Reviewed-by: Marc Mutz <marc.mutz@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QDataStream & QResource: document their lack of security-hardeningThiago Macieira2023-12-211-0/+21
| | | | | | | | | Pick-to: 6.7 6.6 6.5 Fixes: QTBUG-120012 Task-number: QTBUG-119178 Change-Id: I6e2677aad2ab45759db2fffd17a06af730e320d6 Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Bump version to 6.8.0Jani Heikkinen2023-12-111-0/+1
| | | | | Change-Id: I407e6fd7a766450bb6fe00da7f6ebbd49496e5cd Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
* Add support for containers > 4 Gi elements in QDataStreamØystein Heskestad2023-10-231-26/+40
| | | | | | | | | | | | The format is changed from 6.7 to support more than UINT32_MAX - 1 elements. The format used to have a quint32 size. Now if the size is larger or equal to 0xfffffffe (2^32 -2) the old size is an extend value 0xfffffffe followed by one quint64 with the actual value. The 32 bit size with all bits set is still used as null value. Fixes: QTBUG-105034 Change-Id: I62188be170fe779022ad58ab84a54b1eaf46e5d9 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QDataStream: clarify QDataStream::operator>>(char *&s) API docsAhmad Samir2023-09-101-3/+4
| | | | | | | | | | | | | The wording was slightly ambiguous giving readers the idea that it will scan for a \0 terminator in the data; however what actually happens is that readBytes() gets the length of the string from a quint32 in the stream right before the data, and readBytes() always adds a null-terminator. Fixes: QTBUG-3287 Pick-to: 6.6 6.5 6.2 5.15 Change-Id: Ie22500a9c191ffd590a6b57babeb67577c24dddb Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Bump version to 6.7.0Jani Heikkinen2023-06-121-0/+1
| | | | | Change-Id: I69954ccc5cfb44e7bf02b8fcab18e9320e7e8748 Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
* Bump version to 6.6.0Jani Heikkinen2022-12-141-0/+1
| | | | | Change-Id: I957e8a980542f16d3a3b493b41406bbeb884c2dc Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
* Doc: Document Qt Serialization with use casesJaishree Vyas2022-12-081-0/+1
| | | | | | | | | | | Added some background about Serialization with the classes and used cases. Fixes: QTBUG-103951 Pick-to: 6.4 6.3 6.2 Change-Id: I3ff179b814fc5d424f2ac2ffaf3237b90ddd7e2b Reviewed-by: Vladimir Minenko <vladimir.minenko@qt.io> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Kai Köhne <kai.koehne@qt.io>
* Bump version to 6.5.0Jani Heikkinen2022-06-061-0/+1
| | | | | Change-Id: I83a4f915a914bdc18f6706bb902f3e3b13da074f Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
* Use SPDX license identifiersLucie Gérard2022-05-161-38/+2
| | | | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. Files that have to be modified by hand are modified. License files are organized under LICENSES directory. Task-number: QTBUG-67283 Change-Id: Id880c92784c40f3bbde861c0d93f58151c18b9f1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* QDataStream: make qfloat16 streaming a non-memberMarc Mutz2022-03-141-27/+0
| | | | | | | | | | | | | | | | Remove the member function from the API and re-add it as a hidden friend on qfloat16, where it will be a complete type. [ChangeLog][QtCore][Potentially Souce-Incompatible Changes] The qfloat16 QDataStream operators are now hidden friends and only found by argument-dependent lookup. Previously, these were member functions on QDataStream. Fixes: QTBUG-93499 Pick-to: 6.3 Change-Id: Ib3d4df7a3fe3a9d0938f3be8b70b50fef0416262 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Bump version to 6.4.0Jani Heikkinen2022-01-311-0/+1
| | | | | Change-Id: Ie0e2133d6c9125b901364c979c60b6efd585f026 Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
* corelib: Fix typos in documentationJonas Kvinge2021-10-121-4/+4
| | | | | | Pick-to: 5.15 6.2 Change-Id: I64d63af708bc6ddaabd12450eb3089e5077f849e Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Adjust src/corelib/serialization/qdatastream.[h/cpp] for 6.3.0Shawn Rutledge2021-09-141-0/+1
| | | | | Change-Id: I9809d6122c6d3c5ad5753d52679f4ac67a17e3d4 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Bump the version of QDataStreamFriedemann Kleint2021-02-181-0/+1
| | | | | | | Amends f731802ba82ad260e155783e0427fb3f6ebd99fe. Change-Id: I1ba758ef4c9d80fbc11ecc78e0480f57c95007e2 Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
* Bump versionPaul Wicking2020-12-151-0/+1
| | | | | Change-Id: I33ea33c0ecfe42cd25cb9f3a37b7aad72717edd2 Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
* Fix various qdoc warningsVolker Hilsheimer2020-09-221-4/+9
| | | | | | | Parameter types and names, missing enum values, and \since 6.0. Change-Id: I1b028fcf2ef0b57accb1ef7cebf17dab9f6d571e Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Fix a number of MSVC integer conversion warningsFriedemann Kleint2020-09-101-1/+1
| | | | | | | | Mostly related to qstrlen(). Change-Id: I69e2052c83766e4fc466ed398d0d0eac011a77ec Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* Remove deprecated QDataStream::unsetDevice()Edward Welbourne2020-08-281-13/+0
| | | | | | | Deprecated since 5.13. Change-Id: I9f8f58fb92bc12d32eab5b0ae8611611fe2481e5 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Disentangle QIODevice dependenciesLars Knoll2020-08-151-2/+10
| | | | | | | | | | | | | | | | | Move the QIODevice::OpenMode enum into a base class, so that we can remove the full QIODevice (and thus QObject) dependency from qdatastream.h and qtextstream.h. This is required so that we can include QDataStream in qmetatype.h without getting circular dependencies. As a nice side effect, QDataStream and QTextStream can now inherit QIODeviceBase and provide the OpenMode enum directly in their class scope. Change-Id: Ifa68b7b1d8d95687ed032f6c9206f92e63bfacdf Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
* Use QList instead of QVector in corelib implementationJarek Kobus2020-06-291-1/+1
| | | | | | | | Omitting state machine and docs for now. Task-number: QTBUG-84469 Change-Id: Ibfa5e7035515773461f6cdbff35299315ef65737 Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* Long live std::pair!Giuseppe D'Angelo2020-06-101-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make QPair an alias for std::pair, and qMakePair just a forwarder towards std::make_pair. Why? Fundamentally to ditch a bunch of NIH code; gain for free structured bindings, std::tuple and std::reference_wrapper compatibility, and so on. Breakages: * Some that code manually forward declares QPair. We don't care about it (<QContainerFwd> is the proper way). * Some code that overloads on std::pair and QPair. Luckily it's mostly centralized: debug, metatypes, testing macros. Just remove the QPair overload. * Usages of qMakePair forcing the template type parameters. There are a handful of these in qtbase, but only one was actually broken. * std::pair is NOT (and will never likely be) trivially copiable. This is agreed to be a mistake done by practically all implementations in C++11, can can't be fixed without breaking ABI. Some code using QPair assuming it's trivially copiable may break; exactly one occurrence was in qtbase. * QMetaType logic extracts the type names in two different ways, one by looking at the source code string (e.g. extracted by moc) and one via some ad-hoc reflection in C++. We need to make "QPair" (as spelled in the source code) be the same as "std::pair" (gathered via reflection, which will see through the alias) when compared. The way it's already done e.g. for QList is by actually replacing the moc-extracted name with the name of the actual type used in C++; do the same here. On libc++, std::pair is actually in an inline namespace -- i.e. std::__1::pair; the reflection will extract and store "std::__1::pair" so we need an ad-hoc fix to QMetaType. [ChangeLog][QtCore][QPair] QPair is now an alias to std::pair, and does not exist as a class in Qt any more. This may break code such as functions overloaded for both QPair and std::pair. Usually, the overload taking a QPair can be safely discarded, leaving only the one taking a std::pair. QPair API has not changed, and qMakePair is still available for compatibility (although new code is encouraged to use std::pair and std::make_pair directly instead). Change-Id: I7725c751bf23946cde577b1406e86a336c0a3dcf Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QMetaType: Support char16_t and char32_tFabian Kosmale2020-05-151-0/+49
| | | | | Change-Id: Ieec6d4bc64967d875ea12b31638aab05bc682ea3 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Remove QLinkedListSona Kurazyan2020-02-191-1/+1
| | | | | | | | | | | | | QLinkedList has been moved to Qt5Compat. Remove and stop mentioning it in docs, examples (the docs & examples for QLinkedList itself will be moved to Qt5Compat) and remove the corresponding tests. Also remove QT_NO_LINKED_LIST, since it's not needed anymore. Task-number: QTBUG-81630 Task-number: QTBUG-80312 Change-Id: I4a8f1105cb60aa87e7fd67e901ec1a27c489aa31 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Bump versionKari Oikarinen2019-08-271-0/+1
| | | | Change-Id: Ie0cc04ec18fceccaf40eb8fe5c5b4f2e916869ac
* Move away from using 0 as a pointer constantAllan Sandfeld Jensen2019-06-071-7/+7
| | | | | | | | | Cleans up most of corelib to use nullptr or default enums where appropriate. Change-Id: Ifcaac14ecdaaee730f87f10941db3ce407d71ef9 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Merge remote-tracking branch 'origin/5.13' into devLiang Qi2019-05-131-2/+1
|\ | | | | | | | | | | | | Conflicts: src/corelib/tools/qstring.cpp Change-Id: I81dbf90fc936c9bf08197baefa071117bddb1c63
| * Doc: replace even more null/0/nullptr with \nullptr macroChristian Ehrlicher2019-05-081-2/+1
| | | | | | | | | | | | | | | | Try to replace all wordings like '.. to 0' with '.. to \nullptr'. Also checked for 'null pointer' and similar. Change-Id: I73341f59ba51e0798e816a8b1a532c7c7374b74a Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | Add serializer/deserializer for EnumerationPaolo Dastoli2019-04-051-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | Enum class are serialized using the declared size. [ChangeLog][QtCore][QDataStream] Enumerations can now be serialized through QDataStream without the need of manually defining streaming operators. Change-Id: Iae9a63eb62b5a5615b657766a3c4c66ba4d98d0e Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> Reviewed-by: Paolo Dastoli <paolo.dastoli@gmail.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Bump versionKari Oikarinen2019-02-251-0/+1
|/ | | | Change-Id: I5561df4b90b02d88bb2fc7b52d74487e71efce7d
* QtCore: replace 0 with \nullptr in documentationChristian Ehrlicher2019-01-281-2/+2
| | | | | | | | | | | Replace 0 with \nullptr in the documentation. As a drive-by also replace some 0 with nullptr in the corresponding code. Change-Id: I101a61f5fad71cadb73bba9a8fd5dce6cc0836d0 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* QtCore: mark obsolete functions as deprecatedChristian Ehrlicher2019-01-231-3/+4
| | | | | | | | | | | | | | | Mark the following obsolete functions as deprecated so they can be removed with Qt6: - QDataStream::unsetDevice() - QDir &QDir::operator=(const QString &path) - QDir::addResourceSearchPath() - QResource::addSearchPath() - QResource::searchPaths() - QSettings::setSystemIniPath() - QSettings::setUserIniPath() Change-Id: I5edfb2b4ce1ad843fa5fcd5b4c475ab9352b05f7 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Handle fonts that have commas/quotes in the family nameAndy Shaw2018-11-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Since the comma character was originally used as a separator, we need to extend QFont to have setFamilies() so that we can avoid joining the family strings together. This enables us to see the family name as a single string and for multiple family names, we have families(). Subsequently, this has added functions to QTextCharFormat to account for multiple font families too. So it is now possible to set a single one directly with setFontFamily() and multiple ones with setFontFamilies(). This also bumps up the datastream version to 19 as QFont now streams the families list as well. [ChangeLog][QtGui][QFont] Add setFamilies()/families() to aid using of font families with commas and quotes in their name. [ChangeLog][Important Behavior Changes] QDataStream version bumped up to 19 to account for changes in the serialization of QFont. Fixes: QTBUG-46322 Change-Id: Iee9f715e47544a7a705c7f36401aba216a7d42b0 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Merge remote-tracking branch 'origin/5.12' into devLiang Qi2018-10-251-8/+2
|\ | | | | | | | | | | | | | | | | Conflicts: src/corelib/animation/qpropertyanimation.cpp src/gui/image/qicon.cpp tests/auto/widgets/itemviews/qtableview/tst_qtableview.cpp Change-Id: I3698172b7b44ebb487cb38f50fd2c4a9f8a35b21