Commit Graph

50883 Commits

Author SHA1 Message Date
Andreas Buhr
8ae3191757 Merge "Add documentation on how to write a value to a bindable property" 2021-03-18 13:40:36 +00:00
Laszlo Agocs
e933df8ce4 Merge "rhi: Make unreleased resource warnings available in release builds" 2021-03-18 11:55:43 +00:00
Andy Shaw
4c6949d655 Merge "macOS: Don't draw scrollbar handle when there is no range" 2021-03-18 11:18:00 +00:00
Andreas Buhr
48a77e0961 Add documentation on how to write a value to a bindable property
Writing a value to a bindable property is a surprisingly dangerous
operation. This patch adds a section to the documentation
describing the pitfalls which exist when writing bindable properties.

Task-number: QTBUG-90511
Change-Id: I73fea40756a1495d272bc46a7a51776ebcb07ea7
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-03-18 11:53:18 +01:00
Volker Hilsheimer
20639d565b Don't combine enum values from different enum types
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.

Pick-to: 6.1
Change-Id: I61c9dcdc42ccd2b01a6208e067d216107672cc4d
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-03-18 11:46:02 +01:00
Andrei Golubev
f49c6a5672 Merge "Rename QList test to something meaningful" 2021-03-18 10:10:23 +00:00
Timur Pocheptsov
e684d81867 Merge "Stop using QSslConfigurationPrivate inside the plugin code" 2021-03-18 09:39:49 +00:00
Laszlo Agocs
8a0dd61911 rhi: Make unreleased resource warnings available in release builds
...but tie to an environment variable still.

When destroying a QRhi object, it has the ability to print warnings for
each QRhiResource that got created from the QRhi and is still alive.
This includes only QRhiResources that own native objects underneath.

It can be handy to enable this in release builds as well. Therefore,
make this possible by setting QT_RHI_LEAK_CHECK=1. In debug builds this
continues to be always on.

Pick-to: 6.1
Change-Id: I5283676594284fadf2adf4f123b4fc6adb6db1f7
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2021-03-18 10:05:47 +01:00
Andy Shaw
aac33296e6 macOS: Don't draw scrollbar handle when there is no range
If the minimum and maximum is set to be the same then we should not
draw the handle. An empty groove should be shown instead.

Pick-to: 6.1 6.0 5.15
Change-Id: Ie79f55cd761f9a8f614967c40c23a7f59e700a0f
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2021-03-18 08:35:54 +00:00
Andrei Golubev
a2b362f2db Rename QList test to something meaningful
qtbug_xxxxx is a fairly ambiguous test name

Change-Id: I4b407160464c9b8300d3683549b0ede837161e7b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-03-18 08:31:38 +01:00
Timur Pocheptsov
b4f3c5d646 Stop using QSslConfigurationPrivate inside the plugin code
It was reasonable while backends were a part of QtNetwork.
Now if moving them outside (or just trying to implement
a new backend as a plugin), accessing data-members of
QSslConfigurationPrivate means that any plugin knows
about memory layout actual only for the version of Qt
it was built with/for. Instead, we have to use the
public class. Since it does not have all needed setters
and some data-members have no access at all, we
provide an API in QTlsBackend (which stays a part
of QtNetwork) that knows the actual memory layout.

Task-number: QTBUG-65922
Change-Id: I5ca1de4f982b4b11d9a87c4b40413367dcb83c16
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit 31cc0df7607a4d5887812c304aac0001c2cd7705)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-03-18 07:10:51 +00:00
Eskil Abrahamsen Blomfeldt
d860aaa200 Disable two tests in tst_QAccessibility on Wayland
These two tests (applicationTest() and mainWindowTest())
require QApplication::setActiveWindow() to work, which it
does not on Wayland.

