50377 Commits

Author SHA1 Message Date
Shawn Rutledge
c20ad7f101 openssl: fix the build on Linux
qtbase/src/network/ssl/qtls_openssl.cpp:1527:34: error: ‘qScopeGuard’ was not declared in this scope
qtbase/src/network/ssl/qtlsbackend_openssl.cpp:227:9: error: ‘QDirIterator’ was not declared in this scope; did you mean ‘QSetIterator’?
qtbase/src/network/ssl/qtlsbackend_openssl.cpp: In function ‘QList<QSslCertificate> QTlsPrivate::systemCaCertificates()’:
qtbase/src/network/ssl/qtlsbackend_openssl.cpp:387:10: error: aggregate ‘QDir currentDir’ has incomplete type and cannot be defined
tbase/src/network/ssl/qtlsbackend_openssl.cpp:414:13: error: ‘QDirIterator’ was not declared in this scope; did you mean ‘QSetIterator’?
qtbase/src/network/ssl/qtlsbackend_openssl.cpp:415:20: error: ‘it’ was not declared in this scope; did you mean ‘Qt’?
qtbase/src/network/ssl/qtls_openssl.cpp:1527:34: error: ‘qScopeGuard’ was not declared in this scope
qtbase/src/network/ssl/qtlsbackend_openssl.cpp:229:45: error: variable ‘QDirIterator iterator’ has initializer but incomplete type

Change-Id: Ibcf4c7731b04f3f4be59d95130e088114f1536df
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2021-03-18 10:20:37 +01:00
Craig Scott
f058e494c2 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.

Change-Id: I2b7d1ff678b85ea7811969d656555592c9b6865f
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 63a0d263cf233ddf85a60678829298b50e8d1f26)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-03-18 06:17:07 +00:00
Volker Hilsheimer
4cefb50137 Port away from deprecated QVariant::type
Use QMetaType instead to silence compiler warnings.

Change-Id: Ic28b3406ddcd51935f42779e7708ea8a459d3a9e
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 5c396be4e3995f8eed2cb54341f3099c35458fa9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-03-17 21:28:41 +00:00
Timur Pocheptsov
c91ec114b1 Fix qnetworkreply's benchmark
Remove the include of qsslsocket_openssl_p.h, it does not exist anymore.

Change-Id: I5fc0a06fb381204855634b42f43deb02662746b7
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2021-03-17 16:33:24 +01:00
Robert Löhning
a131f01b06 Fix compiler warnings in 32-bit builds
comparison of integers of different signs: 'unsigned int'
and 'qsizetype' (aka 'int') [-Wsign-compare]

Change-Id: Ia27f79ab4abca8b757b65ef5f1d30151842088fe
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
(cherry picked from commit bc5fecf948f0038032d575d640ad4428ffbe89fd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-03-17 11:52:51 +00:00
Timur Pocheptsov
1a7faeef94 Suppress warning (MSVC, C4250)
This design decision was intentional and reflects the fact that we
cannot have inheritance tree 'linear' as before, since the base
interface is an abstract class without any data-members.
Also, fix a warning about size_t -> int implicit conversion.

Pick-to: dev
Fixes: QTBUG-91866
Change-Id: Icbc73c22d8adf72bbd8949125d4404ea6da69c6d
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2021-03-17 10:02:03 +01:00
Assam Boudjelthia
583776b0d5 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
Change-Id: Ib3b2e2bb237159b4851ac0f23dc75f8e56af3f7a
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit d6367aca869ee30e15a3861b2990baafb9972aa1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-03-17 01:09:02 +00:00
Sona Kurazyan
b106568ec1 Mention QPromise in the QFuture docs
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>
2021-03-16 17:04:11 +00:00
Timur Pocheptsov
31cc0df760 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
Pick-to: dev
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>
2021-03-16 13:41:08 +01:00
Timur Pocheptsov
9391ba5514 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).

Pick-to: dev
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>
2021-03-16 10:41:37 +01:00
Laszlo Agocs
6d3115425c rhi: metal: Stop using BufferOp for no good reason
Do what the Vulkan backend does, and just take the offset
and the QRhiBufferData. There is no reason to store a full
QRhiResourceUpdateBatchPrivate::BufferOp struct within the
backend.

