Commit Graph

51676 Commits

Author SHA1 Message Date
Craig Scott
d97fd7af2b Build examples in isolated sub-builds using ExternalProject
Examples are intended to show how to build against an installed Qt.
Building them as part of the main build means the way the Qt targets
are defined and created are not representative of an end user's build.
By building them as separate projects using ExternalProject, we can
more closely replicate the intended audience's environment. This
should allow us to catch more problems earlier.

Having examples built as part of the main build also creates problems
with some static builds where a tool built by the main build is needed
during configure time. This happens with other repos like qtdeclarative
but not (currently) with qtbase. Converting the examples in qtbase to
be built using ExternalProject is intended as a demonstrator for how
other repos can do similar. Until other repos are converted, they will
continue to work as they did before, with examples as part of the main
build for non-static builds only.

The new build-externally behavior is only supported for non-prefix
builds with this change. Prefix builds will continue to use the old
non-external method. Support for building examples externally in
prefix builds will be a separate change.

Task-number: QTBUG-90820
Fixes: QTBUG-91068
Change-Id: I2304329940568dbdb7da18d54d5595ea7d8668bc
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-05-26 13:33:29 +02:00
Mårten Nordheim
9b5fadb9f8 Android: fix missing include
qtbase/include/QtCore/../../../../src/qtbase/src/corelib/kernel/qcoreapplication_platform.h:58:57: error: unknown type name 'QCoreApplication'
    QT_DECLARE_NATIVE_INTERFACE(QAndroidApplication, 1, QCoreApplication)

Change-Id: I0a14a2f2ab80f9cc0e7fd3b3060719a1c772bf57
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2021-05-26 13:28:44 +02:00
Andreas Buhr
7d760480c0 Initialize SYSTEMTIME to {} instead of memset()ing
Change-Id: I7ee02a6bcf5961adce26b635f12722e12c4865d3
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-05-26 13:08:09 +02:00
Paul Wicking
a1dfe27955 Doc: Use \deprecated instead of \obsolete
Task-number: QTBUG-93990
Change-Id: I4e512354a49dde6678ca89cabc56bc76ba666bb3
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-05-26 13:06:56 +02:00
Friedemann Kleint
ae02188233 QTestlib: Add formatting for QObject * in QCOMPARE
Output object name and class in QCOMPARE(). This should help
to debug flaky QWidget tests that for example check on focusWidget().

[ChangeLog][QtTestLib] QCOMPARE() now reports QObject * values by class and objectName().

Task-number: QTBUG-64446
Change-Id: Ife04e89bba04fc78d077c8f0f07af17a17c9cf8c
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-05-26 11:02:48 +00:00
Aleksei Nikiforov
25a7034d78 Qt xcb: remove false detects of Qt::GroupSwitchModifier
In some cases, if X11 is configured with CapsLock as
keyboard language switch key, and CapsLock is toggled
via Shift+CapsLock key combination,
toggled CapsLock is falsely detected as Qt::GroupSwitchModifier
for subsequent key events.

This change fixes this false detect,
but doesn't fix detection of Qt::GroupSwitchModifier
which is likely still broken.

Fixes: QTBUG-49771
Pick-to: 5.15 6.0 6.1
Change-Id: I485e2d4f3c654707c62adaba367c1b8afb3fc36c
Reviewed-by: Liang Qi <liang.qi@qt.io>
2021-05-26 11:02:08 +00:00
Tor Arne Vestbø
d790e9fda9 Blacklist problematic network auto-tests on macOS ARM
QNetworkInterface reports as up and running an interface,
seemingly having a valid IP address which actually has
not IPv4/IPv6 configured at all (this is what getifaddrs
gives us).

