summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Fix uic/rcc generating outdated export for Qt for Pythonv6.0.06.0.0Friedemann Kleint2020-12-046-15/+15
| | | | | | | | | Bump version to 6. Pick-to: dev 6.0 Fixes: QTBUG-89124 Change-Id: Ifcf60552b5b6efb86f79da34da9c34b8efae9fa4 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Doc: Make \youtube macro work with litehtml help backendTopi Reinio2020-12-033-3/+8
| | | | | | | | | | | | | | Unlike the QTextBrowser backend, litehtml does not render elements inside <iframe> correctly. This prevented external links to YouTube from working in offline documentation. Move the <iframe> to a macro override specific to online doc builds. Fixes: QTBUG-88975 Change-Id: Iff7828ddeed353620eaa9ac669a3e0c03749daa2 Reviewed-by: Paul Wicking <paul.wicking@qt.io> (cherry picked from commit ca8e9ff2ef0a01248e3bdd718ef9fc06419214a4) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Dont' return a const ref to QModelIndexLars Knoll2020-12-032-6/+5
| | | | | | | | | | The conversion operator from QPMI to QModelIndex should return by value, to hide implementation details and so that we don't have to rely on a static empty QModelIndex. Pick-to: 6.0 dev Change-Id: I92b3f8451422f2b69bf31f28b387a124fd24ec46 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* Fix hashing of QPersistentModelIndexLars Knoll2020-12-032-0/+36
| | | | | | | | | | | | The hash and equality operators used need to be consistent with each other. Unfortunately, QPMI::operator==() is not suitable to do this. So specialize qHashEquals() for QPMI. Fixes: QTBUG-88966 Pick-to: 6.0 dev Change-Id: If5f19a722ae9fc4e78e93537e7ea15726f148768 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Add a qHashEquals() method and use it to compare keys in QHashLars Knoll2020-12-033-1/+22
| | | | | | | | | | | | | | In some cases, the default equality operator for a class is not suitable for using in hashing (for example because it uses fuzzy comparisons). Add a qHashEquals() method that by default uses the equality operator, but allows to tailor the operations that should be used when using the class as a key in QHash. Pick-to: 6.0 dev Task-number: QTBUG-88966 Change-Id: I346cf0e6e923277a8b42a79e50342a1c2511fd80 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Bump the type info version in qhooks.cppv6.0.0-rc2Lars Knoll2020-12-012-2/+2
| | | | | | | | | | And correct the comment in tst_toolsupport. Amends change d99fdf17842d914daa41124184c6531c92766cd0. Pick-to: 6.0 dev Change-Id: I94e296f5bb5b57132c887072efb0bb56aafc524f Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QSslSocket::verify: do not alter the default configurationTimur Pocheptsov2020-12-014-8/+108
| | | | | | | | | | | | | | | | | | | | QSslCertificate::verify() has an undocumented and not very desirable property - on some platorms it updates the default configuration, which can be surprising. For example, we deprecated QSslSocket::setDefaultCaCertificates() and recommend using QSslConfiguration::defaultConfiguration(), QSslConfiguration::setDefaultConfiguration(), and QSslConfiguration::setCaCertificates(). If an application does this to select CA roots it trusts explicitly, and then for some reason is calling verify, the application can have its QSslSockets successfully connecting to a host, whose root was not trusted by the application. Also, on Windows, defaultCaCertificates() include system roots already, no need to have them twice. [ChangeLog][QtCore][QtNetwork] QSslSocket::verify - do not change the default configuration Fixes: QTBUG-88639 Change-Id: I1cd40b259d0a6dcd15c78d1e7c027ff10859595c Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> (cherry picked from commit 1158ff67b492853b72199ed78bfcf24132e1c7ff) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Doc: Fix QVector[2|3|4]D documentationTopi Reinio2020-12-011-84/+57
| | | | | | | | | | | The \fn commands for friend functions need to include the class scope for QDoc to find the declarations. Fixes: QTBUG-88932 Change-Id: Icbb45c12d7d657d95243231148483c00baf07c36 Reviewed-by: Paul Wicking <paul.wicking@qt.io> (cherry picked from commit 3789ca6c9947d1357641424a5102cdf3fba2dcc7) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix memory leaks in QFuture's continuationsSona Kurazyan2020-12-014-27/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | There were two issues: - Some of the continuations were allocating memory for the continuation's context dynamically, but deleting the allocated memory only if they were actually invoked. Since the continuations may not be invoked at all, this could cause memory leaks. Fixed by postponing the allocations to the point when the continuations need to be invoked. - In other cases the parent future is captured by copy in the continuation's lambda, which is then saved in the parent. This causes the following problem: the data of the ref-counted parent will be deleted as soon as its last copy gets deleted. But the saved continuation will prevent it from being deleted, since it holds a copy of parent. To break the circular dependency, instead of capturing the parent inside the lambda, we can pass the parent's data directly to continuation when calling it. Fixes: QTBUG-87289 Pick-to: dev 6.0 Change-Id: If340520b68f6e960bc80953ca18b796173d34f7b Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
* Fix perfect forwarding of callables in QFuture's continuationsSona Kurazyan2020-12-012-28/+40
| | | | | | | | | | | Use universal references instead of rvalue references for passing callables in the implementations of QFuture's continuations. Pick-to: dev 6.0 Change-Id: I1288c78f78f84f30c6607e505e7f9807a9272071 Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* Inline QCollator's QString methods via QStringViewEdward Welbourne2020-11-302-10/+6
| | | | | | | | | Can't be done before Qt 7 unless we do it now, as it'd be BiC. Task-number: QTBUG-86400 Pick-to: dev 6.0 Change-Id: Ib7b2e7b20b4a80b53dfc6535efe90d1674f38e81 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Also remove 0 initialization from QUrlTwoFlagsAllan Sandfeld Jensen2020-11-301-2/+1
| | | | | | | | | Was overlooked when removed from QFlags Change-Id: If65ff4a07e2f72589d2c32c2d24366ff9dc2405f Reviewed-by: Lars Knoll <lars.knoll@qt.io> (cherry picked from commit 05bb9b1016d981ac3c31c74dc8bc060402b86fa2) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: Fix resource object file paths in prl files for prefix buildsAlexandru Croitor2020-11-303-8/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before this change, the prl files always assumed that resource object files are installed into $qt_prefix/lib when doing a prefix build. That was true for qt_internal_add_resource calls, but not for qt6_add_qml_module and qt6_target_qml_files. Change qt_internal_record_rcc_object_files to take a new required INSTALL_LOCATION argument. The argument takes a path relative to CMAKE_INSTALL_PREFIX. Modify __qt_propagate_generated_resource to save the relative path of the generated resource source file, which will be used in the computation of the final resource object file location. This is needed because the Qml resource functions place the source files in a different directory layout, e.g. .rcc vs .qmlcache Modify qt_generate_prl_file to prepend $$[QT_INSTALL_PREFIX]/ instead of $$[QT_INSTALL_LIBS]/ for the resource install paths. A follow up patch is done in qtdeclarative to pass the new INSTALL_LOCATION argument from the Qml CMake functions. Amends f9dcade5e795a631b9a2d93c855aa8198d58e24e Pick-to: 6.0 dev Task-number: QTBUG-87702 Task-number: QTBUG-88425 Change-Id: Id17bb517b4cb5d00911bfd10a728ba4e0d44871b Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Update setHighDpiScaleFactorRoundingPolicy docsTor Arne Vestbø2020-11-302-8/+4
| | | | | | | | | | | The default is now passthrough. And let's not mention the environment variable overrides, as they are meant for internal testing. Change-Id: Ie2409e5411d4bdcdf041834cb5ca9e1215aa173a Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io> (cherry picked from commit 58afadc624cf284cfe93d6a5c85557ed6e4f9765) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Add instructions to build documentationToni Saario2020-11-272-0/+42
| | | | | | | | | | | | This enables documentation building in add-ons and other modules that need to build docs. Pick-to: 6.0 Pick-to: dev Task-number: QTQAINFRA-3972 Change-Id: Ic2763d6d36d26e5a1267b312727c3c268ad6d114 Reviewed-by: Topi Reiniö <topi.reinio@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Restore pass-by-ref to QRect QCalendarWidget::paintCell()Edward Welbourne2020-11-272-2/+2
| | | | | | | | | | Accidentally changed to pass-by-value while doing that to QDate, in commit af837734b2259201f126b206bd5299497e080f7b Task-number: QTBUG-86400 Pick-to: dev 6.0 dev Change-Id: I8d2db532f537e5f82a5f3b36e72fcf7fefdd2ee5 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Inline the fast path for removeBinding()Lars Knoll2020-11-272-10/+17
| | | | | | | | | | | Save a function call in the common case where we don't have a binding This makes a rather large performance difference for setters that do not have a binding. Change-Id: I140f29790f6fe868721a33b9fad37205e547b8e9 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit c63901c5f3195596eb81e5f5ae5483ca5a0b6d35) Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Smaller cleanup in QBindingStorageLars Knoll2020-11-271-11/+11
| | | | | | | | | Unify code paths and avoid excessive code generation. Change-Id: I4a54234dd322bba380cc45d4f9c97d97a0c93303 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 65759c9867321d978c1f98f5cf66bef11c8f5c15) Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Inline the fast path of a few methodsLars Knoll2020-11-273-18/+37
| | | | | | | | | | No need to do function calls for the case where we return immediately after checking a boolean. Change-Id: I3e449850a10fcf82acb843cce6da6dfd98de32ad Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit e165f416a752398079590161a18255f9a0058a3e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Inline the QPropertyBindingPrivatePtr destructorLars Knoll2020-11-272-4/+8
| | | | | | | | | | In many cases, it only derefs and does nothing else. Inline the fast code path. Change-Id: Ib605c385c1683f7833f7189c84d6cf4eb5b0e59e Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit eda4c29eb26dab32e22040bdda0b9b9109b1408b) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Inline access to the QBindingStorageLars Knoll2020-11-278-42/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | And inline the fast checks inside the methods in QBindingStorage. This allows QObjectBindableProperty and friends to inline all the fast checks and almost completely eliminates the overhead for property accesses when no bindings are being used. Read and write times of QObject based properties when no bindings are being used: Read Write Old style property: 3.8ns 7.3ns QObjectBindableProperty (no notification): 4.5ns 4.3ns QObjectBindableProperty (with signal): 4.5ns 7.6ns QObjectBindableProperty (inline accessors): 3.2ns 3.4ns Numbers without this patch: Old style property: 3.8ns 7.9ns QObjectBindableProperty (no notification): 7.2ns 7.7ns QObjectBindableProperty (with signal): 7.2ns 16.0ns QObjectBindableProperty (inline accessors): 6.3ns 6.7ns Change-Id: Ifd1fa3a489c3be8b1468c0b88af547aac397f412 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 98c82fb445acf45cc4c4bc86a5adda43358127bf) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Simplify the safeguarding logic in notify()Lars Knoll2020-11-273-118/+80
| | | | | | | | | | | | | | | | | | The logic in notify() was doing quite a bit more work than it needed to. By inserting a dummy node after the current one instead of replacing it, we can avoid half of the data shuffling that has been happening and also don't need a back pointer when executing the notification. Also avoid calling a semi expensive destructor of QPropertyObserver. Reduces the overhead of notify() by ~30%. Change-Id: I7ce16bcf9cd9c4368c18bf875fc959223452fd4f Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> (cherry picked from commit e8ef871e3522f340b4efe32382af7e35ef908665) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Remove ExtraBit and FlagMask from QPropertyBindingDataLars Knoll2020-11-273-22/+11
| | | | | | | | | | They are not needed and removing it can simplify the code in some places and avoid a couple of masking operations. Change-Id: I0e4241a2784026aa89deed35f408b094e89a11a0 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit b1be6e6e6f355bfcb0c3814516f6009c91d2de89) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Rename Application ExampleVolker Hilsheimer2020-11-274-7/+7
| | | | | | | | | | | Prefix it with "Qt Widgets -" to make it a bit clearer in the list of highlighted examples which module this one is about. Change-Id: I0bf65b02db72173f1adfe0bcf8657be7905dbd6c Reviewed-by: Tuukka Turunen <tuukka.turunen@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io> (cherry picked from commit 6cb36d825d365988ea7a601218bdd3a329290469) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QCache: Fix crash observed in tst_QAccessibilityFabian Kosmale2020-11-261-1/+1
| | | | | | | | | | | | | | | Fixes a use-after-free which can reliably be observed under ASAN. In QConfFileSettingsPrivate::~QConfFileSettingsPrivate we call unusedCache->insert(conf_file->name, conf_file, ...) Note that the key is a member of the object. Thus by deleting the object before using the key, we dereference a dangling pointer. Amends f08492c6fd9818c7d80b1725355453e179b4d85b. Change-Id: I3a550fc73446b72dd46456232e85f6d206d64c01 Reviewed-by: Andy Shaw <andy.shaw@qt.io> (cherry picked from commit 5283ee71040dc2f3a762e9cc5e807fb17587e9b7) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix broken \endcode marker in Qt 6 porting docsFlorian Bruhin2020-11-261-1/+1
| | | | | | Pick-to: dev 6.0 Change-Id: I8dfd72f6a00a6c91a38bb201b14524b0bc7cf100 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Remove some examples from highlighted listVolker Hilsheimer2020-11-261-3/+0
| | | | | | | | | | | The Local Fortune examples and the JSON Save Game don't need to be highlighted in Qt Creator. Change-Id: I7c7c9997e9a1cfb61f94309f16be65c810b42e14 Reviewed-by: Tuukka Turunen <tuukka.turunen@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io> (cherry picked from commit 61436f24cbd8219b0442544bd8e162fb8970bfc6) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Use event cloning rather than copyingVolker Hilsheimer2020-11-261-1/+1
| | | | | | | | Fixes: QTBUG-88834 Change-Id: I8c21b07c9d8491f26589f29b04d552835b3cbd11 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 78cbb25b9d70f1617ff6c912a22ac532b0352bde) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Document removal of QEvent copyingVolker Hilsheimer2020-11-251-0/+39
| | | | | | | Change-Id: Ia4681fe5c5ae0953ba75f4ab24da4eec7461c719 Reviewed-by: Lars Knoll <lars.knoll@qt.io> (cherry picked from commit 60870ca68c2fc2a1bbbb30bb8c3853c87e142373) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix QVariant/QMetaType::compare APIsGiuseppe D'Angelo2020-11-2514-29/+511
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | std::optional<int> is the wrong datatype to use for compare. First and foremost, it can't be used in the idiomatic form of auto r = a.compare(b); if (r < 0) ~~~ // a is less than b if (r > 0) ~~~ // a is greater than b which we *already* feature in Qt (QString, QByteArray). Also, std::optional<int> (explicitly) converts to bool, which is a trap, because the result of the comparison can be accidentally tested as a bool: if (a.compare(b)) ~~~ // oops! does NOT mean a<b Not to mention extending this to algorithms: auto lessThan = [](QVariant a, QVariant b) { return a.compare(b); }; // oops! std::ranges::sort(vectorOfVariants, lessThan); which thankfully doesn't compile as is -- std::optional has an *explicit* operator bool, and the Compare concept requires an implicit conversion. However, the error the user is going to face will be "cannot convert to bool because the operator is explicit", which is deceiving because the fix is NOT supposed to be: auto lessThan = [](QVariant a, QVariant b) { return (bool)a.compare(b); }; // big oops! Instead: backport to Qt the required subset of C++20's <compare> API, and use that. This commits just adds the necessary parts for compare() (i.e. partial ordering), the rest of <compare> (classes, functions, conversions) can be added to 6.1. Change-Id: I2b5522da47854da39f79993e1207fad033786f00 Pick-to: dev 6.0 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Fix link to Qt OpenGL C++ classesVolker Hilsheimer2020-11-251-1/+1
| | | | | | | Change-Id: Ia8d71cf48b2d0c3d0f6d3de81335c263eb5466c4 Reviewed-by: Paul Wicking <paul.wicking@qt.io> (cherry picked from commit df1a62fe61334d786cbb085200877cd9e6f5a478) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: Use lower cased property name for entrypoint library opt-outAlexandru Croitor2020-11-241-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We need this to enable headersclean functionality to work with CMake <=3.18 which is our minimum required CMake version to build Qt (it's not a problem for 3.19). Otherwise we hit a configuration error while trying to evaluate generator expressions for INTERFACE only libraries for which we need to do the headersclean check (e.g. UiPlugin in qttools). Sample error message: INTERFACE_LIBRARY targets may only have whitelisted properties. The property "QT_NO_ENTRYPOINT" is not allowed. More info: https://gitlab.kitware.com/cmake/cmake/-/issues/21484 Naming it lower case avoids the issue, but is inconsistent with all our other public property names. Furthermore if we do this change, it should probably go to 6.0.0 due to it being a property that a user is meant to set in their project. Task-number: QTBUG-82615 Pick-to: 6.0 dev Change-Id: I1f1439f1e5cbc816010eba7301605a8f60b88fd1 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Blacklist authenticationCacheAfterCancel on Ubuntu 20.04Alexandru Croitor2020-11-241-0/+4
| | | | | | | | | | | | | It flaky fails integrations. Amends 2b49b01aa3467173f0be9252cfa50b41a311dd57 Pick-to: 6.0 dev Task-number: QTBUG-88417 Change-Id: I6aad6ee7a70e580da64e75f69e8c9cab1cb78cd7 Reviewed-by: Andreas Buhr <andreas.buhr@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Re-fix the definition of primitive typesv6.0.0-rc1Giuseppe D'Angelo2020-11-241-1/+1
| | | | | | | | | | The conditions are AND, not OR. Technically we don't rely on not having constructors any more, but we may reserve the right in the future to have uninitialized resizes. Change-Id: Icfae61079a544f7ac8e90a32ad605c12cfa8b4aa Pick-to: 6.0 dev Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Return subclass type from overrides of QEvent::cloneVolker Hilsheimer2020-11-242-38/+38
| | | | | | | | | | | C++ allows overrides to return a covariant type, so if calling code has already cast the callee down to the right type, don't require it to cast the returned clone down as well. Change-Id: I802f00a3c78e03047046986d0ed0a479b47573b8 Reviewed-by: Lars Knoll <lars.knoll@qt.io> (cherry picked from commit 146b37cdf376fb2fde85fa27326acfbeb2a024e3) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QMetaType: Track whether type is QML list typeFabian Kosmale2020-11-243-19/+29
| | | | | | | | | | This information is required in the QML engine to handle list properties (instances of QQmlListproperty<T> and list<T> types from QML). Change-Id: I1e30572f1c91f58b290cb9b4b07433af99a1db6f Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit 5806ecf5cb24cf39ea2608d42246eafbaa817582) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Doc: Update CMake functions in Qt Core for Qt 6Kai Koehne2020-11-247-494/+115
| | | | | | | Change-Id: Ica6141f183c75f60e5b1031c0972f79de7821841 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit f74e572cb7aff59d3a64d1761370b0a88d5ec7c6) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Doc: Update CMake functions in Qt Widgets for Qt 6Kai Koehne2020-11-243-80/+12
| | | | | | | Change-Id: I4110e8695c75c40cec6f94bb94879b07282b29d3 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit c082213556991c6619ef2d2c00a7042406f867a7) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Avoid integer overflow and division by zeroAllan Sandfeld Jensen2020-11-231-3/+3
| | | | | | | | | | | | | Restrain patterns to sensible lengths and values. [ChangeLog][QCosmeticStroker] Pen patterns are restrained to a maximum length and values of 1024, fixing oss-fuzz issue 25310. Change-Id: If062f8336ff5ad113258391b0d70b8ac6f42c4b3 Reviewed-by: Robert Loehning <robert.loehning@qt.io> Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io> (cherry picked from commit 1ff25785ff93d0bd3d597e3a65a261bdbfa13c3b) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: Fix Android non-top-level build against qtbaseJoerg Bornemann2020-11-231-1/+6
| | | | | | | | | | | | | | | | Commit 9e0fb9c4fbe7a11c09a70d7ea1be97405c6bf0f8 introduced build failures in non-top-level builds when building Qt modules against qtbase. This was observed on in the CI for CentOS. Partly revert above commit by taking the old code path for non-top-level builds. Pick-to: dev 6.0 Fixes: QTBUG-88718 Change-Id: I8926e1e4628ec5bdcea99e10497c1f65c10d072d Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QCache: fix accidental pessimizationMårten Nordheim2020-11-211-2/+1
| | | | | | | | | | | | By unconditionally removing the existing entry we never hit the if (result.initialized) branch. Change it to only remove the existing entry if we don't plan on inserting. Task-number: QTBUG-88183 Change-Id: If4e7ebac23aa63d4b9d4b0a22882dd7d90a58e8b Reviewed-by: Lars Knoll <lars.knoll@qt.io> (cherry picked from commit f08492c6fd9818c7d80b1725355453e179b4d85b) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Revert "QChar: assert on illegal construction"Kai Koehne2020-11-211-2/+2
| | | | | | | | | | | | | | This reverts commit 915be6606ead25f4fbbbcb2687b33cf22a955177. Reason for revert: This causes issues in other modules, see QTBUG-88687, QTBUG-88710, QTBUG-88712. We should fix them, but let's not block 6.0.0 until then. Task-number: QTBUG-88687 Task-number: QTBUG-88710 Task-number: QTBUG-88712 Change-Id: I89425082c9c55aabb34283dfec5dfd421d91d269 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QGuiAppPriv: don't clear target and window for TouchCancelShawn Rutledge2020-11-211-2/+0
| | | | | | | | | | | | | It's nice not to leave garbage in QPointingDevicePrivate::activePoints between events; on the other hand, this garbage doesn't matter, because every press event sets the target and window independently, without caring what was stored there from before. But it was wrong to clear it before we've even delivered the TouchCancel event. Change-Id: I924039a7c7a8ed75f420d1837c63dc19d3cc98b6 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit 45a65cbeb2775da71d4e7b417b45d54341a3ee7f) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix safe conversionAllan Sandfeld Jensen2020-11-211-4/+11
| | | | | | | | | | | | Ensure the resulting QScFixed values are no larger than can be safely returned to int after shifting the fixed factor away. Fixes: QTBUG-88683 Change-Id: Id0754b021e5fa9a3cf0d15e37ac643cfc1509993 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io> (cherry picked from commit a31484302d71c29c0e0e62f9941f9d5f0c87f9aa) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix weight when reading old serialized QFontsEskil Abrahamsen Blomfeldt2020-11-213-5/+8
| | | | | | | | | | | | | | | | | | | The QFont::fromString() needs to differ between strings produced before and after Qt 6.0 when interpreting the weight value, since in older strings this will be the legacy scale. Luckily the number of tokens in the string can be used for this purpose, since many tokens were added in Qt 6.0. This broke KDE, where font settings are stored in QSettings and serialized using QFont::toString() from Qt 5. Fixes: QTBUG-88589 Change-Id: I199737fed61917f8b9d8f86176ead29a89eb8e0c Reviewed-by: Andy Shaw <andy.shaw@qt.io> (cherry picked from commit 1d14067680f02f47b2f8ff375c44eb64633eec02) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QWin32PrintEngine: fix compilationAlex Trotsenko2020-11-211-2/+0
| | | | | | | | | | | | On MinGW32 it fails with error: .../src/corelib/global/global.h: 1186:34: error: unused variable 'q' ...qprintengine_win.cpp: 753:5: note: in expansion of macro 'Q_Q' Change-Id: I8eb0e3c5b72f8542cd3bd11514b12d308481f250 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit 27e08b0c40b73edc5354f9ad3cf7e5e660243553) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Delete move constructor and move-assignment for QEventVolker Hilsheimer2020-11-211-1/+3
| | | | | | | | | | | As of 19f9b0d5f54379151eb71e98555b203ad6756276 we define a protected copy constructor and assignment operator. Static analyzers warn about missing move variants, so delete those in addition. Change-Id: I28c1a2afd4560ce35a258bde507dafd93245b75b Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 291e8e729ee7a28e579c3aea22fd4482cd271ed7) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: Name QT_NO_MAKE_*/BUILD_* variables consistentlyJoerg Bornemann2020-11-2013-51/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For consistency, apply the following renamings: QT_NO_MAKE_EXAMPLES -> QT_BUILD_EXAMPLES_BY_DEFAULT QT_NO_MAKE_TESTS -> QT_BUILD_TESTS_BY_DEFAULT QT_NO_MAKE_TOOLS -> QT_BUILD_TOOLS_BY_DEFAULT BUILD_EXAMPLES -> QT_BUILD_EXAMPLES BUILD_TESTING -> QT_BUILD_TESTS This should help to better convey the difference between "BUILD" and "NO_MAKE". To configure tests, but not to build them by default, pass the following to CMake: -DQT_BUILD_TESTS=ON -DQT_BUILD_TESTS_BY_DEFAULT=OFF Analoguous for examples: -DQT_BUILD_EXAMPLES=ON -DQT_BUILD_EXAMPLES_BY_DEFAULT=OFF Tools can be excluded from the default build with: -DBUILD_TOOLS_BY_DEFAULT=OFF The variable BUILD_TESTING is still available and initialized with the value of QT_BUILD_TESTS. Change-Id: Ie5f29dfbdca8bfa8d687981dfe8c19c0397ca080 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit fb21a5ce1a5831fab2af5e4d301600d6a6211e5d) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Doc: explain how to create a test touch device for use with touchEventMitch Curtis2020-11-201-1/+7
| | | | | | | Change-Id: Ib60eb0754449da7c50f8632ebd5228ddbe8389f1 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit 5861e06568c44c58aecacdf26fd7938240348956) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Toplevel builds: Add utility toplevel targets for each moduleVolker Hilsheimer2020-11-201-0/+47
| | | | | | | | | | | | Add a target for each level-1 subdirectory in a module. Ninja already generates phony targets such as "qtbase/src/all", but those are not available in e.g. IDE integrations of CMake. With this addition, targets like qtbase, qtbase_src, and qtbase_tests are available in IDEs. Change-Id: If1c3369e9413b3ce127e68c443d4d22949708d5e Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 08f46bb40075778e89ba9aed3cef53d990852022) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>