summaryrefslogtreecommitdiffstats
path: root/src/corelib/serialization
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* | | Merge remote-tracking branch 'origin/5.13' into devQt Forward Merge Bot2019-07-123-5/+5
|\| | | | | | | | | | | Change-Id: Icaabf08f9af539ddf844d96bc9c3a2d09408ba8a
| * | [Doc] Fix minor typosSze Howe Koh2019-07-103-5/+5
| | | | | | | | | | | | | | | Change-Id: I7e74806218dcc07d800f4ec08e94abce32483f5e Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
* | | Be less laissez-faire with implicit conversions to QCharMarc Mutz2019-07-092-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QChar currently is convertible from nearly every integral type. This is bad code hygiene and should be fixed come Qt 6. The present patch is the result of compile fixes from marking these constructors explicit. As is clear from the distribution of fixes, only low-level string handling code used these implicit conversions, an indication that they're not in widespread use elsewhere. Change-Id: Ief5336f21e6d181e03ab92893b3d13a14adc7cb0 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* | | Merge remote-tracking branch 'origin/5.13' into devLiang Qi2019-07-012-4/+6
|\| | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/network/ssl/qsslsocket_openssl.cpp src/platformsupport/vkconvenience/qvkconvenience.cpp Change-Id: I97ce6ed185f7fdad8102cc58d3cfec0119fd7bb4
| * | Work around Apple Clang's -Wshadow warningThiago Macieira2019-06-281-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: Marc Mutz <marc.mutz@kdab.com>
| * | Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-06-281-2/+4
| |\| | | | | | | | | | Change-Id: I912bd8851c390302414d3dfb3c8220df5a0d5630
| | * Avoid undefined behavior in qjsonwriter.cppUlf Hermann2019-06-201-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | See comment in qnumeric_p.h:convertDoubleTo for details. Change-Id: Ifcd13f7f67995af6a60e50ccabe843a855be04ae Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * | Merge remote-tracking branch 'origin/5.12' into 5.13Liang Qi2019-06-251-4/+6
| |\| | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/io/qstorageinfo_unix.cpp src/network/ssl/qsslsocket_openssl.cpp Change-Id: Ibc9ce799bef62d60d616beaa9fbde8ebeadfbc20
* | | Merge remote-tracking branch 'origin/5.12' into devLiang Qi2019-06-251-4/+6
|\ \ \ | | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf src/gui/painting/qdrawhelper.cpp src/gui/text/qdistancefield.cpp src/gui/text/qdistancefield_p.h src/network/ssl/qsslsocket_openssl.cpp src/plugins/platforms/android/qandroidinputcontext.cpp src/widgets/styles/qstylesheetstyle.cpp Done-With: Timur Pocheptsov <timur.pocheptsov@qt.io> Change-Id: Ia7daad21f077ea889898f17734ec46303e71fe6b
| * | QCborValue::fromJsonValue: rewrite code to remove UBThiago Macieira2019-06-191-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Converting an out-of-range FP to integer is UB. See comment in qnumeric_p.h. Change-Id: Ief874765cd7b43798de3fffd15a9bfe2c5fbbc01 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | | Port from QAtomic::load() to loadRelaxed()Giuseppe D'Angelo2019-06-204-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Semi-automated, just needed ~20 manual fixes: $ find \( -iname \*.cpp -or -iname \*.h \) -exec perl -pe 's/(\.|->)load\(\)/$1loadRelaxed\(\)/g' -i \{\} + $ find \( -iname \*.cpp -or -iname \*.h \) -exec perl -pe 's/(\.|->)store\(/$1storeRelaxed\(/g' -i \{\} + It can be easily improved (e.g. for store check that there are no commas after the opening parens). The most common offender is QLibrary::load, and some code using std::atomic directly. Change-Id: I07c38a3c8ed32c924ef4999e85c7e45cf48f0f6c Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | | Move away from using 0 as a pointer constantAllan Sandfeld Jensen2019-06-079-54/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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-151-4/+8
|\ \ \ | | |/ | |/| | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/global/qfloat16.cpp src/corelib/global/qfloat16.h src/plugins/platforms/windows/qwindowswindow.cpp Change-Id: I0938aaa6a9771f55e48c95ed29f6f5291431b947
| * | Add 'well-formated' JSON string valuesMichal Klocek2019-05-141-4/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support for surrogate code points U+D800 through U+DFFF, represent them with JSON escape sequences. https://github.com/tc39/proposal-well-formed-stringify Change-Id: I84fea53a8ef400beebefdba10ea82dc510fe7dda Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | QDataStream: move QLinkedlist operators to qlinkedlist.hMarc Mutz2019-05-141-13/+0
| | | | | | | | | | | | | | | | | | | | | This is in preparation of deprecating QLinkedList. Change-Id: I7540b784736a48cf4857d1969440d35ec64457e2 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>
* | | Remove handling of missing Q_COMPILER_INITIALIZER_LISTSAllan Sandfeld Jensen2019-05-022-8/+0
| | | | | | | | | | | | | | | | | | Change-Id: Id65b39c787235a051262544932e6717d076f1ea0 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Prepare QDataStream for Qt 6.0Lars Knoll2019-05-021-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | Add the required datastream versions for 6.0. Of course the number for 5.15 and 6.0 is still something we can bump. Change-Id: I676385817befc06ea8d0ff1e9eba9c94cb4698b0 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | | Compile when bumping the Qt version to 6.0Lars Knoll2019-05-022-3/+13
| | | | | | | | | | | | | | | Change-Id: Idae1a2df144598df3921ef9a12e0e0b740fd723d Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | | Prefix textstream operators with Qt::Lars Knoll2019-05-023-4/+4
| | | | | | | | | | | | | | | | | | | | | As the non prefixed variants are deprecated Change-Id: I2ba09d71b9cea5203b54297a3f2332e6d44fedcf Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | | Merge remote-tracking branch 'origin/5.13' into devQt Forward Merge Bot2019-04-291-0/+1
|\| | | | | | | | | | | Change-Id: Ic712e8a84b01b212bb1121d7a2c9b85e0d2da9da