Change-Id: I5808d5dfdbc54004a1e02b791917e9b2ba62905f
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2021-05-26 12:49:56 +02:00
Giuseppe D'Angelo
4b60cea602 Farewell Q_DISABLE_MOVE
In hindsight, this macro is an API mistake, as it should NEVER be used
alone, but always in combination with Q_DISABLE_COPY. But in that case,
there's a better macro: Q_DISABLE_COPY_MOVE; hence this API is either
bad, or completely redundant.

A GitHub search reveals that luckily there's a handful of usages in the
wild (of which 0 in Qt/dev and KDE). Hence, I'm going for the kill, and
removing it entirely.

[ChangeLog][Source-Incompatible Changes][QtGlobal] The Q_DISABLE_MOVE
macro has been removed. Code that was using it can be ported to
Q_DISABLE_COPY_MOVE instead.

Change-Id: I7e346f7e2288f3f5a45315f4f6bfaeb2661f1de5
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2021-05-26 03:14:52 +02:00
Tor Arne Vestbø
f20edffcc8 testlib: Disable automatic backtrace when test crashes on macOS on ARM
The trick we use by spawning lldb to print the backtrace doesn't work
for some reason, and just results in:

    Process 91619 stopped
    * thread #1, stop reason = signal SIGSTOP
        frame #0: 0xffffffffffffffff
    Target 0: (No executable module.) stopped.

    Architecture set to: .
    (lldb) bt all
    * thread #1, stop reason = signal SIGSTOP
      frame #0: 0xffffffffffffffff
      thread #2
        frame #0: 0xffffffffffffffff
      thread #3
        frame #0: 0xffffffffffffffff
      thread #4
        frame #0: 0xffffffffffffffff

Debugging the stopped process manually with lldb works fine.

Change-Id: If5582803a11f1c5c84c31b42d1ae52bdd245bbbb
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-05-26 03:14:52 +02:00
Tor Arne Vestbø
d4cff8c537 Fix wrong variable initialization in tst_QScrollBar::task_209492
Change-Id: Icf1f6da46caa7fb7f3bd308eaaf4e037af814d17
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-05-26 03:14:52 +02:00
Edward Welbourne
55765898fe Initialize SYSTEMTIME to {} instead of memset()ing
Change-Id: Ic17b90d10d6b5b7f4610e904e18979fc1d658a0a
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-05-25 22:55:14 +02:00
Fabian Kosmale
e16afd66fc gcc 11: Adjust pragma warning placement
Apparently, gcc's pragma warning logic has changed from 10 -> 11. For
gcc 11, we need to place the macro directly next to the the line which
triggers the warning.

Task-number: QTBUG-93360
Pick-to: 6.1
Change-Id: Ifaa6136050fe5b887660a8a0acf6938388f4f77d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-05-25 22:54:55 +02:00
Alexandru Croitor
c3c8b7083a CMake: Remove some dead installation code
It was copy-pasted (presumably from plugin handling code)
when initially introduced but was never used.

Change-Id: I571738b9f5269ca038f5931a773aa5c2c66aafbc
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2021-05-25 22:36:56 +02:00
Alexandru Croitor
1bd408d6f7 CMake: Introduce a public qt_add_library function
Internally it uses a new _qt_internal_add_library function (similar
how we have qt_add_executable and _qt_internal_add_executable) as well
as finalizer code line the executable case.

_qt_internal_add_library forwards arguments to add_library with some
Qt specific adjustments to the selected default target type (based on
whether Qt is configured as static or shared).

The new _qt_internal_add_library is now used in qt_add_plugin as well
as some internal library creating functions like
qt_internal_add_module.

This reduces some duplication of file name adjustments across
functions and creates a central point for creation of Qt-like
libraries (for some definition of Qt-like).

