summaryrefslogtreecommitdiffstats
path: root/src/corelib
Commit message (Collapse)AuthorAgeFilesLines
* Add new special QObjectPrivate::{connect, disconnect} for QMLAndrei Golubev2021-01-212-3/+52
| | | | | | | | | | | | | | | | | Original QML-specific connection mechanism ignores the receiver argument and uses sender as receiver. This causes uncontrollable memory growth in certain cases as connections on receiver persist even after receiver is destroyed New connect() with receiver parameter uses underlying API correctly, disconnect is provided for the symmetry (not sure it's really needed) Task-number: QTBUG-86368 Change-Id: I4580d75b617cb2c4dfb971a4dfb8e943e325572b Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 6f520abdab7120789800208dde837b3836f762cc) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix QTzTimeZonePrivate::displayName()'s fallbackEdward Welbourne2021-01-201-1/+2
| | | | | | | | | | It previously fell back on abbreviation, a very poor choice. The base class does better than that, so use its implementation instead. Change-Id: I47cbfce815cd8b2b533d9c6aeebcf398e5852d02 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit f9fff26b2db8152dcae26c92054f031bdebd7bc1) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix build with GCC 11: include <limits>Thiago Macieira2021-01-202-2/+5
| | | | | | | Fixes: QTBUG-90395 Change-Id: Iecc74d2000eb40dfbe7bfffd165b5dd3708b7a40 (cherry picked from commit 9c56d4da2ff631a8c1c30475bd792f6c86bda53c) Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Add missing since to QEvent::copy docsNicolas Fella2021-01-191-0/+1
| | | | | | | Change-Id: Idfadc1801b0e97a5030d2784a65ae658900efd12 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit 9b2df27bb3a5e8fb788f7274013aa66d32d1250d) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix problems with offset-derived ids for QTimeZoneEdward Welbourne2021-01-192-15/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When creating a time-zone from a UTC+offset name that isn't known to the system, QTimeZone (since the fix to QTBUG-77738 in 5.15.0) falls back to constructing a suitable UTC-offset backend; however, the id of this is not guaranteed to match the id passed in to the constructor. In all other cases, the id of a QTimeZone does match the id passed to its constructor. Some utcOffsetId testcases had different id() than the id passed to the constructor, due to mismatches where a zone was constructed using the fall-back but the generated id included its minutes (as :00) or omitted its seconds. The omission of seconds is clearly a bug, but we also don't want to include :00 for seconds when it's not needed. So change QTimeZonePrivate::isoOffsetFormat() to accept a QTimeZone::NameType to configure how much we include in an id. Its callers other than the relevant constructor (from offset) still get minutes, even when :00, but will also get seconds added if that isn't zero; and the constructor from offset now gets the short form obtained by omitting all trailing zeros. Since all valid whole-hour offset names that do include :00 for the minutes field are in fact known standard offset names, the elision of minutes will only affect zones created by ID in the case of a whole-hour offset given without :00 minutes specifier, so these shall necessarily in fact get the ID passed to the constructor. Creating by UTC-offset with a name that specifies zero seconds will result in a QTimeZone instance whose id() differs from what was passed to its constructor (eliding the :00 seconds and potentially also minutes, if also zero) but this should be the only case where a QTimeZone's id doesn't match the one passed to the constructor, when constructed by id. Fixed inconsistency between the offset-constructor's declaration (taking offset as int) and definition (taking qint32) in the process. Added an id check to the utcOffsetId() testcase. Amended two tests of offset-derived time-zones' IDs, added comments to make clear how one of those differs from a matching standard name test and converted two uses of QCOMPARE(, true) to QVERIFY(). [ChangeLog][QtCore][QTimeZone] QTimeZone instances created by offset from UTC (in seconds) shall now only include minutes in their ID when the offset is not a whole number of hours. They shall also include the seconds in their ID when the offset is not a whole number of minutes. Task-number: QTBUG-87435 Change-Id: I610e0a78e2aca51e12bfe003497434a998e93dc7 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 50c63446f525a8625b6315597cb0897d89908d6b) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Doc: Clarify setLibraryPaths behaviorPaul Wicking2021-01-191-3/+4
| | | | | | | | Fixes: QTBUG-89130 Change-Id: Id8460fd00dcfdcca174d523f8d97baef1a764f6f Reviewed-by: Topi Reiniö <topi.reinio@qt.io> (cherry picked from commit efa5a699729c6ff9f9d7991d12ed70139e3be669) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* If available, use a version-specific qt<major-version>.confRalf Habacker2021-01-161-1/+4
| | | | | | | | | | | | | To enable the current Qt version to use a qt.conf that is independent from the previous version, a file named 'qt<major-version>.conf' is searched for first. If this file does not exist, a file with the name 'qt.conf' is searched for. Task-number: QTBUG-88635 Change-Id: If75b63f72a7bdbdf1de7729ea4ecb00810b58d12 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de> (cherry picked from commit ab2c61e6384bbb5a0d154caa8f4784f9053147fe) Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix XCB launch key mappingAllan Sandfeld Jensen2021-01-162-19/+20
| | | | | | | | | | | | | | They have been reported wrong since Qt 4, and not fixed for behavior compatibility, fixing it for Qt 6. [ChangeLog][X11] XF86LaunchXX keys have been remapped, so the Qt names and X11 names match, instead of being 2 off. Fixes: QTBUG-25261 Change-Id: Ie3a8676439ae3e93a78218c9e7f4443565e84356 Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io> (cherry picked from commit cfd935fe6c26800befc10889afc0aebde311acca) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QCache: when overwriting, store the new cost instead of the deltaMårten Nordheim2021-01-141-1/+2
| | | | | | | | | | | | The delta was clearly intended to be used on the total (and still is) but it also wound up getting stored in the cache, which wouldn't be a big problem unless the object was removed, in which case we could incidentally 'free up more space' than intended. Change-Id: Ib2b0f072d30da6d16a93dce60e4c5f6080c109fc Reviewed-by: Lars Knoll <lars.knoll@qt.io> (cherry picked from commit d2e2d0d3a6249ccbc17ec92acb32fec9a0d71807) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: Fix build with GCC and ltcgChristophe Giboudeaux2021-01-131-13/+18
| | | | | | | | | | | | The porting script could not handle this special case. To achieve the same thing, we'll use an intermediate 'OBJECT' library which will get the '-fno-lto' build flag if the conditions are met. Fixes: QTBUG-89426 Change-Id: Ied62502ce9c7f7fd6b89fab166f7bccfcd6e7433 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit 2d4a40f93fd3f0fd31110ef7d19a12fc56c00967) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Doc: Generalize timer docsKai Köhne2021-01-111-3/+3
| | | | | | | | | The snippets do not talk about Qt Widgets specifically. Change-Id: Icc4f243c93189f08124074e4918d535aa37e6560 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> (cherry picked from commit 1f53189c29f80c736877333631338670a06ac439) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Doc: Add partial documentation for CMake API (tech preview)Craig Scott2021-01-114-1/+601
| | | | | | | | | | | | | | | There are still other parts of the CMake API that are not yet documented. This change only addresses qt_add_executable() and the Android-related commands it uses. Fixes: QTBUG-88839 Task-number: QTBUG-84482 Change-Id: I761b5ce908d1f62284baabe2d414cd37a0efe83d Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io> (cherry picked from commit 0be2ecee37ee76f04ff73f782014108c15a5831f) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QDir/QFileInfo: add doc notes about paths starting with ':'Ahmad Samir2021-01-082-7/+27
| | | | | | | | | | | | | | This is an addendum to commit 0da5726a43b; making the note about paths starting with ':' being treated as absolute paths by the underlying QFileSystemEngine, more visible, so that users of the class don't hit that pitfall. Add similar docs to QFileInfo. Change-Id: Ib34d066d31bb673d340ec41422ed4daf911765b8 Reviewed-by: Paul Wicking <paul.wicking@qt.io> (cherry picked from commit 138fa9f2f4445832769a126a8ea72686b3687933) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QProperty docs: update macro nameAndreas Buhr2021-01-081-4/+5
| | | | | | | | | | | Use Q_OBJECT_BINDABLE_PROPERTY instead of non-existing ones. Follow-up to 50e1976437f645e9d6571d4498e9d44388e59c19. Task-number: QTBUG-85520 Change-Id: I138f0775d9804029f2ecd6bd3594ab47b247392e Reviewed-by: Paul Wicking <paul.wicking@qt.io> (cherry picked from commit 618dd6b5a7ed3e9933b3f3a8bf3429caf2506319) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix segmentation fault in QObject::dumpObjectInfoAndreas Buhr2021-01-071-1/+1
| | | | | | | | | | | | | There was a check "if (cd && cd->signalVectorCount())" in the code which was faulty because "signalVectorCount()" could return -1 to indicate that no signalVector is available. This patch fixes the problem. Fixes: QTBUG-89846 Change-Id: I12c512ff8d889ba2bd298789ab6081930f739089 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 6a664d0660911173c7e85c60b9af195a0ef4f110) Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Doc: Improve QMap, QMultiMap descriptionKai Köhne2021-01-062-4/+2
| | | | | | | | | | | | | | Make it clear that the fast lookup is by key, not by value. See also discussion in https://forum.qt.io/topic/121907/misleading-documentation-of-qhash-qmap/ Change-Id: I396297e0e4674e0a1f889f4138ab52ff224c0ee2 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch> Reviewed-by: Paul Wicking <paul.wicking@qt.io> (cherry picked from commit 05146a77fce7f080eefad3f82a14e60c8e3ec464) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Change QLineF::setLength() to work whenever length() is non-zeroEdward Welbourne2021-01-062-11/+11
| | | | | | | | | | | | | | | | | Previously it only worked when isNull() was false, which is true for very short lines, even though length() may be non-zero. [ChangeLog][QtCore][QLineF] QLineF::setLength() will now set the length if the line's length() is non-zero. Previously, it was documented to only set the length if isNull() was false; this is a fuzzy check, so isNull() could be true for a line with non-zero length(). Fixes: QTBUG-89569 Change-Id: I803e622ad09c85815dde25df8dd3ba6dfcba0714 Reviewed-by: Lars Knoll <lars.knoll@qt.io> (cherry picked from commit 6974737695eae5a41bc8a3f344a4f1f199006f21) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Doc: Use correct include for QtFuture namespacePaul Wicking2021-01-061-0/+1
| | | | | | | | Fixes: QTBUG-89766 Change-Id: I20c5d3c12490a5eed7bb4e267b2edb5d45dbaadf Reviewed-by: Topi Reiniö <topi.reinio@qt.io> (cherry picked from commit 32a46a1dcf7c06fac4da2a4e6e549e81d0be98f9) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* android: Generate deployment settings file with correct qml-import-pathsCraig Scott2021-01-061-2/+7
| | | | | | | | | | | | | | | | | | The qt6_android_generate_deployment_settings() command had been creating deployment settings files with the wrong key name for qml import paths. This resulted in the QT_QML_IMPORT_PATH target property having no effect. The QT_QML_IMPORT_PATH property can also potentially hold a list, not just a single value. This change now handles the list case as well, previously qt6_android_generate_deployment_settings() was assuming it always held a single path if it was set. Fixes: QTBUG-89628 Change-Id: Ibdd74ec8d130f160433a60a14a0a9f496f496a1b Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit ae91e3365b775789fd323301a28ed48619953369) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix QMultiHash::equal_range crashesZhang Yu2021-01-061-0/+3
| | | | | | | | | | | | | QMultiHash::equal_range crashes when called in a const member function. The Data `d` is a NULL pointer when calling equal_range() before inserting data into an empty QMultiHash. Then calling`d->find` crashes. Fixes: QTBUG-89687 Change-Id: I10c3d196cbc72aed8c8c922ef16534bba51037b7 Reviewed-by: Lars Knoll <lars.knoll@qt.io> (cherry picked from commit 22416ecaaf58619c716229b71cdca558fda0a861) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Update shared-mime-info to the 2.1 release, adjust implementationDavid Faure2021-01-054-7050/+8878
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The spec hasn't changed, but I made the same mistake in xdgmime (the reference implementation) and in Qt: when multiple globs match, and the result from magic sniffing is unrelated to any of those globs, then I used the magic result, but that's wrong, globs have priority and one of them should be picked up. This is now fixed in xdgmime (https://gitlab.freedesktop.org/xdg/xdgmime/-/merge_requests/3) and in the expected results in shared-mime-info (https://gitlab.freedesktop.org/xdg/shared-mime-info/-/merge_requests/99) which this commit is also tested against. This change also optimizes QMimeBinaryProvider::addFileNameMatches to have the same logic as xdgmime for glob matching: literals > extensions > other globs As soon as one category matches, we can stop there. This makes no difference in the overall results, in practice. The user bug report (against the Qt implementation, actually) is https://gitlab.freedesktop.org/xdg/shared-mime-info/-/issues/138 as well as https://bugs.kde.org/show_bug.cgi?id=411718 Change-Id: Ia0a34080427daff43c732609443ee6df8f41447c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 0cbbba2aa5b472241d45b4be6959a792062fbc30) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QCborStreamReader: move helper function to the only place it's usedThiago Macieira2021-01-041-25/+17
| | | | | | | | | Simplifies the code a little bit Change-Id: I7b9b97ae9b32412abdc6fffd164545632be4590a Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> (cherry picked from commit 2bed336599dddd7e7c3cef73107c5ca3e6d6ab27) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* XmlStringRef: remove operator<=>Giuseppe D'Angelo2021-01-041-6/+0
| | | | | | | | | | | It's defined in terms of operator<=> on QStringView, which does not exist, causing a compile error. Change-Id: I64fc60da4e52c7e53be7849d9b42952be139a816 Fixes: QTBUG-89729 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit 1dc4e5d3ebc265d13fe29657b81b7c44ea5f0ed2) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: Prefer canonical CMAKE_ANDROID_NDK var when writing deploy fileCraig Scott2021-01-041-1/+1
| | | | | | | | | | | | | | | | | | CMAKE_ANDROID_NDK is an official variable provided by CMake. The ANDROID_NDK variable will be set by the NDK toolchain file, but we don't need to rely on that (the user could theoretically not be using the NDK's toolchain file). Using the CMake-provided variable means we don't have to explain the source of the variable in documentation for the qt6_android_generate_deployment_settings() command. We should prefer to use things provided by CMake already where it makes sense and this seems to be one such case. Task-number: QTBUG-89651 Task-number: QTBUG-88839 Change-Id: Ieda54de8f5c65c36da6bb55c87a8b8fdd1d5cd7b Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit 1b4d70676c3fed70a826b3a3cda3cd6c8077addf) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QProcess/Win: handle more errors in openChannel()Alex Trotsenko2020-12-301-40/+46
| | | | | | | | | | | | | In theory, low-level functions like CreateNamedPipe() or DuplicateHandle() could suddenly fail. Thus, in order to ensure the correct configuration of the channels, we must check for these errors. Change-Id: I3d6291043e5e394ec5c5a7d85dfb7b09bfdcd172 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit efb3d87700fc057db1e2374c7cf5717df6dc68b8) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QRegularExpression: mention raw string literal in the docsAhmad Samir2020-12-282-0/+18
| | | | | | | | | | | | | | | Raw string literals (since C++11 according to [1]), make writing/reading regex patterns easier, since one can just use e.g. "\w\d" without having to escape those backslashes e.g. "\\w\\d"; this is especially useful with longer/more complex regex patterns. [1] https://en.cppreference.com/w/cpp/language/string_literal Change-Id: I119f9566d27222b915af931ee7e13e064baede61 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> Reviewed-by: André Hartmann <aha_1980@gmx.de> (cherry picked from commit 824c726340ed8da0393aa97016682bcfd8c8bdc3) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Add test creating QDateTime in double-DST gap in 1947 GermanyAndreas Buhr2020-12-241-0/+3
| | | | | | | | | | | | In 1947, Germany had not only a summer time but also a "Hochsommerzeit", a high summer time. This patch adds a test creating a QDateTime in the time gap at the beginning of this Hochsommerzeit on May 11, 1947. Change-Id: Ib81a23914965f092c3e3195e4c7258e5a4e0b30e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 741862875c4bd72ba6d28cf53f6f88579602e4bf) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* macos: Document that Drawer is obsoleteMorten Johan Sørvig2020-12-221-0/+2
| | | | | | | | | | | This feature is not much used on modern macOS, and Qt 5 has never supported it. Change-Id: I9de195aaf7df954b63f0f816e93c91e870ef5852 Reviewed-by: Andy Shaw <andy.shaw@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io> (cherry picked from commit 093e0d452faa56e5cf3c9adfae3b73faea4f400f) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: Use host variables instead of hardcoded directoriesAlexey Edelev2020-12-211-3/+3
| | | | | | | | | | | | | | | | | | | | 'QT_HOST_PATH' indicates that we use crosscompilation toolchain to build project. In this case 'Qt6Config.cmake' loads 'Qt6HostInfoConfig.cmake' from host QT_HOST_PATH, that defines correct paths to host tools. Replace hardcoded paths for host tools by paths recorded in Qt6HostInfoConfig.cmake. Correct conditions for QT_HOST_PATH, evaluate it explicitly as string, but not as boolean expression. Fixes: QTBUG-86557 Change-Id: Ib52bbd32478051d019a932dcb1f735e2d4aacfbf Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit 56bdef94379479f27858dccc73a95614648735bb) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: Don't rely on versionless commands or targets existingCraig Scott2020-12-211-3/+3
| | | | | | | | | | | Commands like qt6_finalize_executable() should not rely on versionless commands or targets being available, since they can be disabled by a build option. Change-Id: I6a9ab6a9b6a6b731590e5b8c43f73b518ed38e81 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit 50f939bfe8bdd63beca4aff06cbf1b2be1677624) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix crash on reallocateAndGrowMichal Klocek2020-12-211-1/+1
| | | | | | | | | | | | | | | | | | | After 6be398 few tests fail/crash with qtcharts. Fix issue on reallocateAndGraw and avoid accessing flags on invalid header. Data::allocate can return invalid header and dataptr, which takes place if capacity is 0. In code before 6be398 clone method checks if header is not null before resetting flags. However after b76fbb4 resetting flags is no longer needed since it is done in allocateGrow. Task-number: QTBUG-89092 Change-Id: I2fde781dad7a0694a5f17ab716f647c2e35f4ff0 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> (cherry picked from commit b770b7517d30dd17d1096a0bb434677a2b3ff630) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Disallow construction of QPropertyBinding from a propertyFabian Kosmale2020-12-181-5/+1
| | | | | | | | | | | | | | | | | | | | | | This would steal an existing binding from a property, which is most likely not the intended action. Alternatively, we could make it equivalent to Qt::makePropertyBinding(foo), but that conflates properties with bindings to it. On the other hand, this would avoid a potentially source-breaking change. [ChangeLog][Potentially Source Breaking Change] It was possible to create a QPropertyBinding from a property; this would steal any set binding from the property or create an invalid binding if none was set. Use makePropertyBinding if you want to to create a binding which depends on the property's value, or takeBinding if you want to repurpose the property's binding. Fixes: QTBUG-89507 Change-Id: Icd2d3b9261b60f36948f2cea9c33ddbea36efbc1 Reviewed-by: Lars Knoll <lars.knoll@qt.io> (cherry picked from commit c88905f0a947d59c61d9f0f990354ca935d3d4ed) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QCache: fix updating entries breaking the internal chainMårten Nordheim2020-12-171-4/+5
| | | | | | | | | | | | | | | After f08492c6fd9818c7d80b1725355453e179b4d85b was merged this bug would manifest as an entry appearing twice in the chain when a updating an existing entry (insert with an existing key). This could sometimes result in crashes later as the list filled up and the list was used in trim() to remove various entries. Fixes: QTBUG-89176 Change-Id: Ide80160fb4317dc0aefe79eec5dce7ec6813e790 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 0ca46358321f2244386b0b6558a915cda8c6c006) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Restore previous QDateTime behavior in DST gapAndreas Buhr2020-12-171-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | Historic QDateTime behavior when being asked to create a QDateTime in the DST gap was to interpret the given date as if it was in the time before that gap, mapping it to a point in time after the gap. This has changed with a04411119ead3d4473e4f0ac4bceedc585977b2f . Since then, the given date is interpreted as if it was in the time after the gap, thus being mapped to a point in time before the gap. This patch restores the historic behavior. This was not caught by Coin because machines ran in timezone "Atlantic/Reykjavik" which does not have DST since 1967. This patch changes tests to always run in "Europe/Oslo". Driveby: Test function "findSpring" did some operations in local time, even though being asked to work in a specific time zone. Fixed that. Fixes: QTBUG-86960 Fixes: QTBUG-89208 Change-Id: Iecce5898bf9711a10e7dfc0a25e4bbeaed1c8ade Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 3d785249ba43cf4bd895ed679bac2791e0130dc5) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QProperty docs: update macro nameIvan Solovev2020-12-171-2/+3
| | | | | | | | | | Use Q_OBJECT_BINDABLE_PROPERTY instead of non-existing ones Task-number: QTBUG-85520 Change-Id: I47e3ff150f54176b42a478fd3ff639754d90e70a Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 50e1976437f645e9d6571d4498e9d44388e59c19) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Move QObjectBindableProperty documentation into snippet fileFabian Kosmale2020-12-172-18/+71
| | | | | | | | | | | | The \Q_OBJECT macro has been removed but using Q_OBJECT in the file would erroneously trigger automoc. Avoid the issue by moving the snippet into its own file. Task-number: QTBUG-89505 Change-Id: I6630ff4bfcbf33eae348ac3d92aae1878dc573ea Reviewed-by: Paul Wicking <paul.wicking@qt.io> (cherry picked from commit 2c8d7411ace96f268d0692b366364d606f2608be) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QString: update documentationIvan Solovev2020-12-172-120/+215
| | | | | | | | | | | | | | | The QString documentation is aligned with QList regarding common wording and ideas: - Extend general class description - Revise description of several methods - Fix examples to use qsizetype instead of int - Wrap descriptions at 80 characters Task-number: QTBUG-87962 Change-Id: I7d5a7e829ce8b98a0a1a7fae6b7ae0dec4effbae Reviewed-by: Alex Blasche <alexander.blasche@qt.io> (cherry picked from commit 13e2161b7282f995cc702af5d343b5c9d4c03e48) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Add sections about std containers and algorithmsOle-Morten Duesund2020-12-172-0/+72
| | | | | | | | | | | | Add section comparing Qt containers and std containers. Add snippets showing use of std algorithms with Qt containers. Task-number: QTBUG-86584 Change-Id: I1133a5214a5acd086c37658ca11ab205a19a489b Reviewed-by: Paul Wicking <paul.wicking@qt.io> (cherry picked from commit 8183086513ae439220ae1facb1e93fc23b9a116b) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QList docs: lexicographical -> lexicalIvan Solovev2020-12-111-4/+4
| | | | | | | | | | | | | | | | Lexicographical is not the right word for the comparison description. Other classes use the term "lexical", so QList is updated in that way too. The link to cppreference is left, because QList actually uses std::lexicographical_compare, so it's completely valid here. Task-number: QTBUG-87962 Change-Id: I37bd3a92c5a3f857266e9c483d14e64eb90ce2c7 Reviewed-by: Andreas Buhr <andreas.buhr@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> (cherry picked from commit 91c67b04164cba99189131c7ecad9155815c9199) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Check date validity in calendar methods taking a QDateEdward Welbourne2020-12-101-2/+2
| | | | | | | | | | Previously neglected, in dateFromParts() and dayOfWeek(), which only make sense for valid dates. Change-Id: I44879bb441dbf51b96c8fd4d45e8f07423e63047 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit ac1008c16f58d95ae4ff0a7864e3bcb0783cc439) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: Support deferred finalization for qt6_add_executable()Craig Scott2020-12-101-0/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Some parts of qt6_add_executable() need to take into account certain target properties, but the target is created within the function. The caller doesn't get the opportunity to modify those properties before they are used. This change provides a way to defer those property-using steps until either the project explicitly calls a function to finalize the target or the end of the current directory scope is reached. Automatic deferral to end of scope is only supported for CMake 3.19+. With CMake 3.18 or earlier, deferring the finalization step has to be explicitly requested with the new MANUAL_FINALIZATION keyword. The caller is then responsible for also calling qt6_finalize_executable() later. When the keyword is given, automatic finalization is disabled even when using CMake 3.19+. Note that while this could be implemented without CMake 3.19 features, other work relating to qt6_import_qml_plugins() will require it so we may as well use this method now. Fixes: QTBUG-88840 Task-number: QTBUG-86669 Change-Id: Ic3854672ba18cff5af2ffd7f63596aa3ac492f33 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit b94b7687b0635ee74a3ccd83a234ead0600fd47f) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: Regenerate projects using pro2cmake one last timeAlexandru Croitor2020-12-101-1/+1
| | | | | | | | | | And fix up some wrong qmake project files Change-Id: I66cb82aeb9c1419a74df1a650fa78a511ade7443 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit 2304acab5ff3bd3832c2e388cfdab27f2a95caa8) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QString::lastIndexOf: fix off-by-one for zero length matchesGiuseppe D'Angelo2020-12-101-2/+2
| | | | | | | | | | | | Otherwise, it would report that lastIndexOf of an empty pattern in an empty string doesn't exist. Next commit adds extensive autotests; for now, disable a broken autotest (which already features a comment about why it's broken). Change-Id: I9a0e5c0142007f81f5cf93e356c8bd82f00066f7 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit be83ff65c424cff1036e7da19d6175826d9f7ed9) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QUrl: fix parsing of empty IPv6 addressesThiago Macieira2020-12-101-0/+6
| | | | | | | | | There's an assertion. Found by Google fuzz scan of CBOR data. Change-Id: I55083c2909f64a1f8868fffd164f1ff3af71605b Reviewed-by: David Faure <david.faure@kdab.com> (cherry picked from commit 4a1091f489ac3fee9efd81b0f1ffca4275725610) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QProperty: Handle eager binding calling setBindingFabian Kosmale2020-12-092-0/+9
| | | | | | | | | | | | | | | | | | When an eager binding triggers a setBinding call, we end up with a special kind of binding loop: setBinding() -> evaluate -> notifyObserver ^ | | / ---------------------------- We now catch set condition, and set the binding status to BindingLoop (with a distinct description). Task-number: QTBUG-87153 Task-number: QTBUG-87733 Change-Id: I9f9915797d82eab820fc279baceaf89d7e5a3f4a Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit ddc585b7c773786045f3658d7da5425ed2f2f786) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QList: update docsIvan Solovev2020-12-091-40/+48
| | | | | | | | | | | | Update some wording to align with QString and QByteArray documentation Task-number: QTBUG-87962 Change-Id: I8162769c1a5fc94fc8920ad0d4d91e95fe74825f Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io> (cherry picked from commit 088c3913860c216790288622d88d2cae173e73ba) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QString: improve lastIndexOf(QRegularExpression) docsGiuseppe D'Angelo2020-12-091-0/+4
| | | | | | | | | | | | Due to how regex matching works, lastIndexOf has to be implemented by matching from the string's beginning until the from position is reached. This might not be obvious for users, so document that. Task-number: QTBUG-89050 Change-Id: I4b69ea753e7d417d980031926f1e01d77e58720d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 6f2dc8d7f27419d13bfbb2af272af99c03c66562) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix qdoc warning from incorrectly named method parameterVolker Hilsheimer2020-12-081-2/+2
| | | | | | | | | | | | Amends 2eb7d6073d5132a8bf269f5c6fc9f89fde446ab5. Task-number: QTBUG-87962 Change-Id: I55c9e8cf7db9e1e1644a76f29a9dc61b161ae551 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Andreas Buhr <andreas.buhr@qt.io> Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io> (cherry picked from commit cd32e5d746c5fabae443da01d7323cf90bafe222) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* macOS: Add missing QT_MANGLE_NAMESPACEMorten Johan Sørvig2020-12-082-2/+2
| | | | | | | | | | | | KeyValueObserver and RunLoopModeTracker were causing “Class is implemented in both...” messages when loading multiple namespaced Qt versions into the same process. Change-Id: Idbd2229c61cde6fba2c12b35d045390a371dee68 Fixes: QTBUG-89059 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit c2c163a7d8cb95a4901b742a72184975e791635a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QSystemSemaphorePrivate: Fix a call to tr() to translate()Tuomas Vaarala2020-12-081-1/+1
| | | | | | | | | | | Calling QCoreApplication::tr() without #if QT_CONFIG(translation) can cause the build to fail if configured without translation. Changing the call to QCoreApplication::translate() fixes that. Change-Id: I48f0e1be14fc81360b8268620afc2f6c8f255819 Reviewed-by: Andy Shaw <andy.shaw@qt.io> (cherry picked from commit 1051e23ce91a980c5e961b4dcb6d61997bc08050) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>