summaryrefslogtreecommitdiffstats
path: root/src/corelib
Commit message (Collapse)AuthorAgeFilesLines
* QUtf8StringView: ensure binary compatibility throughout 6.xv6.1.0-rc1Thiago Macieira2021-04-203-32/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | We can't depend on whether the user compiles with -std=c++17 or -std=c++20. So select what we can depend on and make that permanent. Prior to this change: $ cat /tmp/test.cpp #include <QtCore/QUtf8StringView> void f(QUtf8StringView) {} $ qcd include $ g++ -S -o - -I. /tmp/test.cpp | grep globl | c++filt .globl f(QBasicUtf8StringView<false>) $ g++ -fPIC -std=c++20 -S -o - -I. /tmp/test.cpp | grep globl | c++filt .globl f(QBasicUtf8StringView<true>) After this change, they're both "false". QUtf8StringView should have been a concrete class that derived from QBsicUtf8StringView<whichever> and inherited all its constructors. We'd cause ODR violations in C++20, but nothing worse than what we usually do for BC reasons. That solution is too late for Qt 6.x. Let's revisit in 7.0. Pick-to: 6.1 dev Change-Id: I6bcbe88c072a438b8b4efffd166e77199ecb39e3 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* QString: add missing char8_t* constructor / fromUtf8 overloadsGiuseppe D'Angelo2021-04-192-0/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently we support: QString s = QString::fromUtf(u8"foo", 3); But we don't support QString s = QString::fromUtf8(u8"foo"); QString s(u8"foo"); There's no reason not to have these two functions. Guess what, we've actually got code _in Qt_ that tries to build a QString out of a char8_t; that code stops compiling under C++20 (which is supported, but not CI-tested at the moment, it seems). Re-add the missing constructor and fromUtf8 overloads. [ChangeLog][QtCore][QString] Added a constructor and a fromUtf8() overload taking a `const char8_t *` argument. Task-number: QTQAINFRA-4117 Task-number: QTQAINFRA-4242 Change-Id: I1f0ae658b3490b9e092941cabcc7fb8fc4c51aa3 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> (cherry picked from commit b322bfcc14845a4b6a6eef85ef359b1e4591a5ca) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Add documentation links for some JNI entitiesAssam Boudjelthia2021-04-183-4/+16
| | | | | | | | | | | Add doc page link for: * AttachCurrentThread call. * Interface Function Table which describes JNIEnv. Change-Id: I12b41429c40838e5133e58132930aede287e2e71 Reviewed-by: Alex Blasche <alexander.blasche@qt.io> (cherry picked from commit d72067c93833e9787a45aeddee800faab0d2d40a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Don't parse XML symbols longer than 4096 charactersAllan Sandfeld Jensen2021-04-181-0/+5
| | | | | | | | | | It is slow and will use too much memory. Fixes: QTBUG-91889 Change-Id: I45c5e6038357c87bbb85b1ace17ef39a2a814ea0 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 38e111158a38507c63fd70f9ee18b9116b537976) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Replace conversion operator by operator* in QJniEnvironmentAssam Boudjelthia2021-04-143-62/+72
| | | | | | | | | | | | Since conversion operators do implicit conversion that might bring some potential issues while using the API, let's stick to having an operator* instead. Change-Id: Ie7ad5537958944b8d1c11d69fbd30284b4b0344d Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io> (cherry picked from commit 13592385723a9b81b3715b5344bdd04e6a393a12) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Make POSIX transition rule parser more robustEdward Welbourne2021-04-141-14/+29
| | | | | | | | | | | | | | | | | | | | | | | | | The POSIX rule parser used by QTzTimeZonePrivate recklessly assumed that, if splitting the rule on a dot produced more than one part, it necessarily produced at least three. That's true for well-formed POSIX rules, but we should catch the case of malformed rules. Likewise, when calculating the dates of transitions, splitting the date rule on dots might produce too few fragments; and the fragments might not parse as valid numbers, or might be out of range for their respective fields in a date. Check all these cases, too. Added a test that crashed previously. Changed QTimeZone::offsetFromUtc() so that its "return zero on invalid" applies also to the case where the backend returns invalid, in support of this. Fixes: QTBUG-92808 Change-Id: Ica383a7a987465483341bdef8dcfd42edb6b43d6 Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Robert Löhning <robert.loehning@qt.io> (cherry picked from commit 964f91fd25a59654905c5a68d3cbccedab9ebb5a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Call statx() with AT_NO_AUTOMOUNTAlexander Volkov2021-04-081-1/+1
| | | | | | | | | | Otherwise it can be very slow in some cases (e.g. 0.5 sec). Besides, AT_NO_AUTOMOUNT is used by {l,f}stat() internally. Change-Id: Iae9c8b46dcdc96d21ac6b114a51c382b4949d3dd Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 9667ac1c2d3b3d48cbd154bece36ec1d41d93a59) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Avoid attempting to parse insanely long texts as zone namesEdward Welbourne2021-04-071-0/+18
| | | | | | | | | | | | | | | There are limits on zone name length and the trial-and-error approach we're more or less forced to take to parsing gets horribly expensive if applied to every prefix of a very long string. So apply a loosened version of the zone-name validity rule that limits the length of the fragments between slashes and limit the number of such fragments. Fixes: QTBUG-92275 Change-Id: I83052b1b6888728c81135db22a9c6298ae439375 Reviewed-by: Robert Löhning <robert.loehning@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 0c9fc20e7ff7b4ff0f15e0b2c071ea834625dce9) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix get out of bounds index in QSortFilterProxyModel::filterAcceptsRowChunLin Wang2021-04-071-3/+5
| | | | | | | | | | Before calling the index function, we need to check the validity of the parameters. Fixes: QTBUG-91878 Change-Id: I9ec7265fff3f81b8a288c4ba8fae606a2ec808a6 Reviewed-by: David Faure <david.faure@kdab.com> (cherry picked from commit b8802071ed00689373da5817fc4824a30b5fcf86) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix return type of QMetaType::sizeOf in documentationVolker Hilsheimer2021-04-071-1/+1
| | | | | | | Change-Id: I6f5a866fa83f0e2720d62c5170c9283997b31a7f Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 1e8b085f8c8bce5d69852df4c4b72d30fcffe793) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: Choose better defaults for qt_add_plugin STATIC/SHAREDAlexandru Croitor2021-04-072-4/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There was a recent behavior change where the public CMake API qt_add_plugin API took into account the value of BUILD_SHARED_LIBS to decide whether the plugin should be a static or shared library. Instead, use the following new behavior - If no explicit option STATIC / SHARED option is passed, default to whatever flavor Qt was built as. Aka if Qt was configured with -shared, qt_add_plugin defaults to creating shared plugins. If it's a -static Qt, create static plugins. - If an explicit STATIC / SHARED option is set, override the default computed value with the given value. As a result BUILD_SHARED_LIBS does not affect Qt plugins anymore. This is more in line with Qt expectations. Add SHARED as a new valid option to pass to qt_add_plugin (it wasn't before). Add tests to check for the above behavior. Amends aa4a1006cbccbc180c600f9b4dc9e882bb5ed5ca Fixes: QTBUG-92361 Task-number: QTBUG-88763 Change-Id: Iae806024ddd5cf10cfe58ddbcebd2818084b0bd7 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit d0c2425d791edd75e35cce65ddbcfaab9a7f16ed) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Explicitly set enums' type to avoid undefined behaviorRobert Löhning2021-04-071-2/+2
| | | | | | | | | | Fixes oss-fuzz issue 31022. Fixes: QTBUG-92159 Change-Id: I8f0dfbe0e198f9ac43754758d18db1f0842d6eae Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit d15bfba176f7e6c616f299e82adfde148b3f26d2) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Doc: Fix various documentation issuesTopi Reinio2021-04-072-4/+11
| | | | | | | | | | | - Document QIODeviceBase - Document QPointerEvent::points - Fix linking issues Task-number: QTBUG-90662 Change-Id: Ib123d5708953b22e01f95c82626b39a49fff95b2 Reviewed-by: Nico Vertriest <nico.vertriest@qt.io> (cherry picked from commit 00e10f62b55626097e94a2d70a9214c0062fbcd5)
* Remove qualification for Julian calendarAlex Blasche2021-03-301-1/+1
| | | | | | | | | | The given qualification was wrong but also not needed in the first place, Fixes: QTBUG-92046 Change-Id: Id28347fee2ef11ffcb0df8320b1025568b59de9c Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> (cherry picked from commit edfab62cb02781b1c5a5e433f6f64af285dfa0f0) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix removing columns when QSortFilterProxyModel has not been sorted yetJoni Poikelin2021-03-301-1/+4
| | | | | | | | Fixes: QTBUG-91788 Change-Id: Iddcafd3171f0f3703b94893a32b4ccaaeea9e713 Reviewed-by: David Faure <david.faure@kdab.com> (cherry picked from commit e287582cba74ddcfc67f83647e72c0b23bd99c36) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Use official names for Android versionsVolker Hilsheimer2021-03-302-8/+8
| | | | | | | | | | | | Google ditched the dessert names as of Android "Q". "Q" and "R" were development names, the released versions are called Android 10 and Android 11, respectively. Task-number: QTBUG-90211 Change-Id: I36225067cc802ebd3ebd1289d509759ae1b2d83d Reviewed-by: BogDan Vatra <bogdan@kdab.com> (cherry picked from commit 76b3d024e45cc044bde2b6fb4b24849cf96b0012) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Rename QJniEnvironment exceptionCheckAndClear to checkAndClearExceptionsAssam Boudjelthia2021-03-304-50/+50
| | | | | | | | | | Address feedback from header view. Task-number: QTBUG-90211 Change-Id: Iad2b609598b16f66fd6ab09484fe6e6899981263 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit b9f27335e7462a15ac642841bb6d86ebebb349f9) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Refactor qt_internal_add_plugin() and qt6_add_plugin()Craig Scott2021-03-291-20/+79
| | | | | | | | | | | | | | | | | | | | | | | Remove code duplication by calling qt6_add_plugin() from qt_internal_add_plugin(). Separate out the public and internal arguments for the variables defined in QtBuild.cmake for these functions. Provide them via commands instead for greater robustness. This separation allows other Qt repos to access the appropriate set of keywords where they define commands that forward on to *_add_plugin() in their implementations. Retain the old variables for now to simplify the integration steps for updating other repos. The old variables can be removed once there are no more references left to them in any repo. Task-number: QTBUG-88763 Change-Id: I0105523afd95995923bd20fc963d245bbb15d34d Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit aa4a1006cbccbc180c600f9b4dc9e882bb5ed5ca) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: Fix qconfig.cpp embedded prefix in the CIAlexandru Croitor2021-03-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the CI on a windows we configure Qt with the following prefix -DCMAKE_INSTALL_PREFIX:PATH=\Users\qt\work\install Note the lack of the drive letter. This is intentional, so that we can abuse CMake's DESTDIR installation mechanism to install into a custom path. This causes trouble for static Qt builds in the CI. Specifically when there is no qt.conf file next to qmake, qmake -query will report a QT_INSTALL_PREFIX:/Users/qt/work/install and ultimately qmake will fail to locate the module .pri files in such a path, showing errors like: Project ERROR: Unknown module(s) in QT: core gui? If a qt.conf is placed next to qmake (even an empty one), a differenct code path is used in qmake to resolve the prefix, which returns a path with a drive letter. In a shared build, because the 'relocatable' feature is enabled by default, a different code path is used and thus the prefix is also successfully resolved. So the problem is specific to static Windows Qt builds that have no qt.conf file next to qmake. This is the exact scenario that we encounter when running static Qt tests (tst_qmake in particular). To circumvent the issue, prepend a drive letter to the prefix hardcoded into qconfig.cpp. Do that with get_filename_component(REALPATH) which apparently resolves to a fully qualified path. Task-number: QTBUG-87580 Change-Id: I17c885f29bfdee45bec1d6aac7c3b26723e761a3 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit 59c3be711728ab0aa644bfdf50e91a1b020f95bb)
* CMake: Get rid of the Core_qobject static libraryAlexandru Croitor2021-03-262-49/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Core_qobject target was problematic for a few reasons. In the very beginning, Core_qobject was an OBJECT library, explaining its existence with the following comment "requires to spill internals into users". The object library contained qobject.cpp and qproperty.cpp and their manually generated moc files. It was was a dependency of Core. Afterwards it got converted into a static library instead, presumably to circumvent some issues with metatype generation. Unfortunately making it a static library was wrong, because it leads to linker failures (undefined symbols) in a static Qt build when trying to link a project that uses only QtCore. Both Core and Core_qobject refer to each other's symbols, and whichever library came first on the link line, many of its symbols were discarded by the linker. Transforming Core_qobject back into an object library could be an option, but that leads to trouble with creating proper prl files (our infrastructure doesn't quite support that for object libraries yet). Furthermore, there was some internal discussion and concern about how to merge the two metatype json file lists (Core and Core_qobject) into a single file. Instead of using an object library, move qobject.cpp and qproperty.cpp to be directly a part of Core again and remove the Core_qobject target. In order to do that, we have to circumvent some issues with AUTOMOC. First, we have to disable AUTOMOC for qobject.cpp and its headers. qobject.cpp contains Q_GADGET, Q_NAMESPACE, etc keywords in its doc comments. That confuses AUTOMOC, because it expects a qobject.moc file which is not included by qobject.cpp. See e2ff9e3b9957f844d6530cc92096bed3c16fa46a for some details on the Q_GADGET + AUTOMOC issue. We still need to run moc on on qobject.h and compile moc_qobject.cpp, so we manually run moc on the header file. Because qobject.cpp directly includes moc_qobject.cpp, we need to adjust the header include path to the generated file. Second, we remove the direct inclusion of moc_qnamespace.cpp in qobject.cpp to prevent duplicate symbol compilation, because the symbols were compiled both as part of qobject.cpp and mocs_compilation.cpp. Finally, because manual moc is used on qobject.h, the generated json file needs to be explicitly passed to Core's metatype generation step. Amends e57a94cbd8f28ccab8b3368afc4365237c533a4f Amends 3c4c02b3f1cec8ebc0134fd05b0e51f1f771937d Task-number: QTBUG-87580 Change-Id: I859a7d2f95508eda211a0a0b4ec132540b78bda4 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit 04df85bbecdc034876d509b9c96a4f17fc990293) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix warning from syncqt.pl about header inclusion pathEdward Welbourne2021-03-251-1/+1
| | | | | | | | | | | | After a "QtCore: WARNING:" intro (separated to avoid being mistaken for a footer) syncqt.pl said: .../qtbase/src/corelib/kernel/qjnienvironment.h includes QScopedPointer when it should include QtCore/QScopedPointer Change-Id: Iaa1f025367b7321af9c5de27196ebf271f9179df Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 968f4001a86d4a3321ac41f6b2808ccb3b1271fe) Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Rework the failure macros in the Qt CTest kitAlexey Edelev2021-03-241-1/+13
| | | | | | | | | | | | The _qt_internal_test_expect_fail macro fails when the test fails during the configuration step. Rename this macro to _qt_internal_test_expect_build_fail and add the _qt_internal_test_expect_fail macro that expects inverted test result. Change-Id: I4635e99152f7a32f5c48202e84fec59800453d34 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit fec5b8e81c976b8b0cdf45b459f7d481222e86d7)
* Restore support for reading /etc/timezone for system zone nameEdward Welbourne2021-03-231-7/+15
| | | | | | | | | | | | This restores one of the two mechanisms removed in commit b0383cbd388336f698ceeac11a4f50cdff931dd9, transformed to fit in with the new cached system-zone determination. Fixes: QTBUG-87326 Change-Id: Ic270acb0d958e17dbc74a0ff93a5a1843c939678 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 824d963700a91294ba4a543ebb486aedbd650284) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QProperty: markDirty should be internalFabian Kosmale2021-03-221-0/+3
| | | | | | Change-Id: If69a6f37c32ce0d7f824794a2a1c52bad82d84cc Reviewed-by: Andreas Buhr <andreas.buhr@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* CMake: Get rid of the Core_versiontagging object libraryAlexandru Croitor2021-03-191-17/+4
| | | | | | | | | | | | | | | | | | We don't currently handle object libraries when creating prl files for static Qt builds, so it's best to compile files as part of the main Core target. Use source file COMPILE_OPTIONS to add the -fno-lto flag to the global/qversiontagging.cpp source file. Amends 2d4a40f93fd3f0fd31110ef7d19a12fc56c00967 Change-Id: Iac1d37ecb4caa7c9889d44b3a103a9bdafec49f3 Reviewed-by: Christophe Giboudeaux <christophe@krop.fr> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit d68486547aaf05994f39786f8527bcb454c6db3f) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QContiguousCache: Remove redundant conditionWang Yu2021-03-191-3/+1
| | | | | | | | | The reverse condition was already checked three lines before. Change-Id: I2f78262004871ec2f3730e2a25f26fe22636cde7 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 852b070529d2721d2d4e1e7ec1c90d8fe536b088) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Don't combine enum values from different enum typesVolker Hilsheimer2021-03-181-2/+2
| | | | | | | | | | | | | Address static analyzer warning dceb66e05690ed1fb2f1455a9eb517f6. C++20 is deprecating arithmetic operations between unrelated enumeration types, and not all of the enums involved here are clearly bitmasks. Change-Id: I61c9dcdc42ccd2b01a6208e067d216107672cc4d Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 20639d565bf26b01d915db2e42daedf3f905f399) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Mention QPromise in the QFuture docsSona Kurazyan2021-03-161-3/+4
| | | | | | | Change-Id: I5f6930116da534dd1dea41c4724c42104de38877 Reviewed-by: Paul Wicking <paul.wicking@qt.io> (cherry picked from commit 0477f6b15a2d71d47c39e52b5da140d19aa76f31) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QRandomGenerator: remove dead code previously used by qrand()Thiago Macieira2021-03-151-22/+0
| | | | | | | | | | | Commit 9ee554ac1d1af97e7ad5b4bf78e2779f7d1c405f removed qrand() and qsrand(), so commit 81896304dc1fb65da3302deb54ab4cfe060625ff removed the functions accessing QRandEngine, but forgot to remove the actual engine. Change-Id: I26b8286f61534f88b649fffd166c41aecf55d2b1 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit 420755edb71267f756df4c61955b910099ec9537) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix QMultiHash::count(key) crashAndrei Golubev2021-03-141-0/+4
| | | | | | | | | | | | As QMultiHash uses a pointer for the data, nullptr dereference is a thing, so check for valid d before doing anything in count() Fixes: QTBUG-91704 Change-Id: Ia20440cd7bdc03cb09c77f796fb9c5b52765eac5 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit f226854d256a382a5cc7ff08b10a0d27fbefb0fe) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QEventDispatcher(Win): Always honor interrupted status to avoid racesMårten Nordheim2021-03-111-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | There may be a race where e.g. thread 'B' is woken up by a queued invoke. At the same time thread 'A' asks 'B' to quit, which will set various atomics (some important ones are 'interrupt' in the dispatcher and 'exit' in the event loop), but it does _not_ try to send another wake since there is already an unhandled wake triggered by 'B' itself. Sadly 'B' reads the 'exit' atomic before 'A' updates it. Then, slightly before, 'B' sets 'interrupt' back to 0, 'A' write 1 to it, meaning 'A's interrupt is ignored. Then, since there is no interrupt, 'B' goes back to waiting for events, leaving the thread alive and running instead of quitting. Maybe this has unforeseen consequences (one consequence is that it will return and re-enter the event dispatcher once more, possible unnecessarily) Fixes: QTBUG-91539 Change-Id: Ie6f861f42ffddf4817d5c8af2d764abe9d9103c2 Reviewed-by: Alex Trotsenko <alex1973tr@gmail.com> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit f274f91cebb0a4fd2ebe37bb3a605c47d6acd404) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QConcatenateTablesProxyModel: skip dataChanged in hidden columnsDavid Faure2021-03-091-1/+6
| | | | | | | | | | | | | | | | | When the source models don't have the same number of columns, the proxy keeps only the smallest number of columns across all source models. Afterwards, if a source model emits dataChanged in a column past that number (a "hidden" column), the proxy needs to ignore it rather than assert. But also, if the source model emits a dataChanged signal across both visible and hidden columns, then the last column number needs to be adjusted so that the signal is correctly processed and forwarded. Task-number: QTBUG-91253 Change-Id: I939e8ec0faf41370472f86785851292e4372f72c Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> (cherry picked from commit f6efbd23b59bcf75866ce47fb762c99f2e4a128a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Add documentation for Q_OBJECT_BINDABLE_PROPERTYAndreas Buhr2021-03-071-0/+23
| | | | | | | | | | | | | | | | The duo Q_OBJECT_BINDABLE_PROPERTY and QObjectBindableProperty can only be documented together. The documentation is now with QObjectBindableProperty. This patch adds a documentation entry for Q_OBJECT_BINDABLE_PROPERTY which links the user to QObjectBindableProperty. Task-number: QTBUG-90511 Change-Id: I9af4a99d49f4b02ee9645a2cc9a9a024a6a1a552 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> (cherry picked from commit 89cc39a894dddaa0347ecf08438ea31b4880961c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix QT_HOST_LIBEXECS for cross-builds on WindowsJoerg Bornemann2021-03-071-0/+4
| | | | | | | | | | | Like for LibraryExecutables, we must default to "bin" on Windows for HostLibraryExecutables in our generated qconfig.cpp. Fixes: QTBUG-91496 Change-Id: Ib5a4b3b3fd6192bd953e615058b482e67ad19462 Reviewed-by: Cristian Adam <cristian.adam@qt.io> (cherry picked from commit 4b9173e3540bd5a80b98be2f41832ae877c2cd1d) Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Doc: Fix section titles that confuse QDoc's autolinkerPaul Wicking2021-03-051-9/+9
| | | | | | | | Fixes: QTBUG-91620 Change-Id: I7c407c7158324d1fbbeb78e47d2198e8ddf5daa0 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit c1c61c3bb468b9db7b3bf1ca49e8b71a146ff780) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Simplify code, remove redundant conditionWang Yicun2021-03-052-6/+2
| | | | | | | | | | | 'clazz || (!clazz && isCached)' is equivalent to 'clazz || isCached' Done-with: Tang Peng <tangpeng@uniontech.com> Change-Id: Ie9eab4a94a61be2b360f64980c4666a622f3a209 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit a913002f13d8a2faad512ffda6c70f413b8e7ee5) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Don't access moved-from objectVolker Hilsheimer2021-03-041-7/+6
| | | | | | | | | | | | | | | | | | | | Clang's static analyzer tooling warns about this access-after-move [1]. While the comment above the function indicated that this was deliberate and relying on a moved-from QString being valid, it is still bad practice. Since 'str' is empty in moved-from state if - and only if - it was a non-const reference, make a compile-time check of the constness of type T instead. [1] https://testresults.qt.io/codechecker/daily_analyses/qtbase/dev/qtbase-dev-20210301-e14ccf0553/qstring.cpp_clang-tidy_b0545db57a2cc5dac67a56f76322ffd0.plist.html#reportHash=209ee3db0b17d21919326a1ad6635318 Change-Id: Iac1813b61b6a3c2ef4053b911a4043c5382f85e4 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> (cherry picked from commit 49113c905d5868e6b76bb6b7b3e0a20b0c56a23a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QMetaType::create: don't leak memory if copy can't be madeVolker Hilsheimer2021-03-041-1/+1
| | | | | | | | | | | | | | | | | | | | | QMetaType::construct will return nullptr if a copy is requested but if there is no copy constructor. In that case, the memory allocated in QMetaType::create will be leaked. This case is covered in the unit tests in template<> void testCreateHelper<QMetaType::Void>() so we can't assert in construct that a copy constructor is present if a copy is requested. Fixes static analyzer warning 618b1e6877f737df57c39fd35ad91cd4. Change-Id: Ic439b36b1f120b9d0f888efaeab2801d8acc13de Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 90b51219ddc75c4dd2d171f2dba644e67d1e4a62) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Improve docs for QFuture::then() with contextSona Kurazyan2021-02-262-0/+21
| | | | | | | | | | | | | | Be more precise about attaching a continuation with the default (QtFuture::Launch::Sync) launch policy after a continuation with context. Change-Id: I5b80063df2443e5742033864ba012bf34ed4cdf7 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> (cherry picked from commit 5624b35d6514c5439b9d6dc639dc71228ca7b5ca) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QEventDispatcherWin32: get rid of the hook procedureAlex Trotsenko2021-02-262-30/+9
| | | | | | | | | | | | | | | | | | | Instead of intercepting the WM_QT_SENDPOSTEDEVENTS message in the hook procedure, we can handle it at receive points, making qt_GetMessageHook() unnecessary. Including general performance improvements, this patch fixes the issue where some applications (e.g. Ableton Live) do not call a chain of nested hooks for plugins. Fixes: QTBUG-90949 Change-Id: If8e96848392c6f10d45af2aac0567707d16af673 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Nuno Santos <nunosantos@imaginando.net> (cherry picked from commit b7e08599cc784777d06d34e49e90c2d408ab629d) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QProcess::startDetached/Unix: report which function failedThiago Macieira2021-02-241-30/+42
| | | | | | | | Like QProcess::start(). Change-Id: Ic90d8429a0eb4837971dfffd1664ef1293a6523d Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de> (cherry picked from commit 5d977b0fd2fa4611571e50378647c09febd49141)
* QProcess::startDetached/Unix: simplify handling of the pipesThiago Macieira2021-02-241-21/+26
| | | | | | | | | | | | | Use a structure that will automatically close them for us. This doesn't apply to startProcess() because the pipes there are long-lived (though each of them in QProcessPrivate could be an AutoPipe...). The destructor only runs in the parent process, so the child processes don't need to worry about setting file descriptors to -1. Change-Id: Ic90d8429a0eb4837971dfffd1664ed98f3d74d1c Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de> (cherry picked from commit f0ce50d3353e8a684f905e19dc6116dd1b515bf2)
* Assert that setCurrentAnimation has the assumed side effectVolker Hilsheimer2021-02-251-1/+3
| | | | | | | | | | | | setCurrentAnimation(0) is expected to set the currentAnimation pointer - which it does, as long as there are any animations. Fixes static analyzer warning 106daf11ddfe9bb4fa7cf98c9097962c Change-Id: I3739bcfda103db391d21f135485f0b700c48ead1 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit 976d8b1f74d3fe556e4f468936affccbd3124247) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* qt6_finalize_executable(): Enable finalizers to be set per-targetCraig Scott2021-02-242-8/+53
| | | | | | | | | | | | | | | | | | | | | | Some plugins need to append additional processing to targets that use them. This is most commonly needed for static builds to identify additional plugins that need to be linked, but which cannot be determined automatically by CMake as part of its transitive dependency handling. Check for finalizers on directly linked targets as a way to help automate common scenarios. Because we need to lookup dependency targets and these may have visibility limited to the depender target's scope, we now formally document that finalizers should be called from the same scope as the one in which the target was created. This was loosely expected before, but is now made explicit. Task-number: QTBUG-90819 Task-number: QTBUG-86669 Change-Id: I065a3f3a4ab6eeff6a98a655835427949e2fe0f1 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit 279ebfd487a8e43a65f50f273c6b6ee8cdbec0a4) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QStandardPaths: Add translation comment for macOS-specific itemFriedemann Kleint2021-02-241-1/+3
| | | | | | | | Change-Id: Idde81ee9badb41ff7893dcbdfd39ec4cb8db9742 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de> (cherry picked from commit f0cc9f10da408a142eea685f9991ffd3cbcb1501) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QSystemSemaphore: Fix broken translated messagesFriedemann Kleint2021-02-245-28/+15
| | | | | | | | | Add Q_DECLARE_TR_FUNCTIONS() and use tr(). Change-Id: I31a27afa06ee2a592a7e588283e5ff08b5d14f3b Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de> (cherry picked from commit 1128e0bea1dbe8578cd71385ef3c7231aee80e1e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Assert that either both or neither pointer are nullptrVolker Hilsheimer2021-02-241-0/+10
| | | | | | | | | | | | | | | If called by QMetaType::canConvert with two nullptr values, the QMETATYPE_CONVERTER_ASSIGN macro will expand to code dereferencing both 'to' and 'from' pointers. Assert that others callers provide two valid pointers. Fixes static analyzer warning 02dc34cc2ad1d4c3c6e55b44e08983f2 Change-Id: I24de914faa25dc7cb1da5eae09a125506caac389 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 52b5e9b76663fa7b43da1466fb2678d6b18d86b2) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Move build tools to libexec instead of the bin dirJoerg Bornemann2021-02-231-1/+1
| | | | | | | | | | | | | | | [ChangeLog][Build System] Tools that are called by the build system and are unlikely to be called by the user are now installed to the libexec directory. This is a step towards easier co-installability of different Qt versions. Task-number: QTBUG-88791 Change-Id: Id19575b5ba27795f7715e4ea6a09391b26dd4942 Reviewed-by: Kai Koehne <kai.koehne@qt.io> (cherry picked from commit 1f30bcf33618ca39c47dc1058529b55635e30aef) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QProcess::startDetached/Unix: fix the resetting of SIGPIPEThiago Macieira2021-02-221-5/+1
| | | | | | | | | | | | | | This should have been SIG_DFL, as we're about to execute a child process. It's the child's responsibility to ignore SIGPIPE if it wants to, or get killed by it when it writes to an pipe with no readers. Qt itself does this for its own purposes (see qt_ignore_sigpipe() [until I can get some time to teach Linux about O_NOSIGPIPE]). Therefore, we ought to reset what we've done. Change-Id: Ic90d8429a0eb4837971dfffd166585a686790dde Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de> (cherry picked from commit f4e3b073b3d2a50133d734dd604bff21f061a3e6)
* QProcess::startDetached/Unix: remove unnecessary ignoring of SIGPIPEThiago Macieira2021-02-221-10/+0
| | | | | | | | | | This is unnecessary because we can only get SIGPIPE if the reading end of the pipe is closed. And that can only happen if the parent process has exited, meaning there's no one to read our message anyway. Change-Id: Ic90d8429a0eb4837971dfffd1664ec6821993ada Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de> (cherry picked from commit 089bcb007454fe44224139b2d0a0e4145f209b15)