Change-Id: Id9a31fe6bf278c8c3bb1e61e00a9febf7f1a2664
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-05-25 22:36:53 +02:00
Fabian Kosmale
5e96c64afb QSharedPointer: Use matching new/delete
When a weak pointer calls getAndRef and there is no strong reference
yet, getAndRef creates a new ExternalRefCountData. Normally,
ExternalRefCountData is never constructed directly, only its subclasses
are constructed via placement new into a memory buffer.
To that end, ExternalRefCountData has a custom operator delete, which
calls the global operator delete (do deallocate the memory buffer
correctly).
When using operator new directly in getAndRef, gcc notices a new/delete
mismatch with the delete in the same function: global operator new
matched with class operator delete. This isn't actually an issue in
practice, as the class operator delete simply calls the global delete.
But to avoid the warning, we can simply call the global operators
explicitly.
To make it clear that allocation of ExternalRefCountData requires some
care, we additionally delete the class operator new, and only allow
placement new (or usage of global operator new, as in getAndRef).

Pick-to: 6.1
Task-number: QTBUG-93360
Change-Id: I132d1e4e07520eadc5b8f3f955c06aecec80c646
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-05-25 22:23:57 +02:00
Andrey Butirsky
b45b9090c3 qxkbcommon: Map Super/Hyper to Meta early enough to have an effect
Super/Hyper keys are detected during a direct mapping phase, but the
function returned before the translation to Meta could take place.

Task-number: QTBUG-62102
Pick-to: 5.15 6.0 6.1
Change-Id: I9f7ccfd757fa86dbc648951306deb1b43ccf4167
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Andrey Butirsky <butirsky@gmail.com>
2021-05-25 20:02:12 +00:00
Friedemann Kleint
cb881f7c97 uic: Add further widgets to class lib map
It should be possible to use them with promotion.

Task-number: PYSIDE-1404
Change-Id: Idea0ab076c66d2842958eabf66e5dc4f8e1bad3f
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2021-05-25 22:01:56 +02:00
Friedemann Kleint
4b82c1c727 uic: Extract a base class for WriteIncludes
Extract base class WriteIncludesBase from WriteIncludes which
basically adds the dependent classes.
Move the classlibmap there as well.

Task-number: PYSIDE-1404
Change-Id: I899c7818cb96dd3b1af5f328cd20d64fbaf7755b
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: Christian Tismer <tismer@stackless.com>
2021-05-25 22:01:53 +02:00
Andrey Butirsky
6ecde6265a qxkbcommon: Keep lower case as Qt key when upper case is not in Latin1
Upper-casing a Latin1 character might move it out of Latin1 range,
for example U+00B5 MICRO SIGN, which upper-case equivalent is
U+039C GREEK CAPITAL LETTER MU. If that's the case, then map the
original lower-case character.

Fixes: QTBUG-93858
Pick-to: 5.15 6.0 6.1
Change-Id: Ibd86fbb7c70d620c0884015ec1c40aa6351e6320
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Andrey Butirsky <butirsky@gmail.com>
2021-05-25 15:29:49 +00:00
Xiao YaoBing
6519bcf85d Remove unnecessary type conversion
Change-Id: Ic362f6647d8eaf2004d3bd5e1c6d6411cfb31d86
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2021-05-25 23:06:17 +08:00
Haoyu Liu
c3804ba061 CMake: fix CMake function qt_commandline_addString
1. a missing '}' breaks CMake
2. the variable "opt" should really be "arg", otherwise it'll be meaningless

Pick-to: 6.1
Change-Id: If29557998bf7aa786dc5c821e2c55f1195e7922b
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2021-05-25 12:28:32 +00:00
Kimmo Ollila
95c6eb2f2e Add #include <mutex>
Needed for having std::unique_lock

Pick-to: 6.1
Change-Id: I3665e9e2afab0d9230778b8b36f2b7f0c8f44a2a
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2021-05-25 15:28:32 +03:00
Giuseppe D'Angelo
0c7e653ffd QDateTime(Parser): code tidies
Fixup a bunch of QFlags usage that ended up triggering implicit
conversions. These conversions happen because QDateTime tries to save
some space and shove a QFlags value in a bitfield, so there's
no way around them; use explicit conversions instead.