Change-Id: I67528029de40320b3e4f031346d40dfc0bb9ab52
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
(cherry picked from commit adf6ba7eaeba97fb2561394e52ee265d94e1c6e0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-03-15 12:14:43 +00:00
Laszlo Agocs
3467fd99fd rhi: metal: Skip unnecessary writes when updating the entire buffer
Follow the similar Vulkan change in 20eb40bce92c3e5460cd2540547f3c404fe6dccc
and drop the queued up buffer data for a given slot when the current update
covers the entire buffer. This is relevant in particular for Qt Quick 3D
where such dynamic buffer changes are common.

Change-Id: If1e70d78968586b552a5357bc97af10cc61d9611
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
(cherry picked from commit 0c6375a346551dbf2effb2ea54e1df7de56f0849)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-03-15 12:14:42 +00:00
Laszlo Agocs
49c5851054 QOpenGLTexture: Fix typo in enum value
Fixes: QTBUG-91431
Change-Id: I59c37de527f53339130216997402f325d0badb12
Reviewed-by: Jonas Karlsson <jonas.karlsson@qt.io>
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
(cherry picked from commit 2cfbce4bc61fd1f450f221e6ce733753f6cabb0b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-03-15 12:14:40 +00:00
Fabian Kosmale
3858d1e913 Fix QMetaType benchmark
The benchmark used to crash because QMetaType::typeName would return an
empty string, which is not a legal value for newRow.

Change-Id: I9e6c6c1cf153943bfa21181cd2cca596a7943ea0
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
(cherry picked from commit 1316af2f3ed7861d0955793261a18f8ebf237f6f)
Fixes: QTBUG-91711
2021-03-15 08:33:58 +00:00
Thiago Macieira
0f7d433d6d QRandomGenerator: remove dead code previously used by qrand()
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>
2021-03-15 05:14:45 +00:00
Andrei Golubev
3c224d1122 Fix QMultiHash::count(key) crash
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>
2021-03-14 20:34:04 +00:00
Alexandru Croitor
0680c87856 Bump Apple platform minimum versions
Includes both minimum deployment targets and minimum sdk
versions.

As per supported Apple platforms versions which was done
in qt/qtdoc at
8807fdedce29cbbd7662fcd745234da30eace3fb

For Qt for iOS 6.0.x we only bump the minimum
deloyment target because applications seem to crash with iOS 12.4+,
and it's better to have a build error than a runtime error.

The minimum required sdk will not be bumped for 6.0.x, so we don't
accidentally break someone's existing build, given that 6.0 is already
released.

Task-number: QTCREATORBUG-23574
Change-Id: I3046384164f2d7fdbd0cfd16dcb85e0d60bc56ce
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 4b2035cd0f9a7c289c7a9e470fde83dae9351092)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-03-12 14:43:31 +00:00
Craig Scott
e2a11171ab qtdeclarative now directly handles more qml-specific logic
Associated changes in the qtdeclarative repo now ensure that arguments
for qml plugins are handled on the calling side. This reduces the
qml-specific logic needed in qtbase and gives qtdeclarative clearer
control over qml build and install locations.

As part of that work, the INSTALL_LOCATION keyword used in
qt_internal_record_rcc_object_files() has been renamed to
INSTALL_DIRECTORY to make it consistent with the keyword used for the
same concept in other commands.

Change-Id: Iebd319899f63d79fbe15ce965b84ce324c28a508
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 78a64e310efc9f3e91bda855fa8275caf10bea4f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-03-12 10:17:24 +00:00
Paul Wicking
47056c3b23 Doc: Add hyperlink to relevant section
Fixes: QTBUG-91734
Change-Id: I3910c7fcf1625ad08a65e691a8eaf9ed6b61779a
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit b42df9756a8d72cbdfbf72f15e98385b35148eb6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
v6.1.0-beta2
2021-03-12 08:00:56 +00:00
Paul Wicking
6db4495929 Doc: Change section titles that cause bad links
Section titles are valid targets for QDoc's autolinker. When
they are identical to other valid link targets, such as for
example a class, these sections may cause invalid links.

Fixes: QTBUG-91141
Change-Id: Ie9a6258d2bf83932335976d8c0b5fc59f2028ae5
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
(cherry picked from commit 5fa8f5df7bb722c5b7451229f5eecd13bd13326f)
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2021-03-12 06:37:10 +01:00
Volker Hilsheimer
42f364c494 Revert "QPushButton: fix support of style sheet rule for text alignment"
This reverts commit 6269438af95bbd988ead08829fa3bc9dc25891e8, and adds a test.

This change introduced QTBUG-91735, without fixing QTBUG-86857 correctly. The
code already interprets the textAlignment values from the rule, also if no
icon is set. Adding the same, or some default textAlignment to the text flags
if there is no icon doesn't work.

Fixes: QTBUG-91735
Task-number: QTBUG-86857
Change-Id: Iee07e63a40e72909275f32e1caa28b33a595f879
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit 674747bac1c8b57d4940de2ee68b6b562dfcad61)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-03-11 23:35:52 +00:00
Robert Löhning
cc6f0a6c35 Limit value in setFontSizeFromValue()
Avoids overflows in QFreetypeFace::computeSize and
QFontEngineBox::boundingBox

