Commit Graph

55665 Commits

Author SHA1 Message Date
Fabian Kosmale
8f73b25e52 Benchmarks: Do not depend on transitive includes
Change-Id: I1d0dbfca130f43d76de2d6ac585a0f242d490b5a
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2022-03-17 17:14:37 +01:00
Fabian Kosmale
819e1bf91d Tests: Do not depend on transitive includes
Change-Id: Ibc6a948480a904913a5427e6408d4d296784fb4f
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
2022-03-17 17:14:37 +01:00
Fabian Kosmale
468e9c13a9 Misc: Do not depend on transitive includes
As a drive-by, remove superfluous includes from qnetworkmanagerservice.h
and obey the coding conventions for includes in a few more places.

Change-Id: I65b68c0cef7598d06a125e97637040392d4be9ff
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-03-17 17:14:37 +01:00
Fabian Kosmale
49b25ab07b XCB: Do not depend on transitive includes
As a drive-by, follow the coding convention when including qobject.h

Change-Id: I73066646d7f03ee0138e70567738e296b2183f63
Reviewed-by: Liang Qi <liang.qi@qt.io>
2022-03-17 17:14:37 +01:00
Fabian Kosmale
e4ab3e39e1 Sql: Do not depend on transitive includes
Change-Id: I9407c34c9fb6add655649dd7058bce7a25be5f5d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-03-17 17:14:37 +01:00
Fabian Kosmale
b73ce88998 Network: Do not depend on transitive includes
Change-Id: Ie37a4d332ff808e2524b1742fa70dc07992fa8c7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-03-17 17:14:37 +01:00
Fabian Kosmale
b5b4d0ec06 Widgets: Do not depend on transitive includes
Change-Id: Idfd7af066264dd38375d45771693a536a1985607
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2022-03-17 17:14:37 +01:00
Fabian Kosmale
caed0c3ac3 Gui: Do not depend on transitive includes
Change-Id: I27321235d9c8428de0cff1e22a618299b9e5a97f
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2022-03-17 17:14:37 +01:00
Fabian Kosmale
ffa5820fa3 Core: Do not depend on transitive includes
Change-Id: I2c71188a4d27692a2d6ef1aa447b329627214b17
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2022-03-17 17:14:36 +01:00
Ulf Hermann
03b281a0f2 QColor: Explicitly return std::nullopt
gcc 10.2 struggles with returning just {} when compiling in release mode
with debug symbols. std::nullopt is also more readable.

Change-Id: Ib050d47e8741ee87bef865dd55ecba622faf25b4
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2022-03-17 17:14:36 +01:00
Ulf Hermann
98b8818ad7 QMetaObject: Allow custom meta calls
Add a new entry to the Call enum that can be used by dynamic meta
objects to encode their own metaCall variations.

Change-Id: I7890d11924ab99311b6f016ce97d2ab483c26d27
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2022-03-17 17:14:36 +01:00
Giuseppe D'Angelo
5089db0303 QFuture: fix QtFuture::connect corner-cases
Connecting to nullptr, or connecting to a non-signal PMF, would result
in a QFuture which would never finish. Catch these cases and handle
them.

Windows+MSVC for some reason fails the test. I can't entirely understand
why, so I've marked it as XFAIL, with QTBUG-101761 to track it.

Change-Id: I314980e7e9b7156d8cddd3b33d5cbf1d0bcd6116
Pick-to: 6.2 6.3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
2022-03-17 17:14:36 +01:00
Alexandru Croitor
440438092b coin: Use configure and qt-configure-module in instructions
We want to use configure and qt-configure-module when building in
Coin, rather than pure cmake and qt-cmake.

There are a few benefits:
- CI tests the scripts, making sure we don't introduce regressions
- CI uses the same scripts that we mention in our documentation for
developers to use
- The platform configurations become a bit less verbose and easier to
read due to less shouty-case CMake options

