summaryrefslogtreecommitdiffstats
path: root/src/corelib/serialization
Commit message (Collapse)AuthorAgeFilesLines
* Fix use of \inheaderfileTor Arne Vestbø2020-10-071-1/+1
| | | | | | | Change-Id: Ib969d6cf23b874e873cfc82b1b19dff2a4fe5f8f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 539cd49cee388189793c4691c4ce904825e156b2) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QJsonObject: fix sorting after parsing from JSON textThiago Macieira2020-09-301-29/+11
| | | | | | | | | | | | The logic was complex and missed the UTF-8 UTF-8 case. It ended up calling the UTF-8 to Latin1, resulting in an improperly-sorted container, which in turn meant keys were not found when searched. Fixes: QTBUG-86873 Change-Id: I0d3ff441bec041728945fffd16379dec418637ca Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit f00d322f6701580f97f38794b83b0ec13973d177) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix conversions to JSON from QVariantSona Kurazyan2020-08-147-20/+77
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After reimplementing Qt JSON support on top of CBOR, there were unintended behavior changes when converting QVariant{, List, Map} to QJson{Value, Array, List} due to reusing the code for converting QVariant* types to CBOR types, and from CBOR types to corresponding JSON types. In particular, conversions from QVariant containing QByteArray to JSON has been affected: according to RFC 7049, when converting from CBOR to JSON, raw byte array data must be encoded in base64url when converting to a JSON string. As a result QVariant* types containing QByteArray data ended up base64url-encoded when converted to JSON, instead of converting using QString::fromUtf8() as before. There were also differences when converting QRegularExpression. Reverted the behavior changes by adding a flag to internal methods for converting CBOR to JSON, to distinguish whether the conversion is done from QVariant* or CBOR types. These methods now will fall back to the old behavior, if the conversion is done using QJson*::fromVariant*(). Additionally fixed QJsonValue::fromVariant conversion for NaN and infinities: they should always convert to QJsonValue::Null. This works correctly when converting from variant to QJsonArray/QJsonObject, but has been wrong for QJsonValue. Added more tests to verify the expected behavior. [ChangeLog][Important Behavior Changes] Restored pre-5.15.0 behavior when converting from QVariant* to QJson* types. Unforeseen consequences of changes in 5.15.0 caused QByteArray data to be base64url-encoded; the handling of QRegularExpression was also unintentionally changed. These conversions are now reverted to the prior behavior. Additionally fixed QJsonValue::fromVariant conversions for NaN and infinities: they should always convert to QJsonValue::Null. Fixes: QTBUG-84739 Change-Id: Iaee667d00e5363906eedbb67948b7b39c9d0bc78 (cherry picked from commit 1df02b5f980b01a4e42f32061f1cba696b6a22e9) Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QXmlStreamReader: Don't resize readBuffer to a size it already hasRobert Loehning2020-08-131-1/+2
| | | | | | | | | | | Resizing it to 0 will cause it to allocate memory. This will then cause append() to copy the data from the other string instead of using copy on write. Task-number: oss-fuzz-24347 Change-Id: I581bd109f9b973e1c70b7b41b1f610a2ad5725b8 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 3e3fdbe831f24365780383b3c45a3d53f23ba435)
* Doc: Fix various documentation warningsTopi Reinio2020-08-131-140/+139
| | | | | | | | | | | QDoc now qualifies the scope of \fn arguments with the namespace the documentation comment appears in; move the comments that do not relate to the Qt namespace away from the namespace scope. Fix linking to Qt Designer manual. Change-Id: I84f71a16bc65a408bd92384bb337a99a43d1c91d Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* QJsonDocument: fix comparison of valid vs defaultThiago Macieira2020-08-121-1/+3
| | | | | | | | | | | | [ChangeLog][QtCore][QJsonDocument] Fixed a bug that caused QJsonDocument's equality operator to crash if one of the operands was default-constructed and the other wasn't. Fixes: QTBUG-85969 Change-Id: I5e00996d7f4b4a10bc98fffd1629f835f570ef6b Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io> (cherry picked from commit e790af0e0a030dea597bbc9489170b5ba1cf9e46) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Always return long long variants from integer qjsonvalueAllan Sandfeld Jensen2020-07-311-1/+2
| | | | | | | | | Makes the return type from the simple toVariant match the nested versions. Fixes: QTBUG-85808 Change-Id: Ib44213f062ac4de0cdb29fb20729e965351cf852 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Doc: improve documentation about QVariant to JSON lossy conversionsThiago Macieira2020-07-032-12/+43
| | | | | | | | Fixes: QTBUG-85299 Change-Id: I24006db8360041f598c5fffd161c77638a54a27e Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> (cherry picked from commit 0d55d1c640eff6b1bb9fcfa8f9130635782e0c97) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QCborMap: remove the optimization not to detach from non-const find()Thiago Macieira2020-06-301-8/+4
| | | | | | | | | | | | | | | | | | All our tests were find() == end() or !=, which depends on the evaluation order of the arguments to operator==(). If end() is called first, then the detach happens before find() and all is well. But if find() is called first, it may return end() before end() detaches. [ChangeLog][QCborMap] Fixed a bug that could cause the iterator returned from a failing key search with find() not to match end(). Now, every call to find() will detach in shared QCborMaps; to avoid this, use constFind() and constEnd(). Fixes: QTBUG-84583 Change-Id: I552d244076a447ab92d7fffd161793496a8d03a8 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> (cherry picked from commit 727fab7d291d8d6e1b61a7faec4b4318f714d1e0) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix conversion of QVariant() in QJsonArrays and Objects (through CBOR)Thiago Macieira2020-06-241-7/+3
| | | | | | | | | | | | | | | | | | | | | | When I wrote the QCborValue to QJsonValue conversion, I used QJsonValue::Undefined because it allowed to keep some level of compatibility in CBOR, despite the function documentation saying that CBOR undefineds became JSON nulls. Which they did. But when we converted QJson{Array,Object} to be backed by CBOR classes, that Undefined meant the insertion into the array/object actually deleted the entry. [ChangeLog][JSON] Fixed a regression from 5.14 that caused values of default-constructed QVariants in QVariantLists, QVariantMaps and QVariantHashes to disappear when converting to JSON via fromVariant{,List,Map,Hash}. Fixes: QTBUG-84610 Change-Id: Ic0987177fe463f352db9bd84993f116e2bdacc75 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit cb1c66bd204c12d848f47de6411d31edbafaf008) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Add since markers for the Qt::endl, etc.Albert Astals Cid2020-06-111-24/+72
| | | | | | | | | | | | The Qt namespace was introduced in 461e89ee1a53f7669e0215f9015380c4a9d62371 which is only since 5.14 Also remove QTextStreamFunctions:: from the documentation of the deprecated functions since the QTextStreamFunctions namespace is a syntaxic workaround. Change-Id: I9c15bcc49984bf5f5099c2f7df6b8adb3d2c61fb Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> (cherry picked from commit 20ba86262f39886629880fa1e07383f1e3e1d52e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix Clang 10 warnings about deprecated copy constructorsThiago Macieira2020-06-101-0/+1
| | | | | | | | | qstring.h:1235:22: warning: definition of implicit copy constructor for 'QCharRef' is deprecated because it has a user-declared copy assignment operator [-Wdeprecated-copy] Task-number: QTBUG-83666 Change-Id: I99ab0f318b1c43b89888fffd160b4a12bee11723 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* QXmlStreamReader: fix a qint64 -> int truncationMarc Mutz2020-05-191-2/+2
| | | | | | | | | | | QIODevice::read() returns qint64, not int, and nbytesread is qint64, too. Change-Id: I6d41c5c656336a95bb115b461282e9f247493c25 Reviewed-by: Lars Knoll <lars.knoll@qt.io> (cherry picked from commit 90ad722fb294b9c8bc7bb83d507b9b47d4d09367) Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Doc: Remove mentioning of QXmlSimpleReader from QXmlStreamReaderKai Koehne2020-05-181-6/+4
| | | | | | | Change-Id: Ieba073c21f666421ab519089e0976880e67ad0b1 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> (cherry picked from commit 40001d4a53ed6f0f43bce3f0e731ac020d03a2a7) Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* QCborValue: catch overflow in QByteArray when decoding chunked stringsThiago Macieira2020-05-071-1/+1
| | | | | | | | | | We checked against integer overflow, but not against overflowing the QByteArray size limit. That caused a std::bad_alloc to be thrown, which is bad when decoding unknown data. QCborStreamReader wasn't affected, since it doesn't merge chunks. Change-Id: I99ab0f318b1c43b89888fffd160c36f495fada87 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QCborValue: check parsing of invalid URLThiago Macieira2020-04-301-3/+5
| | | | | | | | | QUrl will reject invalid URLs for us, so we don't get normalization. The original junk should be retrievable, of course. Change-Id: Ibdc95e9af7bd456a94ecfffd160610f5b2c8e1a2 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QCborValue: add an extra check against producing invalid ISO datesThiago Macieira2020-04-301-4/+6
| | | | | | | | | By QCborValue design, we store the textual representation in ISO format, equivalent of CBOR tag 0, which isn't allowed to have negative years or beyond year 10000. Change-Id: Ibdc95e9af7bd456a94ecfffd16060ccff359c296 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* QCborValue: avoid signed integer oveflows when decoding time_tThiago Macieira2020-04-301-4/+19
| | | | | | | | | | | | QDateTime::fromSecsSinceEpoch() multiplies by 1000 but does not check for overflow. That means we must do so in QCborValue validation. We can't use mul_overflow<qint64> on 32-bit platforms, so we do a compare- and-branch there. For 64-bit platforms, we prefer to do the multiplication with checked overflow, as the common case is that it will not overflow and we'll need the multiplication anyway. Change-Id: Ibdc95e9af7bd456a94ecfffd16060cba6f1c86b8 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Fix data corruption regression in QJsonObject::erase()Eirik Aavitsland2020-04-231-4/+4
| | | | | | | | | The internal removeAt(index) method was implemented as taking cbor indexes directly, in contrast to the other ...At(index) methods. Fixes: QTBUG-83695 Change-Id: I16597eb6db1cf71e1585c041caa81bf8f7a75303 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QCborValue: don't update internal states if decoding a string failedThiago Macieira2020-04-221-1/+1
| | | | | | Change-Id: Ibdc95e9af7bd456a94ecfffd16061db982ad3fa7 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QCborValue: fix double-accounting of the usedData when decoding stringsThiago Macieira2020-04-221-2/+0
| | | | | | | | | | | | We can only update usedData at the end, after we've decoded all chunks. The update inside the lambda was double-accounting for the first chunk, which could lead to signed integer overflows in usedData. Not unit-testable since the usedData value is not visible in the API. Change-Id: Ibdc95e9af7bd456a94ecfffd16061cc955208859 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QCborValue: fix the move-assignment operatorv5.15.0-beta4Thiago Macieira2020-04-111-3/+2
| | | | | | | | | | | | | | | | | | | | The double-swap technique I used was flawed and broke on self-assignment. What I had meant to use was the move-and-swap technique. Thanks to Peppe for pointing it out. This also fixes a compiler bug in the Green Hills compiler. It was finding the wrong "swap" function in qSwap: using std::swap; swap(value1, value2); It's supposed to find swap(QCborValue &, QCborValue &) due to argument- dependent lookup. It's instead finding std::swap<QCborValue>, which recurses. Fixes: QTBUG-83390 Change-Id: Ibdc95e9af7bd456a94ecfffd1603e1bee90cd107 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* Switch to using versioned deprecated macrosAllan Sandfeld Jensen2020-04-091-24/+24
| | | | | | Change-Id: I4728e6ecc7218a6c98fd3a10e50e6edd1704fb83 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QCborArray: fix operator[] that extends the arrayThiago Macieira2020-04-091-1/+1
| | | | | | | | | | | This was never tested. The infinite loop in QCborContainerPrivate::grow is the proof. [ChangeLog][QtCore][QCborArray] Fixed an infinite loop when operator[] was called with with an index larger than the array's size plus 1. Change-Id: Ibdc95e9af7bd456a94ecfffd1603df3855c73f20 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* QCborMap: fix assigning elements from the map to itselfThiago Macieira2020-04-091-3/+7
| | | | | | | | | | | | | | | | | | | | | | | Similar to the QJsonObject issue of the previous commit (found with the same tests, but not the same root cause). One fix was that copying of byte data from the QByteArray to itself won't work if the array reallocates. The second was that assign(*that, other.concrete()); fails to set other.d to null after moving. By calling the operator=, we get the proper sequence of events. [ChangeLog][QtCore][QCborMap] Fixed some issues relating to assigning elements from a map to itself. Note: QCborMap is not affected by the design flaw discovered in QJsonObject because it always appends elements (it's unsorted), so existing QCborValueRef references still refer to the same value. Task-number: QTBUG-83366 Change-Id: Ibdc95e9af7bd456a94ecfffd1603df846f46094d Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* QJsonObject: add missing detach2() callsThiago Macieira2020-04-091-0/+3
| | | | | | | | | | | | | | The refactoring to use CBOR missed two places where we could assign from the same object and thus cause corruption. In fixing this issue, I found a design flaw in QJsonObject, see Q_EXPECT_FAILing unit test and task QTBUG-83398. [ChangeLog][QtCore][QJsonObject] Fixed a regression from 5.13 that incorrect results when assigning elements from an object to itself. Fixes: QTBUG-83366 Change-Id: Ibdc95e9af7bd456a94ecfffd1603df24b06713aa Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Doc: Document QTestStream manipulators under the Qt namespaceTopi Reinio2020-04-072-26/+98
| | | | | | | | | | | | | The global variants of the manipulators have been deprecated in favor of the ones in the Qt namespace. However, only one set was documented (the deprecated ones). Ensure documentation for both sets is generated, and link to the Qt:: manipulators in QTextStream documentation. Fixes: QTBUG-82532 Change-Id: I430d15f6d9a34411d1d7265031249e600f6874ef Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* Merge remote-tracking branch 'origin/5.14' into 5.15Liang Qi2020-03-312-17/+45
|\ | | | | | | | | | | | | Conflicts: tests/auto/widgets/itemviews/qabstractitemview/tst_qabstractitemview.cpp Change-Id: Ifaa56153f5f0d687a6b4d94f84fcfa1e1751afd2
| * CBOR support: prevent overflowing QByteArray's max allocationThiago Macieira2020-03-272-17/+45
| | | | | | | | | | | | | | | | | | | | | | | | QByteArray doesn't like it. Apply the same protection to QString, which we know uses the same backend but uses elements twice as big. That means it can contain slightly more than half as many elements, but exact half will suffice for our needs. Change-Id: Iaa63461109844e978376fffd15f9d4c7a9137856 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2020-03-272-46/+67
|\| | | | | | | | | | | | | Conflicts: src/corelib/serialization/qcborvalue.cpp Change-Id: I539d8cae5fd413b8a6c9c5d8a6364c79c8133a0a
| * QCborValue: apply a simple optimization to avoid unnecessary allocationsThiago Macieira2020-03-252-28/+29
| | | | | | | | | | | | | | | | | | If the map or array is known to be empty, we don't need to allocate a QCborContainerPrivate. Change-Id: Ief61acdfbe4d4b5ba1f0fffd15fe212b6a6e77c3 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
| * QCborValue::fromCbor: Apply a recursion limit to decodingThiago Macieira2020-03-252-13/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A simple 16k file can produce deep enough recursion in Qt to cause stack overflow. So prevent that. I tested 4096 recursions just fine on my Linux system (8 MB stack), but decided 1024 was sufficient, as this code will also be run on embedded systems that could have smaller stacks. [ChangeLog][QtCore][QCborValue] fromCbor() now limits decoding to at most 1024 nested maps, arrays, and tags to prevent stack overflows. This should be sufficient for most uses of CBOR. An API to limit further or to relax the limit will be provided in 5.15. Meanwhile, if decoding more is required, QCborStreamReader can be used (note that each level of map and array allocates memory). Change-Id: Iaa63461109844e978376fffd15fa0fbefbf607a2 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
| * QCborValue: create a wrapper to set the QCborStreamReader error stateThiago Macieira2020-03-252-6/+12
| | | | | | | | | | | | | | | | The next commit will need to do so from outside QCborContainerPrivate, where QCborStreamReader::d can't be accessed (private). Change-Id: Iaa63461109844e978376fffd15fa0f6f04081bf2 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Doc: Mark QTextStream manipulators as deprecatedTopi Reinio2020-03-261-0/+24
| | | | | | | | | | | | | | | | and instruct to use the ones from the Qt namespace instead. Task-number: QTBUG-82532 Change-Id: I6a85f5096da8aec925a287beff136b77d113926e Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* | Fix binary compatibility issue in QJson{Array,Object} initializer_listThiago Macieira2020-03-202-4/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The rewrite using CBOR internals replaced one of the two naked pointers that were members of QJsonArray and QJsonObject with a QExplicitlySharedDataPointer. The problem is that its operator= will read the current value to decrement the refcount and possibly delete the pointed object. But QJson{Array,Object}::initialize() are called from inlined code, without initialization. So we can't call operator=. We need to memcpy to write a nullptr. This is not unit-testable because it requires compiling against 5.14 or earlier, then running against 5.15. Fixes: QTBUG-82700 Change-Id: Iaa63461109844e978376fffd15f98c62656d197c Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | Doc: update QJsonObject::operator[] non-const to say it creates keyThiago Macieira2020-03-201-1/+3
| | | | | | | | | | | | | | | | | | | | the non-const QJsonArray::operator[] requires a valid index and all the const operator[] say that it returns Undefined if the key or index doesn't exist. This is the exception. Task-number: QTBUG-39864 Change-Id: Iaa63461109844e978376fffd15f9716f0cc66cca Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2020-03-111-1/+2
|\| | | | | | | | | | | | | | | | | Conflicts: src/corelib/plugin/qlibrary.cpp src/corelib/plugin/qlibrary_unix.cpp src/corelib/plugin/qpluginloader.cpp Change-Id: I866feaaa2a4936ee5389679724c8471a5b4b583d
| * Port from deprecated std::is_pod to is_trivial + is_standard_layoutMarc Mutz2020-03-061-1/+2
| | | | | | | | | | | | | | | | The std::is_pod trait is deprecated in C++20; is_trivial and is_standard_layout exist since C++11. Change-Id: I4b901d8edf1a55001764445aee9c338d3dc23b21 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | QDataStream: keep brace delimiters inside #if-scopesMårten Nordheim2020-03-101-1/+2
| | | | | | | | | | | | | | Because it looks odd. Change-Id: Ic272ae7b1b5a3e0a70884caa683ccbdd3a61ff6a Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | QDataStream: fix compilation with QT_DISABLE_DEPRECATED_BEFORE=0x0050F00David Faure2020-03-081-4/+8
| | | | | | | | | | | | Fixes: QTBUG-81023 Change-Id: I0d56785d1fed2c4c8e0e87ccefb0b72b0ed3644a Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* | Doc: Fix documentation for deprecated methods in QJsonDocumentKai Koehne2020-02-281-4/+10
| | | | | | | | | | | | | | | | \deprecated has to stand on its own - qdoc will ignore anything on the right side of it. Change-Id: Ib698aa66826d6430bbafd926a9c64febd5463c5c Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | Add an expansion limit for entitiesLars Knoll2020-02-264-2/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Recursively defined entities can easily exhaust all available memory. Limit entity expansion to a default of 4096 characters to avoid DoS attacks when a user loads untrusted content. Added a setter and getter to allow modifying the expansion limit. [ChangeLog][QtCore][QXmlStream] QXmlStreamReader does now by default limit the expansion of entities to 4096 characters. Documents where a single entity expands to more characters than the limit are not considered well formed. The limit is there to avoid DoS attacks through recursively expanding entities when loading untrusted content. The limit can be changed through the QXmlStreamReader::setEntityExpansionLimit() method. Fixes: QTBUG-47417 Change-Id: I94387815d74fcf34783e136387ee57fac5ded0c9 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* | Doc: Fix documentation warnings for Qt CoreTopi Reinio2020-02-251-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - QCborError: Classes cannot relate to header files; use \inheaderfile instead and link to the class from header file documentation. - QRecursiveMutex: QDoc doesn't allow shared documentation comments for duplicating \fn docs between the base and deriving classes. Remove the sharing, the function documentation is available under 'All Members' doc for QRecursiveMutex. - QMultiMap: unite() and one overload of insert() were not recognized because their definitions in the same header file interfered with QDoc - use Q_CLANG_QDOC macro to comment them out, and tag \fn comments to ensure that the function documentation is matched. Change-Id: Ic96869904a72d92453e4ffa6901000147571969b Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* | Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2020-01-282-6/+10
|\| | | | | | | | | | | | | Conflicts: src/gui/image/qpnghandler.cpp Change-Id: I8630f363457bb613d8fb88470a71d95d97cdb301
| * QXmlStreamReader: fix memory leakGiuseppe D'Angelo2020-01-232-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | On some inputs a QXmlStreamReaderPrivate may allocate another QXmlStreamReaderPrivate as its entityResolver. Which, recursively, may allocate yet another one. This "chain" of QXmlStreamReaderPrivate objects was managed using raw pointers, and a leak was possible by resetting one of these pointers to nullptr without freeing the corresponding object. Change-Id: I2c6e1f023a2ed68b2b1857db25c53cce7f6bd3e7 Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
| * QXmlStreamReader: early return in case of malformed attributesGiuseppe D'Angelo2020-01-231-2/+5
| | | | | | | | | | | | | | | | There's no point at keep raising errors after encountering the first malformed attribute. Change-Id: Idb37e577ea96c3bd850b3caf008fe3ecd57dd32e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Doc/QtBase: replace some 0 with \nullptrChristian Ehrlicher2020-01-261-1/+1
| | | | | | | | | | | | | | | | | | Replace some 'is 0' or 'are 0' where 0 referes to a nullptr with 'is \nullptr' and 'are \nullptr' Change-Id: Ida9af2971924377efe2f49f435d79e109de2bdf4 Reviewed-by: André Hartmann <aha_1980@gmx.de> Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com>
* | Replace most use of QVariant::type and occurrences of QVariant::TypeOlivier Goffart2020-01-233-37/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I made a clazy automated check that replaced the use of QVariant::Type by the equivalent in QMetaType. This has been deprecated since Qt 5.0, but many uses were not yet removed. In addition, there was some manual changes to fix the compilation errors. Adapted the Private API of QDateTimeParser and QMimeDataPrivate and adjust QDateTimeEdit and QSpinBox. QVariant(QVariant::Invalid) in qstylesheet made no sense. But note that in QVariant::save, we actually wanted to use the non-user type. In the SQL module, many changes were actually reverted because the API still expects QVarient::Type. Change-Id: I98c368490e4ee465ed3a3b63bda8b8eaa50ea67e Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Merge remote-tracking branch 'origin/5.14' into 5.15Liang Qi2020-01-091-2/+2
|\| | | | | | | | | | | | | Conflicts: src/corelib/kernel/qobject.cpp Change-Id: I4780b25665672692b086ee92092e506c814642f2
| * Resolve a build error for ICC 19Inho Lee2020-01-091-2/+2
| | | | | | | | | | | | | | This argument name makes an error with "line 302:Type t = Undefined;" Change-Id: I5488ff02ab7c9f9391c17361da5e2aac2727a6a0 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>