summaryrefslogtreecommitdiffstats
path: root/src/corelib
Commit message (Collapse)AuthorAgeFilesLines
* Remove pre-Win10 code paths in QtBaseYuhang Zhao2021-11-024-35/+6
| | | | | | | | | | | | | | Mostly a removal of dynamically loaded API. They should all exist on Windows 10 1809 (Qt6's minimum supported version). accessibility parts left untouched to make sure MinGW still compiles. Task-number: QTBUG-84432 Pick-to: 6.2 Change-Id: I7a091fc967bd6b9d18ac2de39db16e3b4b9a76ea Reviewed-by: André de la Rocha <andre.rocha@qt.io>
* QCollator: add public, static functions to do comparisonsThiago Macieira2021-11-013-25/+55
| | | | | | | | | | | | | | | | | Collation with the default QCollator object (no numeric, punctuation or case sensitivity changes) is a common-place occurrence, so add two functions to do this work. It's also what QString::localeAwareCompare() calls. The test ends up testing that default, static collator updates after the default QLocale changes too. Task-number: QTBUG-95050 Change-Id: I7e0b82c2d2fe464082d8fffd1696ac77f32840b2 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Correct qcollator_posix.cpp's check against system localeEdward Welbourne2021-11-011-3/+6
| | | | | | | | | | | | | | The check was made against the default locale but the code calls the system functions (wcscoll, wcsxfrm, wcscmp) for locale-specific collation, so should be comparing to the system locale's collation locale (i.e. LC_COLLATE). Also correct the Android-only check in tst_QCollator::compare() which duplicated the check but neglected the C locale, which is also supported (via QString::compare). Pick-to: 6.2 Change-Id: I48c3237dd6825e2070272ab88d95bdb8cbb9fc37 Reviewed-by: Aleix Pol Gonzalez <aleixpol@kde.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QAbstractProxyModel: Use QCompatProperty with custom getterIevgenii Meshcheriakov2021-11-012-68/+5
| | | | | | | | | Use new API for QCompatProperty with custom getter instead of ad-hoc solution. Task-number: QTBUG-89655 Change-Id: I06481ad4d360b178be001ceb9c6c8460b73391f6 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
* Add warning about QCoreApplication deferred deleteMichal Klocek2021-11-011-0/+4
| | | | | | | | | | | | | | | In some bug reports we got code which does deleteLater() on QCoreApplication, however this is not going to work as the user may expect. In cases where an application uses Qt WebEngine, this leads to weird looking crashes on exit as webenginecontext is not destroyed. Pick-to: 6.2 5.15 Change-Id: I4d284f30b0c7cad15ba6da3d65cdf813c36ee036 Reviewed-by: Michael Brüning <michael.bruning@qt.io> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Inline QPropertyBindingDataPointerAndrei Golubev2021-11-012-11/+12
| | | | | | | | | | | | The only non-inline function of that class was observerCount() which would use two of the inline functions defined in the header file, so we can safely inline observerCount() and make the whole class contain only inline methods Consequently, inline class doesn't have to be exported in Windows Change-Id: I41d144d9a50420bbc0091992b36cc36ac2567704 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Match documentation of shared pointers to new definitionsAllan Sandfeld Jensen2021-11-011-4/+8
| | | | | | | | We also have move semantics and noexcept. Pick-to: 6.2 Change-Id: Idcb1d39f79ff45738c641f8dd07fb71cf32d9aca Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* qconfig.cpp: use qOffsetStringArrayThiago Macieira2021-10-293-19/+23
| | | | | | | | | | It's been there for ages, we may as well use it and remove unnecessary complexity from CMake. Pick-to: 6.2 Change-Id: I2bbf422288924c198645fffd16a9742567a7e4af Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* Add --no-rcc-bundle-cleanup option to androiddeployqt toolAlexey Edelev2021-10-291-0/+6
| | | | | | | | | | | Add --no-rcc-bundle-cleanup option to androiddeployqt tool that helps to debug android build procedures and check the raw rcc bundle for missing items. Also add the QT_INTERNAL_NO_ANDROID_RCC_BUNDLE_CLEANUP CMake variable that adds the option when configuring projects for Android. Change-Id: I1f30ba979f9fb3274e44a53fdc5ebde4e65f0843 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* Doc: Fix broken formattingIvan Tkachenko2021-10-291-1/+1
| | | | | | | | Amends f25bc30d8d9d13fffd34213dfbf5e7373a18222a Pick-to: 6.2 5.15 Change-Id: Ia42c7639e4919de3f995d771bfc7d8237a8773d8 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QMetaType: Avoid superfluous template instantiationsFabian Kosmale2021-10-292-11/+8
| | | | | | | | | | | | Apparently msvc still parses the template and generates code for it when it encounters an extern template declaration. Thus, instead of speeding up compilation, it gets slowed down significantly as the instantiation would happen in every compilation unit that (transitively) included qmetatype.h. Task-number: QTBUG-97601 Change-Id: Id5e934afb14ad8973df1b9197aef336b22220111 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* qglobal.h: Do not include <algorithm>Fabian Kosmale2021-10-291-2/+0
| | | | | | | | | | | | | | | | algorithm is a rather heavy header, so we do not want to include it everywhere. It most likely was put into qglobal, because before C++11, swap could be found there. However, since C++11 it is located in <utility>, which we already include. Thus drop the superfluous include. [ChangeLog][QtCore][Potential source breaking change] The <algorithm> header is no longer transitively included with qglobal.h. If you used functionality from that header and relied on the transitive include, you will now need to explicitly add the header. Change-Id: Idc1912956b483d313dafd61b8f6a49d60eed8d3c Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix target existence check in qt6_android_generate_deployment_settingsAlexey Edelev2021-10-291-6/+5
| | | | | | | | | Move the check to the beginning of the function. Pick-to: 6.2 Change-Id: Ia44bb2e56626b00e75efabf2ebdc8eb97eee0ff8 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Craig Scott <craig.scott@qt.io>
* QVarLengthArray: Add explicit assertions for implicit assumptionsRobert Löhning2021-10-291-0/+2
| | | | | | | Change-Id: I4dfbf6174483b4af91f31a05c18cfec2aaec6e1f Pick-to: 6.2 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Extend documentation for bindable propertiesIvan Solovev2021-10-292-4/+26
| | | | | | | | | | | | | Extend the general property system page with a section on how to use bindable properties. Add some cross-references to improve the user experience. Task-number: QTBUG-97656 Pick-to: 6.2 Change-Id: I2520cdc168e3a8a66ea387e4ab717f4e0f969424 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* QLoggingRegistry: Disable internal tracking of source file namesThiago Macieira2021-10-271-3/+2
| | | | | | | | | | Commit d78fb442d750b33afe2e41f31588ec94cf4023ad (5.4) did this for all regular users of our macros, but obviously missed this manual override. So apply here too. Change-Id: I8c6a0ff3ec184205a544fffd16af7734fed2ebd1 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QLoggingRegistry: add the ability to have environment variable overridesThiago Macieira2021-10-272-1/+56
| | | | | | | | | | | Quite a lot of our code in Qt predating QLoggingCategory has manual environment variable controls. For compatibility with established documentation and tips-and-tricks out there, we should keep them working when switching to categorized logging. Change-Id: I3eb1bd30e0124f89a052fffd16a6c151d3e9d552 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix QDebug operator<< for QMultiMap when Q_CLANG_QDOC is definedJoerg Bornemann2021-10-271-1/+1
| | | | | | | | This amends commit 8a8bf1b84e9a096993b892873eb62c735149f320. Pick-to: 6.2 Change-Id: If863d33d055e0a743606d11859b11c112de105f1 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QHash: avoid crashing when reserving on a shared hashMårten Nordheim2021-10-261-1/+2
| | | | | | | | Pick-to: 6.2 Change-Id: I21ad13fa223bd5a2c61112e790965093a2750268 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QHash: use the shadow seedThiago Macieira2021-10-261-21/+20
| | | | | | | | | | | | | [ChangeLog][Important Behavior Changes] The qHash functions operating on string-like types and the qHashBits function will now mix in a shadow seed (not available in any API) if the provided main seed is not 0. This means the hashing value for any particular input has an almost zero chance of being equal in two different processes, even if processes of the same application. This unpredictability makes QHash more strongly resist denial-of-service attacks through degenerate hashing tables. Change-Id: Id2983978ad544ff79911fffd167240196f7cd5c8 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QHash: double the size of the stored seedThiago Macieira2021-10-261-66/+114
| | | | | | | | | | | | | | | | There's now another half of the seed which will be used by the hashers. This is not stored in QHash, so it is never changed for the lifetime of the application (not even when QHashSeed::setDeterministicGlobalSeed() is called). However, we will not use it when we're in deterministic mode. This commit uses the compiler thread-safe statics to implement the initialization of more than one atomic word, thus freeing us from having to have a reserved value. As a bonus, the QT_HASH_SEED warning will only be printed once. Change-Id: Id2983978ad544ff79911fffd16723f1673f9a5b4 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Add internal property to store Qt namespaceAlexey Edelev2021-10-261-0/+2
| | | | | | | | | | In some cases it might be useful to use the value of Qt namespace in CMake files. Currently the value is only stored inside Core target compile definitions. This adds the internal property _qt_namespace to the Core target and exports it. Change-Id: Ic0454f0ce6b8c65b5a186981463d3977169b022e Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Fix overflow issue on parsing min-qint64 with its minus sign repeatedEdward Welbourne2021-10-261-1/+16
| | | | | | | | | | | The call to std::from_chars() accepts a sign, but we've already dealt with a sign, so that would be a second sign. Check the first character after any prefix is in fact a digit (for the base in use). This is a follow-up to commit 5644af6f8a800a1516360a42ba4c1a8dc61fc516. Fixes: QTBUG-97521 Change-Id: I65fb144bf6a8430da90ec5f65088ca20e79bf02f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Doc: Enforce zero warnings for QtCore, QtGuiTopi Reinio2021-10-261-0/+3
| | | | | Change-Id: I7b39f9bf8d7bc9c9c5c21c4bd648a86281162740 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* QObjectComputedProperty docs: move example to snippetIvan Solovev2021-10-262-36/+38
| | | | | | | | | | | This patch amends 89a4c8d40d2ee1b8794dd7fcf80d226c5c87ba6c. It moves the code sample into a separate snippet file, which allows us to use Q_OBJECT macro in it without complaints from moc. Task-number: QTBUG-97656 Pick-to: 6.2 Change-Id: I368d8dd8c00dbbebd8a6bf3788be796c8ca4bce8 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Make QObjectComputedProperty documentation visibleIvan Solovev2021-10-251-2/+0
| | | | | | | | | | | QObjectComputedProperty belongs to public API. It's even referred in other documentation (for example, QBindable). It does not make sense to have its documentation marked as \internal. Task-number: QTBUG-97656 Pick-to: 6.2 Change-Id: I6ca81292cfafea873dd3577fb0e5ddb583969dc3 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Fix -trace build on WindowsIvan Solovev2021-10-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | The TraceLoggingValue template does not have overloads for Qt types, so it was throwing multiple template instantiation errors while trying to log the unknown types. Fix it by serializing such types to QString using QDebug::toString, and the logging this string. Apart from that, fixes some other compiler errors on Windows build with -trace enabled: - implicit size_t to ULONG conversion - complaints on std::min - add QT_BEGIN_NAMESPACE/QT_END_NAMESPACE to the generated *_tracepoints_p.h headers to fix the namespace build. Task-number: QTBUG-97246 Fixes: QTBUG-97241 Pick-to: 6.2 Change-Id: Ifba134bab8d7fda7f1e30da9938e25cae813e1c6 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Doc: Fix formatting: remove extra \c before \nullptrIvan Tkachenko2021-10-241-1/+1
| | | | | Change-Id: Ie93cf7253bdc6b70fd187c208da636fc551491c2 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Update windows version detectionMårten Nordheim2021-10-241-1/+11
| | | | | | | | Since the API still doesn't return 11. Pick-to: 6.2 5.15 Change-Id: Ifd4f7f845915702fcbb0f857487358ae8e806273 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Remove old pre-6.0 hooksThiago Macieira2021-10-221-2/+0
| | | | | | | Now only qt_startup_hook officially remains Change-Id: Iac31783a62a040638d73fffd168aaaa7408c9be4 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Doc: Fix qdoc warningsVenugopal Shivashankar2021-10-234-9/+14
| | | | | | | | | | | | | | | | | src/corelib/kernel/qmetatype.cpp:1605: (qdoc) warning: Command '\snippet (//! [[implicit]])' failed at end of file 'qmetatyp> src/corelib/kernel/qmetatype.cpp:1615: (qdoc) warning: Command '\snippet (//! [[member]])' failed at end of file 'qmetatype/> src/corelib/kernel/qmetatype.cpp:1626: (qdoc) warning: Command '\snippet (//! [[memberOk]])' failed at end of file 'qmetatyp> src/corelib/kernel/qmetatype.cpp:1639: (qdoc) warning: Command '\snippet (//! [[unaryfunc]])' failed at end of file 'qmetaty> src/corelib/text/qbytearraymatcher.cpp:233: (qdoc) warning: No such parameter 'view' in QByteArrayMatcher::indexIn() src/corelib/time/qdatetime.cpp:1854: (qdoc) warning: Can't link to 'QLocaleie:pmText()' src/corelib/thread/qsemaphore.cpp:494: (qdoc) warning: Undocumented return value (hint: use 'return' or 'returns' in the text src/corelib/thread/qsemaphore.cpp:505: (qdoc) warning: Undocumented parameter 'timeout' in QSemaphore::try_acquire_for() src/corelib/thread/qsemaphore.cpp:505: (qdoc) warning: Undocumented return value (hint: use 'return' or 'returns' in the text src/corelib/thread/qsemaphore.cpp:516: (qdoc) warning: Undocumented parameter 'tp' in QSemaphore::try_acquire_until() src/corelib/thread/qsemaphore.cpp:516: (qdoc) warning: Undocumented return value (hint: use 'return' or 'returns' in the text Change-Id: Ib612c69525ec7542f2ad3dd9a07e89f266718fd8 Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* QVarLengthArray: Reduce memory allocations in emplace()Robert Löhning2021-10-231-1/+2
| | | | | | | | | | | | | | | | Currently, we allocate memory for elements one by one which can get pretty slow when adding many elements. [ChangeLog][QtCore][QVarLengthArray] Reduced number of memory allocations in emplace() by allocating more memory at once. Fixes: QTBUG-97489 Pick-to: 6.2 Change-Id: Idfb5b5946b047d5215c8ed00770574249f9f5d40 Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Remove superfluous qfuture.h includes from qcoreapplication[_p].hJoerg Bornemann2021-10-223-6/+2
| | | | | | | | | | | | | | | | | This include is only needed on Android, and removing it improves build times slightly. Remove the include from qcoreapplication.h and guard the includes in qcoreapplication_platform.h properly for Android. Remove the include from qcoreapplication_p.h as well. This was a left-over from the app permissions API that was removed. Pick-to: 6.2 Task-number: QTBUG-97601 Change-Id: I131baebe3e08e93ad5420d40908c2dceab89554c Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Remove unused qapplicationpermission.hJoerg Bornemann2021-10-224-82/+0
| | | | | | | | | The app permission API was removed, and this file is a left-over. This amends commit 72e5b36e2e4c79dc7995f0203968503266b4f2f5. Pick-to: 6.2 Change-Id: Ie1bf9465260594864464c4d4ee4dc99593c28cc1 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Doc: QString: formalize that we now include the QBA's nullsThiago Macieira2021-10-211-7/+36
| | | | | | | | | | | | | | We've been meaning to do this ever since the QByteArray overloads were added some time prior to Qt 4.5.1[1], but had been wary of behavior compatibility issues. Commit 6abdbb65e59779af56ae25372a853efca19eac59 did it and even explained so in the ChangeLog. I'm just being more explicit. [1] https://code.qt.io/cgit/qt/qt.git/tree/src/corelib/tools/qstring.h?h=v4.5.1#n415 Fixes: QTBUG-97451 Change-Id: Icb2516126f674e7b8bb3fffd16ad55e46a9781c8 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QLatin1String: harmonize null byte handling with the rest of QStringThiago Macieira2021-10-221-3/+3
| | | | | | | | | | | | | | | | | | | | After the introduction of QByteArrayView, all the QString::fromXxx overloads and the constructor will include the null bytes inside QByteArrays and so will QLatin1Strings created from QByteArrayViews. This was the lone stand-out that wasn't fixed in 6.0, so do it now. [ChangeLog][Important Behavior Changes] Since Qt 6.0, all QString and QLatin1String methods consuming QByteArray and QByteArrayView objects will include any embedded null bytes and treat them as U+0000 Unicode characters, whereas in Qt 4.x and 5.x, they would stop at the first null byte like bare C strings. Qt 6.3 contains a fix for a couple of the methods that mistakenly persisted the old behavior in 6.0-6.2, namely the QLatin1String constructor from QByteArray and the equality and inequality operators between QByteArray and QString. Task-number: QTBUG-97451 Change-Id: Icb2516126f674e7b8bb3fffd16ad5621cf3e64ec Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Avoid warnings when compiling bootstrap library without zstdUlf Hermann2021-10-211-0/+4
| | | | | Change-Id: Ic67cd2b582df0464a17f6181157ebbd47986114c Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Move the ABI tag from minimum-linux.S to qlibraryinfo.cppThiago Macieira2021-10-214-111/+44
| | | | | | | | | | | | | | | We don't need the assembly file any more. According to a comment to patchsets 2 in the Gerrit code review for commit bb8a61866ec6a6de2426012f8c4219d41b3a414a, the section ended up as SHT_PROGBITS instead of SHT_NOTE. I didn't know then that the section type is not actually important, only whether it's present in the segment pointed by a PT_NOTE is. That isn't recorded in the review. Since we now depend on the linker properly placing the .note.* sections for Qt plugins, we can rely on this working. Change-Id: Icb2516126f674e7b8bb3fffd16ad659149e34a23 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Doc: QByteArrayMatcher: add note that the pattern must remain on scopeThiago Macieira2021-10-211-4/+9
| | | | | | | | This issue bit me. The API is surprising and very un-Qt-like... Pick-to: 6.2 Change-Id: I2bbf422288924c198645fffd16aa1c58d921bd7e Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QFactoryLoader: continue the port from JSON to CBORThiago Macieira2021-10-203-20/+43
| | | | | | | | | | | | | | This continues the effort from the previous commit, by not passing through the JSON conversion at all, and simply using CBOR directly. The port in qtbase is complete, but in order to support the conversion in other modules without introducing breakages, there's a temporary class used for converting to QPluginParsedMetaData from QJsonObject. It'll be removed once all other modules have finished converting. Change-Id: I2de1b4dfacd443148279fffd16a3ed4ddaf34afc Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QPlugin: keep the CBOR data as CBORThiago Macieira2021-10-206-78/+110
| | | | | | | | | | Since QJsonValue and QCborValue use the same backend, we may as well use the CBOR frontend classes, which means we avoid an unnecessary conversion until later. Change-Id: I2de1b4dfacd443148279fffd16a3e2f56cd74c0b Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Remove WIN32 and MACOSX_BUNDLE arguments when building Android binaryAlexey Edelev2021-10-201-1/+1
| | | | | | | | | | This fixes the regression introduced in Android multiabi changes. Amends 0a02d845559e4fd9d1bd72942c5118f3bb1307bf Task-number: QTBUG-88841 Change-Id: I09e129361eb760cdc14c2302e821ce4fcbf117c3 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* QDateTime: Limit string processing to known boundariesMårten Nordheim2021-10-201-6/+18
| | | | | | | | | | | We were treating the input as if it was always reasonably good. Since we know the max boundaries anyway lets just stop processing when those are reached Fixes: QTBUG-97489 Change-Id: Ibb78d6d51ad58454b2007ab46d54116ca0be5448 Reviewed-by: Robert Löhning <robert.loehning@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix metatype declaration for QHash/QMultiHash with no operator==Sona Kurazyan2021-10-201-6/+14
| | | | | | | | | | | | | | | | | | | | | | | When declaring metatypes, the metatype system tries to detect if the comparison operators for the given type exist and automatically register them. In case of QHash, the equality operator was enabled if the value type provides one. But the implementation needs equality operator of the key type as well. As a result, when the key type has no equality operator, the metatype system detects that the equality operator is available for the QHash itself, but the compilation for metatype registration fails when trying to instantiate the code that uses equality operator for the key. This is fixed by enabling equality operators for the QHash only when both the key and value types provide one. The same issue existed also for QMultiHash, with the difference, that QMultiHash didn't have the constraints even on the value type. So added checks for both. Fixes: QTBUG-96256 Pick-to: 6.2 Change-Id: Ib8b6d365223f2b3515cbcb1843524cd6f867a6ac Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Help the compiler avoid duplicate TLS lookupsUlf Hermann2021-10-201-2/+4
| | | | | | | | | Most compilers are clever enough to optimize this out. Yet, even with optimizations disabled, we don't want to do two TLS lookups here. Change-Id: I822954c7cec591084d6c27c916818dab7e000ea9 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Optimize QObjectCompatProperty::notifyUlf Hermann2021-10-203-25/+44
| | | | | | | | Do the check for inBindingWrapper() last. Change-Id: I3d589c9fba524f465e35cd4cc0e65e3af376b419 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QObjectCompatProperty: Add support for custom gettersIevgenii Meshcheriakov2021-10-203-11/+31
| | | | | | | | | | Add additional template argument to QObjectCompatProperty to specify a custom getter. This may be useful for classes like QAbstractProxyModelPrivate the need to customize property getters. Task-number: QTBUG-89655 Change-Id: I34fe4bdebbbf1446aff60bd20a946454607f52d5 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Make QDir::mkpath() return true when given an existing root pathKarsten Heimrich2021-10-201-0/+2
| | | | | | | | | | On macOs with APFS mkdir sets errno to EISDIR, so take the error code into account. Pick-to: 6.2 Fixes: QTBUG-97110 Change-Id: I8e7d10c95430a2802bdbfbf94dd65219bd9071a7 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Make QDir::mkpath() return true when given an existing drive nameKarsten Heimrich2021-10-201-1/+1
| | | | | | | | | | | | Commit ed48391c592e8ba68c723e3017ac384f0c7a7c23 removed the check for ERROR_ACCESS_DENIED reported by the Windows CreateDirectory(...) function in case an existing windows drive name was passed as argument. This restores the behavior of the function which broke after 5.15. Pick-to: 6.2 Fixes: QTBUG-85997 Change-Id: Ie86188100766f7364acee57b15a250f4a2720b9f Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
* Compile Private API autotests for INTEGRITYTatiana Borisova2021-10-201-1/+1
| | | | | | | | | | | | | | | | | | | | | - GHS's __PRETTY_FUNCTION__ (used by QT as Q_FUNC_INFO) doesn't have spaces round the = operator when indicating the type of the template parameter. The compilation error: qt5/qtbase/src/corelib/kernel/qmetatype.h", line 2104: note #3316-D: cannot access position 53 in array of 49 elements constexpr const char *begin = func + prefix; ^ detected during: instantiation of "auto QtPrivate::typenameHelper<T>() [with T=void]" at line 2186 Task-number: QTBUG-97087 Pick-to: 6.2 Change-Id: I33e61f5d54a61944a5aecf07d149a8dee0ef1e5d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>