To ensure a more gradual porting, Coin will only use the new
instructions if the 'UseConfigure' feature is set on a platform
configuration in qt5.git. This allows going back to the old
instructions in case if something isn't working properly.

Due the opt-in, we need to support both old and new instructions in
the implementation.

The change strives to remove as much duplicate code as possible,
by moving it into common includes.

The README.md is updated to mention the overview of how the different
environment variables are used.

There are a few important things to point out.

1) Because during the porting we have to allow mixing of the old style
and new style, platform configs have to separate CMake-style options
from configure-style options in different environment variables.
Otherwise the instructions wouldn't be able to create a valid
configure call, where all CMake-style options have to go at the end
after a double dash --.

After all platform configs are ported to the new style, it should be
possible to combine all the options in a single environment variable
if that is desired, but it will require another round of porting to
remove all the '-D' prefixes in CMake-style options, and just use
regular variable assignment which configure supports.
e.g. -DQT_BUILD_EXAMPLES=ON becomes QT_BUILD_EXAMPLES=ON, which can be
mixed in-between configure-style args.

2) Configure is more strict in that it doesn't allow passing
unknown options. Due to that, we can't pass non-qtbase configure
options via NON_QTBASE_CONFIGURE_ARGS. qt-configure-module would
error out in the repos where the configure option is unknown.
Because we don't have a Coin configure variable for each repo,
we circumvent the issue by continuing to pass CMake-style options via
NON_QTBASE_CMAKE_ARGS instead, which does not do validation checks.
In the future, we could introduce a configure flag that disables
the validation checks.

Pick-to: 6.2 6.3
Task-number: QTQAINFRA-4357
Task-number: QTQAINFRA-4815
Change-Id: I72d8ba0b3a543b42982e22ae8d6566c0e885c446
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Toni Saario <toni.saario@qt.io>
2022-03-17 17:14:36 +01:00
Toni Saario
b3ec373e2f Remove useless error messaging
This part originates from when the CMake was being introduced and
now things are stable enough that the bug rarely is everywhere.

Pick-to: 6.2 6.3
Task-number: COIN-828
Change-Id: Ifb7b5ce82740f5ae49f712f9666870993ce00b15
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-03-17 16:14:36 +00:00
Alexey Edelev
97ef7752a2 Remove the LINK_LANGUAGE genex condition when generating .pc file
Conditions with the LINK_LANGUAGE genex are not parsed correctly when
generating .pc file. So link options will be added unconditionally.

Amends d1e02c3855

Pick-to: 6.2 6.3
Fixes: QTBUG-101723
Change-Id: Ib837b3f3429d195a469450ef25af9630ad7d15e2
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-03-17 16:25:00 +01:00
Alexey Edelev
8adacba3e6 Add VERBATIM option to add_custom_command calls
Use VERBATIM option to prepare the correct command line for the
add_custom_command. This especially sensitive when using build
directories with names containing special symbols, that cannot be
handled by shell correctly.

Change-Id: I51d7041cb806411135fd59bf6273c04a3c695443
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-03-17 15:15:06 +01:00
Mårten Nordheim
74bef86da8 QVulkanWindow: fix QByteArray::count deprecation warning
By using QBA::size

Change-Id: I716c0e27230cd46e92ca5521d9a19cb296e221bd
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
2022-03-17 14:15:06 +00:00
Sona Kurazyan
893dd5d7be Add QStringView::localeAwareCompare()
QString already has a localeAwareCompare(QStringView, QStringView)
static method. Use it in QStringView::localeAwareCompare(QStringView).

[ChangeLog][QtCore][QStringView] Added
QStringView::localeAwareCompare().

Task-number: QTBUG-98431
Change-Id: Iec3865a5439d9fb653cc1150da21042186bdee98
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2022-03-17 14:27:45 +01:00
Sona Kurazyan
b86b22cfde Move localeAwareCompare tests from tst_qstring to tst_qstringapisymmetry
Pick-to: 6.3 6.2
Change-Id: I3c395d989e4659ebfa24b78f34b2a99769b734dc
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2022-03-17 14:27:45 +01:00
Liang Qi
f08e57540d GUI: add ScreenWindowGrabbing capability
On Wayland, there is no protocol to do it yet.