Task-number: QTBUG-91418
Change-Id: I0e7b4e24050684b437de63d19bd885bab53d36b9
Reviewed-by: Liang Qi <liang.qi@qt.io>
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@qt.io>
2021-03-18 07:58:42 +01:00
Craig Scott
63a0d263cf Prevent static plugin triggering autogen dependency on reconfigure
A call to file(WRITE) will unconditionally update the file's timestamp
even if the file's contents don't change. The *Plugin.cpp file was
being written using configure_file() which avoids that, but the .cpp.in
file it was configuring from was being written out using file(WRITE)
every time CMake ran. Autogen saw that file as a dependency and then
regenerated the mocs_compilation.cpp file, which in turn results in
unnecessary rebuilds and relinking when nothing is actually changing.

The file(WRITE) - configure_file() dance is no longer needed anyway,
since the generated *Plugin.cpp file is very simple with no
substitutions required. Therefore, we can simplify that file's
generation with a single file(WRITE) that only executes if the file
contents will change or the file is missing.

Pick-to: 6.1 6.0
Change-Id: I2b7d1ff678b85ea7811969d656555592c9b6865f
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2021-03-18 15:06:14 +11:00
Giuseppe D'Angelo
2409e9b2c7 QPainterPath: plug memory leak
The copy operations didn't take into account the recent upgrade
to QESDP, just reimplement them idiomatically and thus avoid a leak.

Change-Id: I796c02b7d7835cfecd8e097c9979a6d431ee3f07
Fixes: QTBUG-91916
Reviewed-by: Robert Löhning <robert.loehning@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2021-03-17 21:37:53 +01:00
Volker Hilsheimer
48ce0bed62 Merge "QSqlError: protect against self-assignment" 2021-03-17 19:51:49 +00:00
Timur Pocheptsov
fc52acf621 Merge "Convert QSslSocket(Backend)Private into plugin" 2021-03-17 18:26:54 +00:00
Volker Hilsheimer
872f3fffbf QSqlError: protect against self-assignment
Address static analyzer warning 6eb3060fd64e459b6cd5586dc561e0ba.

Also make assignment from a moved-from object safe.

Task-number: QTBUG-91912
Change-Id: I732dc244ac0c731a02d85e88023dbd952b9eb112
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
2021-03-17 17:22:08 +01:00
Volker Hilsheimer
5a2ee82f2c Disable security warnings from MSVC in tests
MSVC generates the following for those tests:
warning C4996: '_open': This function or variable may be unsafe. Consider using _sopen_s
instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online
help for details.

We need to set the define before any C runtime headers are included, so
do it right away, it doesn't do any harm on other compilers.

Change-Id: Ia25afb87934058c3f27e63820eeb2db063a627f1
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2021-03-17 17:22:00 +01:00
Sona Kurazyan
659f7a06e9 Remove the unnecessary template parameter from the class specialization
This seems to cause errors when compiling with gcc-11. Although this is
most likely a compiler bug, specifiying the template parameter type in
this case isn't necessary.

Fixes: QTBUG-91909
Fixes: QTBUG-90568
Pick-to: 6.0 6.1 5.15
Change-Id: Ib231257ccb2e16cc533f23ca5840d31e26a66d53
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2021-03-17 16:38:36 +01:00
Mårten Nordheim
1d6a35c536 CMake: Don't attempt to add to a target that doesn't exist
When configuring a benchmark using the standalone-test script the
'benchmark' target is not available, causing a configure error.

Pick-to: 6.1 6.0
Change-Id: I8e480c9e72b47783c0910428187f0092049e89db
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-03-17 16:28:37 +01:00
Timur Pocheptsov
b477d823ad Convert QSslSocket(Backend)Private into plugin
All backend-specific code is now separated and removed
from QSslSocket(Private) code. The original code is mostly
preserved to avoid (as much as possible) regressions (and
to simplify code-review).

Fixes: QTBUG-91173
Task-number: QTBUG-65922
Change-Id: I3ac4ba35d952162c8d6dc62d747cbd62dca0ef78
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 9391ba55149336c395b866b24dc9b844334d50da)
2021-03-17 16:25:37 +01:00
Alexey Edelev
fac23d695f Merge "Rework the failure macros in the Qt CTest kit" 2021-03-17 15:15:38 +00:00
Volker Hilsheimer
0f51d2a6ed Merge "Port away from deprecated QVariant::type" 2021-03-17 14:18:41 +00:00
Alexey Edelev
e6a0b26729 Merge "Unify QLibraryInfo settings" 2021-03-17 13:06:37 +00:00
Alexey Edelev
fec5b8e81c Rework the failure macros in the Qt CTest kit
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>
2021-03-17 13:34:39 +01:00
Volker Hilsheimer
5c396be4e3 Port away from deprecated QVariant::type
Use QMetaType instead to silence compiler warnings.

