summaryrefslogtreecommitdiffstats
path: root/src/corelib/serialization
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* | Deprecate QJsonDocument methods for converting to/from JSON binarySona Kurazyan2020-01-092-4/+13
| | | | | | | | | | | | | | | | | | Also remove the example code for deprecated methods and use CBOR instead where it makes sense. Task-number: QTBUG-81068 Change-Id: Iffb7a4b3d7b16a1e485fc05b3ab2e2468e9e0718 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | Fix some qdoc warningsFriedemann Kleint2020-01-033-11/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | src/corelib/serialization/qjsonvalue.cpp:174: (qdoc) warning: No such parameter 'n' in QJsonValue::QJsonValue() ... examples/widgets/doc/src/icons.qdoc:584: (qdoc) warning: Command '\snippet (//! [24])' failed at end of file 'widgets/icons/mainwindow.cpp' src/corelib/text/qbytearray.cpp:5177: (qdoc) warning: clang found diagnostics parsing \fn QByteArray::FromBase64Result::operator QByteArray() const error: out-of-line definition of 'operator QByteArray' does not match any declaration in 'QByteArray::FromBase64Result' src/corelib/serialization/qjsonarray.cpp:178: (qdoc) warning: Overrides a previous doc src/corelib/serialization/qjsonarray.cpp:140: (qdoc) warning: (The previous doc is here) src/corelib/serialization/qjsonobject.cpp:1016: (qdoc) warning: clang found diagnostics parsing \fn QJsonValueRef QJsonObject::iterator::operator[](int j) const error: out-of-line definition of 'operator[]' does not match any declaration in 'QJsonObject::iterator' src/corelib/serialization/qjsonobject.cpp:1267: (qdoc) warning: clang found diagnostics parsing \fn QJsonValue QJsonObject::const_iterator::operator[](int j) const error: out-of-line definition of 'operator[]' does not match any declaration in 'QJsonObject::const_iterator' src/corelib/tools/qhash.cpp:2641: (qdoc) warning: Overrides a previous doc src/corelib/tools/qhash.cpp:1492: (qdoc) warning: (The previous doc is here) src/corelib/tools/qhash.cpp:2659: (qdoc) warning: Can't link to 'unit()' src/corelib/text/qchar.cpp:274: (qdoc) warning: Undocumented enum item 'Script_Sundanese' in QChar::Script src/corelib/text/qchar.cpp:274: (qdoc) warning: No such enum item 'Script_Sundaneseo' in QChar::Script src/network/ssl/qsslsocket.cpp:1514: (qdoc) warning: Can't link to 'QSslConfiguration::addDefaultCaCertificate()' src/widgets/widgets/qtabwidget.cpp:581: (qdoc) warning: Undocumented parameter 'visible' in QTabWidget::setTabVisible() Change-Id: I05c2a4884873850b684fa94036cd90db1a6e7726 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Fix parameter of QJsonObject::const_iterator operator-(const_iterator)Friedemann Kleint2020-01-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | It used to be "iterator", causing a qdoc warning: src/corelib/serialization/qjsonobject.cpp:1405: (qdoc) warning: clang found diagnostics parsing \fn int QJsonObject::const_iterator::operator-(const_iterator other) const error: out-of-line definition of 'operator-' does not match any declaration in 'QJsonObject::const_iterator' Add a small test. Change-Id: Id65effffa720ed1e0fb0ee6937dcc4298f3ef363 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | cborstreamwriter: Fix developer-build with clangRobert Loehning2019-12-302-3/+3
| | | | | | | | | | | | | | Both functions are unused which results in a build error. Change-Id: If7e7a47cd62b91fbfc5bbf5330825bbb341a734b Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Mark the old style unprefixed stream functions deprecatedAllan Sandfeld Jensen2019-12-162-22/+72
| | | | | | | | | | | | | | | | Requires a third definition for the source-compatible but deprecated version. Change-Id: I260ae79f4547f99eed701b10e0b25222f81cd5ff Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Replace usages of QVariant::value by qvariant_castOlivier Goffart2019-12-152-7/+7
| | | | | | | | | | | | | | This is done automatically with a clazy check Change-Id: I3b59511d3d36d416c8eda74858ead611d327b116 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Qt 6: Deprecate QHash::insertMultiLars Knoll2019-12-121-0/+3
| | | | | | | | | | | | | | | | | | [ChangeLog][QtCore][QHash] insertMulti(), unite() and values(const Key &key) are now deprecated. Please use QMultiHash instead. Change-Id: Ic14907fd5fd38d585708e2dcf2c0200d221ebb25 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* | Split cborstream feature in twoUlf Hermann2019-12-1211-1362/+1685
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reading of Cbor streams is substantially more complicated than writing as it requires float16 support. When writing Cbor, we can just choose to always write 32bit floats, even if we could compress the numbers into 16 bits. We need Cbor writing in the bootstrap library, but we cannot easily add float16 support. Furthermore, Cbor reading is required for plugin support, but not Cbor writing. It might make sense for some users to build a custom Qt with Cbor writing disabled. Therefore, provide two features, cborstreamreader and cborstreamwriter, split up the code in cborstream.{h|cpp} into several files, and enable Cbor writing in the bootstrap library. Change-Id: I15450afb0e328a84a22ebca9379cffc4f900a75a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Merge remote-tracking branch 'origin/5.14' into 5.15Liang Qi2019-12-104-7/+6
|\| | | | | | | | | | | | | Conflicts: tests/auto/network/kernel/qnetworkinterface/BLACKLIST Change-Id: I1e8866c63b54bcd95fc2a044276ee15b7f60e79a
| * Don't wrap feature detection macros with QT_HAS_FOO() variantsTor Arne Vestbø2019-12-103-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Using wrappers for these macros is problematic when for example passing the -frewrite-includes flag to preprocess sources before shipping off to distcc or Icecream. It will also start producing warnings when compilers implement http://eel.is/c++draft/cpp.cond#7.sentence-2. See for example https://reviews.llvm.org/D49091 Both https://clang.llvm.org/docs/LanguageExtensions.html and the SD-6 document at https://isocpp.org/std/standing-documents/sd-6-sg10-feature-test-recommendations recommend defining '__has_foo(x) 0' as a fallback for compilers without the macros, so that's what we go for. Change-Id: I0298cd3b4a6ff6618821e34642a5ddd6728be767 Reviewed-by: Alex Richardson <arichardson.kde@gmail.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * QCborValue: fix replacing of elements with byte data with ones withoutThiago Macieira2019-12-051-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | We forgot to reset the flags when replacing the element, so we ended up with an integer with HasByteData after: testMap[0] = QStringLiteral("value"); testMap[0] = 42; Fixes: QTBUG-80342 Change-Id: Ia2aa807ffa8a4c798425fffd15dabfa066ea84b0 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | Fix compile with we use QT_DISABLE_DEPRECATED_BEFORE=0x060000 in appsLaurent Montel2019-12-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | in qt5.15 you deprecated iterator &operator--() in qhash but QDataStream needs it. (see writeAssociativeContainer) So when we compile without deprecated method we can see: qdatastream.h:333:9: error: no match for ‘operator--’ (operand type is ‘QHash<QString, QImage>::const_iterator’) 333 | --it; | ^~~~ The current code is only QHash<QString, QImage> m_images; QDataStream stream(&file); stream << m_images; Change-Id: I12e61c0c60615455ac1eeff02969f155edb12e56 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* | Merge remote-tracking branch 'origin/5.14' into 5.15Ulf Hermann2019-12-031-74/+87
|\| | | | | | | | | | | | | Conflicts: src/corelib/serialization/qcborvalue.cpp Change-Id: I675a3029955c96e81a33ed9d98b72b55b6784b52
| * QCborValue: Extend the constructor to also create extended typesThiago Macieira2019-11-231-74/+83
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We already did that when parsing from CBOR binary data, so the code was already present. [ChangeLog][QtCore][QCborValue] The constructor taking a CBOR tag and a value to be tagged now attempts to convert to a QCborValue extended type. For example, if the tag is 0 (UnixTime_t) and the payload is a number, the resulting object will become tag 1 (DateTime) and the payload will be the the ISO-8601 date/time string. Fixes: QTBUG-79196 Change-Id: I6edce5101800424a8093fffd15cdf650fb2fc45c Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
| * Fix QCborValue::toCbor with non-ASCII URLsThiago Macieira2019-11-231-5/+5
| | | | | | | | | | | | | | Found while fixing QTBUG-79196. Change-Id: Ia2aa807ffa8a4c798425fffd15d841657def99af Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | Deprecate reverse iteration on QHashLars Knoll2019-11-051-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | std::unordered_map only supports forward iteration for good reasons. Align our API with this by deprecating reverse iteration and the operator+/-() for iterators. [ChangeLog][QtCore][QHash] Reverse iteration over QHash is now deprecated. [ChangeLog][Potentially Binary-Incompatible Changes] QHash's iterator category was changed from bidirectional iterator to forward iterator. This may cause trouble if a library uses the iterator category to alter functionality through tag dispatching. This only applies when compiling the library or application with QT_DISABLE_DEPRECATED_BEFORE=0x050F00 and the other with a lower value. Change-Id: I0fb6d017cabdef1bc508e62f76dc2fa73cd3652d Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2019-10-261-0/+3
|\| | | | | | | Change-Id: I208a36bf1c88c8291baaa5ca8fe8e838bc9d7aea
| * Disable Clang warning for 'using namespace' in qtextstream.hJüri Valdmann2019-10-251-0/+3
| | | | | | | | | | | | | | | | | | This header file intentionally puts a 'using namespace' into the global namespace, the artful cleverness of which Clang doesn't properly appreciate. Teach Clang a lesson by disabling the warning. Change-Id: I9754ac5fc9d4c53654854082e1145d8b5fef186d Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | Reimplement JSON support on top of CborUlf Hermann2019-10-2126-2320/+2800
| | | | | | | | | | | | | | | | | | | | | | | | In turn, deprecate the QJsonDocument methods that deal with JSON binary data. You should use CBOR for data serialization these days. [ChangeLog][Deprecation Notice] The binary JSON representation is deprecated. The CBOR format should be used instead. Fixes: QTBUG-47629 Change-Id: Ic8b92ea36de87815b12307a9d8b1095f07166db8 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Move CBOR debug stream functions into qcborvalue.cppUlf Hermann2019-10-172-112/+106
| | | | | | | | | | | | | | | | Some of them were already there, and this way they continue to function, even if the cborstream feature is turned off. Change-Id: I6828d2f525ab0a1437fc940a0fe786f6fa56fd6a Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Provide a feature for CBOR stream I/OUlf Hermann2019-10-164-2/+23
| | | | | | | | | | | | | | We need to turn it off in bootstrap code. Change-Id: I826e49fbc5f6128e56f84b58d29358dd7b0b9dc5 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Cbor: Avoid QUrl in bootstrap codeUlf Hermann2019-10-152-0/+12
| | | | | | | | | | | | | | | | | | QUrl is not available when building qmake. Hopefully we can get rid of this mess in Qt 6. Change-Id: Ia234996dd4f27d7f843db227e4cf2db869c92dc1 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Make QJsonObject::iterator a true random access iteratorLars Knoll2019-10-132-0/+123
| | | | | | | | | | | | | | | | | | | | Amends and fixes 7236721bf8bacc0978fc872d7e4805c7be7824f0 where the iterator category was changed from bidirectional to random access without adding all the required functions. Fixes: QTBUG-57353 Change-Id: I2c96448facb222c8b8f9ad4423cb0dbd1ed098f4 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2019-09-052-2/+2
|\| | | | | | | Change-Id: I065e212f0dc115efa1ffcb14cf9f679259da6b79
| * Use quiet NaNs instead of signaling onesEdward Welbourne2019-09-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I see no good reason why the NaN returned when reading "nan" as a double should be a signaling one; a quiet one should be just fine. [ChangeLog][QtCore][QLocale] The NaN obtained when reading "nan" as a floating-point value is now quiet rather than signaling. [ChangeLog][QtCore][QTextStream] The NaN obtained when reading "nan" as a floating-point value is now quiet rather than signaling. Change-Id: Ife477a30bfb813c611b13a33c38ea82f9e8a93eb Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * Merge remote-tracking branch 'origin/5.13' into 5.14Liang Qi2019-09-041-1/+1
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/codecs/qicucodec.cpp src/dbus/qdbusserver.cpp src/gui/painting/qbezier.cpp src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmscreen.cpp src/plugins/printsupport/cups/qppdprintdevice.cpp Change-Id: I2703128bb64baf5580fbc2c2061b55b0f0611d2a
| | * Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-08-311-1/+1
| | |\ | | | | | | | | | | | | Change-Id: I9823da32168e99bbece2f8337d0bd4d33e6d634c
| | | * Doc: Clarify QJsonDocument::toJson()Joerg Bornemann2019-08-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Mention that this method returns an indented document. Change-Id: I0cadcc1c894c9a87910cfce389c6a5288238044d Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
* | | | Bump versionKari Oikarinen2019-08-271-0/+1
|/ / / | | | | | | | | | Change-Id: Ie0cc04ec18fceccaf40eb8fe5c5b4f2e916869ac
* | | Cbor: Add overloads for QStringViewUlf Hermann2019-08-223-23/+52
| | | | | | | | | | | | | | | Change-Id: I8d22d0741c4d3852b438b12099f81ed87244871d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Merge remote-tracking branch 'origin/5.13' into devLiang Qi2019-08-131-2/+2
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: mkspecs/win32-clang-msvc/qmake.conf src/corelib/tools/qlist.h src/gui/painting/qcompositionfunctions.cpp src/gui/painting/qtriangulator_p.h src/gui/text/qfontengine_p.h src/network/kernel/qhostinfo_p.h src/platformsupport/fontdatabases/freetype/qfontengine_ft.cpp Done-With: Allan Sandfeld Jensen <allan.jensen@qt.io> Change-Id: Ib8a0308cf77224c4fbdcf56778fdac4a43e37798
| * | Merge remote-tracking branch 'origin/5.12' into 5.13Liang Qi2019-08-121-2/+2
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: config.tests/arch/write_info.pri Repair architecture config test for the WASM_OBJECT_FILES=1 build mode configure.pri tests/auto/gui/text/qtextdocument/tst_qtextdocument.cpp Done-With: Jörg Bornemann <joerg.bornemann@qt.io> Change-Id: I9e12088356eb5bc65b53211cd7a8e330cccd1bb4
| | * Fix sign change warningSimon Hausmann2019-08-091-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | The conversion from int to uint is deliberate here, so let's cast and avoid a warning for users compiling with warnings enabled. Change-Id: I7136d6161ace735be49f8d987338f6d401a5c78a Fixes: QTBUG-77245 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Fix removal of QJsonObject properties when assigning undefinedSimon Hausmann2019-07-301-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 8010e906d3612aface0daccde41d1a65fca04b0c accidentally ended up removing the removal-on-undefined-insertion check by calling insertAt instead of insert, which had it. This patch moves the check back into setValueAt. Change-Id: Ic381e284d3da37e31c4eb29f79dfab9c55c2e3e9 Fixes: QTBUG-77204 Reviewed-by: Liang Qi <liang.qi@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | | Port from QStringViewLiteral to u""Marc Mutz2019-07-291-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Now that all our supported compilers know char16_t, we no longer need QStringViewLiteral, whose only purpose in life was to turn u"" into L"" for MSVC < 2015. Change-Id: I25a094fe7992d9d5dbeb4a524d9e99e043dcb8ce Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* | | Merge remote-tracking branch 'origin/5.13' into devLiang Qi2019-07-221-1/+9
|\| | | | | | | | | | | | | | | | | | | | Conflicts: qmake/generators/makefile.cpp Change-Id: Ib3715e626f2fd32804c75c16ea9aa06a1216e76d
| * | Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-07-201-1/+9
| |\| | | | | | | | | | Change-Id: Ic34021fbb87d689ee23a5d1b3f50617ada9ec9b9
| | * Fix QCborStreamReader not flushing QIODevices due to internal bufferingThiago Macieira2019-07-191-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When successfully finishing a parse, it's reasonable to expect that the QIODevice was advanced to the end of the input data. [ChangeLog][QtCore][QCborStreamReader] Fixed a bug that caused the QIODevice that the data was being read from not to show the entire CBOR message as consumed. This allows the user to consume data that may follow the CBOR payload. Fixes: QTBUG-77076 Change-Id: I1024ee42da0c4323953afffd15b23f5d8fcc6f50 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: BogDan Vatra <bogdan@kdab.com>
| | * Work around Apple Clang's -Wshadow warningThiago Macieira2019-07-161-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Well, yeah, it technically does... qcborstream.h:245:15: warning: declaration shadows a typedef in the global namespace [-Wshadow] /usr/include/libkern/OSTypes.h:36:26: note: previous declaration is here Fixes: QTBUG-75825 Change-Id: Idce141629dd34287808bfffd159ee2a75428bf12 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* | | QJsonObject: add QLatin1String overloads of non-const methodsMat Sutcliffe2019-07-203-44/+179
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also optimized the existing QL1S overload of non-const operator[](), and applied Extract Method refactoring to the other existing QL1S overloads. [ChangeLog][QtCore][QJsonObject] Added insert(), remove(), and take() overloads taking QLatin1String. Change-Id: I5e737cf2d7d9ffb325d6981db1e4a6a9f093657b Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru>
* | | JSON: add some QStringView overloadsMat Sutcliffe2019-07-208-37/+180
| | | | | | | | | | | | | | | | | | | | | | | | | | | [ChangeLog][QtCore][JSON] Added overloads of functions taking key strings as QStringView; in QJsonObject, QJsonValue and QJsonDocument. Change-Id: I78b40aba8200003acfae257ff06f5f15737005e7 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru>
* | | QJsonObject: minor refactoringMat Sutcliffe2019-07-202-16/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | Applied DRY principle. Change-Id: Ic3035552c6174167b4fe19fd4c825500dff16ded Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Optimize non-const overload of QJsonObject::operator[]Mat Sutcliffe2019-07-202-6/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Refactored parts of insert() into a new private method insertAt(), which can also be called by operator[]() to avoid a redundant key lookup. This is in preparation for overloading QJsonObject's non-const methods on QLatin1String. As a bonus, this also avoids a redundant key lookup in QJsonValueRef::operator=(). Change-Id: Ic481981d838e50bc55fb8e7844536749781899ce Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>