Task-number: QTBUG-100792
Task-number: QTBUG-101145
Change-Id: Id72625a8161359111a2d0f43f3215e787778ba6b
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2022-03-17 14:27:44 +01:00
Eirik Aavitsland
9619cec279 Baseline testing: Fix overriding of Project property
Remove some kludgy, redundant and never used functionality for setting
project and test case names, as it also hindered overriding those
properties at runtime.

Pick-to: 6.3 6.2
Change-Id: Ibef7d7d0cb5fc1e462752f2ba2db76cc088dbd48
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-03-17 14:27:44 +01:00
Marc Mutz
60592f72d6 Rest of QtBase: compile-optimize inline swap functions
Instead of using the overly-generic qSwap() monster, use

- qt_ptr_swap() for swapping raw pointers
- member-swap for swapping smart pointers and owning containers

In QtCore, this has proven to give a nice reduction in compile time
for Qt users, cf. b1b0c2970e.

Pick-to: 6.3 6.2
Task-number: QTBUG-97601
Change-Id: I53e031a021031d53a74a712cd0f5e6bb8bf800bd
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-03-17 07:15:06 +01:00
Marc Mutz
f438d29b6f QtNetwork: compile-optimize inline swap functions
Instead of using the overly-generic qSwap() monster, use

- qt_ptr_swap() for swapping raw pointers
- member-swap for swapping smart pointers
- std::swap() for swapping scalars

In QtCore, this has proven to give a nice reduction in compile time
for Qt users, cf. b1b0c2970e.

Pick-to: 6.3 6.2
Task-number: QTBUG-97601
Change-Id: I26586da1f158fe6b18314abd8cf9bb040bc9cad1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2022-03-17 07:15:04 +01:00
Marc Mutz
870bb22c17 QtDBus: compile-optimize inline swap functions
Instead of using the overly-generic qSwap() monster, use

- qt_ptr_swap() for swapping raw pointers
- member-swap for swapping smart pointers and owning containers
- std::swap() for swapping scalars

In QtCore, this has proven to give a nice reduction in compile time
for Qt users, cf. b1b0c2970e.

Pick-to: 6.3 6.2
Task-number: QTBUG-97601
Change-Id: I2cb0dd3cef3a2923e7d08bb9d93c692308797e5b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-03-17 07:15:01 +01:00
Marc Mutz
9f8da21239 QDateTime: future-proof swap()
In Qt 7 32-bit builds, the ShortData will be larger than the
d-pointer.

So don't swap() the d-pointer, but a) delegate to Data to swap itself
and b) swap the ShortData there, adding a static_assert in the .cpp
file that triggers when the assumption that ShortData is always at
least as large as a pointer is violated.

Found while porting away from overly-generic qSwap(), so done that,
too.

Task-number: QTBUG-97601
Pick-to: 6.3 6.2
Change-Id: I5139da58d99e9491a582ff2cb2f817cd96952044
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-03-17 06:14:58 +00:00
Marc Mutz
73d0174f50 QLibrary: restore translated string
We want to pick this change to LTS branches, so we cannot change the
translated string.

Instead of fixing the order of placeholders, use multi-arg, which
performs only a single pass over the input and doesn't suffer from
placeholder injection by interpolation the way .arg() chaining does.

Requires to use QString::number(), though.

Amends 3636325946.