In other places: fix QFlags->bool conversions by using testAnyFlag.

Change-Id: I50e8d92ed829b64ac46097c09e547e1c89cc2e35
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-05-25 13:38:44 +02:00
Paul Wicking
3bc80defdc Doc: Add missing preposition
Fixes: QTBUG-93969
Pick-to: 6.1
Change-Id: I60e08ab7f17459b6cff969767273228a8406cfc3
Reviewed-by: Johanna Vanhatapio <johanna.vanhatapio@qt.io>
2021-05-25 12:36:09 +02:00
Pekka Gehör
32cdf0ce0f Android: Fix select handles misplacement on QDialog
Get select handles {Left, Right}Point from a mapToGlobal with a cursorRectangleof anchorRectangle
of the selected word/text.

Task-number: QTBUG-90799
Change-Id: I4fed19a1d3bb2247656b052306307e6980074405
Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
2021-05-25 08:45:39 +03:00
Iikka Eklund
13c8db52a2 Add conanfile.py to support builds with Conan package manager
Initial version of the conanfile.py to support builds with Conan
package manager. Tested with Linux, macOS and Windows desktop
builds first.

Use 'scm' revision_mode so that the revision matches with the git
commit id.

The recipe uses Qt's configure(.bat) and cmake directly,
'conans.CMake' utility tool is not used.

Load options dynamically based on configure(.bat) features:
- configure(.bat) -write-options-for-conan <output file>
  - Expose all usable configure(.bat) options as Conan options
- We want to query configure(.bat) for available options and
  features to avoid duplicating these in multiple places
- The available configure(.bat) option names are formatted to
  suit as dictionary keys in Conan 'options'

The recipe writes 'configure_options.json' and
'configure_features.txt' which are exported as part of the
conan package. This is done only once during the 'conan export'
i.e. when the initial Conan package is being created.
The recipe will reference these files in later phases when needed.

The recipe translates the Qt configure options and features as
Conan options and default_options. When the build is invoked
('conan install') the recipe translates the Conan options back
to suitable Qt configure options which are then passed to
configure(.bat).

Additional cmake flags can be passed via 'extra_cmake_args' option:

  $conan install ... -o extra_cmake_args="-DFOO=bar -DFOO2=bar2"

Remove those options from 'package_id' that point to local environment
like installation paths. These are most probably different on end user
machines making it impossible to re-use the pre-built binaries by Qt CI
as the path values would become of the 'package_id' checksum.

Task-number: QTBUG-92031
Change-Id: I4e47d116fdef6a5daa23aba22bac2b2d74d12c6e
Reviewed-by: Toni Saario <toni.saario@qt.io>
2021-05-24 14:24:34 +03:00
Janne Koskinen
bd31bb4166 Fix compilation for other compilers
Fixes property offset macro compilation issues.

Change-Id: I401a9a35acd1d389c670960edb363a4d919cdb76
Reviewed-by: Kimmo Ollila <kimmo.ollila@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-05-24 10:18:25 +03:00
Giuseppe D'Angelo
0fecaaec54 QUrl: use QFlags::toInt / qToUnderlying
In preparation for blocking QFlags->int conversions. The existing
casts to uint are wrong, in the general case, as the enumeration
might actually be backed by signed integers; that makes them
fail to compile. Port them to toInt(). For symmetry, also use
qToUnderlying.

Change-Id: I851544f6ba05295fa5f6c5cc355b9de0f1362e2b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-05-23 21:54:29 +02:00
Thiago Macieira
64bfc927b0 QHash: fix qHash(std::pair)
There were two problems here: first, qHash(std::pair) must be declared
before qHashMulti that might call back to qHash(std::pair) (i.e., a pair
with one element that is also a pair). But moving the declaration above
causes the second problem: the noexcept expression can't refer to qHash
functions that aren't declared yet. So we forward-declare a constexpr
function for that result, but implement it far below.