Pick-to: 6.1
Change-Id: Ic28b3406ddcd51935f42779e7708ea8a459d3a9e
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-03-17 12:57:39 +01:00
Fabian Kosmale
2534854257 Merge "tst_qguimetatype: Avoid deprecated methods" 2021-03-17 11:56:37 +00:00
Robert Löhning
35ca446e3b Merge "Fix compiler warnings in 32-bit builds" 2021-03-17 11:52:42 +00:00
Alexey Edelev
6fb569af95 Unify QLibraryInfo settings
Exporting QLibraryInfo internals allows to reuse settings in
qmake/qtpath without having to keep its own instance.
Also there is no need to check setting groups in QLibraryInfo
except the 'Paths' group, since this logic belongs to qmake/qtpaths
only.

Change-Id: If762defba025ad7f7489f8a86ef5768a8628bd2f
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-03-17 11:57:11 +01:00
Joerg Bornemann
a423c0d211 Merge "Fix installation of Find*.cmake files in shadow per-repo builds" 2021-03-17 10:39:14 +00:00
Kai Köhne
8dac535a87 Merge "MSVC: Build harfbuzz with -Zc:__cplusplus -permissive-" 2021-03-17 10:12:10 +00:00
Fabian Kosmale
a7f24218e3 tst_qguimetatype: Avoid deprecated methods
This makes the 5.15 and 6.x branches more comparable, as in 6.0 the
preferred way is to use the non-static methods (which avoids an
expensive lookup in 6.x).
As a drive-by, Avoid memory leaks if the test fails.

Pick-to: 6.0 6.1 5.15
Change-Id: I95b133342a4ea19dd23c235a408f38089706412b
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-03-17 10:19:10 +01:00
Robert Löhning
bc5fecf948 Fix compiler warnings in 32-bit builds
comparison of integers of different signs: 'unsigned int'
and 'qsizetype' (aka 'int') [-Wsign-compare]

Pick-to: 6.1
Change-Id: Ia27f79ab4abca8b757b65ef5f1d30151842088fe
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2021-03-17 09:12:05 +00:00
Thiago Macieira
f7c292a713 Merge "Remove unnecessary int() casting in QRandomGenerator::bounded" 2021-03-17 08:55:00 +00:00
Joerg Bornemann
232c70ecc8 Fix installation of Find*.cmake files in shadow per-repo builds
In shadow per-repo builds we never hit the code that is supposed to
install cmake/Find*.cmake files. This caused problems when statically
building a Qt repo like qtshadertools against qtimageformats which
provides such Find*.cmake files.

Fixes: QTBUG-91538
Change-Id: I1147daee817ac71303d93e8bf368b2769afb0bb4
Reviewed-by: Craig Scott <craig.scott@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-03-17 09:05:19 +01:00
Joerg Bornemann
e6cee41c53 Error out on attempt to configure framework build with lib infix
Setting a lib infix is not supported with framework builds due to the
nature framework of include resolution: includes like <QtCore/qstring.h>
won't work if the framework is named QtCoreInfix.

The combination framework build and lib infix was agreed on to be out of
scope in the comments of QTBUG-35604.

Pick-to: 6.1
Change-Id: Ib7c6983f2f64ea1a7cfcd56657d31eeab3f55fe3
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2021-03-17 09:04:57 +01:00
Joerg Bornemann
7b4507d0be Fix qmake user projects for QT_LIBINFIX builds on Windows/iOS
QMake user projects could not be built on Windows or iOS if Qt was
configured with QT_LIBINFIX set. The code that generates
qt_lib_entrypoint_private.pri file did not take into account the lib
infix.