Pick-to: 6.3 6.2 5.15
Change-Id: I6484a052115096c609edfea27dfd36b196efc1b6
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-03-17 07:14:55 +01:00
Marc Mutz
021134195e QHash: fix -Werror=maybe-uninitialized (GCC 11.2)
The compiler doesn't understand understand that the only way ok can be
true is for qstrntoll() to have been executed.

  qhash.cpp:158:9: error: ‘seed’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
    158 |         if (seed) {
        |         ^~

Help poor GCC by initializing the variable unconditionally.

Amends cc5cc3225d.

Change-Id: Ic8387e0add2291d994f7f4d96c4bc614b2a8aa99
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-03-17 06:14:20 +00:00
Lorn Potter
d10b910e39 wasm: remove compiler and linker warnings
INITIAL_MEMORY and PTHREAD_POOL_SIZE are linker flags only
USE_PTHREADS is both linker and compiler arguments.

Also increase default INITIAL_MEMORY

Pick-to: 6.3
Change-Id: Id1998efbf1d6de901f404db7e988f6cafd547a39
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2022-03-17 15:56:19 +10:00
Giuseppe D'Angelo
d0cae531e6 QResultStore: remove unused include
Change-Id: I829e98af4f46156926a1ee68bddf4399bc557439
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
2022-03-17 06:34:55 +01:00
Giuseppe D'Angelo
9d685a870d QLoggingCategory: code tidies
Sprinkle explicit and remove an unnecessary operator in favor
of a named function.

Change-Id: I7e11b3910014827018341fde7d5aba36f9487fc4
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-03-17 05:34:55 +00:00
Laszlo Agocs
bc54031d57 Exercise reparenting more in QOpenGLWidget autotest
Change-Id: I771250ba889835e886c2801066ef023d82c5186d
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2022-03-17 05:34:55 +00:00
Giuseppe D'Angelo
e0a7364b50 QThread: avoid lock/relock an empty QMutexLocker
These semantics are deprecated and about to be changed.
Drive by, use nullptr instead of 0.

Change-Id: I213bf7d528d2fa312549f9fa49a5533198eddf88
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-03-17 02:02:15 +01:00
Giuseppe D'Angelo
979ee48ca1 QObject: add another couple of tests for broken connect()
Connecting to a non-signal should fail, but apparently it doesn't on
Windows+MSVC under certain conditions.

Task-number: QTBUG-101761
Change-Id: I3e014660e4e5b287242e32307f677bb22ab10a39
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-03-17 01:02:15 +00:00
Michal Klocek
2f894293ae Add missing install of pnglibconf.h for static builds
Installing only pngconf.h is not enough.

This commit amends be2745e478

Pick-to: 6.3
Change-Id: I8de1565434c315c7197d4602a8460ead794176d7
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-03-16 20:19:22 +01:00
Tatiana Borisova
715420095a Fix has_signaling_NaN usage for INTEGRITY
- The newest GHS compiler versions set the value of has_signaling_NaN to False.
  Add compilation and autotest fix for GHS-compiler 2021/2022 releases.

Task-number: QTBUG-99123
Pick-to: 6.2 6.3
Change-Id: I45e5da6759a15c60c17f896e565002cbba8524ed
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-03-16 20:09:37 +02:00
Marc Mutz
1977c922e9 QFlatMap: make insertion STL-compatible
That is, insert() doesn't overwrite an existing entry, and range
insert inserts the first of equivalent keys' values, not the last.

This allowed this author to optimize the implementation of
makeUnique() to a O(N) algorithm (was: O(N²)). Said optimization would
have been possible with the old semantics, too, but I wrote the
algorithm first and only then noticed the broken insert() behavior is
present on QFlatMap, too, so I decided not to let good code go to
waste and to fix both problems at the same time.

In order to give users a hint of the changed semantics, make the new
API opt-in until Qt 6.5, so Qt 6.4 ships with the both the old and the
new semantics disabled, where they contradict.

Fixes: QTBUG-100092
Change-Id: Ic96d8bfe6bed9068dbe8c0d7171bd8921050fd95
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-03-16 18:28:27 +01:00
Kai Uwe Broulik
e516a7bcf8 QAction: Add NOTIFY changed declaration to priority property
It already emits the signal and was merely missing the declaration.

This fixes warnings about depending on non-NOTIFYable properties
when binding to the priority property from QML.

Pick-to: 6.3 6.2
Change-Id: Ia91ae5d00d722bdb2fc1f89671c3e7faab4b129f
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-03-16 17:28:27 +00:00
Volker Hilsheimer
58a14d9433 Enable tests to turn off Windows Vista animations
Animations in that style depend on the current time, which makes it
impossible to run baseline tests. Introduce a dynamic property that
allows us to set the time that animations use.

This way, tests can turn the animation off, or control which time should
be used.

To keep performance overhead low, check only once whether the dynamic
property is set at all.

Pick-to: 6.3
Change-Id: I9bc57b9867fb0d852e101570eca4c7609e7fe1a8
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2022-03-16 15:56:17 +01:00
Kai Köhne
9f5f64e9db Use QDebugStateSaver in example operator<<()
This makes sure that changes in the debug stream - like nospace() -
do not "leak". Also use the example snippet in QDebugStateSaver
documentation.

Pick-to: 6.2 6.3
Change-Id: I934976d2c7c2335abfec68c763526a5cbb0e6f1e
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-03-16 15:56:17 +01:00
Alexandru Croitor
21bffeec90 CMake: Add deployment auto test
Add a cmake test that builds a simple widgets application, installs
it, in a shared Qt build deploys the runtime dependencies and then
runs it to confirm that the app works.
With a static Qt, the installation of the runtime dependencies is
skipped, but the app should still run.

The test is expected to pass only when targeting Windows and macOS
(both when using shared and static Qt).

Pick-to: 6.3
Task-number: QTBUG-98545
Change-Id: I41b616e1e1fc463d57c64be9273ed4dc755e9187
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-03-16 15:56:17 +01:00
Alexandru Croitor
d1c56073b4 CMake: Don't rely on CMAKE_FIND_ROOT_PATH_MODE_PACKAGE for examples
We shouldn't set CMAKE_FIND_ROOT_PATH_MODE_PACKAGE to BOTH when
cross-building examples without ExternalProjects.

Instead append the $build_tree_prefix to CMAKE_FIND_ROOT_PATH
and $build_tree_prefix/lib/cmake to QT_EXAMPLES_CMAKE_PREFIX_PATH
to circumvent the usual CMake path-rerooting issue.

This ensures that the build-tree Config files are found by the in-tree
find_package calls when cross-building examples.

Pick-to: 6.2 6.3
Task-number: QTBUG-96232
Change-Id: I4e31f0bf3dbfeb4339823fe09addda3ae83f12c3
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-03-16 15:56:17 +01:00
Alexandru Croitor
c89da21249 CMake: Fix cross-building examples in prefix builds as ExternalProjects
For examples to successfully find not yet installed Config files in a
prefix cross-build, both CMAKE_FIND_ROOT_PATH and CMAKE_PREFIX_PATH
need to be adjusted when toolchain files set
CMAKE_FIND_ROOT_PATH_MODE_PACKAGE to ONLY.

Before this change, we lacked two things.

1) If the chain-loaded toolchain file sets CMAKE_FIND_ROOT_PATH
(instead of appending), then the initial value of CMAKE_FIND_ROOT_PATH
that was passed by ExternalProject's initial cache would be
overridden.

