summaryrefslogtreecommitdiffstats
path: root/src/corelib/json/qjsonarray.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-02-181-8/+64
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | This also reverts commit 018e670a26ff5a61b949100ae080f5e654e7bee8. The change was introduced in 5.6. After the refactoring, 14960f52, in 5.7 branch and a merge, it is not needed any more. Conflicts: .qmake.conf src/corelib/io/qstandardpaths_mac.mm src/corelib/tools/qsharedpointer_impl.h tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp Change-Id: If4fdff0ebf2b9b5df9f9db93ea0022d5ee3da2a4
| * Fix quadratic behavior when converting from QVariantLars Knoll2016-02-181-2/+39
| | | | | | | | | | | | | | | | | | | | | | | | The old code called insert for each item, leading to constant reallocation of the data structure. Instead rely on the fact that a QVariantMap (as well as the variant list) is sorted, so we can convert to the QJson data structure in one go without lots of reallocations. Task-number: QTBUG-44737 Change-Id: Id2d38d278fb9afa5e062c7353b4d4215bdfb993c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * Avoid size overflows when inserting into very large JSON objectsLars Knoll2016-02-181-6/+25
| | | | | | | | | | | | | | | | | | | | | | QJson has a size limitation for arrays and objects. Make sure we don't go over that size limit and create corrupt objects when inserting data. Change-Id: I45be3caefc282d8041f38acd120b985ed4389b8c Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Updated license headersJani Heikkinen2016-01-151-14/+20
|/ | | | | | | | | | | From Qt 5.7 -> LGPL v2.1 isn't an option anymore, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new LGPL header instead of LGPL21 one (in those files which will be under LGPL v3) Change-Id: I046ec3e47b1876cd7b4b0353a576b352e3a946d9 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Doc: Move selected \keywords to be \targets insteadTopi Reinio2015-09-071-6/+6
| | | | | | | | | | | | | | QDoc now handles \keyword slightly differently - it no longer generates a unique html anchor at the location it appears in. Instead, it'll inherit the anchor of the documentation item it appears in. Therefore, switch the \keyword commands that are used for linking to a subsection within a page to be \targets instead, so they'll get an anchor and not link to the top of the page. Change-Id: Iec6d3f0edbcfb0aec95e222615eca9de2b0e153e Reviewed-by: Martin Smith <martin.smith@digia.com>
* core: Add several QList::reserve() calls.Sérgio Martins2015-06-111-0/+1
| | | | | | | Reduces reallocations. Change-Id: Ib63539fb690a80245d8fe81ff8468e79ffa8e57c Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Doc: Json classes added to list of implic.shared classesNico Vertriest2015-03-111-0/+1
| | | | | | Task-number: QTBUG-44053 Change-Id: I52a1b6c413aaa594bfee9bf7484c3d0ce7e9c9fa Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
* Merge remote-tracking branch 'origin/5.4' into 5.5Frederik Gladhorn2015-02-241-6/+7
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: examples/xml/htmlinfo/simpleexample.html examples/xml/rsslisting/rsslisting.cpp qmake/generators/win32/msbuild_objectmodel.cpp src/3rdparty/harfbuzz-ng/src/hb-private.hh src/corelib/global/qlogging.cpp src/corelib/io/qstorageinfo_unix.cpp src/corelib/thread/qwaitcondition_unix.cpp src/gui/kernel/qguiapplication.cpp src/plugins/platforms/linuxfb/qlinuxfbintegration.cpp src/testlib/doc/src/qt-webpages.qdoc tests/auto/other/qaccessibility/tst_qaccessibility.cpp Change-Id: Ib272ff0bc30a1a5d51275eb3cd2f201dc82c11ff
| * Doc: corrected link/autolink issues in corelibNico Vertriest2015-02-241-6/+7
| | | | | | | | | | | | Task-number: QTBUG-43115 Change-Id: I31da92e3a7c4dd7b75ee283dbfecd77e284978ca Reviewed-by: Martin Smith <martin.smith@digia.com>
* | Update copyright headersJani Heikkinen2015-02-111-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Outdated header.LGPL removed (use header.LGPL21 instead) Old header.LGPL3 renamed to header.LGPL3-COMM to match actual licensing combination. New header.LGPL-COMM taken in the use file which were using old header.LGPL3 (src/plugins/platforms/android/extract.cpp) Added new header.LGPL3 containing Commercial + LGPLv3 + GPLv2 license combination Change-Id: I6f49b819a8a20cc4f88b794a8f6726d975e8ffbe Reviewed-by: Matti Paaso <matti.paaso@theqtcompany.com>
* | QtCore: Use QDebugStateSaver in (almost) all QDebug operator<<Kai Koehne2015-02-091-1/+2
|/ | | | | | | | | Unify the behavior of the different operator<< by always using QDebugStateSaver (appending an optional space at exit), and making sure that the space(), nospace() setting isn't 'leaked'. Change-Id: I38e4f82fa6f7419d8b5edfc4dc37495af497e8ac Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* QJsonArray::(const_)iterator: mark the pointer typedefs as internalGiuseppe D'Angelo2014-11-271-0/+10
| | | | | | | | | Just like the other typedefs; removes the doc warnings. Change-Id: I61142b8db57f4e0cc44cb8c459b1e82e69da3413 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
* Doc: corrected autolink issue jsonNico Vertriest2014-11-131-1/+1
| | | | | | | Task-number: QTBUG-40362 Change-Id: I851670eea6af80b0bb463f00b147d7a6ef289046 Reviewed-by: Martin Smith <martin.smith@digia.com> Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
* Update license headers and add new license filesMatti Paaso2014-09-241-19/+11
| | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 - Removed LICENSE.GPL Change-Id: Iec3406e3eb3f133be549092015cefe33d259a3f2 Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>
* Add operator-> to QJson iteratorsAllan Sandfeld Jensen2014-08-251-0/+10
| | | | | | | | | | | | | The iterators for QJsonArray and QJsonObject are currently lacking an operator-> definition. Unfortunately it is not possible to do in clean way without redefining either the iterators or QJsonValueRef class. This patch instead adds two fake pointer classes that are only used to handle the operator-> return value. Task-number: QTBUG-29573 Change-Id: Ief785a6afbbedc9e89cf3b6f3958c2c755997a66 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Add initializer list support in QJsonArrayJędrzej Nowacki2014-07-041-0/+25
| | | | | | | | | | | | | | It allows to create a QJsonArray instance in C++ by using a similar expression to JSON. For example: QJsonArray a = {1, 2, 4}; [ChangeLog][QtCore][QtJson] QJsonArray now supports C++11 initializer lists. Task-number: QTBUG-26606 Change-Id: Icc352e518d9649d24176c89e7113d200d5c50b0d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Added convenience methods to QJsonArray for appending QJsonValuesMatt Broadstone2014-01-161-0/+25
| | | | | | | | | | | operators for +, +=, and << were added to QJsonArray to make it easier to work with, and more closely resemble the Qt container classes [ChangeLog][QtCore][QJsonArray] Added convenience methods to QJsonArray for appending QJsonValues Change-Id: I96e0a43015f7c0f980cbbef7f20bd2085ee04795 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Add JSON parsing support to qmake.Morten Johan Sørvig2013-10-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add qjson* implementation files from corelib/json to the qmake build. Add a read-only compile mode, enabled by defining QT_JSON_READONLY. Add qmake built-in function parseJson(file, into) which parses a json file into the given variable. qmake uses a flat key -> value-list implementation for storing variables, which means that some hackery is need to represent arbitrarily nested JSON. Use a special "_KEYS_" variable for arrays and objects: Arrays: ["item1", "item2"] $${array._KEYS_} -> 0 1 2 $${array.0} -> "item1" $${array.1} -> "item2" Objects: { "key1" : "value1", "key2" : "value2" } $${object._KEYS_} -> key1 key2 $${object.key1} -> value1 $${object.key2} -> value2 Change-Id: I0aa2e4e4ae14fa25be8242bc16d3cffce32504d2 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Add json/savegame example.Mitch Curtis2013-08-221-0/+2
| | | | | | | | | | | | There wasn't any example documentation besides json.html, which doesn't actually describe usage of the various QJson* classes. This also makes each QJson* class page link back to json.html. Change-Id: If5ad6493d2728df0cec7bdbbc5790f0b755f816c Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Jerome Pasion <jerome.pasion@digia.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Fix crashes when creating large documentsLars Knoll2013-05-091-8/+16
| | | | | | | | | | | | | Compact an object in regular intervals when inserting data into it, to avoid the object becoming huge. Compact an object/array before inserting into another array or object. Check that the document doesn't get so big it's overflowing the internal data structures. Task-number: QTBUG-29288 Change-Id: Id39d80dac1e7d5a11f40819f41b4b336bce16947 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Update copyright year in Digia's license headersSergio Ahumada2013-01-181-1/+1
| | | | | Change-Id: Ic804938fc352291d011800d21e549c10acac66fb Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* QtBase: Doc: Fix links to STL-style iteratorsDavid Schulz2012-12-061-4/+4
| | | | | Change-Id: I2822c2a7e9bfc1949c20ff81e08961f641e961fb Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-221-24/+24
| | | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: If1cc974286d29fd01ec6c19dd4719a67f4c3f00e Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* Removing duplicate includesSergio Ahumada2012-09-091-1/+0
| | | | | | | Do not include a header more than once Change-Id: Ia2e5d66e72988ad833cf5177a3f8aa988bf510e9 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Removed extra detach calls from QJsonArray::takeAtDenis Dzyubenko2012-08-291-6/+1
| | | | | Change-Id: I5711ec6b03e3979eca61f62004a7c6f0eaae79e0 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* doc: Fix some qdoc warningsEskil Abrahamsen Blomfeldt2012-08-231-9/+11
| | | | | | | | | | | QDoc doesn't supported nested tags, and there doesn't seem to be any way to trick it into thinking you've mentioned the argument (\omit didn't work), so actually rephrasing is the only way to kill the warning. Also add a const modifier to a signature to make it match the declaration. Change-Id: Ie02a488c42565205e827602959111c53e2d05a83 Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* Doc: Add \inmodule QtCore to all QtCore class doc bodiesThiago Macieira2012-08-231-0/+3
| | | | | Change-Id: I19100755c97cc155c76a859e19940e9f9222d34e Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* Fix some qdoc errors in the QJson* classesLars Knoll2012-08-201-0/+8
| | | | | Change-Id: If475655445afdba307508c5a3863c4bc8d87ebe6 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fixed most qdoc errors for the json classes.Lars Knoll2012-07-201-9/+89
| | | | | | Change-Id: Ibbbdd7212f6c5e25422bbaa9ccaf4822db52222a Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com> Reviewed-by: Richard J. Moore <rich@kde.org>
* Doc: Prepare for building modular QtCore docs.Casper van Donderen2012-04-191-9/+4
| | | | | | | | | | | | This change fixes most qdoc errors in QtCore. There are about 900 left. The main thing this change does is moving documentation from qtcore from /doc/src to /src/corelib/doc. Other issues resolved are mis-use of qdoc commands. Change-Id: I002d01edfb13575e8bf27ce91596a577a92562d1 Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com> Reviewed-by: Jerome Pasion <jerome.pasion@nokia.com>
* Don't crash when comparing values containing empty arrays/objectsLars Knoll2012-04-111-0/+2
| | | | | | | Task-number: QTBUG-25164 Change-Id: I1fa00e359ef3583b9a7136bb888cdf5e1c3e75ac Reviewed-by: Jamey Hicks <jamey.hicks@nokia.com>
* Fix warnings about signed/unsigned comparisons in QtJson.Friedemann Kleint2012-04-031-2/+2
| | | | | Change-Id: I92071ea870bf0ebb740fcb360aff19658380a0cd Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix a bug in the assignment operators for QJsonObject and ArrayLars Knoll2012-03-081-1/+1
| | | | | | | | | | When objects or arrays where being used read only, several objects can share the same d pointer, but will have different pointers into the binary data. Correctly change the pointer into the binary data even if the d-pointer is the same. Change-Id: Ife0ea5ac5daf46586f855dccdf35b51ec696a623 Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
* Merge remote-tracking branch 'origin/api_changes'Lars Knoll2012-03-041-0/+1
|\ | | | | | | | | | | | | | | | | | | Conflicts: dist/changes-5.0.0 mkspecs/features/qt_module_config.prf qmake/project.cpp qmake/property.cpp Change-Id: I6e4af40743a9aeff8ed18533a48036e332acc296
| * Make qlocale.h not depend on qvariant.h.Stephen Kelly2012-02-291-0/+1
| | | | | | | | | | | | | | As a consequence, we have to add more explicit includes. Change-Id: Ib3137031f0554b846c7bbd08f1f7df10dfeb8e61 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* | Remove the usage of deprecated qdoc macros.Casper van Donderen2012-03-021-2/+2
|/ | | | | | | | | | | QDoc now has support for Doxygen style commands for italics, bold and list items. This change applies that change in QDoc to the actual documentation. Task-number: QTBUG-24578 Change-Id: I519bf9c29b14092e3ab6067612f42bf749eeedf5 Reviewed-by: Shane Kearns <shane.kearns@accenture.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Fix some warnings from clangLars Knoll2012-02-021-2/+2
| | | | | | | | | One of them was a real error, that could lead to Data::alloc containing wrong values. Change-Id: I48315ef6fd59188630107ebbe7bf8dbaa5da689e Reviewed-by: Robin Burchell <robin+qt@viroteck.net> Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
* Update contact address in license headers.Jason McDonald2012-01-311-1/+1
| | | | | Change-Id: I35bf916087511f26bfeb49ceb3256d9a20fbc1c0 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Remove "All rights reserved" line from license headers.Jason McDonald2012-01-301-1/+1
| | | | | | | | | | As in the past, to avoid rewriting various autotests that contain line-number information, an extra blank line has been inserted at the end of the license text to ensure that this commit does not change the total number of lines in the license header. Change-Id: I311e001373776812699d6efc045b5f742890c689 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Import json support from playground/qtbinaryjsonLars Knoll2012-01-241-0/+1014
This imports the JSON support for Qt 5 from playground/qtbinaryjson. It adds a fast, fully compliant json parser, a convenient C++ API, conversion to and from QVariants and a binary format for JSON that is extremely fast to use together with the C++ API. Change-Id: If9e3a21a4241d388d0abaa446b6824f9cc6edb1c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>