summaryrefslogtreecommitdiffstats
path: root/src/corelib
Commit message (Collapse)AuthorAgeFilesLines
* Refactor duplicate code for clearing JNI exceptions before returningAssam Boudjelthia2021-02-111-80/+43
| | | | | | | | | | | Add a private function to handle checking/clearing and deleting the local reference to jobject before returning a QJniObject. Task-number: QTBUG-89633 Change-Id: I0ea28c8ba4da0bfc1e341c6b4c1f61fecfec87a6 Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io> (cherry picked from commit c7bcc51e2c196e5cc3def89137ca31b4a9d29157) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Android: take JavaVM() from QJniEnvironment and not QtAndroidPrivateAssam Boudjelthia2021-02-111-2/+3
| | | | | | | | Task-number: QTBUG-89482 Change-Id: Idfd442afc90c00e672b28b43c78c789813f46c7d Reviewed-by: Alex Blasche <alexander.blasche@qt.io> (cherry picked from commit 3348107c038cbac724e33d6bb30671ddddc1505a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix registerNativeMethods for goodAssam Boudjelthia2021-02-111-3/+4
| | | | | | | | | | | | | | | | | | The initial implementation and the commit c00ab6f8eaa3cdc9a29dd103c91b2eaf212cac9f was wrong: * env->findClass() in fact returns a global reference, and in any case we shouldn't be calling that, instead QJniObject would be enough. * The size param provided to env->RegisterNatives was wrong. * A test for registerNativeMethods() is added to ensure such break is not repeated again. Task-number: QTBUG-89633 Change-Id: I4d3a6a9270755f465c40add25521fb750dd4de0a Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io> (cherry picked from commit deca7cd730a44988d3e15c551d9a82a5c75618e2) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Restore pre-Qt6 QList::fill() behaviorAndrei Golubev2021-02-101-1/+4
| | | | | | | | | | | | | | | | | | | Somehow QList::fill(t, newSize) introduced a regression in Qt6: when newSize < QList::size() we should resize to the newSize. This is aligned with QVector::fill() in 5.15 and std::vector::assign() While 6.0 is already out, picking it to 6.0.x could save someone who haven't migrated yet as well as fix some accidental bugs in Qt's code [ChangeLog][QtCore][QList] Fixed QList::fill() regression introduced in 6.0: calling fill() with size < current list size wouldn't truncate the list Fixes: QTBUG-91042 Change-Id: Ic166e2c5e42390b61df1030f7c705e344433f7f2 Reviewed-by: Lars Knoll <lars.knoll@qt.io> (cherry picked from commit 6512a7fc642c65455db770385c67cfa6d71c294c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: always pass QT6_INSTALL_PREFIX to androiddeployqtAssam Boudjelthia2021-02-101-5/+2
| | | | | | | | | | | | | Qt CMake uses a fake_prefix as install dir when running tests instead of the main qt install path, this will throw androiddeployqt off since it expects the real qt install path which has gradle and java sources. Fixes: QTBUG-88579 Change-Id: I6580470840ae14d4a4a68a95f217b30408d7ab44 Reviewed-by: Craig Scott <craig.scott@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit 0d42f4df9275897d708ee01ed879ac185aab7360) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix typo in android APK generation logAlex Blasche2021-02-101-1/+1
| | | | | | | Change-Id: I9e593f35e1c4a51ef2cd4b08fe7e4b7c1a35a5d6 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io> (cherry picked from commit 04eb9b7c3279e7e8c3f6079cc28cee9baea5e944) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: fix typo in qt_finalize_executable snippetAssam Boudjelthia2021-02-101-1/+1
| | | | | | | | Task-number: QTBUG-90943 Change-Id: Idea90f1a5fdd2070102ebda85feed79abcba3f70 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit ab907053bd7b4c5acc1ddb9220a708b9244f7b0f) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Doc: link to QScopeGuard in QScopedValueRollback documentationMitch Curtis2021-02-091-1/+1
| | | | | | | Change-Id: I02b9960fe37b09bc373ed52dec84b1efc8f43397 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit 1c2aa56cfa2c5648f05aed912dae2bb3ed5d8951) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Documentation improvements to JNI APIAssam Boudjelthia2021-02-095-264/+362
| | | | | | | | | | | | Amends 4e60681c879a54cf5b34862a30e27c492ed36363. Fixes: QTBUG-89632 Change-Id: I7856e9b63eea5ba68a5472575016540ae656ec5f Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> (cherry picked from commit 817f8ac03cd4e85b7813b45f8cabf5b679f28702) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix QJniObject::registerNativeMethods use of global referenceAssam Boudjelthia2021-02-021-4/+3
| | | | | | | | | registerNativeMethods() should be using the local jclass from findClass() instead of the global reference. Task-number: QTBUG-89633 Change-Id: I469a9a1ecff95ab9948421baa5c88735ba7ad776 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Fix handling of Sunday in POSIX time-zone rulesEdward Welbourne2021-02-011-2/+2
| | | | | | | | | | | | | | | | | | | | | Dating from the origins of our support for the zoneinfo file format, the mapping of POSIX's day-numbering (0 = Sunday through 6 = Saturday, see [*]) to Qt's (1 = Monday through 7 = Sunday) was done by mapping 0 to 1, when it should have been 7. [*] http://www.gnu.org/software/libc/manual/html_node/TZ-Variable.html Corrected a QTimeZone test that trusted the results it got without checking which day of the week those were: they were all Mondays. Verified that the corrected dates are in fact Sundays. Checked the zone abbreviations, too. Fixes: QTBUG-90553 Pick-to: 6.0 5.15 Change-Id: I84b4b14f9892ff687918cd3c42c7c9807e45313c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
* Do delete on QMetaType::destroy() even without dtorUlf Hermann2021-02-011-2/+3
| | | | | | | | | As we call operator new on create(), we also need to delete on destroy(). Otherwise we leak memory. Change-Id: Ib80fe96c4173cba6fa474d3c81d88fe603d1ded2 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Ensure Core target has INTERFACE_QT_COORD_TYPE property definedCraig Scott2021-02-022-5/+3
| | | | | | | | | | | | | | | | | | In order for other Qt modules to be able to reliably use this property, it needs to be defined under all supported scenarios. Previously, it would only have been defined for a per-repo build and not for a top level superbuild. The only place it was being set was in the Qt6CoreConfigExtras.cmake file and only when QT_NO_CREATE_TARGETS was false (so it wouldn't be defined for examples even in a per-repo build). It was also noticed that INTERFACE_QT_MAJOR_VERSION was also being handled in Qt6CoreConfigExtras.cmake, but this was not needed. This was already being done as part of a call to qt_autogen_tools_initial_setup() which occurs inside qt_internal_add_module(). Fixes: QTBUG-90617 Change-Id: I589316ffb8138bd2df8a1d49fdd6335d2e2836f1 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Fix compilation with 32-bit clangRobert Loehning2021-02-011-2/+5
| | | | | | | | Currently fails with: undefined reference to `__mulodi4' Change-Id: Iefa321d6fd7cb989dd4a00166ed65e5b7f3ba33f Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Remove usage of the definitions that are never definedAlexey Edelev2021-02-011-9/+3
| | | | | | | | The QT_BUILD_QMAKE_BOOTSTRAP and QT_BUILD_QMAKE_LIBRARY definitions are never defined in the project since migrating to CMake build. Change-Id: I7108c92387005a2fde6ebdb2d74843e3efc6413e Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Update double-conversion library to current masterEdward Welbourne2021-02-011-10/+19
| | | | | | | | | | | | | | | | | | | | | | Turned our local diffs into a side-branch in the upstream repo, got material changes upstreamed (leaving only our #include changes), rebased it to master, copied back to our version. Upstream has made no new release since 3.1.5 in 2019 May, but there is substantial change since then, including acceptance of our upstreaming. Our patches have been refined in the process of upstreaming. The list of source files is slightly changed. The double-conversion.* files are split in two, string-to-double.* and double-to-string.*, but the old double-conversion.h header is retained, simply pulling in its two halves. These thus need to be present in the include directory. Changed the patches/ directory to be in git format-patch form, for sending or applying to the upstream repo, before copying files into the qtbase source tree. This should make future upstreaming easier. Task-number: QTBUG-90214 Change-Id: Id94198f58ef7bdf02af117c35cb9678b5c34ac0e Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Remove QObjectCompatProperty::operator= for safer usageAndreas Buhr2021-01-292-7/+1
| | | | | | | | | | | | | Introduction of QObjectCompatProperty requires every write to the property to be examined whether it is OK or should be replaced by a setValueBypassingBindings/markDirty combination. The existence of operator= make this difficult as it is easy to miss places where it is written. By not having operator=, we can help developers make sure they had a conscious decision about each write to the property. Change-Id: Ia61ea4722eb0bab26ce7684b85dd03d710cd1751 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QEventDispatcherGlib: do not omit active notifiers on source dispatchingAlex Trotsenko2021-01-291-2/+8
| | | | | | | | | | | | | | | | It is quite common for a socket notifier to be disabled in a slot connected to its activated() signal. But the event dispatcher did not update the position in the list of registered notifiers, which caused the next notifier to be omitted. Of course, on the next iteration of the event loop, the omitted notifier would fire again, but this reduced the scalability of applications that use a large number of sockets. To solve the problem, we update the current position in the list when a notifier becomes unregistered. Change-Id: I6565bf23500d9e38ce84b34784d89d227fa166e1 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QProcess/Unix: remove dead functionAlex Trotsenko2021-01-293-10/+4
| | | | | | | | findExitCode() doesn't do anything on Unix. Change-Id: I3efdc1380a39437c4c029073f3b10ccf7a65e580 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Revert "Port QThreadPool to the new property system"Allan Sandfeld Jensen2021-01-293-42/+17
| | | | | | | | | | This reverts commit 8f8405e04642b98663d4752d4ae76c304ae33b01. Reason for revert: Appears not entirely thread-safe and caused QTBUG-90705 Change-Id: I390c0b1a555a18e6a095b52010371d017071e26b Fixes: QTBUG-90705 Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* Specification of pointer usageHou Lei2021-01-291-7/+8
| | | | | | | Avoid C-style casts when possible. Change-Id: I8e86eb8c439b456da41d52a5666190330edeeda2 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QVariant: Use QMetaTypeInferface directlyFabian Kosmale2021-01-283-24/+63
| | | | | | | | | | | | There is no reason for QVariant to go through QMetaType when it can use the QMetaTypeInterface directly. Without LTO, the QMetaType method calls are opaque, and we therefore risk to lose optimizations. Additionally, avoid constructing a QMetaType from a type id if we already have the QMetaType. Fixes: QTBUG-90673 Change-Id: I7069ff6aff70d5baecdf5cf5760014c3dda81784 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QProperty: Treat change listener modifying its source property as a loopFabian Kosmale2021-01-281-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is in line with QML where import QtQuick 2.15 Rectangle { width: 100 height: 100 color: "red" Rectangle { id: inner x: 10 y: x width: 50 height: 50 onYChanged: { console.log("hey"); inner.x = 10} TapHandler { onTapped: inner.x = 20 } } } results in a binding loop warning when the tap handler triggers. While the change handler would only run once, we cannot statically determine if we need to loop once, twice, or if there actually is a diverging loop. Thus we unconditionally warn about the binding loop and stop executing the binding. As a drive-by, verify in the related test that a change handler which overwrites its properties binding itself removes the binding. Change-Id: I5372019c2389ab724c49cd7489ecbd3ebced1c69 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Create bindable property overview documentationAndreas Buhr2021-01-282-54/+107
| | | | | | | | | | | So far, all documentation about bindable properties was in the corresponding classes QProperty and QObjectBindableProperty. This patch creates one documentation page for a general introduction to bindable properties and information concerning all of those classes. Change-Id: Ib718dbeb385c3899fb34cc2ce03bec7a8d43a034 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Safer setting of interval in QTimerAndreas Buhr2021-01-281-2/+4
| | | | | | | | | | | There are two methods which set the interval and do things afterwards. Setting the interval might trigger other code. This patch uses setValueBypassingBindings and marks the interval dirty later, just to be safe. Change-Id: I2cae3e4a9f040007dfd246c424250034e8df10a0 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
* Q_OBJECT_BINDABLE_PROPERTY_WITH_ARGS: Silence warnings properlyFabian Kosmale2021-01-271-5/+5
| | | | | | | | Same reason as for the version without args. Amends 1461df2ce4ea0283759e653612208c8729a03d7a. Change-Id: Ib9f0d8f27d858ff35134001c3cd7945b17668ae4 Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* QProcess/Unix: simplify notifiers deactivationAlex Trotsenko2021-01-272-18/+4
| | | | | | | | To minimize code duplication, move the socket notifier deletion to the closeChannel() function, where the pipe descriptor will be closed. Change-Id: If75ba1c955c706ae6e2b3d9f53f7a25e4aa32fa7 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
* Make QJniObject and QJniEnvironment public APIAssam Boudjelthia2021-01-2717-109/+2691
| | | | | | | | | | | | | | | | | | | | As part of Qt 6 restructring for the extras modules, this change exposes the Jni APIs which are very important for Android platform. This patch adds the APIs QJniObject, QJniEnvironment, QJniExceptionCleaner based from private QtCore and QtAndroidExtras. The Jni interface is cross-platform which justifies the name, but currently, this API is used mainly for Android, and the naming comes generic without Android keyword to avoid any future limitation on supporting other platforms. [ChangeLog][QtCore] Add new QJniObject, QJniEnvironment and QJniExceptionCleaner APIs. Task-number: QTBUG-89482 Fixes: QTBUG-89633 Change-Id: I4382dd53a225375759b9d042f6035a4a9810572b Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
* Q(Untyped)Bindable: add takeBinding methodFabian Kosmale2021-01-272-1/+42
| | | | | | | | | | | We missed takeBinding as a supported operation on Q(Untyped)Bindable. To avoid adding version checks to code dealing with QBindableInterface, we simply synthesize takeBinding as a combination of binding to retrieve the binding and setBinding with a default-constructed QUntypedPropertyBinding. Change-Id: I43803a0dfe210353d0235f0373d2257f75ffe534 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QBindable: add initial documentationFabian Kosmale2021-01-272-0/+84
| | | | | | Change-Id: I43681093c8819289037c76bd9c05b88a6da8311b Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QTzTimeZonePrivate::init(): fix handling of empty IDEdward Welbourne2021-01-271-7/+13
| | | | | | | | | | | | | | | | We were using the first abbreviation in the list, where the current time's one is probably more apt. We look up displayName() using ICU, when in use, but that abbreviatio may be unknown to it. So ensure, when using abbreviation in place of empty id, that we get the system zone for ICU, for use if we're asked for the display name. This is a follow up to b12d6c6a8ab5f7b01bdd2cb862a66a409700faa1. Pick-to: 6.0 5.15 Change-Id: I177db55de1ffbc763def8a0423642f2b3da74fa6 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Add qHypot() to qmath.h, exposing and extending std::hypot()Edward Welbourne2021-01-274-12/+183
| | | | | | | | | | | | | | | | | | | | We have plenty of places where we add some squares and take a square root; this may be done more accurately and faster by hypot(). Introduce QHypotHelper to handle hypot with more than 3 parameters, and with 3 when the C++17 version is missing (which it never should be). Include an overload taking arbitrarily many valus and ensure that we can use qHypot() with qfloat16. Illustrate with some example uses, add some tests. [ChangeLog][QtCore][QMath] Header <QMath> now provides qHypot(), an implementation of std::hypot() taking arbitrarily many numeric values, including support for qfloat16, while avoiding the overflow and underflow problems that arise when naively taking the square root of a sum of squares. Change-Id: Ia4e3913fe83fc27d17d8e7f1a52f03ad445c1fed Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Update to CLDR v38.1, adding Yukon Standard TimeEdward Welbourne2021-01-271-221/+224
| | | | | | | | | | | No change to QLocale's data, one addition to the Windows time-zone data. What was formerly "Us Mountain Standard time / Canada" is now Yukon Standard Time. Fixes: QTBUG-89784 Pick-to: 6.0 5.15 Change-Id: I4c9a23620e74ea379be8a4c5ba0896d35fe9b594 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Port QThreadPool to the new property systemSona Kurazyan2021-01-273-17/+42
| | | | | | | | | | | Ported all properties, except activeThreadCount. Marking it dirty may cause a re-evaluation of properties depending on it, which may reault in a deadlock in case of trying to read activeThreadCount property which is being marked as dirty. Task-number: QTBUG-85520 Change-Id: Id073b0895c89a9e6b05b57ad520db994e550a1c9 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Q_GLOBAL_STATIC - deal with static code analysersTimur Pocheptsov2021-01-271-0/+4
| | | | | | | | | | | | At least some of them don't like the fact we have classes with non-trivial destructors but trivial move/copy constructors - disable them explicitly, hopefully those analysers are smart enough to stop complaining. Change-Id: I285711a2d21bff89661af928ba326ecd5b69823f Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QVariant: Do not destroy trivial typesFabian Kosmale2021-01-272-3/+8
| | | | | | | | | | | | | | | | | | perf indicates that we spend quite some time in ~QVariant in the referenced task's benchmark. With this patch, we significantly reduce the amount of work we do in the destructor for trivial types: Instead of calling an out-of-line function, which does a few checks and then does an indirect call through a function pointer to a do-nothing dtor before freeing the memory, we now simply free the memory. We achieve this by changing QMetaTypeInterface to leave the dtor function pointer null if the type is trivially destructible. Then, in QVariant we use the QMetaTypeInterface directly instead of going through QMetaType. Task-number: QTBUG-90560 Change-Id: Iaf87036710e1680323842e1ba703a5d3d0e5027a Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QJsonObject::take: add missing detach() callThiago Macieira2021-01-271-0/+1
| | | | | | | | | | We were modifying shared objects. Pick-to: 6.0 5.15 Fixes: QTBUG-89625 Change-Id: Id6bc735b79cf4beb9454fffd165c56476a5dec04 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
* QTimer: port to new property systemIvan Solovev2021-01-262-8/+43
| | | | | | | | Task-number: QTBUG-85520 Change-Id: I1f92b86619f2ca186c505251b21463f396af0ac6 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Andreas Buhr <andreas.buhr@qt.io>
* Port QPauseAnimation to the new property systemSona Kurazyan2021-01-262-2/+13
| | | | | | | Task-number: QTBUG-85520 Change-Id: I8c0ee86598f4c0f093f64b2891ee835a43964b84 Reviewed-by: Andreas Buhr <andreas.buhr@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QRegularExpression: add move constructorIvan Solovev2021-01-262-6/+75
| | | | | | | | | | | | - Add move constructors to QRegularExpression, QRegularExpressionMatch and QRegularExpressionMatchIterator. - Update the documentation to explicitly state that only destructor and assignment operators can be called for a moved-from object Task-number: QTBUG-86634 Change-Id: I06b4f54e300541033a9a18339c97338717a06da0 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Workaround MinGW not handling error suppression macro correctlyFabian Kosmale2021-01-261-0/+6
| | | | | | | | Fixes: QTBUG-90353 Change-Id: I9270f4107f3f7083d28228f2426b34bc1e198112 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Kai Koehne <kai.koehne@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QVariant: avoid superfluous QMetaType lookupFabian Kosmale2021-01-261-38/+38
| | | | | | | | | | | | | | | | | | Constructing a QMetaType from an id requires a lookup which isn't free, even for builtin types. When constructing a QVariant from an integer, this leads to a noticeable performance loss. In the mirco-benchmark of the linked bug, we improve from 100000000 965 to 100000000 789 on Linux, Intel i5-4690, clang 11.01 with a CMake release build. This however still does not recover the performance we had in Qt 5. Task-number: QTBUG-90560 Change-Id: I26440bdc04ef131ce91d3698957f0df43a4c4017 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
* Partially revert 813a928c7c3cf98670b6043149880ed5c955efb9Ulf Hermann2021-01-261-0/+3
| | | | | | | | Otherwise ASAN complains about mismatched new/delete. Change-Id: I76ddcc388309e20055c93c68b9b6fa8a11b884e1 Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
* Update QMutexLocker documentationLars Knoll2021-01-263-2/+11
| | | | | | | | | And add an entry about the API changes to qt6-changed.qdoc. Pick-to: 6.0 Task-number: QTBUG-89429 Change-Id: I146574acd3e4aa5ed6f1629fc68888f009472f19 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Extend alignment of QArrayData to std::max_align_t in allocationAndrei Golubev2021-01-261-7/+16
| | | | | | | | | | | | | | | | | | | | Make stricter alignment requirements for the allocated header This strict alignment allows reallocateUnaligned() to property account for the padding occurring in cases when alignof(QArrayData) < alignof(T) <= alignof(std::max_align_t), which happens to be the case on e.g. 32-bit platforms with specific alignment requirements. This adds 4 bytes (the difference between alignof(std::max_align_t) and sizeof(QArrayData)) of overhead for QString, QByteArray and certain QLists on 32-bit systems. Task-number: QTBUG-90359 Pick-to: 6.0 Change-Id: I8176a4cc79f100ee772b09425e88fe8ff3ae226a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* QMimeDatabase/xml: support both 'xmlstarlet' and 'xml' for minifying XMLKai Köhne2021-01-251-0/+4
| | | | | | | | | | | | | Commit 370324f6e2f3 changed the call to 'xml' to 'xmlstarlet' because some Linux distributions do not provide a binary called xml. Anyhow, the official Windows packages of xmlstarlet only provide 'xml.exe'. Therefore just check for both. Pick-to: 5.15 6.0 Change-Id: I4381b256850e4101b760df21f2b0baffb4414620 Reviewed-by: Eric Lemanissier <eric.lemanissier@gmail.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QLocale: Allow direct conversion from language, country, and script codesKai Köhne2021-01-253-7/+51
| | | | | | | | | | | | | | | This complements patch a148c7b5d71d244, where languageToCode(), countryToCode() scriptToCode() methods were introduced, with matching codeToLanguage(), codeToCountry(), and codeToScript() methods. This allows us to remove the use of private Qt Core API in Qt Linguist. [ChangeLog][QtCore][QLocale] Added static codeToLanguage(), codeToCountry(), codeToScript() methods that convert ISO code strings to the respective enum values. Change-Id: If5c0843a718c006ade086a6f74ceb86ac6e0fce4 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Make QCalendar's backend registration reentrant-safeEdward Welbourne2021-01-251-32/+120
| | | | | | | | | | | | | | | | | | | | | | | | | | Previously, different threads instantiating the same back-end could collide in the register, with various unwelcome results. Give Registry an atomic status flag to track whether it has been populated or is being destroyed; and protect it with a mutex to ensure distinct threads do not collide during registration or attempt to register while the registry is being destroyed. Document the correct way to instantiate custom backends, and that no code other than the QCalendar implementation should instantiate the built-in ones. Instantiators that follow these rules should be safe from failed registrations, provided they don't pick a name that conflicts with some other backend. They can also use the recent change to semantics of registerAlias() to verify that registration *has* succeeded. Done-with: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> Pick-to: 6.0 5.15 Task-number: QTBUG-88815 Task-number: QTBUG-85692 Fixes: QTBUG-84575 Change-Id: Ie78e700e71d610454152c05cafb38f6f713649ad Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Add correct prefix for GHS compilerKimmo Ollila2021-01-251-0/+2
| | | | | | | | | | | | This fixes INTEGRITY build error: cannot access position 53 in array of 49 elements constexpr const char *begin = func + prefix; and many "expression must have a constant value" errors. Change-Id: I0e043028fbcb479c6657b59ea144b4536cc65651 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QProcess/Win: move pipe draining into QWindowsPipeReaderAlex Trotsenko2021-01-224-32/+89
| | | | | | | | | | | | | | | | | | ... where it belongs. To avoid the loop, introduce the drainAndStop() function, which allows QWindowsPipeReader to flush the pipe itself. It determines the number of bytes pending and blocks until the remainder of the process output is received. Note that the loop in drainOutputPipes() didn't actually have to interleave the two pipes (because we're presuming that the operations will finish instantly), so we don't do it now. Also, the code violated the API contract: 'true' was returned when the 'wrong' channel received data; this is now fixed as a side effect. Change-Id: I38ed4861a238e39e793c3716e856e5bfdeed3d74 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>