2) The prefixes we passed via QT_EXAMPLES_CMAKE_PREFIX_PATH did not
end in lib/cmake, to work around the path re-rooting problem in CMake.

We can handle both of these points by using
QT_ADDITIONAL_PACKAGES_PREFIX_PATH which was introduced for Conan
usage.

Each value assigned to QT_ADDITIONAL_PACKAGES_PREFIX_PATH
gets prepended to CMAKE_FIND_ROOT_PATH by qt.toolchain.cmake AFTER the
original toolchain file is chain-loaded.

And each value also gets lib/cmake appended and assigned to
both CMAKE_PREFIX_PATH and _qt_additional_packages_prefix_paths (used
by Qt6Config.cmake.in to work with find_package + NO_DEFAULT_PATH).

This is exactly what we need to ensure examples build.

Pick-to: 6.2 6.3
Task-number: QTBUG-96232
Change-Id: I11a52457ff795a6661a3a7b68e823e0615d0ce89
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-03-16 15:56:16 +01:00
Eike Ziller
9943cf7371 QMainWindow: Fix unused separator widgets blocking mouse events
We need to hide separator widgets that are unused, otherwise they block
mouse events from the underlying widgets.

Pick-to: 6.2 6.3
Fixes: QTCREATORBUG-24600
Change-Id: I98c6d4860f683a861b89c4cad042bb734f590000
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-03-16 09:50:52 +01:00
Robert Löhning
d865129d9e Painting: Fix value check in isUnclipped()
left() == INT_MIN or top() == INT_MIN will still underflow
in QRect's ctor, so the check must be more strict

