Commit Graph

51790 Commits

Author SHA1 Message Date
Mårten Nordheim
6725f0f77d Attributions: Don't mention QT_CRYPTOGRAPHICHASH_ONLY_SHA1
It's only meant for bootstrap builds.
Considering that SHA1 is deprecated by NIST we should not artificially
limit ourselves to using only that.

Task-number: QTBUG-93838
Change-Id: Ib779ad4e4349cfdc71d797eb3ba5ccfb7747e933
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-05-23 11:47:42 +00:00
Fabian Kosmale
3f7741000c QTestAccessible: Clear objects in EventList when deleted
The list persists events, which reference objects. Those objects might
get deleted by the time we investigate the objects. We cannot change the
event to store a QPointer for BIC reasons, and for normal usage of the
events, that doesn't make sense either.
Instead, connect the objects destroyed signal to a lambda which clears
the events' object member.
In order to access the private member, we befriend the test class.

Change-Id: I036be7053dccde4bdf862173789564e89d729ee1
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2021-05-23 10:46:03 +00:00
Nodir Temirkhodjaev
ffde36c9a3 qcborstreamreader.cpp: Use QT_TRY/QT_CATCH
To avoid build error with no exceptions:
qtbase/src/corelib/serialization/qcborstreamreader.cpp:1586:9: error: cannot use 'try' with exceptions disabled
        try {
        ^
qtbase/src/corelib/serialization/qcborstreamreader.cpp:1629:9: error: cannot use 'try' with exceptions disabled
        try {
        ^
2 errors generated.

Used compiler: https://github.com/mstorsjo/llvm-mingw

It's not a supported configuration, but the change is simple.

Change-Id: I263ce23b458f114b2330e832c5f4fd2a99cbb973
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-05-23 09:22:04 +00:00
Li Xinwei
19bb9837a1 Skip building debug bootstrap lib for CMake 3.20 and multi-config build
When building qtbase with CMake 3.20, only release tools will be built
by default in a multi-config build, so it is possible to skip building
debug bootstrap lib.

Task-number: QTBUG-88414
Change-Id: I266ac458ae3c89c593656e4ebdc788ae5797b788
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2021-05-23 14:00:53 +08:00
Friedemann Kleint
6fff7bb269 QTestlib: Fix formatting of pointers in QCOMPARE
After 1ed8a7bff5,
volatile needs to be specified for toString(), else it is not
used by compare_ptr_helper(). Add an overload.

Pick-to: 6.1 5.15
Change-Id: I3c335f324df346233623272d1014c8360ca33160
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-05-23 00:23:07 +02:00
Joerg Bornemann
895edcd7cd Support multiple equally named .qrc files in qt_add_big_resources
It is now possible to call qt_add_big_resources with multiple .qrc files
that are in different directories but have the same file name.
Before, this resulted in target name conflict errors.

Pick-to: 6.1
Fixes: QTBUG-93230
Change-Id: Ic3d9d6974a107163aeb7ada0b6f1fa113fb18de0
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-05-22 22:32:27 +02:00
Alexey Edelev
ecbf6c5b00 Add export of the Private targets for the internal modules
We need to export the Private targets of the internal modules to keep
compatibility with existing internal module users across repositories.

Amends 425ff34aa1

Fixes: QTBUG-93943
Change-Id: I10234cec1eb618b69d041f80fbe29620a4e307b9
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-05-22 18:07:02 +02:00
Giuseppe D'Angelo
8789ace197 QPromise: code tidies
Get rid of a reduntant initialization; a data member gets default
initialized anyways.

Change-Id: I85ad4c9a00b3066ccd993dfc2652a3f0164a860e
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
2021-05-22 03:20:32 +02:00
Giuseppe D'Angelo
41774f7597 QPromise/QFuture: fix value semantics
In random order:

* QFutureInterfaceBase has a d-pointer, and copy semantics. So,
"naturally" extend it to support move semantics as well. (These get
used by QPromise/QFuture, as they both hold a QFutureInterface*
as a data member). The only addition needed is a check for a null
d-pointer in the destructor.

Drive by, reorganize the code for the copies, and use copy-and-swap
instead of the hand-rolled solution. Also, add a free swap()
overload, and mark the existing one as candidate for inlining
in Qt 7 (doesn't need to be an exported function).

* QFutureInterface inherits QFutureInterfaceBase, again with value
semantics. To be honest, I'm not sure why QFutureInterfaceBase is
polymorphic -- could be a design mistake, as polymorphic classes
don't mix with value semantics. Anyways, reorganize the code for
copies, apply copy-and-swap, and add move semantics. This requires
adding a check into derefT().

* Finally, QPromise was already move-only, but had broken move
semantics: the move constructor was not noexcept (!) and it actually
allocated memory (!!!). Fix that one (can be defaulted now), and
streamline the move assignment via the proper macro.

Drive by, fix the signature of the constructor from QFutureInterface
(take const-ref, not plain ref -- it's eventually copied, so it
can keep the const), and add another internal constructor from
rvalue QFutureInterface that moves from it.

Change-Id: I9d61a9dd4d45f34942d8f34416baa118c0307390
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
2021-05-22 03:20:32 +02:00
Lorn Potter
a89754a2f3 wasm: fix tooltips show/hide behavior
When tool tip was trying to show its window became activated causing
tool tip to hide instantly due to a redundant window activation bug on
show/hide/raise/lower.

Fixes: QTBUG-91095
Change-Id: Id215400a79cdc4ed1961731949ca139b575eec88
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2021-05-21 21:26:51 +00:00
Lorn Potter
8c9fef0473 wasm: Fix visual representation to not show tool tip window title bar
Change-Id: I1adf841a97daa64cd8a0ae799235d99bf961171f
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2021-05-22 07:26:48 +10:00
Joerg Bornemann
c3b5ca129a rcc: Fix error message when temporary file cannot be opened
If rcc cannot open the file passed with --temp, display the path of the
temporary file, not the one of the output file.

Pick-to: 6.1
Change-Id: I58f8ab2f68ac2f1a19feb6b02974dff9fc8b7ec1
Reviewed-by: hjk <hjk@qt.io>
2021-05-21 23:15:42 +02:00
Mårten Nordheim
4da22d6534 tst_QDecompressHelper: Move pointer size check inside the test
For some reason the test case was (no longer?) detected by moc

Change-Id: I20f20de76479f7d9db43fae985cefe0869a7e203
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-05-21 21:13:47 +02:00
Tor Arne Vestbø
f9c850cc42 qmake: Pick default architecture on macOS based on uname
When dealing with a universal build of Qt, we would end up
using the QT_ARCH as the architecture for user projects,
but this architecture is always the primary one that Qt
was configured with.

Instead of relying on QT_ARCH, we start writing QT_ARCHS
(plural) to qconfig.pri, based on CMAKE_OSX_ARCHITECTURES,
and then use that to initialize QMAKE_APPLE_DEVICE_ARCHS.

We then resolve the active arch using uname -m, matching
what CMake does.

We still feed all the available architectures to the
Makefile or Xcode project, so that the user can build
for any of the available architectures without needing
a reconfigure.

Fixes: QTBUG-93760
Change-Id: I0d338241ba4d944ca36d85371e9c4df7dbc4f269
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-05-21 17:45:28 +00:00
Lars Schmertmann
46db337975 androiddeployqt: Refactor apkSignerRunner
Avoid to publish all local variables in the lambda and
only provide the necessary information as parameter.

Change-Id: Iea68280f79f90ac3d5f7b9a0a92e073865a1d291
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2021-05-21 16:05:44 +02:00
Alexey Edelev
34d33becd4 Make the internal Zlib module private
Rename Zlib module to adjust its name to the internal module naming
policy.

Change-Id: Ieb04842bd362a36fbf4247e3559b9907d29c28b8
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-05-21 16:05:44 +02:00
Alexey Edelev
715041b663 Enable UNICODE for all Qt targets and Qt consumers by default
After discussion we decided to opt-out the UNICODE definintion
behavior. To disable UNICODE in user projects the
qt6_disable_unicode_defines function could be used.

Amends 5b64e5950c

[ChangeLog][CMake] Enables the UNICODE and _UNICODE definitions on
WIN32 platforms by default for all cmake projects to reflect the
qmake behavior. Use qt6_disable_unicode_defines function to disable
the default unicode definitions.

Pick-to: 6.1
Fixes: QTBUG-93895
Change-Id: Id70ff7dcf8c74f660ec851f8b950e1e3b94d9fb4
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-05-21 16:05:44 +02:00
Allan Sandfeld Jensen
f1983dcdf6 Correct RGB to Grayscale conversion
The existing conversions weren't handling gamma correctly and used
an ad-hoc definition of gray instead of based on true luminance.

[ChangeLog][QtGui] RGB conversions to grayscale formats are now
gamma-corrected and produce color-space luminance values

Change-Id: I88ab870c8f5e502ddb053e6a14a75102239a26f2
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2021-05-21 15:37:32 +02:00
JiDe Zhang
b254855aa6 Use __has_* instead QT_HAS_*
Use __has_include instead QT_HAS_INCLUDE
Use __has_feature instead QT_HAS_FEATURE

Change-Id: If9b0af1f4386f7bcae6ca2fb911ffaba422750dd
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2021-05-21 21:37:32 +08:00
Giuseppe D'Angelo
bf22f91441 QFuture/QPromise: don't check for is_copy_constructible
The check is over-arching. is_move_constructible is sufficient;
we don't have to support "ridiculous" types that are copiable but
have deleted move operations (such types are fundamentally broken).
This is in line with the Move* (legacy) named requirements.

Change-Id: Idc7116b39013501b9be39628a4e7afd35fe15530
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
2021-05-21 11:08:11 +02:00
Albert Astals Cid
973700c546 Make sure _q_printerChanged is called even if only pdf printer is available
Otherwise things like the pagesRadioButton don't get properly disabled

Change-Id: Idc0693b6747f13da5afb22e2187af310a5b454f8
Pick-to: 6.1 5.15
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2021-05-21 11:03:18 +02:00
Robert Löhning
8862685805 QTextHtmlParserNode: Avoid invalid enum values
Fixes oss-fuzz issue 31027

Fixes: QTBUG-93072
Change-Id: I8c7fa31bae79221fbeaf84db7c839fc61c93d48e
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Nils Jeisecke <nils.jeisecke@saltation.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2021-05-21 10:32:47 +02:00
Eskil Abrahamsen Blomfeldt
11a40defff Fix memory leak when using small caps font
The small caps version of a font is kept as a QFontPrivate*
which is manually reference counted, but we neglected to
actually delete it when the reference count went to 0.

[ChangeLog][Fonts] Fixed a memory leak when initializing
a small caps font.

Fixes: QTBUG-93068
Pick-to: 6.1 5.15
Change-Id: Icc7fb7a59bf523da84d2e6fa026940a7d1230525
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Robert Löhning <robert.loehning@qt.io>
2021-05-20 21:38:25 +02:00
Mårten Nordheim
ea3a4a5003 QHttpNetworkConnectionPrivate::createAuthorization: refactor
Grab a reference to the channel instead of indexing into the array
repeatedly.

Change-Id: I114d571fcfcfd3a751346b513cec728dc2fcda0a
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-05-20 20:31:05 +02:00
Mårten Nordheim
55feb0d08a QHttpNetworkConnectionChannel: remove *authMethod
We store the authenticator right alongside it, which knows the
method.

The biggest change from this is changing a, self-proclaimed, duplicate
method from QHttpNetworkReply. Finding the method name ahead-of-time
is not actually needed, all we need to know is that a supported
authentication method is requested. Also moved that specific
functionality to a more logical location: QAuthenticatorPrivate.

Change-Id: I11627803ccb42b8ec33a28ef1d1e00bf60dc6da9
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2021-05-20 20:31:05 +02:00
Mårten Nordheim
5a701f5a7e Add function to QAuthenticatorPrivate to check method support
To see if a certain method is supported. To be used in an upcoming patch.

Change-Id: I1a5c2f655585331820701bb54f6991b4aba38273
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2021-05-20 20:31:05 +02:00
Allan Sandfeld Jensen
fe6dc9dc85 Add runtime ARM64 AES check
Adds runtime CPU detection for Windows and macOS, and switches feature
detection of AES to runtime like for x86,

So far only on ARM64, since gcc doesn't do function versioning on ARM32,
but clang can, so it could be added later.

Change-Id: Ibe5d60f48cdae3e366a8ecd6263534ba2b09b131
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-05-20 18:31:05 +00:00
Alexey Edelev
5b64e5950c Do not expose Qt internals by the HEADER_MODULEs
HEADER_MODULEs use the INTERFACE visibility to link libraries. This
causes a transitional propagating of the Qt-internal compile definitions
and options to the user targets.

This commit avoids an implicit adding of the Qt::PlatformModuleInternal
library to the HEADER_MODULEs and stops propagation of the Qt-internal
compile definitions and options. If module wants the transitional
propagation of some properties, this needs to be done explicitly.

Amends 8b7894cb63

Pick-to: 6.1
Fixes: QTBUG-89951
Change-Id: Ia9cecc38bac98eb5bc6e47d288308b49813ab5ac
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-05-20 20:31:05 +02:00
Tor Arne Vestbø
40878e7517 macOS: Restore logic to set wantsBestResolutionOpenGLSurface
The logic was removed in 1fc7ca091b when
we removed support for surface-backed views, based on the documentation
for wantsBestResolutionOpenGLSurface noting that layer-backed views
ignore the property.

But in some cases, when plugin views are embedded into host views, and
the host was built with a pre-10.14 SDK, AppKit seems to get confused,
and we still need to set this property.

Fixes: QTBUG-93770
Pick-to: 6.1
Change-Id: Id67f2fcb8c090c0e01c05d00792eaef311146df1
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-05-20 17:40:46 +00:00
Joerg Bornemann
9e8f43e5ac Fix qt6_add_big_resources
The qt6_add_big_resources command was dysfunctional whenever AUTOMOC was
enabled for a target.

We passed multiple object files with the --temp argument of the second
pass of rcc. We must pass exactly one. The spurious object file was the
one that's created by AUTOMOC. Turn off all of AUTOGEN for the C++
source file that's generated in the first pass of rcc.

Enable AUTOMOC for tests/auto/cmake/test_add_big_resource to cover this
situation.

Pick-to: 6.1
Fixes: QTBUG-85051
Change-Id: I6d2ce4953297db0751913456db0a4a126fe33f14
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-05-20 19:40:46 +02:00
Alexandru Croitor
c4df673dd9 CMake: Replace qt_finalize_executable with qt_finalize_target
It's very likely that we'll have to run certain finalizer code for
targets other than executables.

Rename qt_finalize_executable to _qt_internal_finalize_executable so
it's internal.

Introduce a new function qt_finalize_target which will call the above
internal one when the target is an executable.

This should future proof the API so we have a hook to call code for
any user CMake project that intends to use Qt CMake API.

Change-Id: I03f6f4dcba22461351c247a20241ca7de1a59c1d
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2021-05-20 19:40:45 +02:00
Morten Sørvig
560d839461 wasm: disable the canvas resize observer
We’re seeing crashes on tab close and also when the
page has been open for a minute or two. Skip installing
the handler until we figure out what’s wrong.

Pick-to: 5.15
Fixes: QTBUG-93713
Change-Id: Idd0c4d646de544ebdd2f4d00425faa08645335ac

Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: David Skoland <david.skoland@qt.io>
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
2021-05-20 19:40:45 +02:00
Andreas Buhr
f9e543b8a3 Document that QProperty::subscribe might get executed deferred
With the introduction of grouped property changes, notification
calls in bindable properties might be immediate or deferred,
depending on the context. This patch documents that one must not
rely on immediate execution of functions given to subscribe()
and onValueChanged().

Change-Id: I26ec4dbbff17a44ab62037ba1da9ce34c77da972
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-05-20 18:40:45 +01:00
Alexey Edelev
425ff34aa1 Merge main and private targets of the internal modules
In cmake, targets are used as an entity for modules. This causes a
number of problems when we want to manipulate a module as a separate
entity with properties associated with it.
The _qt_internal_module_interface_name target property is introduced to
represent the module entity. All modules write a name to this property,
which will subsequently expand into the module name matched with
the module name in qmake.

The 'qt_internal_module_info' function is responsible for providing the
correct values ​​for the module properties used when working with a module
target.

Unlike qmake, for internal modules in cmake it is expected that the
Private suffix will be specified explicitly. In case the user wants to
have a different module name, an additional argument
MODULE_INTERFACE_NAME of the qt_internal_add_module function is
introduced.

This also changes the way how target dependencies are collected and
resolved. Since the 'Private' suffix no longer means an unique
identifier of the module 'Private' part, we look for the both Private
and non-Private package names when resolving dependencies.

TODO: This change doesn't affect the existing internal modules, so to
keep compatibility with the existing code the existing internal modules
create 'Private' aliases. The code that provides backward compatibility
must be removed once all internal modules will get the proper names.

Taks-number: QTBUG-87775
Change-Id: Ib4f28341506fb2e73eee960a709e24c42bbcd5ec
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-05-20 19:40:45 +02:00
Tor Arne Vestbø
640eb55c13 macOS: Fix warning about comparing different types in QCocoaScreen::isOnline
Pick-to: 6.1
Change-Id: Ieb70108d22bf254c69665e5b3e3a2988703e26a2
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-05-20 17:56:47 +02:00
Tor Arne Vestbø
486b7a8f8a Type erase native interfaces via string instead of typeid
The latter forces users to build with RTTI enabled, as the typeid
use is in our public headers. Surprisingly this is also the case
even without instantiating the relevant template.

Change-Id: Icd18a2b85b250e0b77960797e5c43b7eaf9bd891
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-05-20 17:02:38 +02:00
Dongmei Wang
e253a30238 QFileSystemModel fails to locate a host from root's visible children
In QFileSystemModel, in some cases the hostname in a UNC path is
converted to lower case and stored in the root node's visibleChildren.
When QFileSystemModel sets the UNC path as the root path, it tries to
get the row number for the host, but it didn't convert the hostname to
lower case before getting the row number, which resulted in the host
not found in the root node's visible children. As a result, it returns
-1, an invalid row number. Change the behavior to find the node for the
host using the host name case-insensitive and then get the row number.

Fixes: QTBUG-71701
Pick-to: 5.15 6.0 6.1
Change-Id: Ib95c7b6d2bc22fd82f2789b7004b6fc82dfcb13b
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
2021-05-20 15:02:38 +00:00
Volker Hilsheimer
c2258e85a3 QXcb: don't dereference pointer before checking
The virtualDesktop pointer is expected to be populated by queryPointer, but
that method handles the case that there either is no reply, or that the
reply doesn't match, in which case the pointer remains nullptr.

Don't dereference it afterwards without checking.

Addresses code checker warning a179d1087759bb6ca9c3380257bd70d6

Pick-to: 6.1 5.15
Change-Id: I5877f26fd3b49327c0de3f2c918bb606bee8ac57
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2021-05-20 17:02:38 +02:00
Mårten Nordheim
a5dc381b4c QByteArrayView: add compare
There was previously no way to compare QByteArrayView to with another
QByteArrayView case-insensitively without allocating memory.

[ChangeLog][QtCore][QByteArrayView] Added compare(), enabling case
sensitive and insensitive comparison with other QByteArrayViews.

Change-Id: I7582cc414563ddbde26da35a568421edcc649f93
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-05-20 17:02:38 +02:00
Mårten Nordheim
e8297ba176 QByteArray: Move some free-functions around
Most of them go to qbytearrayalgorithms.h while the deprecated (inline)
version of qChecksum goes to qbytearrayview.h

In preparation for adding compare to QByteArrayView.

Change-Id: If7f65e9e7cd74838e11ebdb952309b811cef079d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-05-20 17:02:38 +02:00
Joerg Bornemann
4b09522c23 Add support for building and installing repo target sets
Introduce the concept of repository target sets, which is a named set of
targets within a Qt module repository.

In a Qt repository, a repo target set 'qtfoo' can be defined in the
top-level project file with
    qt_internal_define_repo_target_set(qtfoo DEPENDS Bar Baz)

The DEPENDS argument specifies Qt components that need to be
find_package'd when building the targets that belong to qtfoo.

In subdirectory project files, use
qt_internal_include_in_repo_target_set(qtfoo) to mark the file as
belonging to the repo target set.

To build and install a single repo target set, specify
QT_BUILD_SINGLE_REPO_TARGET_SET=qtfoo when configuring the Qt
repository.

Change-Id: Ic9e6213e3225988fd561f315bc857ee44ff17420
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-05-20 12:08:33 +02:00
Assam Boudjelthia
df022972b0 Don't throw an exception on platforms with no permission API
Using the permission API without guards for Android cause exception
on all other platforms, instead we can print a warning with the same
message if QT_DEBUG is defined to also make it less confusing for other
platforms.

Also, return QPermission::Authorized by default for platforms with no
implementation to this API.

Change-Id: Ie01a6a7f8b6a066685d32c861a56e9ded2c06410
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2021-05-20 09:26:42 +00:00
Alexandru Croitor
6fcc272ac9 CMake: Introduce finalizer mode handling of static plugins
Allow linking all plugin initializer object libraries directly
into the final target (executable or shared library).

The finalizer mode is triggered when the project adds a call
to qt_import_plugins, as well when the project has an explicit
call to qt_finalize_executable or when it is defer called by
CMake 3.19+.

Otherwise the old non-finalizer mode is used, where each plugin
initializer object library is propagated via the usage
requirements of its associated module.

A user can explicitly opt in or out of the new mode by calling
qt_enable_import_plugins_finalizer_mode(target TRUE/FALSE)

The implementation, at configure time, recursively collects all
dependencies of the target to extract a list of used Qt modules.

From each module we extract its list of associated plugins and
their genex conditions. These genexes are used to conditionally
link the plugins and the initializers.

Renamed QT_PLUGINS property to _qt_plugins, so we can safely query the
property even on INTERFACE libraries with lower CMake versions.
QT_PLUGINS is kept for backwards compatibility with projects already
using it, but should be removed in Qt 7.

The upside of the finalizer mode is that it avoids creating link
cycles (e.g. Gui -> SvgPlugin -> Gui case) which causes CMake to
duplicate the library on the link line, slowing down link time as well
as possibly breaking link order dependencies.

The downside is that finalizer mode can't cope with generator
expressions at the moment. So if a Qt module target is wrapped in a
generator expression, it's plugins will not be detected and thus
linked.

Task-number: QTBUG-80863
Task-number: QTBUG-92933
Change-Id: Ic40c8ae5807a154ed18fcac18b25f00864c8f143
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2021-05-20 00:55:46 +02:00
Karsten Heimrich
06689a2d7a Fix QUrl::fromLocalFile with long path prefix
After commit 3966b571 the function was kinda broken already, though
this got unnoticed since it was not covered by an the auto-test.
This commit adds another test case with Windows native separators
and removes the use of QDir::fromNativeSeparators. Instead use the
original code from QDir::fromNativeSeparators to replace the backslashes.

Pick-to: 5.15 6.0 6.1
Change-Id: I190560d0e75cb8c177d63b142aa4be5b01498da2
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2021-05-19 21:38:38 +02:00
Tor Arne Vestbø
f111c376d6 Granularily disable PCRE2 JIT on macOS ARM
2f8df4d1a8 disabled the PCRE2 JIT on macOS
for ARM, but did so based on the build system architecture configure
test. When doing a universal build these configure tests are based on
the primary architecture (x86_64 in our case), which means we ended up
still enabling the JIT.

We work around it by passing the PCRE2_DISABLE_JIT define only when
building the arm64 slice.

Change-Id: I60df82acb57030ccef8b117a40209eb107b1d5bd
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-05-19 20:00:56 +02:00
Giuseppe D'Angelo
9c89743d72 QKeyCombination: code tidies
* Use the new QFlags::toInt() instead of an explicit cast.

* Don't apply ~ to an enumerator and then convert the result to an
int; instead, convert the enumerator to int and then bitwise negate it.
The former is going to break in an upcoming commit.

Change-Id: I3a798d61452891d2f61f84e2d8e17237f47c5659
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2021-05-19 19:48:17 +02:00
Fabian Kosmale
d95e39a9b8 QNetworkAddressEntry: export QDebug stream operator
It already existed, but was only used internally in QNetworkInterface's
debug stream operator.

Change-Id: I36c2b4f6cb228df2f92ec92cc879b6d34f1e3ea1
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2021-05-19 19:48:17 +02:00
Laszlo Agocs
8827cd657d rhi: gl: Add support for importing an existing renderbuffer object
Normally we only allow creating wrappers for texture objects. These
can then be used with a QRhiTextureRenderTarget to allow rendering into
an externally created texture.

With OpenGL (ES), there are additional, special cases, especially on
embedded. Consider EGLImages for example. An EGLImageKHR can be bound to
a renderbuffer object (glEGLImageTargetRenderbufferStorageOES), which
can then be associated with a framebuffer object to allow rendering into
the external buffer represented by the EGLImage. To implement the same
via QRhi one needs a way to create a wrapping QRhiRenderBuffer for the
native OpenGL renderbuffer object.

Here we add a createFrom() to QRhiRenderBuffer, while providing a dummy,
default implementation. The only real implementation is in the OpenGL
backend, which simply takes a renderbuffer id, without taking ownership.

Task-number: QTBUG-92116
Change-Id: I4e68e665fb35a7d7803b7780db901c8bed5740e2
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2021-05-19 17:35:35 +02:00
Allan Sandfeld Jensen
2d9cc639a4 Avoid mixing atomic futex changes and QAtomic
Either the mix of futex and atomic, or the mix of 32-bit futex and
64-bit atomic doesn't work. In any case, the existing code leads to
bad behavior.

Pick-to: 6.1 5.15
Fixes: QTBUG-92188
Change-Id: Icc6ba28d6e2465c373d00e84f4da2b92c037e797
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2021-05-19 16:27:52 +02:00
Mårten Nordheim
2ced64d240 QStringTokenizer: Add a benchmark
Mostly for testing QLatin1String::indexOf optimizations in the next
patch but useful in general

Change-Id: I85bf76f3e1d5abb994fd12907db2f2a723a8d330
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-05-19 16:27:52 +02:00