summaryrefslogtreecommitdiffstats
path: root/src/corelib
Commit message (Collapse)AuthorAgeFilesLines
* Replace Qt CONSTEXPR defines with constexprAllan Sandfeld Jensen2020-08-1460-1085/+1085
| | | | | | | | Both normal and relaxed constexpr are required by our new minimum of C++17. Change-Id: Ic028b88a2e7a6cb7d5925f3133b9d54859a81744 Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* Drop qunicodecharGiuseppe D'Angelo2020-08-141-6/+1
| | | | | | | | | It's unused except in the definition of QStringLiteral, where we can just use char16_t. The static_assert can also go as it's already checked in qglobal.cpp. Change-Id: I06e8a87b4dea1582cd84957efca1b8ad0d2e0266 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QAtomic*: purge deprecated load() and save() methodsEdward Welbourne2020-08-143-66/+3
| | | | | | | | Deprecated in 5.14 in favor of loadRelaxed() and storeRelaxed(). Caught one surviving use of load() in the ios platform plugin. Change-Id: I9518064a948e5d26ccb956490cbb0561bed5d8b5 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* qglobal.h: remove deprecated global functionsEdward Welbourne2020-08-144-106/+1
| | | | | | | | Since 5.0 - qMalloc(), qFree(), qRealloc(), qMemCopy(), qMemSet() Since 5.15 - qsrand(), qrand() Change-Id: I74fa3d17b05521271c3dc563fc85a5b133289ce3 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QVariant: remove docs for non-existent deprecated methodsEdward Welbourne2020-08-141-40/+0
| | | | | | | | This follows up on commit 3898c022a647b1c742042e586963e193da546c1e which removed the code but not the methods themselves. Change-Id: Ia2311921365fdc5fee1104dd3162d6f26e5bb091 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QObject/Q_OBJECT: remove deprecated old APIEdward Welbourne2020-08-142-21/+2
| | | | | | | Since 5.0, trUtf8(), qFindChild() Change-Id: I7bc0d125f92faebf24a422c1aac528a3f4687434 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QCoreApplication: purge deprecated APIEdward Welbourne2020-08-142-84/+2
| | | | | | | | | Since 5.9 flush() Since 5.6 notifyInternal() Since 5.0 trUtf8() Change-Id: I1cc0fc5ebc3d7f2f4809c4494ab2a7486a481b10 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QQueue: purge deprecated API, swap(i, j)Edward Welbourne2020-08-141-5/+0
| | | | | | | | Was deprecated in 5.14 although the relevant annotations won't show up until 5.15.1. Change-Id: I5b88bd109b9785d8170c616c619d478969536bbf Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Another round of using noexcept instead of pre-C++11 definesAllan Sandfeld Jensen2020-08-133-27/+5
| | | | | | | A few new files were added with old-school defines. Change-Id: Ieb2c71e094e55102f3f39fb9551823f36863f5f4 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* CMake: Allow specifying a sysconfdir that's outside the prefixAlexandru Croitor2020-08-131-1/+1
| | | | | | | | | Also use the value to actually write it into qconfig.cpp so that qmake reports the right information. Change-Id: Icc4bf36b0dc6ad75d93ac16f39e5b361c0ce52b4 Fixes: QTBUG-81289 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* De-inline QIODevice::write(const QByteArray &)Alex Trotsenko2020-08-132-4/+7
| | | | | | | | | | | Since QRingBuffer is used as a temporary store for data to be written to a buffered device, we can implement a "zero-copy" strategy between the user-space code and QIODevice's internal write buffer. As a first step, we should have an entry point, where we can implement a possible solution. Change-Id: I1c658c13accc98c65a802be943688359cc9f9917 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix conversions to JSON from QVariantSona Kurazyan2020-08-137-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 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Restrict QVariant::isNull() behaviorLars Knoll2020-08-133-153/+18
| | | | | | | | | | | | | | | | | | | | | isNull() would forward to the contained type and check that type's isNull() method for some of the builtin types. Remove that behavior and only return true in isNull(), if the variant is invalid, doesn't contain data or contains a null pointer. In addition, implement more consistent behavior when constructing a QVariant using the internal API taking a copy from a void *. isNull() should return true in both cases. This mainly changes behavior for some corner cases and when using our internal API. [ChangeLog][Important Behavior Changes] QVariant::isNull() no longer returns true when the variant contains an object of some type with an isNull() method, that returns true for the object; QVariant::isNull() now only returns true when the variant contains no object or a null pointer. Change-Id: I3125041c4f8f8618a04aa375aa0a56b19c02dcf5 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Restrict comparison of variantsLars Knoll2020-08-131-38/+82
| | | | | | | | | | | | | | | | | | | | | Comparing two variants will not try to convert the types of the variant anymore. Exceptions are when both types are numeric types or one type is numeric and the other one a QString. The exceptions are there to keep compatibility with C++ and to not completely break QSettings (which needs automatic conversions from QString to numeric types). [ChangeLog][Important Behavior Changes] Comparing two variants in Qt 6 will not try attempt any type conversions before comparing the variants anymore. Instead variants of different type will not compare equal, with two exceptions: If both types are numeric types they will get compared according to C++ type promotion rules. If one type is a QString and the other type a numeric type, a conversion from the string to the numeric tpye will be attempted. Fixes: QTBUG-84636 Change-Id: I0cdd0b7259a525a41679fb6761f1e37e1d5b257f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Use the new support for comparisons in QMetaType for QVariantLars Knoll2020-08-133-91/+13
| | | | | | | | | | | | | | Remove the compare method in the QVariant::Handler struct. Rely on the generic support provided by QMetaType instead. [ChangeLog][Important Behavior Changes][QVariant] QVariant will now use builtin support in QMetaType to compare its content. This implies a behavioral change for some graphical types like QPixmap, QImage and QIcon that will never compare equal in Qt 6 (as they do not have a comparison operator). Change-Id: I30a6e7116c89124d11ed9052537cecc23f78116e Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QCborValue: add support for QCOMPARE string outputThiago Macieira2020-08-121-72/+78
| | | | | | Change-Id: Ibdc95e9af7bd456a94ecfffd16066c47ea9766d0 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Configure.json: Do not link to pthread on Android on feature testingCristian Adam2020-08-123-2/+1009
| | | | | | | | | pthread has been removed from the NDK and the cxx11_feature detection fails. Fixes: QTBUG-72330 Change-Id: I22a97814b7e95011ad3944327f02343348c72b91 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Expose public info about whether Qt is a shared lib buildAlexandru Croitor2020-08-121-0/+1
| | | | | | | | | | We expose it in the private QtBuildInternals package, but we need it also as public information for consumption in qt_import_qml_plugins() to decide whether it should do anything. Change-Id: If135ae596b4edaf8e2c458f6a2518b968c6d01c4 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* QXmlStreamReader: Don't resize readBuffer to a size it already hasRobert Loehning2020-08-121-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 Pick-to: 5.12 5.15 Change-Id: I581bd109f9b973e1c70b7b41b1f610a2ad5725b8 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Inline two macros in the unicode tablesEdward Welbourne2020-08-121-10/+6
| | | | | | | | They were only used by one function each, in unicodetables.cpp, so don't need to be macros. Change-Id: I3e7f9f661568862d0a0d265bb8f657a8e0782b13 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QJsonDocument: fix comparison of valid vs defaultThiago Macieira2020-08-111-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. Pick-to: 5.15 Fixes: QTBUG-85969 Change-Id: I5e00996d7f4b4a10bc98fffd1629f835f570ef6b Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* Introduce QIODevice::skipData()Alex Trotsenko2020-08-113-10/+18
| | | | | | | | | | | | | | | | | | | QIODevice::skip() called a virtual QIODevicePrivate::skip() to implement an efficient skipping on I/O devices for the internal subclasses. The user subclasses cannot inherit QIODevicePrivate, so this functionality was not externally accessible. This patch replaces QIODevicePrivate::skip() with a virtual protected QIODevice::skipData(). While the basic implementation simply discards the data by reading into a dummy buffer, users can reimplement this function to improve the performance in their subclasses. [ChangeLog][QtCore][QIODevice] Added virtual protected skipData(). Now, subclasses can implement device-specific skipping of data. Change-Id: I9522f7f7ab9d03ac06e972a525f8ec2fa909a617 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Fix handling of last second in 1969Edward Welbourne2020-08-111-11/+16
| | | | | | | | Due to a limitation of mktime(), we would have declared it invalid. Tidied up qt_mktime() slightly in the process. Change-Id: I25469e314afee6e0394e564bc69a98883005d4ec Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Tidy up use of local variables and add an assertionEdward Welbourne2020-08-111-6/+4
| | | | | | | | Petty tidy-up, narrowing the scopes and asserting that localtime_r()'s return, when non-null, is the pointer we gave it. Change-Id: I6c0959524260028ca9b234f6d33eae78f27c1412 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Add degree<->radians conversions for long double and integral typesGiuseppe D'Angelo2020-08-112-0/+54
| | | | | | | | | | | | | | | | | | | | | | | | For long double: they're just missing, so add them for completeness. For integral types: follow the advice of C11's trigonometric functions; first convert the angle to double, then do the actual conversion. This is offered only for the degree->radians conversions, as someone may legitimately want to call e.g. qDegreesToRadians(90). On the other hand, it seems extremely unlikely that someone may want to do a radians->degree conversion starting from integral datatypes, so I'm not adding it for the moment being (instead, I'm leaving a note). [ChangeLog][QtCore][QtMath] qDegreesToRadians now also accepts long double and integral types. A value of integral type will be casted to double before the conversion to radians. [ChangeLog][QtCore][QtMath] qRadiansToDegrees now also accepts long double. Change-Id: Ib1576be5193ae09bb6cb4a70d7a31702955df2c5 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QMultiMap: add constructors from QMapGiuseppe D'Angelo2020-08-102-0/+44
| | | | | | | | | | | We can provide those. They don't lose information, do not have the problem we face at offering ranged constructors (namely the order of duplicate keys), and have a distinct advantage over ranged constructors: a non-shared rvalue QMap can be "upgraded" to a QMultiMap without allocating memory for the multimap. Change-Id: Ic23c83927c05a210bc1f0050006c9f26365d3916 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Improve QMultiMap docs a bitGiuseppe D'Angelo2020-08-101-1/+8
| | | | | Change-Id: I170dc5de15dac61620aaed94f32226c158092dce Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QFileInfo: make stat method publicVolker Hilsheimer2020-08-103-4/+4
| | | | | | | | | | | | Forcing the reading of all file system attributes is generally useful in multi-threaded applications, and has at least one more use case in Qt. Using it in QFileSystemWatcher on Windows avoids several file system accesses. Task-number: QTBUG-41373 Change-Id: Ib3c3243fd083142393ad46d62f49cb4f7bfda17c Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* CMake: pro2cmake: Specify library versions for 3rd party librariesAlexandru Croitor2020-08-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | If certain 3rd party libraries have a version that's not suitable for Qt, the configure summary should say so, rather than use them and fail at build time. With the current situation, we have to duplicate the version information from the configure.json files in helper.py, by assigning the version number as an extra find_package variable. Rerunning configurejson2cmake then embeds this version info into the qt_find_package calls in configure.cmake. Some of the Find modules are rewritten to take the specified version into account when looking for the libraries. This involves moving around the code for creating a target, after calling find_package_handle_standard_args() so we know if a good enough version was found. Task-number: QTBUG-82917 Change-Id: I139748d8090e0630cda413362760034dc3483e11 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Fix build with mingw gcc 9 and -Wsuggest-overrideKai Koehne2020-08-101-30/+21
| | | | | Change-Id: I780b0761a7f6b19022116b738efa7aca1378b715 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Fix compilation in C++20 modeAllan Sandfeld Jensen2020-08-081-6/+12
| | | | | | | | The comparisons with pointer were ambiguous as the comparisons could be done between iterators or pointers. Change-Id: I0484946931502d04bd63519fcd6e886c732758d3 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QSettings: purge deprecated APIEdward Welbourne2020-08-072-42/+1
| | | | | | | Since 5.13: setSystemIniPath(), setUserIniPath() Change-Id: Ie02fa96e652c10ac1a276016bd556474030fe0f5 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QStandardPaths: purge deprecated APIEdward Welbourne2020-08-072-12/+2
| | | | | | | Since 5.2: enableTestMode(bool) Change-Id: Ibfd5958b6383491d9297d3f0e815ad4679fb57f5 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QFileInfo: inline the file-time methodsEdward Welbourne2020-08-072-22/+11
| | | | | | | | As instructed in a // ### Qt6 comment Added missing #include for QDateTime. Change-Id: Ic1f9e6ec42ecae07d037b84943444785847bdf98 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QFileInfo: purge deprecated APIEdward Welbourne2020-08-072-48/+0
| | | | | | | | Since 5.10: created() Since 5.13: readLink() Change-Id: I9722f81750dd92315a67a1c38df41a95ae63e0db Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QFile: purge deprecated APIEdward Welbourne2020-08-072-41/+2
| | | | | | | | Since 5.0: set{En,De}codingFunction() Since 5.13: readLink() Change-Id: I5386d0accf2724d84550c9bfdbbe914937194be2 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Purge deprecated API from QDirEdward Welbourne2020-08-072-51/+1
| | | | | | | | | Assignment from QString and addResourceSearchPath(), both deprecated since 5.13. Change-Id: I25f08ffadc7b9dfd7895a9199255ca5f1948bd47 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Purge QResource of some deprecated APIEdward Welbourne2020-08-072-79/+1
| | | | | | | | Removed isCompressed(), deprecated since 5.15, and (since 5.13) addSearchPath() and searchPath(). Change-Id: I4b6fb8077c02bbe322334e474eaf0a2a7caf0004 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QQueue: clean up 5.14's deprecationEdward Welbourne2020-08-071-5/+5
| | | | | | | | | | | Follows up on commit 9dc1edb3146e2ffd85c357f950a83751ef265549, giving the relevant advice on what to use instead and protecting with the appropriate version-check deprecation macro. Pick-to: 5.15 Change-Id: I4191493e6c43448c4390bf22be1571611b172950 Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QSharedData: remove #include relating to deprecationEdward Welbourne2020-08-071-4/+1
| | | | | | | | The header pulled in qhash.h for no readily apparent reason. It did so subject to deprecation #if-ery, so rip it out. Change-Id: I00529dd2b2de11d9a997b6fa766901f5b2f4b254 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Avoid UB in moc generated codeLars Knoll2020-08-072-0/+16
| | | | | | | | | | | | | | Introduce a Q_OFFSETOF() macro that uses the optional support of offsetof() for non standard layout types and disables the corresponding compiler warnings. All our supported compilers support offsetof() on non standard layout types. Use the macro to do the offset calculations required in moc generated code to replace a manual offset calculation that was dereferencing a null pointer. Change-Id: I4aab3af3c8bbaa90372f2234aa1cf8399d023c22 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QMap/QMultiMap: use =default for their default constructorsGiuseppe D'Angelo2020-08-071-2/+2
| | | | | Change-Id: I48e5bd8367fc6040128a50cd08c803310d3a4507 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Add x86 vector implementation of UTF-8 comparison to UTF-16Thiago Macieira2020-08-061-17/+121
| | | | | Change-Id: Ied637aece2a7427b8a2dfffd161181f75b738532 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QCalendar: actually remember if the registry has been populatedGiuseppe D'Angelo2020-08-061-0/+2
| | | | | | | | The "populated" variable is otherwise never written into. Change-Id: I979411a19927dc4e7e09c6c36edfb2308f519596 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* CMake: Properly handle CONFIG += thread aka Threads::ThreadsAlexandru Croitor2020-08-061-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | mkspecs/features/qt.prf adds a dependency on the system threading library if the Qt Core thread feature is enabled. Because qt.prf is loaded by any public or internal Qt project, it's essentially a public dependency for any Qt consumer. To mimic that in CMake, we check if the thread feature is enabled, and and set the Threads::Threads library as a dependency of Qt6::Platform, which is a public target used by all Qt modules and plugins and Qt consumers. We also need to create a Qt6Dependencies.cmake file so we find_package(Threads) every time find_package(Qt6) is called. For the .prl files to be usable, we have to filter out some CMake implementation specific directory separator tokens 'CMAKE_DIRECTORY_ID_SEP' aka '::@', which are added because we call target_link_libraries() with a target created in a different scope (I think). As a result of this change, we shouldn't have to hardcode Threads::Threads in other projects, because it's now a global public dependency. Task-number: QTBUG-85801 Task-number: QTBUG-85877 Change-Id: Ib5d662c43b28e63f7da49d3bd77d0ad751220b31 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* QMultiMap: add range eraseGiuseppe D'Angelo2020-08-063-48/+82
| | | | | | | | Also remove duplication by centralizing the main code for erase(), and implement erase(pos) in terms of erase(first, last). Change-Id: Ie0272ebac92fd7da48c31f9d68e69a2faa583bbc Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QMap: fix insert() rvalue overloadsGiuseppe D'Angelo2020-08-061-0/+12
| | | | | | | | Receiving an rvalue still requires to check whether the parameter is detached, otherwise we can't steal its backing std::map. Change-Id: Ie88dbf39fd777112ad7bb20a46d5c2d65be8eb3d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Long Live QMap as a refcounted std::map!Giuseppe D'Angelo2020-08-0610-1966/+3224
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ... and QMultiMap as std::multimap. Just use the implementation from the STL; we can't really claim that our code is much better than STL's, or does things any differently (de facto they're both red-black trees). Decouple QMultiMap from QMap, by making it NOT inherit from QMap any longer. This completes the deprecation started in 5.15: QMap now does not store duplicated keys any more. Something to establish is where to put the QExplictlySharedDataPointer replcement that is in there as an ad-hoc solution. There's a number of patches in-flight by Marc that try to introduce the same (or very similar) functionality. Miscellanea changes to the Q(Multi)Map code itself: * consistently use size_type instead of int; * pass iterators by value; * drop QT_STRICT_ITERATORS; * iterators implictly convert to const_iterators, and APIs take const_iterators; * iterators are just bidirectional and not random access; * added noexcept where it makes sense; * "inline" dropped (churn); * qMapLessThanKey dropped (undocumented, 0 hits in Qt, 1 hit in KDE); * operator== on Q(Multi)Map requires operator== on the key type (we're checking for equality, not equivalence!). Very few breakages occur in qtbase. [ChangeLog][Potentially Source-Incompatible Changes] QMap does not support multiple equivalent keys any more. Any related functionality has been removed from QMap, following the deprecation that happened in Qt 5.15. Use QMultiMap for this use case. [ChangeLog][Potentially Source-Incompatible Changes] QMap and QMultiMap iterators random-access API have been removed. Note that the iterators have always been just bidirectional; moving an iterator by N positions can still be achieved using std::next or std::advance, at the same cost as before (O(N)). [ChangeLog][Potentially Source-Incompatible Changes] QMultiMap does not inherit from QMap any more. Amongst other things, this means that iterators on a QMultiMap now belong to the QMultiMap class (and not to the QMap class); new Java iterators have been added. Change-Id: I5a0fe9b020f92c21b37065a1defff783b5d2b7a9 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Mac: (temporarily?) drop support for QMultiMap in QSettingsGiuseppe D'Angelo2020-08-061-44/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | In preparation for the QMap/QMultiMap split. The previous code had a workaround for storing multimaps, because the CF classes actually don't support it: build a dictionary from one key to a _list_ of values. Stop doing that. In principle, if QMultiMap support does get added to QVariant (which it probably should), then a similar workaround could be readded for QMultiMap support. [ChangeLog][Important Behavior Changes][QSettings] On Apple platforms, when using the native format, QSettings is no longer able to handle QVariantMap values which are actually multimaps. Since the native storage does not actually support multimaps, QSettings used to flatten and unflatten the maps. However, with QMap being changed to no longer allow for equivalent keys, flattening when writing does not make sense any more (there cannot be equivalent keys, because QMap in Qt 6 is a single-key map). Reading existing settings is supported by having a key in the map mapping to a QVariantList of values. Support for QMultiMap may be added back to QVariant and QSettings in a future version of Qt. Change-Id: Iaa9535100fe5ef55693f22a2068454a84180b4a6 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* qustrlen: Add #warnings to explain how to deal with GCC 7.x's ASanThiago Macieira2020-08-051-0/+7
| | | | | | | | | | | | | | | The build breaks by disabling ASan in this function because it also removes its ability to emit SSE2 code. That's clearly broken because all x86_64 can use SSE2. So this adds #warnings so people are told how to choose their solution. Clang doesn't currently define __SANITIZE_ADDRESS__ but I added a conditional just in case some future version does. Fixes: QTBUG-84856 Pick-to: 5.15 Change-Id: I552d244076a447ab92d7fffd1617875fdd8dbe62 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>