Pick-to: 6.1 6.0
Fixes: QTBUG-91511
Change-Id: Ibc40548a269238320f8f89a710d10e7f639246cb
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-03-17 09:04:56 +01:00
Kai Köhne
78fee50e53 MSVC: Build harfbuzz with -Zc:__cplusplus -permissive-
harfbuzz includes QtCore/qatomic.h. But the Qt headers are expected
to be compiled with -Zc:__cplusplus.

Change-Id: I28847844e9a00f2b7c84f0d5d7d3257eb22e2e8e
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-03-17 07:59:35 +00:00
Thiago Macieira
ae9e433753 Remove unnecessary int() casting in QRandomGenerator::bounded
Commit 21d3916817 added the 64-bit
version, so qsizetype now works cross-platform. The casts were added to
make qtbase compile on commit df853fed66.

Change-Id: I26b8286f61534f88b649fffd166c409c5c232230
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2021-03-17 06:21:52 +00:00
Niclas Rosenvik
3c93f7dd4f Fix configure build due to use of qt_set01 in configure.cmake
The change "Enable X11 on other platforms than just Linux"
uses qt_set01 in a configure.cmake file but does not add it
to the stubs list in QtProcessConfigureArgs.cmake thus
breaking builds based on configure.
Add a defstub with qt_set01 to fix this.

Change-Id: Ia3e0ec61df5228f88f77f631968f6f96d567ec8e
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2021-03-17 07:14:41 +01:00
Assam Boudjelthia
d6367aca86 CMake: make sure to collect Android dependencies for plugins
androiddeployqt relies on *-android-dependencies.xml files to know
what dependencies like jar files and permissions a Qt module requires.
CMake create those files under Qt prefix's lib dir but CMake was not
accounting for module plugins.

Fixes: QTBUG-90812
Pick-to: 6.1 6.0
Change-Id: Ib3b2e2bb237159b4851ac0f23dc75f8e56af3f7a
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-03-17 01:02:21 +02:00
Oliver Eftevaag
57f752b30a Add nullptr check
Adding a nullptr check before dereferencing in case q is null.

Pick-to: 6.0 6.1
Change-Id: Ia440e2ed41cbaf06a5919930c2e1615bb3916ff3
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2021-03-16 18:44:17 +01:00
Sona Kurazyan
2eec7db03d Merge "Mention QPromise in the QFuture docs" 2021-03-16 17:03:59 +00:00
Niclas Rosenvik
a03d0ba208 Merge "Enable X11 on other platforms than just Linux" 2021-03-16 15:54:26 +00:00
Morten Johan Sørvig
c48a5b2458 Merge "Round physical dpi when calculating scale factor" 2021-03-16 15:24:31 +00:00
Topi Reinio
bddad0079f Merge "Doc: Fix various documentation issues" 2021-03-16 15:03:27 +00:00
Sona Kurazyan
0477f6b15a Mention QPromise in the QFuture docs
Pick-to: 6.1 6.0
Change-Id: I5f6930116da534dd1dea41c4724c42104de38877
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2021-03-16 15:40:52 +01:00
Edward Welbourne
d0bf7f471b Merge "Use QFile directly instead of via QTextStream" 2021-03-16 13:12:40 +00:00
Niclas Rosenvik
05e4c8f2e9 Enable X11 on other platforms than just Linux
Set CMake variable X11_SUPPORTED for all systems that have X11.
Adjust _adjust_library_map() in util/cmake/helper.py to apply X11_SUPPORTED
condition around X11 related packages instead of just LINUX.
Adjust configure.cmake in src/gui based on this change.
Why, because X11 is not just Linux.

Change-Id: Ic3c04eaa55301d1237c7e74281eccd4f8e27e9ce
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-03-16 13:05:17 +00:00
Topi Reinio
00e10f62b5 Doc: Fix various documentation issues
- Document QIODeviceBase
- Document QPointerEvent::points
- Fix linking issues

Task-number: QTBUG-90662
Change-Id: Ib123d5708953b22e01f95c82626b39a49fff95b2
Reviewed-by: Nico Vertriest <nico.vertriest@qt.io>
2021-03-16 13:17:39 +01:00