Pick-to: 6.2 6.3
Change-Id: I12ab148934c8c90865ca9247bd8badeedd4a9f45
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2022-03-16 02:31:10 +00:00
Robert Löhning
286a63898f Doc: Fix typos
Pick to: 6.3

Change-Id: Iaea3c0e567ddd6a72db0b2ba1731c416cf85ef47
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2022-03-16 02:26:56 +00:00
Marc Mutz
e74e27e67e QObject: give some TLC to dumpRecursive()
In no particular order:

- use the variable field width feature of QString::asprintf() to
  generate the indentation implicitly, instead of fill()ing a
  QByteArray with the desired number of spaces

- just default-construct 'flags', don't assign an empty string

- use qUtf16Printable() to avoid funneling UTF-16 data through 8-bit
  encodings

- use a C++11 ranged for instead of a counted loop

- remove a pointless isEmpty() guard (the loop won't execute when the
  children().isEmpty())

- avoid copying object->children() (returns by cref, so it's also ok
  to stuff it directly into the ranged for loop).

Add a test.

Pick-to: 6.3
Change-Id: Ie7314713cb48de7e890cdee0760c0361dd24fd18
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-03-16 02:26:56 +00:00
Marc Mutz
78891e5390 QString/QByteArray: = default the move ctors
Instead of relying on implicit construction of the d-pointer and then
swapping that with other.d (using overly-generic qSwap(), no less),
simply let the compiler do The Right Thing™ via QArrayDataPointer's
move constructor.

Pick-to: 6.3 6.2
Task-number: QTBUG-97601
Change-Id: I3be30f99f6fb0e17d3550edbe64cbe80880e604a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2022-03-16 03:26:56 +01:00
Mårten Nordheim
156afbc9b8 Fix qt version tagging on windows with namespaces
The libraries linking to QtCore were looking for
__imp_qt_version_tag_6_4 but the exported symbol was
__imp_qt_version_tag_NAMESPACE_6_4 (with the mangled namespace)

Change-Id: Ida7b18bea4b5e7dab9c0efb63279779d1af898cb
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-03-16 01:10:23 +00:00
Kai Köhne
7d5604c194 Deprecate QElapsedTimer::TickCounter
Also remove left-over code paths related to it.

[ChangeLog][QtCore] QElapsedTimer::TickCounter enum is now
deprecated. Qt does not use the Windows API behind this
enum already since Qt 5.9, so it's fair to assume that
any code path relying on the enum is dead code.

Change-Id: I308fe23658835034774e2015a8ee64659102de56
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-03-16 00:30:34 +01:00
Kai Köhne
aaa3184f8d Doc: Update documentation for QElapsedTimer's in Windows
We only support Windows versions that feature the PerformanceCounter
API (see also 48fd845c61).

Pick-to: 6.3 6.2 5.15
Task-number: QTBUG-84433
Change-Id: I477f9015ee8c87d31f859f529631f3a6b0215ae6
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-03-16 00:30:34 +01:00