Calling Q[Multi]Hash::reserve(n) when n is much smaller than the
current amount of elements in the hash, could result in an infinite
loop, because at some point the algorithm could not find a free bucket
for the element.
Fixing it by returning early if the new desired capacity is less than
current.
Fixes: QTBUG-102067
Pick-to: 6.3 6.2
Change-Id: I38ef0b2168c4e2a317eedf91b2155b1fdffb1c27
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Make sure androidtestrunner reports the following cases as failures:
* XPASS test case
* The test output doesn't have closing block.
* The test result read from output.txt is empty
Pick-to: 6.2 6.3
Fixes: QTBUG-100312
Task-number: QTBUG-100470
Change-Id: Ifbb3c31fa22159df0c39b264e95e2f1ccd16e5ff
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Different platforms and drivers hae different defaults, so make sure
to request what we need.
Pick-to: 6.3 6.2
Change-Id: I54ae6e0770fea53fbf59c86d7e55aa5897292b67
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
It's one of our best tools to improve compile times.
Can't backport to Qt 6.2 because the macros don't exist there.
Pick-to: 6.3
Task-number: QTBUG-102206
Change-Id: Ic8f3870d8eec6211c4be506dc67717cc4e0ff7d6
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Use new QByteArray::resize(n, ch) method to resize the buffer
directly, instead of first allocating a QByteArray full of NULs and
then using public write() API to append it.
Change-Id: Ibdb082b970de0ba24534a570ecb23304c5f1470c
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>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
QList and QString had them, so add them to QByteArray and
QVarLengthArray, too.
In the QVLA case, we need to jump though a hoop or two to avoid having
to duplicate all the reallocation logic. Nothing a few template tricks
cannot solve.
[ChangeLog][QtCore][QByteArray] Added resize(n, ch) overload.
[ChangeLog][QtCore][QVarLengthArray] Added resize(n, v) overload.
Fixes: QTBUG-102270
Change-Id: I0d281ae5b574f440f682e4a62427b434dcf5b687
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
By the time setNodeValue() gets its hands on the removed object, the
removeChild() function has already called removed->ref.deref(), which
performs an acquire fence if the ref-count drops to zero.
IOW: if removed->ref == 0 now, then an acquire fence has been
executed. If ref != 0, then we're not reaching into removed, so we
need no acquire.
Therefore, a relaxed load suffices (as opposed to the loadAcquire()
the implicit conversion operator performs).
Found by disabling QAtomic<T> -> T implicit conversions.
Change-Id: I367754fde0ad82db797161b5e94e2ebc08a90c0b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Clazy complained about this polymophic class being copyable.
Change-Id: I05087bb7fcf7112136e5d62c108ea460569f2aa0
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Destructors in C++ are implicitly noexcept, so the try-catch around
QSettingsPrivate::flush() is not to prevent throwing from a dtor
(anymore), but to prevent a throw statement inside flush() from taking
down the whole application.
We don't need to care about abi::__forced_unwind here, since we
couldn't re-throw it even if we wanted to (throw in noexcept function
is direct std::terminate(); at least by not re-throwing, the user will
get a nice complaint message from the runtime).
Pick-to: 6.3
Change-Id: I3b24a4be9aeb74637a58725540990b535d005bdd
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Disable copy and move SMFs and make the dtor protected. This requires
to restore the default ctor, which in turn also becomes protected,
because it needn't be public.
Found by clazy-copyable-polymorphic.
Pick-to: 6.3
Change-Id: Ibde8202e755f6de05cd8f9e92cf0f9cf19b4e19b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
We were triggering detach during the transform, but the short-cut for
indexed formats wasn't triggering that. Instead make the detach explicit
and avoid it during the loop.
Pick-to: 6.3 6.2 5.15
Change-Id: I0f12b7f93841342a0770ce3d3c78f26ad19d8dac
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
We’d like to support use cases which require using
multiple html documents, for example when displaying
application content using more than one browser window.
Normally Emscripten uses the primary html document when
looking up elements by id, which means that targeting
elements on secondary documents is not possible.
Emscripten does provide a workaround: the application
can create custom id mappings to any html element on
the “specialHtmlTargets” object, and then use the
“!id” syntax instead of normal “#id” lookup.
Change-Id: I4dda920868cfbc6f8991425daf8933144c0ffad8
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
On 32-bit platforms, the range of qsizetype is smaller than the range
of the qint64 used as a parameter in seek().
When seek()ing beyond the current buffer's size, the old code relied
on a write() to fill the gap with NUL bytes. This has two problems:
First, this may allocate a huge amount of memory just to find that it
cannot write that much, possibly even taking the program down when the
allocation in the QByteArray ctor fails, instead of returning false from
seek().
Second, the QByteArray ctor to which we pass the gapSize only takes
qsizetype, not qint64, so we were writing data of size gapSize mod
(INT_MAX+1) on 32-bit platforms, which may succeed, just to find that
that wasn't the number of bytes we expected to be written. By that
time, however, the internal buffer has already been enlarged.
Fix by checking whether the desired seek position is within the limits
that QByteArray can contain early on, before attempting to construct
such a large QByteArray.
[ChangeLog][QtCore][QBuffer] Fixed silent data corruption on 32-bit
platforms when seek() fails due to position > INT_MAX.
Pick-to: 6.3 6.2 5.15
Fixes: QTBUG-102274
Change-Id: Ib63cef7e7e61ef8101a5f056c7b2198bb7baa228
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Because moc silently ignores missing headers, or sometimes includes
the wrong header, it is useful to have a facility to print which
header paths were considered and found.
Add a new --debug-includes option that does that.
Task-number: QTBUG-101775
Change-Id: I72b294ae53d6e47252c7d8afe0f2245da78bfadb
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
In setMSecsSinceEpoch(), when epochMSecsToLocalTime() fails (e.g. when
msecs is near one end of time and the offset being added causes
overflow), the call to setDateTime(d, ...) is bypassed so the d-ptr is
not updated and getStatus(d) returns the status prior to the function
call. The new status being prepared by the function should thus not be
updated to getStatus(d) unless setDateTime(d, ...) was called.
This amends commit 74eddd5bf0
Done-with: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Fixes: QTBUG-102157
Pick-to: 6.3
Change-Id: I25e358070907f22d9e4fb0030fa82ec290c7a730
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
qmake had a feature to set androidtestrunner's timeout. This
feature is not yet ported to CMake. So with CMake, we always
have androidtestrunner's default timeout. Which was
five minutes. We have several tests which take just shy of five
minutes and are thus flaky.
This patch extends the timeout to eight minutes. This should be
a temporary workaround until the timeout feature is implemented
in CMake.
Task-number: QTBUG-101596
Pick-to: 6.2 6.3
Change-Id: Ia67ed6ab40a40f1b82861bd15bd04528ee9334ee
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
tst_qmessagebox was disabled because it crashed.
It does not any more. Now it hangs, which
is a new problem.
Fixes: QTBUG-87671
Task-number: QTBUG-101217
Pick-to: 6.2 6.3
Change-Id: Iec15cf82a4112ee79182ec091622e40147bd3e7f
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
We want to enable gaining access to the underlying resource(s) by
inspecting a QRhiRenderTarget. This is not currently possible for
swapchains since there is nothing that references the actual
QRhiSwapChain. To clean this up, make an explicit, new
QRhiSwapChainRenderTarget subclass. Thus the logic already used in a
couple of places to examine the resources attached to a
QRhiTextureRenderTarget can now work with swapchain render targets too,
by branching based on the resourceType().
This eliminates the somewhat odd setup where a "RenderTarget" resource
is QRhiRenderTarget corresponding (but not exposing!) a swapchain,
whereas a "TextureRenderTarget" is a QRhiTextureRenderTarget which
is a subclass of QRhiRenderTarget. Now we correctly have an (abstract)
base and two subclasses, one for each type of render targets.
Besides, it allows us to clean up the oddly named
Q...ReferenceRenderTarget classes in the backends, which initially tried
to indicate that this "render target" merely references (or, in
practice, is) a swapchain. We can now have a nice and symmetrical
Q...SwapChainRenderTarget and Q...TextureRenderTarget naming scheme.
Change-Id: Ib07e9be99a316eec67b94de0860e08f5f4638959
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
This is needed for use in QHash and similar.
It's essentially the same as using the integer id, but typesafe
Change-Id: I9515b8e178c8f9828934cb0bb099cce5553ec393
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
It's one of our best tools to improve compile times.
Can't backport to Qt 6.3 or 6.2 because this change introduces new
exported symbols.
Task-number: QTBUG-102206
Change-Id: I6bfa532be34ca847d3b9034d16c94efed3d602c3
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
The old code performed one load-acquire (in the assertion) and one
ordered(!) fetch_sub() (in the pre-decrement operator) where one
relaxed fetch_sub() would suffice (it's just a counter).
Fix by caching the result of the relaxed fetch_sub() and performing
the following checks on the cached result.
As drive-bys, rename the atomic member variable (to catch any outside
uses) and make the ctor explicit.
Found by locally disabling the QAtomic<T> -> T implicit conversion
operators.
Change-Id: Ifdc11c2c4807b71f4cab2ba9f5405ace7d8d71a9
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
- Currently we manually unpack all platform libraries,
that are required for GUI apps, and pack it into single eglmegapack.a library.
It could be better do not execute such additional step,
but have possibility to add required graphical libs
to cmake interface lib via toolchain file list variable.
Pick-to: 6.2 6.3
Change-Id: Ic4122600f02e6828d528ee4f00075f8c27f42e38
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Add required environment variable configurations to COIN for
building Qt SW in Windows host for QNX OS.
Task-number: QTBUG-101292
Pick-to: 6.3 6.2
Change-Id: I3ea4cbaaebb693a0a46b5f9cbd08209805366ca7
Reviewed-by: Samuli Piippo <samuli.piippo@qt.io>
To ensure that both Linux and Windows host builds are equivalent
the Linux host builds need to use the common QNX SDP file that
support both host environments. This new QNX SDP does not include
QNX license files like previously, instead they are separately
installed by the Ansible scripts of the CI system to the $HOME/.qnx
directory. That directory is also supposed to be used for any possible
binaries found via PATH environment variable.
Task-number: QTBUG-101292
Pick-to: 6.3 6.2
Change-Id: I97ad71f00e8289e708c51565f86c6d0c84a9ae84
Reviewed-by: Samuli Piippo <samuli.piippo@qt.io>
It's quite clear from the code in qmainwindow.cpp and
qmainwindowlayout.cpp that centralWidget returns nullptr (not zero)
if it's not set. This also seems to be perfectly well supported,
contrary to the note given.
Change-Id: Ib7ab37f3645089fb85d7262717b7147b5871c1ad
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
The highligh color we have looks too different to what system menus
have. Accent color seems to be better matching this color, though
it's not really what we can see in menus, which are transparent and blend
with watever lies below them.
Fixes: QTBUG-75386
Change-Id: I03f66808eb885594862ad9b31398cae4ca186593
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Add the CONFIG value c++2b that represent the upcoming C++23 standard.
Add QMAKE_CXXFLAGS_CXX2B and QMAKE_CXXFLAGS_GNUCXX2B.
On MSVC, use /std:c++latest when c++2b is active.
This fixes an issue with MSVC where c++latest implied the /std:c++20
compiler flag.
Pick-to: 5.15 6.2 6.3
Fixes: QTBUG-102202
Change-Id: Ie00ee5793c1a649195013c8c19efc8d59cf0acc9
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
QNX tests are run under QEMU so have the same problem as Ubuntu.
Pick-to: 6.2 6.3
Task-number: QTBUG-100928
Change-Id: Id7c7639b743062c777502e2ba8b28f9bb18deb19
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Removes some #ifdef'ery.
Also remove the unneeded dtor. While this is a polymophic class, it's
not in a header, so we won't run into the scenario described in
QTBUG-45582.
Pick-to: 6.3
Change-Id: I1a8598402ff2a564cc53da2f85ed3ed00ca3ddbf
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
As all other 20+ users of the state variable, use a relaxed atomic
load under the protection of the mutex. There's no need for the
loadAcquire() that the implicit conversion operator uses under the
hood, because a) we're under mutex protection and b) the state doesn't
guard any other data but itself.
Found by disabling said implicit conversion operators.
Change-Id: I2a76242271cec96175cde503ca883805db6b9212
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Since the class is exported, both ctors from source_location (std and
experimental) need to be in the DLL, otherwise a Qt built with C++20
(using std::source_location) may break C++17 users that, however, have
experimental::source_location (and therefore expect the DLL to export
it).
This is exactly the same issue we had with QPolygon and
QVector::begin() with and w/o QT_STRICT_ITERTORS, therefore the same
fix applies, with the difference that we don't need a separate TU here
to inject the missing symbols, because both versions can be
overloaded.
[ChangeLog][QtCore][QPropertyBindingSourceLocation] (Windows only)
Fixed a binary-incompatibility where source_location constructors were
missing in the ABI.
Pick-to: 6.3 6.2
Change-Id: I4a514565cceea5f92975eff3a3e936efa5f7d8da
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
It's one of our best tools to improve compile times.
Can't backport to Qt 6.2 because the macros don't exist there.
Pick-to: 6.3
Task-number: QTBUG-102206
Change-Id: I80734b4d43928fce0e66329b5b897a2738db9b30
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
It's one of our best tools to improve compile times.
Can't backport to Qt 6.3 or 6.2 because this change introduces new
exported symbols.
Task-number: QTBUG-102206
Change-Id: Ib8224ed60afa893744f369fe7394d27e89b66c11
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
These are sometimes needed for passing objects on
to native API.
Change-Id: I89a1a95e6d51932ae3b49eec072261bcb5dbb463
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Android permissions query blocks Qt main thread. If the input method
was activated before the permissions query started, android would try
to invoke input method before returning back to permissions query.
This will cause a deadlock.
Fix the issue by moving the deadlock counter to Qt core and
incrementing the value before the permissions query. This will prevent
the input method queries to enter Qt main thread.
Fixes: QTBUG-99484
Pick-to: 6.2 6.3 6.3.0
Change-Id: I54ea59578880cde4095c26fa2a6a264c4dc1b7ff
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
The signal can be emitted not only when user fonts are added or removed,
but also when the system fonts change.
Change-Id: I8f066ac87e7bc68843cd9014cd3c31af2f3a7890
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
If a test returns 0 but writes an XML logfile that contains FAIL or a
corrupted XML file, then qt-testrunner considers it a CRASH and exits
with 3.
Previously any test execution returning 0 (success) was considered
a PASS. Changing this behavior with this patch finds a lot of test
crashes on Android (QTBUG-100470), because the tests are run indirectly
on the emulator and the test wrapper process could not detect the crash,
thus returning 0 to qt-testrunner. But the corrupt XML file is caught
now.
Likewise, if a test returns != 0 but the XML logfile contains only PASS,
qt-testrunner considers it a FAIL. This used to be the case but now
tests are added.
Finally changed logging for such cases from INFO to WARNING.
Task-number: QTBUG-100470
Change-Id: I404c9d2211c7de027bf776d1914519d37f513ca1
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
The macro enables tabbed content in the online style
only. It's usage must be gaurded with a conditional
block as shown in the following example to handle
the offline style usecase:
\if(onlinedocs)
\tab {build-qt-app}{tab-cmake}{CMake}{selected}
\tab {build-qt-app}{tab-qmake}{qmake}{}
\tabcontent {tab-cmake}
\else
\section1 Using CMake
\endif
CMake-specific instructions go here
\if(onlinedocs)
\endtabcontent
\tabcontent {tab-qmake}
\else
\section1 Using qmake
\endif
qmake-specific instructions go here
\if(onlinedocs)
\endtabcontent
\endif
Pick-to: 6.2 6.3
Change-Id: I02d50c057280a9ffea913642284e67ddcda7aa94
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
The printed lib path did not appear when building the project with the
Unix Makefiles generator.
Make sure the printing does not depend on the shell used by the
generator, by making it VERBATIM.
Amends 39f657032b
Pick-to: 6.2 6.3
Task-number: QTBUG-101653
Change-Id: I3853bbed3b121ecdc8b2e9da42eb3399f347b8c2
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
To do that, we install the example binaries into a new directory
rather than the main install dir.
The contents of the dir is not archived by the Coin agent.
This decreases the size of the binary artifacts.
This will be especially important when the examples contain deploy logic
which will install the shared Qt libraries next to each example binary.
Pick-to: 6.2 6.3
Task-number: QTBUG-90820
Change-Id: I0b112698514309bb9b0794ce4117e8bf30c3a819
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>