Fixes: QTBUG-92910
Change-Id: Ia8e48103a54446509e3bfffd16767ed2e29b026c
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-05-23 12:08:43 -07:00
Thiago Macieira
a5ff71578d QRandomGenerator: let qt_initial_random_value() return 128 bits of data
It's how much there is in Linux's AT_RANDOM block.

I've also removed the check for validity. It's highly unlikely that 128
bits are bad.

Change-Id: Id2983978ad544ff79911fffd16723161ea7ec315
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2021-05-23 12:08:43 -07:00
Thiago Macieira
928ce402a4 QHash & QRandomGenerator: cooperate to provide a simpler initial seed
Instead of initializing the whole QRandomGenerator::system(), which in
turn gets to checking CPUID and whether the HWRNG works, trust the
operating system functions for an initial value. On Linux, we'll use 4
or 8 of the 16 bytes of random data that the kernel populates for us on
AT_RANDOM.

This should make Qt applications not stall on an early system launch
without an RNG daemon, if compiled without getentropy() support. And
avoids silly mistakes causing recursion, like QTBUG-78007 found.

Additionally, qt_random_initial_value() will most likely not throw
either. It's marked noexcept, even though SystemGenerator::fillBuffer
could throw on Linux, if the current thread is canceled, but Linux also
has AT_RANDOM. That leaves the other Unix systems without getentropy()
(read: macOS, since the BSDs have getentropy()).

Fixes: QTBUG-69555
Change-Id: Id2983978ad544ff79911fffd1671fca1a9f9044d
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2021-05-23 12:08:43 -07:00
Thiago Macieira
4ef99b8fbb Deprecate qGlobalQHashSeed and qSetGlobalQHashSeed in Qt 6.6
That's two years from when the replacements were added (6.2).

Change-Id: Id2983978ad544ff79911fffd1671f7dd38fede02
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2021-05-23 12:08:43 -07:00
Thiago Macieira
a24ced7474 Mark QHashSeed::globalSeed() noexcept
It is noexcept, except when initializing. When initializing, let's just
use qEnvironmentVariableIntValue (which we should have used anyway),
which avoids the memory allocation and is noexcept. The QRandomGenerator
functions are not marked noexcept, but are mostly so: they can't throw
regular exceptions, but some implementations do call POSIX Thread
Cancellation Points, which may cause forced stack unwinding. That's
unlikely to happen at the moment of the QHash initialization.

This is also mitigated in the next commit.

Change-Id: Id2983978ad544ff79911fffd1671fd16f8d6378d
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2021-05-23 12:08:42 -07:00
Thiago Macieira
7ac0621ad1 Introduce QHashSeed and switch to size_t seeds
Commit 37e0953613 added a to-do, but we
can actually change the type, since we've documented since Qt 5.10 that
setting a non-zero value (aside from -1) with qSetGlobalQHashSeed was
not allowed. Storing a value to be reset later is simply not supported.

Change-Id: Id2983978ad544ff79911fffd1671f7b5de284bab
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2021-05-23 12:08:42 -07:00
Alexey Edelev
ffe5f92546 Add _qt_module_interface_name for 3rdparty libraries
Since we add 3rdparty libraries to the set of the Qt modules, they are
treated as the Qt modules by the depenedcy helper as well. So give them
_qt_module_interface_name to fix dependency helper.

Amends 425ff34aa1

Change-Id: I5898c1c90156de1878aeeef5a0924349b44c50fa
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2021-05-23 16:16:09 +02:00
Alex Trotsenko
76bd873030 QProcess/Unix: fix build in debug mode
qprocess_unix.cpp:633:55: error: ‘i’ was not declared in this scope

Change-Id: I152fbd9df6e9d3f31e2c2c8b23a3c1ab87aa237a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-05-23 16:04:57 +03:00
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