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>
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>
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>
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>
Sprinkle explicit and remove an unnecessary operator in favor
of a named function.
Change-Id: I7e11b3910014827018341fde7d5aba36f9487fc4
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
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>
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>
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>
- 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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
Do not print information about deprecated headers when running in "quiet"
mode (-quiet argument, the default when configuring Qt modules).
Pick-to: 6.3
Change-Id: I4ea7f9251725527addef6c382b41f639048b8a9f
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Instead of lazily initializing (with some platform exceptions, see the
equivalent qsimd.cpp commit). The rationale is the same as for
qCpuFeatures(): this the qHashBits() function is hot and the current
code generation needs to save a lot of state because of the possible
call to the C++ runtime functions to enable the thread-safe
initialization of the hash seed.
[ChangeLog][Important Behavior Changes] QtCore now initializes the QHash
global seed before the main() function is run, so it is no longer
possible to use qputenv() to affect the seed value for the current
process. Disabling the random global seed for the current process should
be done programmatically with by calling either the 6.2 function
QHashSeed::setDeterministicGlobalSeed() or, if compatibility with Qt 5
is required, by calling qSetGlobalQHashSeed() with value 0.
Change-Id: I54f205f6b7314351b078fffd16cf7eae93f9e27e
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
The runtime runs the function pointers located between subsections $XCA
and $XCZ only, so using $QT meant it would never get run.
Change-Id: Ibf4acec0f166495998f7fffd16d8ecb19019ce10
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Same as the previous commit, one of the reasons it was done like this
was because of git blame. The qt_{starts,ends}_with functions that are
shared between QtPrivate:: and QString:: are getting inlined so there's
no code benefit.
Pick-to: 6.3
Change-Id: Ib42b3adc93bf4d43bd55fffd16c19a8ed3c94483
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
We only support Windows 10 in Qt 6.
Task-number: QTBUG-84433
Pick-to: 6.2 6.3
Change-Id: I0c5bacac570dbb97a71f5af04b645d69040a5fe6
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
qAtomicDetach() does d = new T(*d); which calls the copy constructor.
Since there was no copy constructor declared for QShaderPrivate,
the compiler generated one which copied the refcount over, instead of
setting it to 1 in the detached instance. As a result, the destructor
didn't delete the QShaderPrivate.
Nothing was calling this constructor that takes a pointer, so clearly
this was a typo for a copy constructor.
Detected in an ASAN build, the qsb tool exited in error.
Pick-to: 6.3 6.2 5.15
Change-Id: Idbe659b52d2600ac7c11b09142a6aa5b25310df9
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
The test task191545_dragSelectRows relied on the fact
that the view is not scrolling. But on a small screen,
it scrolls automatically.
Fixes: QTBUG-87407
Pick-to: 6.2 6.3
Change-Id: I691361c965ab03d8a012f2b83715c7c96d990ec5
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
It's not immediately clear that trashedName doesn't contain %1 or %2,
in which case the subsequent .arg() would replace that instead of the
intended %2.
Fix by using QString::asprintf(), which doesn't perform multiple
interpolation passes.
Pick-to: 6.3 6.2 5.15
Change-Id: Ib6c24bfea01db4cdc80f7547c8269cce3f815158
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
The previous constraint called for the value_type of the container to
exactly match the value_type of the tokenizer, which means
toContainer() could only ever work on containers of views. But there
is value in allowing QStringList, even though it works only on QL1S
needles (QStringView -> QString isn't implicit). But users may have
other types that for better or worse implicitly convert from views, so
we shouldn't over-constrain the function.
[ChangeLog][QtCore][QStringTokenizer] toContainer() now works on
containers whose value_type can be constructed from the tokenizer's
value_type. It no longer requires an exact match.
Fixes: QTBUG-101702
Change-Id: Ie384cd1c4b51eaa57675f2a014141ceec8651c81
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Update printer and m_currentPrintDevice before calling
QPrintDialogPrivate::selectPrinter() to show values for
PDF printer instead of the previously selected printer.
Pick-to: 6.3 6.2 5.15
Change-Id: Iacc34ca4460ec4de0b4b373cd875628733df01bd
Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
Use new global include snippets for the 'Using the Module' section and
reorganize the sections structure. The sections should follow this
order:
- Using the Module
- Articles and Guides
- Examples
- (API) Reference
- Module Evolution
- Licenses and Attributions
Task-number: QTBUG-100369
Pick-to: 6.3
Change-Id: I239bcf53719f0036867ac1d513dc74e1bfa7bc8b
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
Move some of the sections into an overview page and reorganize the
contents structure. In addition, provide links to the different sections
that are covered in the overview.
Task-number: QTBUG-100369
Pick-to: 6.3
Change-Id: I46eb3df4a09e57f5778002ce694decf134b65e83
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
Android 9 introduce an API call to clear the clipboard, before that
it wasn't possible to do that, the test QPlainTextEdit::canPaste()
should expect that to fail.
Pick-to: 6.3 6.2
Task-number: QTBUG-100470
Change-Id: Ie2d8aabf77672c62b3a6c72a080a4e37f1696303
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
androidPlatformIntegration might be called before
setAndroidPlatformIntegration() is called, and also all other
uses of androidPlatformIntegration is already guarded in our
code.
Pick-to: 6.2 6.3
Task-number: QTBUG-100470
Change-Id: Ifd7d36ba7f2f3b55652466825d7fd84c87ec5e19
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
In a recent improvement (6de36918c0) the
last set clip region or path was stored in separate variables, in
order to be set again if the aliasing mode changed. That solution was
too simplistic, as it would break down as soon as more than one clip
area was set, with the latter either replacing or intersecting the
first. It was also unnecessary to introduce new storing of clip areas
and transforms, as those are already recorded in the clipInfo stack in
the painter state. This patch hence reverts much of that implementation.
However the basic idea of setting the clip area again after AA change
is good, so that part is kept, implementated instead by calling a
pre-existing function to replay the clipInfo stack.
One of the baseline test cases is extended to excercise the
combination of clip areas. As a driveby, support for setClipRectF is
added to the painting baseline test scripts, and the build of the
manual lance tool is fixed.
Fixes: QTBUG-101474
Pick-to: 6.3 6.2
Change-Id: Ide8b70d8cbf138deb06cbb84f69e62f7405886e6
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Amends a74cdf778c, after which the
initialization of items in invisible rows is skipped. Since data members
in QFormLayoutItem were lazily initialized, this resulted in out-of-bounds
access of QList entries.
Use member initialization for all QFormLayoutItem fields, and check that
vLayoutIndex is valid before using it to access the list entry. Skip
labels and fields for which it is not initialized.
Add test case. As a drive-by, silence the test's provoked warning
messages via ignoreMessage.
Change-Id: I374b414a51df20b9af3087a2676061fc6b7f23e2
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Fix exp63-cpp by assigning fresh values to mocEntries and mocIncludes to
get them out of the moved-from state.
Change-Id: I9ad36c0ebd922bc6a0c9e61c15be02cb987c1edb
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Don't create a QString from a wchar_t array to check that the array
contains "1\0". Just do character-by-character comparison.
Change-Id: I7e5c2348c24af6a9b046c91423a52f756ceb9eb9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
... while keeping the QString overload for users that pass actual
QStrings (e.g. QStringLiteral).
However, QString and QAnyStringView cannot be overloaded (they're
ambiguous for most arguments), so we need to make one of them a
Q_WEAK_OVERLOAD.
Normally, we'd make the new function weak and keep the old function
as-is, but, here, that would be beside the point, because all callers
would continue to resolve to the QString overload, and nothing would
call the QAnyStringView one.
So we really want the old function to be the Q_WEAK_OVERLOAD, so that
the QString overload is only selected when actual QStrings are
passed. That means we need to leave the old function in a compat build
(compiled in, but not visible in the public header). Since
Q_WEAK_OVERLOADs cannot be (easily) exported (they're templates), make
it call a private function (which can be, and is, exported).
Reviewers may questions whether one can overload
setObjectName() and
template <typename = void> setObjectName()
The answer is that we can, because templates mangle differently from
normal functions. We can even call the template function (with
explicit template arguments), as seen in removed_api.cpp.
This adapts the interface of the function to how most users use it:
They pass QLatin1String or just const char[]. Only very few passed
QStringLiteral, which, ignoring that fact that it produces a ton of
code for the temporary QString's destructor that's never executed,
would have been, and continues to be, the optimal way of passing data,
modulo plugin bugs (QTBUG-51602, QTBUG-49061).
[ChangeLog][QtCore][QObject] Added setObjectName() overload taking
QAnyStringView.
Fixes: QTBUG-101393
Change-Id: I1243545614754b4978d4c8641460980b6b293c1a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
... to centralize the creation of QObjectPrivate::extraData.
Change-Id: I04e97779ceb0168fa7660e77e0dab2ed3e1ad03e
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>