Fixes oss-fuzz issue 30290

Change-Id: If8e9ff74bf706a701e26832ad21b3439a3b437f7
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit 976fede67ca4a4d322bc8d2c00266a2e2f1a6e3d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-03-11 21:14:21 +00:00
Mårten Nordheim
ba0a105c61 QEventDispatcher(Win): Always honor interrupted status to avoid races
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>
2021-03-11 14:13:50 +00:00
Assam Boudjelthia
a1b83c3dd8 Android: use libexec path for rcc for Android deployment settings file
Task-number: QTBUG-88791
Change-Id: Ie34278496e0c23a8301e7ab0f2e33e36f393d1d8
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 15c2a79f19bdc3f0c0700aab1077950c2f99cf25)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-03-11 11:13:17 +00:00
Fabian Kosmale
7dfe36a9a0 tst_qguivariant benchmark: Only use valid QMetaTypes
Otherewise, we hit an assertion because the name is empty.

Fixes: QTBUG-91709
Change-Id: I03a530d64ea8dead3efc5fcb8c00909388a387d0
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit 3e46c22d943233554be8897ddda191cdfdb5e44e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-03-10 20:04:31 +00:00
Fabian Kosmale
6498e6f76d tst_bench_qguimetatype: only consider valid metatypes
Otherwise the benchmark crashes as the data tag for the row would be
empty.

Fixes: QTBUG-91708
Change-Id: I484ded5b8670571b80012e64d67846d3b8db5320
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit 90dc1f9204b8f44302b57392ba2fbfdc3653bdf2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-03-10 20:04:30 +00:00
Laszlo Agocs
0a7463715a rhi: metal: Avoid unused argument warning on iOS
Change-Id: I4cb729f3d8dbe7703b89153b742ce2874f35cfd2
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit dd7087342dc73ee7adf7b24fc96f79d9d1056682)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-03-10 17:32:53 +00:00
Laszlo Agocs
ae1869ab63 rhi: metal: Use the layer as the single source of truth
...when it comes to the output size.

This mirrors what all other backends do. For example, with Vulkan
the only source of size is the surface (VkSurfaceKHR), never the
QWindow, even though we'd expect that the surface size equals
to window_size * dpr, and that's almost always true, but there
are exceptions. (e.g. we have seen bugs on Windows with some drivers
in high DPI situations where the Vulkan surface did not fully match
the window size, yet it is the surface, and only the surface, that
matters for rendering, i.e. viewports and such must match the surface,
not the native window)

With Metal we hit a similar problem on iOS: the QWindow's size*dpr
and what we calculate from the CAMetalLayer have a height difference
of 1.

Mitigate this by making QRhiSwapChain::surfacePixelSize() and the
calculation for currentPixelSize() done via the same route (the
CAMetalLayer). Otherwise, if there is a mismatch between what the
QWindow and the layer says, Qt Quick will think that there is a
resize happening (has happened) whenever starting a new frame, and that
has far reaching consequences (suboptimal performance, increased
memory usage by buffers, etc.)

Change-Id: I114df92bf35622c99f2747420fdce401db7705a6
Fixes: QTBUG-91438
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 83fb8fe208ec816df7d04c8247d5696d95f2cab1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-03-10 17:32:44 +00:00
Laszlo Agocs
0b490df50f rhi: gl: Fix missing uniform data with certain command lists
Following patterns from the other backends is insufficient with OpenGL
because we do not use real uniform buffers. There is currently a
possibility that a shader program will be bound without following it
with setting uniforms. Correct this by having a second level of tracking
of the associated srb object in the pipelines.

Fixes: QTBUG-91630
Change-Id: I74a012daade826dd22c436bde06381c1233bad11
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
(cherry picked from commit 80029e0ca65d4bf4575f7a08d186c781ec6c2f0e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-03-10 09:07:23 +00:00
Craig Scott
58ac65008e Make qt_get_module_for_plugin() internal and do what its name says
Contrary to its name, this command was also setting a target property.
Since it was only called in one place and that caller can just as
easily set the property instead, rename the command to make clear its
internal nature and refactor it so that the caller is responsible for
setting that property instead.

Also make it an error rather than just a warning if the command is used
for a target that doesn't belong to any module. Since this is now
unambiguously an internal command, we should always expect the target
to belong to a module.

Change-Id: I929a652ddd482653868fc9df887f38f4bc7f35d9
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit c6bbca748659468b99002ec4b71559c65963b950)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-03-10 00:15:36 +00:00
David Faure
32d00fdfb3 QConcatenateTablesProxyModel: skip dataChanged in hidden columns
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>
2021-03-09 21:16:45 +00:00
Joerg Bornemann
ebd4d0cbf4 configure: Fix error when turning on/off non-emitted features
Features that are not emitted in the current
configuration (e.g. plugin-manifests on Linux) should not yield an
error. Instead, print a warning message like Qt5's configure did.

Set insignificant feature to OFF.

Remove the now unneeded emit_if parameter from
qt_feature_set_cache_value.

Fixes: QTBUG-88305
Change-Id: I0f2ce152fca5f08417038c9bd2c07639ff6a3df4
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit c4f5762b20dc20bab3cc62e9166d0e5b36e21cc6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-03-09 18:21:32 +00:00
Joerg Bornemann
e591f14117 Move syncqt.pl to libexec
To not disturb the qmake build we kept syncqt.pl in <src>/bin but
installed it to libexec. This is not necessary anymore.

This also removes the need for having syncqt.pl in both, bin and libexec
in the build dir of qtbase.

Fixes: QTBUG-91076
Change-Id: I44b014ea41e3f00c420e02fd5c76f11169340b8c
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
(cherry picked from commit 800f7451406d58910568854deb4dbebbca0ee6d4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-03-09 12:16:08 +00:00
Jan Grulich
4581f14ffd FileChooser portal: send window id in hex
We send window id in decimal, however, it is expected to be send in hex.
This causes a mismatch and makes portal dialog to show in background.

Change-Id: Ibd77199bbb4a2ad4782a0457ddc5506c6b5608fe
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit acaabc9108dfe75530960cf8e3ec4f3602cd82e0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-03-08 21:06:15 +00:00
Qiang Li
13cb272a70 Fix the crashes when animated QTreeWidgetItems are hidden
QTreeView's drawTree implementation performs lazy layouting
when calling itemDecorationAt. If animations are enabled,
this can change the list of items, and invalidate the copy
made earlier.

Don't copy the list of items, use a reference instead so that
code iterating over the items later operates on valid data.

Add an assert in the private itemHeight method, it must not
be called with an index that is out of bounds.

Fixes: QTBUG-42469
Change-Id: Ifdb782881447912e00baffd1c407de10a1d8d0d4
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit f140ef04a0c54c2c8a699db33433b8d7235d137c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-03-08 14:39:10 +00:00
Morten Johan Sørvig
667d0eb3c5 High-DPI: Set the minimum scale factor to 1
Avoid painting errors with dpr < 1, also for the PassThrough
mode.

This limits the minimum high-dpi scale factor to 1,
for the code path which determines the scale factor
based on screen DPI.

Task-number: QTBUG-89948
Change-Id: I14b3f130f0ae141d5f05c87437f926a9f76d1dec
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit ee409e6f0cab4aa051f75f7c7116d4b607d137fc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-03-08 10:47:53 +00:00
Toni Saario
93f46f303e Doc Build: Do not fail if CMakeCache.txt does not exist
If we skip module build the CMakeCache.txt does not exist.

Change-Id: Ic44bddf29f1eef1e6ffc568c871d9d7e7de71f48
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Simo Fält <simo.falt@qt.io>
(cherry picked from commit 22d692e9e01bcf486e2b268059c30998ca8b06bc)
2021-03-07 16:56:22 +00:00
Toni Saario
4f923348f5 Allow disabling module build and building of tests per module
This patch enables per module control of the build instructions.
This enables documentation building in modules that are not capable
of building the module itself on linux.

Change-Id: I72b7931c5ffda9bf437a99c27c0bb340665ce927
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Simo Fält <simo.falt@qt.io>
(cherry picked from commit 6172f3101e6606d48cca8424c5472af1daeefc17)
2021-03-07 16:56:20 +00:00
Toni Saario
9c0ba50658 Skip globalstatic threadStressTest on QEMU
The test causes frequent failures in the CI. This is the most
subtle fix until it is properly fixed.

Task-number: QTBUG-91423
Change-Id: I6499378dcd3ed1c31275db38d83b572e764366cc
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Samuli Piippo <samuli.piippo@qt.io>
(cherry picked from commit 49e93b6e3928e12507ec7956d66e79a2555c13a8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-03-07 16:56:12 +00:00
Øystein Heskestad
03332d8a00 Make qdecompresshelper archive bomb check only trigger for large files
This is to avoid false positives.
By default files are large if uncompressed size > 10 MB. Only configurable internally.
Also add auto tests.

Task-number: QTBUG-91392
Change-Id: I32258cb7c957f2a23a05157ba4ed5c0af2ba585e
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit be73ca7eb1cebcc15064666e647bc337b5c2baa2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-03-07 07:56:21 +00:00
Andreas Buhr
218b7c8a5b Add documentation for Q_OBJECT_BINDABLE_PROPERTY
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>
2021-03-07 07:56:13 +00:00
Joerg Bornemann
542f2036e7 Fix QT_HOST_LIBEXECS for cross-builds on Windows
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>
2021-03-07 08:56:03 +01:00
Joerg Bornemann
5618d51272 Complete the renaming of qt_add_tool to qt_internal_add_tool
Fix the name in the function's doc comment and error messages.

Change-Id: I918db802a0dbb0508f65d227f7c896d2ad0beeae
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Craig Scott <craig.scott@qt.io>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
(cherry picked from commit 728baba70a389dd13411819a4ec5db6004fb1e97)
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-03-07 08:55:57 +01:00
Joerg Bornemann
94f28c2ed0 Generate information about user-facing applications in build dir
When packaging different Qt versions for Linux distributions (or any
distribution with a common bin dir), Qt tools cannot be installed to
/usr/bin, because the executable names of the different Qt versions
clash.

To solve this conflict, our recommendation is to install Qt's tools to
/usr/lib/qt6/bin and to create versioned symlinks to user-facing tools
in /usr/bin.

User-facing tools are tools that are supposed to be started manually by
the user. They are marked in Qt's build system. Distro package
maintainers can now configure with
  -DCMAKE_INSTALL_PREFIX=/usr
  -DINSTALL_BINDIR=/usr/lib/qt6/bin
  -DINSTALL_PUBLICBINDIR=/usr/bin
and will find a file called user_facing_tool_links.txt in the build
directory after the cmake run. Nothing will be installed to
INSTALL_PUBLICBINDIR.

Each line of user_facing_tool_links.txt consists of the installation
path of a user-facing application followed by a space and the versioned
link name in INSTALL_PUBLICBINDIR.

Example content:
/usr/lib/qt6/bin/qmake /usr/bin/qmake6

To actually create the versioned symlinks, the content of this file can
be fed to ln like this:
  xargs ln -s < build-dir/user_facing_tool_links.txt

Or the package maintainer may decide to do something completely
different as suits their needs.

This patch adds the USER_FACING argument to qt_internal_add_tool to mark
tools as user-facing. In addition, every Qt created by
qt_internal_add_app is treated as user-facing.

The only tool this patch marks as user-facing in qtbase is qmake.

Fixes: QTBUG-89170
Change-Id: I52673b1c8d40f40f56a74203065553115e2c4de5
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
(cherry picked from commit b1ad7f938e2f71288e65a8c9a86b732b89a6a345)
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-03-07 08:55:52 +01:00
Thiago Macieira
82f4c5ebe5 QNetworkInterface/Unix: fix DNS eligibility of global addresses
[ChangeLog][QtNetwork][QNetworkInterface] Fixed the reporting the "DNS
eligibility" factor (QNetworkAddressEntry::dnsEligibility) for global IP
addresses. Previously, QNetworkInterface interface erroneously reported
all global addresses as eligible, regardless of whether they had already
been deprecated by the OS or were temporary in the first place.

From the tst_QNetworkInterface::dump output (netmask & broadcast
suppressed for readability, IPv6 prefixes changed to protect the
innocent, but the local part is exactly as found on my system):

   address  0: 192.168.26.33/24  dns-eligible preferred:33546998ms valid:33546998ms
   address  1: 2001:db8::800/128  dns-eligible preferred:264817000ms valid:264817000ms
   address  2: fd00::800/128  dns-eligible preferred:forever valid:forever
   address  3: 2001:db8::2f5b:342c:fc53:b9b2/64  dns-ineligible preferred:12422000ms valid:264817000ms
   address  4: fd00::9351:adff:333d:5c8d/64  dns-ineligible preferred:12421999ms valid:531402999ms
   address  5: fd00::7297:9516:fbb4:17ac/64  dns-ineligible preferred:0ms valid:445585999ms
   address  6: fd00::fdc8:e620:691:3b44/64  dns-eligible preferred:forever valid:forever
   address  7: 2001:db8::ae82:a01:5a8a:e210/64  dns-ineligible preferred:0ms valid:264816999ms
   address  8: 2001:db8::c673:e0a2:8927:2118/64  dns-eligible preferred:264816999ms valid:264816999ms
   address  9: fe80::bd89:b998:4aeb:a5d0%bond0/64  dns-ineligible preferred:forever valid:forever

Prior to this commit, only address 9 was showing as ineligible.

Addresses 1 and 2 come from DHCPv6 and are thus always eligible.
Addresses 3, 4, 5, and 7 are temporary addresses added on account of
RFC 4941 and are therefore ineligible (they have the IFA_F_TEMPORARY
flag set). Note how 5 and 7 have also stopped being preferred. Address 3
is the one I see when I go to ip6.me and address 4 is the one used to
reach the router.

Addresses 6, 8, and 9 are the "permanent" addresses that would normally
be based on the MAC address of the interface, but are actually in
"stable privacy" mode for me (RFC 8064). Address 9 is the link-local
one, which makes it ineligible, leaving the other two stable addresses
eligible.

Addresses 1, 3, 7, and 8 are global, from a DHCPv6-PD delegation from my
ISP, which is why they have finite lifetime. Addresses 2, 4, 5, and 6
are from my local Unique Local Address (ULA) prefix, which is why 2 and
6 are valid forever.

Change-Id: If8b43dc9678c4b4ba9c1fffd1668fdcae873c6bd
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 83876c025674eba9c932c108d355ba40e7789546)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-03-07 01:58:38 +00:00
Sona Kurazyan
4387b9ffea Improve docs for Qt Concurrent run with promise mode
For the readers that are new to QtConcurrent, it may be confusing that
unlike the normal usage of QPromise, they don't have to call start() or
finish() when using Qt Concurrent run with promise mode. Be more
explicit about that.

Change-Id: I08df6c4ca41bec4120e208a6643ee20c7adf265c
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
(cherry picked from commit fcc453df5cd03a24dad3328d930cc3ef2a1b05ef)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-03-05 22:36:21 +00:00
Timur Pocheptsov
e4efa00c72 Fix a BIC introduced by extending the namespace QSsl in _p.h files
Renamed the private part of the namespace to QTlsPrivate.

Pick-to: dev
Fixes: QTBUG-91531
Change-Id: Id2d9c458d8d958b35e437eee42889177dad0a7a7
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2021-03-05 19:35:23 +01:00
Paul Wicking
d23cd35e45 Doc: Fix section titles that confuse QDoc's autolinker
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>
2021-03-05 15:35:36 +00:00
Wang Yicun
bb1070e17a Simplify code, remove redundant condition
'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>
2021-03-05 15:35:35 +00:00
Volker Hilsheimer
d12df462c3 Protect against self-assignment, plug potential memory leak
Fixes static analyzer warning f03d95823e9f1395d64501cc111f0f63

As a drive-by, plug the potential memory leak if the assigned-to
QDockAreaLayoutItem already holds a QDockAreaLayoutInfo object.
The subinfo is deleted in the destructor, QDockAreaLayoutItem
has ownership for the subinfo.

Change-Id: I8546adc6fb0537078eea9dfb45d1bd9967d8d149
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 3ae09debab67eecc48721481b76fa11a9f9a383c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-03-05 11:14:19 +00:00