Clang 19 -std=c++23 complained that ITERATIONS_PER_THREAD was
captured, but not used, so 668d81f73a5c2f4ec14764d1892f2eaf6494c0f1
dropped it, after making the variable constexpr.
Picking that change back to older branches, we found that MSVC
(14.29?) complains that it's _not_ captured anymore:
tst_qpointer.cpp(491): error C3493: 'ITERATIONS_PER_THREAD' cannot be implicitly captured because no default capture mode has been specified
To appease both compilers, and cover the maximum range of C++ standard
editions, use implicit [&] capture, which should work everywhere.
Not picking to 6.5, because the cherry-pick of
668d81f73a5c2f4ec14764d1892f2eaf6494c0f1 already had to make that
change in order to pass CI.
Pick-to: 6.10 6.9 6.8
Change-Id: Iacbd53d3904608e8c9cd73edf31ba7924fd508e6
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
... not all of qglobal.h.
[ChangeLog][Potentially Source-Incompatible Changes][QtCore] The
qscopeguard.h header no longer includes qglobal.h, but only what it
itself needs. A backwards-compatible fix is to not depend on
transitive includes and include all you need explicitly.
Pick-to: 6.10
Change-Id: I257ae4cbd36d331e2fbda7fa238dcbc26a75647c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
tst_QScroller::overshoot was initially a boilerplate, making it
difficult to understand what was actually being tested.
Refactor this test to be data-driven. Additionally, create a new test
function, overshoot_segments, which was part of
tst_QScroller::overshoot and should be tested independently.
Transfer the blacklisted platform of overshoot to overshoot_segments.
Change-Id: I59d89dfab4bb09c41fce99ad4f40163736c6ef78
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Writing the tests for QUtf8StringView showed that this conversation does
not work if the underlying storage_type is not char8_t. This is
something a user rightfully expects from our library and we therefore
added an explicit conversion operator for it.
[ChangeLog][QtCore][QUtf8StringView] Added std::u8string_view operator
if compiled with C++20.
Pick-to: 6.10
Change-Id: Ia80507bdd76686bee16a40745be064e9bdfef130
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Replace some c-arrays with std::array<> for easier handling.
Pick-to: 6.10 6.9
Change-Id: I34766a2aad603d83187515626982adc976667d48
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
QWindowsScreenManager::removeScreen() read an element from m_screens
and removed it. If the removed screen was not the primary screen,
QWindowSystemInterface::flushWindowSystemEvents() is called.
When removeScreen() is called from handleScreenChanges() in the same
class, flushing window events can lead to a re-entry. That is e.g. the
case when a RDP connection is closed and the server removes the virtual
screen.
QWindowScreenManager::removeScreen() removes the platform screen only
at the very end, which means that m_screens contains a stale pointer.
The re-entry can therefore crash with a double delete.
Take the platform screen at the beginning of the method, to make it
safe for re-entry.
Fixes: QTBUG-135337
Pick-to: 6.10 6.9 6.8 6.5
Change-Id: Id18a6fb3e72922bcdb62c9e79857b6bb713c0c1b
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Wladimir Leuschner <wladimir.leuschner@qt.io>
Even though there are two \fn's, we still use singular form when we
refer to the effects of the function.
Amends 4f077b7e5ff1081afc0e362bdab6522c2b7ee43b.
Pick-to: 6.10 6.9 6.8 6.5
Change-Id: I7cc150eb96b4aac40abcf7076bb82049a209f837
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The class docs should include a discussion of salient API, not leave
that only to \fn's.
Amends 9229452e574e603aa86fd5adb28da33cf5879db9.
Pick-to: 6.10 6.9 6.8 6.5
Change-Id: I53144c7e56eca21ceeda0c1bca0028e987da9e18
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
__has_include is part of C++17, but moc did not handle it so far.
This commit fixes moc to correctly support it.
It should be noted that support for __has_include relies on all
necessary include paths being passed to moc.
Pick-to: 6.10 6.9 6.8
Fixes: QTBUG-136097
Change-Id: I7284e97dea12d1637b38349d32e090c0102124e7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
For AUTOMOC, we were missing the compiler flavor flag, as well as the
WIN32 define. While the latter has not caused any known issues yet, the
former is rather problematic for implementing __has_include in moc.
Note that this only applies in the case where the AUTOMOC flags are set
by us in a qt_ function like qt_add_excutable. Plain add_executable
won't benefit from it, but we already mention that Qt targets should not
use plain CMake functions.
This change is (indirectly) tested by the commit adding __has_include
support for moc.
Task-number: QTBUG-136097
Pick-to: 6.10 6.9 6.8
Change-Id: Ie2beb08a44a3a67e3bc363d9c1ba93b7d6a49133
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
The wrappedUploadByteDevice is obviously intended to be owned by
QNetworkAccessBackend. It needs to be deleted when QNetworkAccessBackend
is destroyed.
Ideally we shouldn't use bare pointers at all here, but since we need
to pick this back all the way to 6.5, a minimal fix is preferred.
Amends commit bba0bdb35c2806bcdde8e89965e99b3d412b8d3a
Change-Id: Icbe857ad02c23693c313d3fcb2d0ee068362e5b7
Pick-to: 6.10 6.9 6.8 6.5
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
The old code performed a fetchAndSubAcquire() followed by an implicit
loadAcquire() in the Q_ASSERT(). But fetchAndSub() returns the old
value, so we don't need to re-load it; we just need to store the
result of fetchAndSub().
We need to adjust the assertion, of course, since we're now checking
the old value, which is one more than a load would show, so replace ≥
0 with > 0.
Amends the start of the public history.
Pick-to: 6.10 6.9 6.8 6.5
Change-Id: I6f6804261cd56a5a8bbb276ed7a0ac360c94195e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Let's avoid std::back_inserter for non-complex types, which generates a
huge amount of unnecessary code. The implementation of assign() is far
more modern.
Pick-to: 6.10
Change-Id: Ia8b9c90336af2bebd49ffffd0d69ace761c6aa59
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Despite the name, this class is copyable, as evidenced by the fact it
has a copy constructor. But that copy constructor causes the implicitly-
declared copy-assignment operator to be deprecated.
warning: implicitly-declared ‘constexpr Movable& Movable::operator=(const Movable&)’ is deprecated [-Wdeprecated-copy]
tst_containerapisymmetry.cpp:55:5: note: because ‘Movable’ has user-provided ‘Movable::Movable(const Movable&)’
Amends 2e1763d83a1dacfc5b747934fb77fa7cec7bfe47 (5.14).
Pick-to: 6.10 6.9 6.8 6.5
Change-Id: Ie661f7361a8d86648b21fffdaf9e7d076f86ebe9
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
This patch fixed QtDisplayManager::getDisplaySize
function to use API's that do not require
MANAGE_APP_TOKENS permission.
The function previously failed on 32-bit architectures
with Android 11 aka SDK 30 aka VERSION R due to
createWindowContext requiring MANAGE_APP_TOKENS
permission. The earlier try-catch lead to next error,
because of invalid values.
Amends: 98120622ff1f6f87664f4c42e830000a21391751
Fixes: QTBUG-137027
Pick-to: 6.10 6.9 6.8 6.5
Change-Id: Ia9c3a64ea41ad0575a34a96858851a1123cfc915
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Add "since 6.10" to ExcludeOther's docs.
Found in API review.
Amends c553f39e3d3cd02854850da0dfc639acbae59299.
Pick-to: 6.10
Change-Id: I3edb32d4d50864ddbdde03aaca750d590a0e0854
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The key/certificate lifetime management in our Schannel backend is a
little lacking. We haven't guaranteed that the original contexts are
held alive for the full duration of their usage. Though with default
settings they get persisted to disk so it has been mostly fine.
One problem with that is that the legacy APIs in Windows for this is not
smart enough to figure out that a repeatedly-loaded key is the same one,
so it 'persists' a new file to disk every time we set up a credential
context for a connection. For a busy server this may end up with
creating a ton of small files that don't get deleted (or reused).
By using the ncrypt APIs we don't fully stop persisting _all_ data to
disk, but from testing we now only have one file per key. Regardless of
the amount of connections.
Another patch around lifetimes can be done for dev, and dev only, as
it's quite a bit more extensive, and not fit for picking back to the
LTS branches.
Fixes: QTBUG-136055
Pick-to: 6.10 6.9 6.8
Change-Id: I61398a3773ef8c25aab21df3e78b71f3ab11d488
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
There are no icons for computer, trash, desktop, folders, files etc. on
mobile platforms. QAbstractFileIconProvider tests the
QPlatformTheme::PreferFileIconFromTheme hint, and if set, gives
QIcon::fromTheme a try with an icon name mapped to the icon provider's
icon type.
We have at least some mapping of such standard icons in the native icon
engines, and those engines would also be the right place to perform
additional platform specific look-ups of icons (i.e. for specific file
types). So as a first improvement, try to use the icon engine for file
icon provider icons.
Task-number: QTBUG-134239
Pick-to: 6.10
Change-Id: Ib8c301a19b0d7e23f1d3ebdccde2147709f3ddb3
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
When QGroupBox::checked changes, it disables children, and enables
children that are not explicitly disabled. The group box itself however
remains enabled, so it's possible for user code to override the behavior
for individual child widgets, which can happen accidentally when
the order in which children are added, and the checked state of the
group box is changed, is inconsistent.
We won't change this as it has too many side effects. Instead, document
the conceptually deviation from enable/disable state propagation.
Pick-to: 6.10 6.9 6.8 6.5
Fixes: QTBUG-25938
Change-Id: I2aa37600ec932cd4ce721bfa98f63169eb0d0beb
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
We should not use defaulted arguments of non-trivial type, because
their construction and destruction, even if not passed, is repeated at
every call site, producing O(n) executable code.
By overloading out-of-line, we execute the same code at runtime, but
we have only one copy of the arg construction and destruction, in the
library, O(1) executable code production.
Found in API-review of QAccessibleWidgetV2.
Amends the start of the public history.
Can't pick further than (unreleased) 6.10, because this adds a new
symbol.
Pick-to: 6.10
Task-number: QTBUG-98117
Change-Id: I705bca764992d9e7a2aa1021e0f94006b6817177
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Function has become flaky due to additions made in
84e09e060bedd37d8de7cded7e430371e335c029.
Blacklist for now.
Add missing link to QTBUG-134105 in BLACKLIST file.
Task-number: QTBUG-134105
Pick-to: 6.10 6.9
Change-Id: I2e53ab8de08575f13c950dd92d24ad3017a7dc0a
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Our accessibilityWindow implementation asks the parent for it's window,
expecting that it will always be the same. This is conceptually correct.
However, as we don't represent windows through QAccessibilityInterface
and instead rely on the natively provided element, the filtering out of
ignored elements result in accessibilityParent return a null object once
the parent is the window.
Instead, check if we get an interface that represents a Window, and
if so fall through to the code returning the NSView (after going through
QAcessibilityInterface::window call, which was so far missing).
And if we then get a Window element as the parent, then we don't have
to call accessibilityWindow on that parent again. Instead, return the
result directly and only keep going if we got some other element.
Add a test case that confirms that we now get a valid result for the
window attribute.
Pick-to: 6.10 6.9 6.8 6.5
Fixes: QTBUG-137157
Change-Id: Ifa485734b290284bd5a1286e3b3c18454442fa10
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
A Q_ASSERT() must not have side-effects, incl. ordering memory. So the
implicit loadAcquire() was too strong. The code must also work with
loadRelaxed(), so use that.
Amends the start of the public history.
Pick-to: 6.10
Change-Id: Ib94bd0989d1a358b552275dc3963b014e6e4c180
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
QAccessibleWidget (i.e. V1) has a protected dtor, so V2, which merely
extends V1 because we can't add new virtuals (via a new base class)
due to BC constraints, shouldn't differ in this respect.
Amends bb2121551c3d7b1af1553710bc211ba0e39b4212.
Found in API-review.
Pick-to: 6.10
Change-Id: I0c9a00691a14c600b020ff1a9f433634bb7c8d24
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Says Clang:
tst_moc.cpp:86:14: warning: inline namespace reopened as a non-inline namespace [-Winline-namespace-reopened-noninline]
86 | namespace B::inline C {}
| ^
| inline
tst_moc.cpp:84:21: note: previous definition is here
84 | namespace A::inline B {}
| ^
There's no minimally-invasive fix, because neither
inline namespace B::inline C {}
nor
namespace inline B::inline C {}
are valid C++.
So wrap the whole thing in another namespace ("Qt_", to avoid clashing
with somthing else, incl. our own namespace Qt), so we have roughly
the same structure as before, but with two non-inline outer namespaces
instead of one.
Amends 5222df2be7d10bf44dfc2971774eadcb526b7a13.
Pick-to: 6.10 6.9 6.8 6.5
Change-Id: Ia0e35e87934abebc76b719e3bd8124ac77ea07f5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
We should not use defaulted arguments of non-trivial type, because
their construction and destruction, even if not passed, is repeated at
every call site, producing O(n) executable code.
By overloading out-of-line, we execute the same code at runtime, but
a) we have only one copy of the arg construction and destruction, in
the library, O(1) executable code production, and b) being out-of-line
in the library, the compiler can optimize the call to the base class
ctor away, if it wants to, because it sees its implementation.
Found in API-review.
Amends bb2121551c3d7b1af1553710bc211ba0e39b4212.
Pick-to: 6.10
Task-number: QTBUG-98117
Change-Id: Ib6a3b15cc861893797c0445a91691132b21bbf2c
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
The current approach for custom titlebar uses an overlay of a
frameless popup window at the position of the titlebar area. This
involves synchronizing the window state, position and size of the
popup window with the original window. Also, the drawing of
rounded edges needs to be done manually with the old approach.
This patch adds the titlebar as a real child to the
original window, so that the window manager takes care of the
synchronization and clipping process.
Fixes: QTBUG-135643
Fixes: QTBUG-133943
Fixes: QTBUG-133946
Pick-to: 6.10 6.9
Change-Id: I1770580a1c306074f41a7ff64c1d525c93918480
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
There were some artifacts added (white pixels and bad anti aliasing)
when the icon was changed in e771e5e2d7ae77f46d01f087242e0f777fdc02ac
Pick-to: 6.10 6.9 6.8 6.5
Change-Id: I12a8658090a1f081321e53433d17fc19ad3e5f12
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Updated the description to match Qt 6 behavior,
clarifying that the instance argument now follows
the member function pointer.
Fixes: QTBUG-113401
Pick-to: 6.10 6.9 6.8
Change-Id: I6cb9c63718790eda153bc5202ed4eb1d23f032bc
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Sync the cmake arguments to search for DB2 with the rest of the qsql
find modules and provide a DB2_ROOT env or cmake var.
Also allow the old variables as a fallback.
Pick-to: 6.10
Change-Id: I587e519b5cf3513e9580f64f0fb9b46bf789da5c
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
It's easier to interpret an "SEGV_MAPERR", "FPE_INTDIV", or "ILL_ILLOPC"
rather than "code 1".
Alongside the decoded instruction pointer from the previous commit, we
now get a message like:
Received signal 11 (SIGSEGV), code SEGV_MAPERR, at address 0x00005637dd5c1346, for address 0x0000000000000004
Change-Id: Ic9f54e06fd2956fea3ccfffde7aa7b54167333b7
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Change-Id: I4d90d8ea8d25b89c9e8dfffd0210fc99e0d5ac3e
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Sometimes, fillMetaData() is called with a QFileSystemEntry with only
the native (QByteArray) format, which we used above in this function
anyway in order to lstat() and stat() the path. This avoids forcing the
QFSE to create the QString form for us to check the first character.
Pick-to: 6.10 6.9 6.8
Change-Id: I8d93f6db83a28d70a192fffd6668734a8024b88b
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Our wrappers around the statx(2) system call on Linux return the
negative of errno, to avoid setting errno and reading it back for the
OSes where the system call doesn't apply. That means the vast majority
of errors from qt_lstatx() will not be -1 (the most common being -2 for
ENOENT) and we'd thus not enter the next block:
// second, we try a regular stat(2)
if (statResult == -1 && (what & QFileSystemMetaData::PosixStatFlags)) {
Pick-to: 6.10 6.9 6.8
Change-Id: I489e7c9ee1327fb98510fffd315c66948956534f
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Amends efe41182fda94c0e4805c24b3305577e5da81880.
The code already tests for QT_NO_WIDGETS before including and using
Widgets APIs, and we will want to extend the corelib_snippets target
with more of the existing snippets code to make sure that they build.
To not break -no-widgets builds, don't link against Qt::Widgets unless
the feature is set.
Pick-to: 6.10
Fixes: QTBUG-137556
Change-Id: Ic30fd519416068c275c3fffd0e1df10a76ce8fad
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Amends 7d0017cda8fde28a1130feaeecf41010b40e3cb3 which added the APIs,
and ef7e5ea616a3f04ff0ba5f6fe34487a332152b01 which only added the guard
for QListWidget.
Address header review comment.
Pick-to: 6.10
Task-number: QTBUG-137478
Change-Id: I405190190f4d64dd810d7d35e9ef616ab0147b19
Reviewed-by: David Faure <david.faure@kdab.com>
Clang informs that ITERATIONS_PER_THREAD need not be captured:
tst_qpointer.cpp:548:66: warning: lambda capture 'ITERATIONS_PER_THREAD' is not required to be captured for this use [-Wunused-lambda-capture]
548 | QThread::create([&startSemaphore, &targetObject, ITERATIONS_PER_THREAD]() {
| ~~^~~~~~~~~~~~~~~~~~~~~
Make ITERATIONS_PER_THREAD (and NUM_THREADS, while at it) constexpr,
indicating even to non-language-lawyers that these variables, indeed,
need not be captured, then drop the capture.
Amends 253f34082f526ff1ffd9eaefac73cc9aa616ab2a.
Pick-to: 6.10 6.9 6.8 6.5
Change-Id: I27d94763058e1dcea3a65d4ff2c859b40336446f
Reviewed-by: David Faure <david.faure@kdab.com>
The old code used the same type of container for both target and
source in the range-assign() test. This limits our test coverage.
Fork the test to explicitly test with random-access (std::vector), as
well as forward-only (std::forward_list) iterators. This ensures we
have coverage of random-access, forward as well as the existing input
iterator types.
Amends 426d975cee9c783aec0832f376b836cdabee983f.
Pick-to: 6.10 6.9 6.8
Change-Id: I59c7a322ecbcc564baa1263e02b234bc53563fac
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
A container is not an iterator, so don't call a container
'iter'. Since we're copying from it, call it 'src'.
Amends 7cbdc8abbda12488f51317313347bbc220b42fe0.
Pick-to: 6.10 6.9 6.8
Change-Id: I7732465f222032b2833396576873fed370f71d11
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Those weren't caught for the Qt 6.0 release.
Pick-to: 6.10
Change-Id: I5831d4ad80b7f60d8782fffd6c64ef552f82ad6e
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
The function append the unique entries to the CMAKE_CONFIGURE_DEPENDS
property. This suppress the ninja recompat issue, which complains
about the duplicated entries in that come from the
CMAKE_CONFIGURE_DEPENDS property. It's likely the CMake issue, but
we may work around it.
Pick-to: 6.8 6.9 6.10
Change-Id: I2f10834b0dca3d2aa08fe13fba69849e97fa77d0
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Because we were consulting GetLocalTime we didn't get disambiguated
times for repeated hours. Drop that code-path and simple rely on
GetSystemTime instead.
Done-with: Mate Barany <mate.barany@qt.io>
Done-with: Edward Welbourne <edward.welbourne@qt.io>
Fixes: QTBUG-133656
Pick-to: 6.10 6.9 6.8
Change-Id: I3f1f09edfd9fb3135ccc12bf98e06254327e76fe
Reviewed-by: Mate Barany <mate.barany@qt.io>
We previously asserted that the reply was not nullptr, except in some
special circumstance. But then we proceeded to dereference it anyway.
This was then recently changed to be an if-check, but that just
highlighted the logic-flaw (and made static analyzers warn about it...)
What we want to assert is that the stream object is valid and
conditionally return early if the reply is nullptr, which it is for
promised streams, since no request has been made yet so no reply is
created.
At the same time, update the logic in the QHttp2Stream to not store or
emit header-related signals for a stream that has been reset.
Pick-to: 6.10 6.9
Change-Id: I55d69bbedc027893f6ad125c29468a34e7fb406f
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
We already have the alias for it, we just never updated the stored
member to use it.
Pick-to: 6.10 6.9 6.8
Change-Id: I850c9f0b899a15603b4c5ac83693019b856effb2
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Now that argumentTypesFromString() actually doesn't normalize types
anymore, all type names are substrings of the signature, and so
QByteArrayView suffices (was: QByteArray) to hold the result.
QArgumentType in only used transitively, during QMetaObject member
function or QObject::connect() calls, so the source string will also
never go out of scope before the QArgumentType object that references
it.
As a drive-by, make the QArgumentType ctor explicit and port from
QVLA::op+=() to emplace_back().
No discernable impact on tst_bench_qobject's connect_disconnect.
Task-number: QTBUG-135572
Change-Id: If6544917b9df8191a256dc2a67e31c6b7e5a38cb
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The argumentTypesFromString() function is clearly documented not to
perform any normalization, yet in typical Qt 6.0 porting rush, it did,
and this kludge was never removed.
Do it now; it's in the way of porting QArgumentType from QBA to QBAV,
and it's causing correct code to incorrectly fail.
This, however, changes the behavior of QMetaObject::indexOf*(), because
they don't fall back to normalization (indeed, these functions are used
as isNormalized checks, e.g. in connect()). So we can't remove the
kludge just yet, but we can drag it out of the fast path and re-try
with QVector replaced by QList when nothing was found using the
original signature. This way, we only pessimize unported users (and
calls that would have failed for other reasons, by scanning for
"QVector<" in the signature).
Add a qWarning() that we'll remove this behavior going forward.
It does, however, fix the bug that signals and slots that contain
types that match, but are not, "QVector<", fail to be found by the
machinery:
[ChangeLog][QtCore][QMetaObject/QObject] Fixed a bug that caused
signals and slots with argument types matching "QVector<"
(e.g. "MyQVector<int>" or "NotQt::QVector<int>") to not be found in
QObject::connect() or QMetaObject::indexOfMethod().
[ChangeLog][Deprecation Notices][QMetaObject] The
indexOf{Constructor,Slot,Signal,Method}() functions are documented to
require input according to QMetaObject::normalizedSignature(), but
accepted a QList declared as QVector. This was an internal porting aid
and is being deprecated now. Watch out for runtime warnings about this.
QObject::connect() and QMetaObject::invokeMethod() are unaffected, as
they fall back to normalizeSignature() automatically.
No change in tst_bench_qobject connect performance, which is
unsurprising, as the benchmark doesn't use a QVector alias.
Amends 03326a2fec416405b437089874f6439e937bbada.
Task-number: QTBUG-135572
Pick-to: 6.10
Change-Id: I7fd9293bba5d2b57b4452e55499ffbf360bc6123
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Before this patch, we did not set the view item positions in the views.
This was fine as they were ignored until
b780eaf6a063a7efe03417cf6b7008a188e222a4 added a condition to early exit
on invalid positions. This then broke all qss background styling using
QStyleOptionViewItem::ViewItemPosition as they were always invalid.
Set the position when trying to draw a cell of the view before
reaching the code handling the qss rules for backgrounds.
Fixes: QTBUG-137346
Pick-to: 6.10 6.9 6.8
Change-Id: I83d7a3ea7b9bab98889791bb807988a74e355b93
Reviewed-by: Santhosh Kumar <santhosh.kumar.selvaraj@qt.io>
For AndroidBackendRegister::callInterface, it would be more convenient
to call simple functions without parameters, without being forced to
specify the void return type. Added a default void type argument for
the return type.
Change-Id: Ib7f631c172955cdf0b2e853155fd57c06bef9843
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
A quick blurb to explain the usecase and limitations of
AndroidBackendRegister, meant for future developers.
Also documents the two public-facing functions, getInterface()
and callInterface().
Change-Id: I79f07d4a19fdb1f4a53529ab42a8663999759f85
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
The native WebGL context is tied to a single canvas,
and can only be used with that canvas. (Qt creates
one canvas per QPlatformWindow).
This means that we need new native contexts in cases
where a QWindow is repeatedly created and destroyed.
It can be tempting to just create a new WebGL context
"behind the scenes" on the makeCurrent() call in this
case, but this does not work since GL resources created
by user code with the original WebGL context in place
are now invalid.
Inform user code that this has happened by signaling
a context loss. This is done by returning false from
makeCurrent(), and then making sure isValid() returns
false as well.
The context becomes invalid whenever the owning platform
window is destroyed; add a call from ~QWasmWindow() which
handles that bookkeeping.
Pick-to: 6.10
Task-number: QTBUG-120138
Change-Id: I929b9bb51153007c16630b1a991399f01ebffa62
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
FreeBSD may return a single POLLHUP revent not coupled with any of POLLOUT nor
POLLERR. This causes a busy-loop, so put POLLHUP into write_flags.
Change-Id: Ief62138eeb6de8e2caf1d6937507bfd828adfb81
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
On FreeBSD when asked for POLLOUT the poll() syscall returns only POLLHUP to
signify the fact that the other side closed the connection. It never sends
POLLERR for EOF cases, which results in a busy-loop inside the Glib dispatcher:
- poll() returns immediately with POLLHUP for a closed socket
- socketNotifierSourceCheck() does not detect it, because .events = POLLOUT | POLLERR
and we get .revents = POLLHUP. The (events & revents != 0) condition evaluates to false
- the code decides there is nothing to do and a new iteration starts
A similar issue in dbus code: https://gitlab.freedesktop.org/dbus/dbus/-/merge_requests/526
Change-Id: I2660a5179031da8eb9fe2562abe7fb283c77f64a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
MSVC exports inline functions, so we're not allowed to remove them. This
is an unlikely problem, though, since it was only called from other
inline functions: if the compiler was inlining content into user code
(as it should), then it would likely have inlined this one too; if
instead the inliner was disabled, then it wouldn't have inlined the
caller either.
Amends commit 1957597aa6bc6ebd8bd1f903389800897411ac5d. Seen in API
review.
Pick-to: 6.10
Task-number: QTBUG-137478
Change-Id: Idd01170c3396c5b6fefefffd748f3335fc42fd79
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
The getAndRef(const QObject*) function failed to initialize
ExternalRefCountData's destroyer field: the Qt::Uninitialized ctor
doesn't init anything and there are no following assignments to the
field, either.
This probably a) caused some Coverty complaint (but I didn't check,
because the Coverity UI is so clumsy) and b) was harmless, seeing as
the -1 in strongref indicated that the destroyer is never to be fired.
Fix it nevertheless by initializing it to nullptr.
Amends the start of the public history.
Pick-to: 6.10 6.9 6.8 6.5
Change-Id: Ib76b4bc00b08289bb8d6d58096b43501b47814d1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
It's unclear¹ whether static zero-initialization of a static
QBasicAtomic actually initializes the object with a zero value, or
whether it remains default-constructed (without a value until a
following call to std::atomic_init gives it one).
Play it safe and use Q_BASIC_ATOMIC_INITIALIZER(0) to dodge any issues
the old code may have had.
¹ see ongoing discussion on the Jira ticket
Amends 04d6495bf773a6bb0d4fa6980df22d3b81a605b0.
Task-number: QTBUG-137465
Pick-to: 6.10 6.9 6.8 6.5
Change-Id: Iee0d75ce10a589390afdd9069b7040a1c9c608e1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Until C++17 (inclusive), a default-constructed std::atomic object can,
officially, only be initialized with a call to std::atomic_init, for
which QBasicAtomic doesn't have API. It is even unclear whether
zero-initialization of static and thread-local objects will cause the
object to be initialized.
QRegion is using QtPrivate::RefCount, but that's just another wrapper
around QBasicAtomic, so it has the same problems: it must always be
initialized.
So don't default-construct and then storeRelaxed() (via
initializeOwned()), use NSDMI with (newly-added)
Q_REFCOUNT_INITIALIZE_OWNED to avoid this dark language corner.
Task-number: QTBUG-137465
Pick-to: 6.10 6.9 6.8 6.5
Change-Id: I4b765aed329211984c35c40fbc5648bf104990ce
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
When project's Android package source directory is set to the
project level (instead of project/android) androiddeployqt keeps
copying the build directory under itself infinitely.
Add check to copyFiles:
-If android source dir is the same as project source dir
-And if current directory copied is in build directory path
Pick-to: 6.5 6.8 6.9 6.10
Fixes: QTBUG-126743
Change-Id: If45766152c6cbf9e2ee916baa5a15282d3fedaf2
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
The comment in the QTRY_IMPL macro definition pertains to the
following using namespace std::chrono_literals, which has nothing to
do with the default timeout of QTRY_ macros, because that is
determined somewhere else. Further, "5 seconds" is not a valid chrono
literal, as "5s" was.
Partially reverts 55f163382d36ddf908fc2884f2020a1b92340c10.
Found in API-review.
Pick-to: 6.10
Change-Id: Ic1242436bf87d7067e3c5240eb2687505e24800f
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
We were always checking 'client' or 'server' usage depending on our own type,
which breaks for any intermediate certificate with the 'ca' usage set.
We assume that any non-leaf certificate should be a CA (if anything),
and leaf certificates must be for client or server usage.
Pick-to: 6.10 6.9 6.8 6.5
Fixes: QTBUG-137041
Change-Id: I268f3bad669df77351fc458f56e318db75ecac7b
Reviewed-by: Mate Barany <mate.barany@qt.io>
QVERIFY that the file could be opened, fail the test if it couldn't.
Pick-to: 6.10 6.9
Change-Id: Iab9b819e70b71fade6a58286edff8e022748d9f6
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Since 9d8663c18e88cb0b5a65f86cfd7726f3d31e04d6, we print a warning when
endResetModel is called without beginResetModel.
This however triggers false positives with a QSFPM if we set a source
model which is resetting at this point in time:
The QSFPM reacts to the endResetModel signal in _q_sourceReset by
calling its own endResetModel, but it does not have the resetting flag
set.
Fix this by deferring the endResetModel work that we are doing in
setSourceModel if the source is undergoing reset.
Task-number: QTBUG-132775
Pick-to: 6.10 6.9 6.8 6.5
Change-Id: I363f2f34a06cc5de031fa87c6274322bf03bd77f
Reviewed-by: David Faure <david.faure@kdab.com>
Recent changes in QDoc's output for QML type reference pages included
rearranging the `extra synopsis` element, i.e, read-only, since, and
deprecation information for properties.
As a result, the existing CSS for the offline documentation caused some
elements to be rendered on top of each other when using the qlitehtml-
based backend in Qt Assistant and Qt Creator.
To fix the layout, set a fixed width for the table elements that
are used to display the properties, property groups, and methods.
This change brings the style of QML reference pages closer to that
of C++ reference, where signatures also have a fixed width.
Pick-to: 6.10 6.9 6.8
Fixes: QTBUG-136990
Change-Id: I72adbeaca46cd9dd99c54368257268dc8db6bfdc
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: David Boddie <david.boddie@qt.io>
The tika mimetype database contains multiple rules that would fit to a
valid file (e.g. svg file that is svg and xml) with the same priority
(50 in case of svg and xml). The choice is thus ambiguous which leads to
regressions in the reported mimetype.
In order to break ambiguity, we look now also at the sub-class-of
element and we prefer sub-classes as they are more narrow and detailed
than the super-class.
The recommended checking order of freedesktop.org suggests that this is
the correct thing to do: "If any of the mimetypes resulting from a glob
match is equal to or a subclass of the result from the magic sniffing,
use this as the result." However, this does not fit perfectly to the
case of the bug report because both results come from magic sniffing.
If two rules match and have the same priority, without one being a
sub-class of the other, there is still an ambiguity. In that case we
now print a warning about the ambiguity.
The patch adds a test for the previously ambiguous case. There is no
test for the warning on ambiguity, because such a test file would be
difficult to generate and is probably not worth the effort.
Fixes: QTBUG-133221
Pick-to: 6.10 6.9 6.8
Change-Id: I1817ec4da947cd91729d0ce35defc9f63cd784d9
Reviewed-by: Mate Barany <mate.barany@qt.io>
This isn't needed, and actually counter-productive, because this mix
used to be ambiguous in Qt 6.5.
Amends 5c563a98a5ffe2a72a641bfa9ed30e17ecffd893.
Not picking to 6.5, because the 6.5 cherry-pick of the amended commit
doesn't compile, so the _L1's were already removed as part of manual
conflict resolution.
Pick-to: 6.10 6.9 6.8
Change-Id: I1810f90c7cf6e3760f1d99e026b291311501c3aa
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
The existing tests were taken from tst_QLatin1StringView. This patch
adds the simple tests from tst_QStringView.
The tests fromLiteral(), fromRange() and fromContainer() are not
included in this patch.
Pick-to: 6.10 6.9 6.8 6.5
Task-number: QTBUG-132097
Change-Id: I1efc0c2d2f474f6644261575a745aa8f7e5ac4b2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
If T is a C-array, like it is in some of our tests, then an instance of
that can never be nullptr, which recent gcc versions think warrants a
compile time warning -Waddress.
As a C array is a valid data structure to instantiate a QRangeModel
from, silence that warning by handling the case explicitly.
Pick-to: 6.10
Change-Id: I63090891988e677cf3ae2d871418b1abd4d1dc71
Reviewed-by: Matthias Rauter <matthias.rauter@qt.io>
The application provided overrides of the Android files were not being
used in aux mode. In aux mode androiddeployqt was only copying the
Android files from the Qt sources and updating them.
With this change androiddeployqt also copies the Android files from the
application source, allowing overrides prior to template processing.
Change-Id: Idf790f1c270691dab8fe093c20e84bed79bf481d
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Propagate the `_Qt6CTestMacros` variable so that
`_qt_internal_get_cmake_test_configure_options` can be used
inside the RunCMake tests
Pick-to: 6.8 6.9 6.10
Change-Id: I2b7f3996315169d840bab3dff011927288c9782d
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
It's no longer available on macOS 26, and we don't use it anymore
anyways.
Pick-to: 6.10 6.9 6.8 6.5
Change-Id: Ia1d0e37dda177f333646e598e517f4af20215dad
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
QSortFilterProxyModel does this exactly, it was missing in
QIdentityProxyModel.
Pick-to: 6.10
Change-Id: If14bc7a377c1ad9235dd70222e3bfbf88eef11c0
Reviewed-by: Santhosh Kumar <santhosh.kumar.selvaraj@qt.io>
In the macOS 26 SDK the NSUserActivityTypeBrowsingWeb is claimed to come
from both Foundation (as in earlier SDKS), as well as CoreServices.
However the latter is not the case on macOS 15, resulting into load
errors with missing symbol.
By explicitly linking to Foundation, and putting it first in the
framework list, we trigger the linker to use the right reference
for the symbol.
Reported upstream as FB17876148.
Pick-to: 6.10 6.9 6.8 6.5
Change-Id: I0c3203f92851ad9fa862aed237823f0e1e28f6ff
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Amend 7c0a96785fee4fea8ef1452166b1dde88957445c and add needed
defines to fix EGL build without x11. Otherwise eglplatform.h
will try to include X11 headers.
See 4cc5428548cb8ab973e4b0281dd123d59bfaf6a0 for more details.
Pick-to: 6.10
Change-Id: I2c284219e83fecf862520a2f667d561adf4d4357
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Builds with DBus but without XCB/Wayland, failed with:
qgnometheme.cpp:(.text+0x3ec): undefined reference to `vtable for QGnomePortalInterface'
/usr/bin/ld: src/gui/CMakeFiles/Gui.dir/platform/unix/qgnometheme.cpp.o: in function `QGnomeThemePrivate::QGnomeThemePrivate()':
Change CMake configuration and build QGnomePortalInterface always with DBus,
except on Apple platforms, where it is not needed.
Pick-to: 6.10
Change-Id: I3fb6400d87ba08f03c30e33924c8c7d483486c3b
Reviewed-by: MohammadHossein Qanbari <mohammad.qanbari@qt.io>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Still causing an internal compiler error with the currently latest VC++
version.
Amends 4e3a1675793995e44f5c84f28bfdc0fd02aa27cc.
Pick-to: 6.10
Change-Id: Ia4290c9b21eb8163180d725ed200629e36e85f1f
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Particularly for the no-parameter case, which fails on any warning, it
makes no sense to not also fail on a critical.
Pick-to: 6.10 6.9
Change-Id: I36f02a7dfb195616ce68babedbccc61480935fb9
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
In tst_QDate the test previously had a hard-coded list of versions by
name. This, however, needed updates on each new release (or at least
new version of QDS), which have been neglected since Qt 5.0. The
tst_QDateTime version, meanwhile, only identified versions by their
numeric value, not their symbolic names.
So borrow the way tst_QCalendar enumerates QCalendar::System, making
QDataStream a Q_GADGET and its Version a Q_ENUM to support this, to
iterate over all versions algorithmically. Apply to both data stream
tests to get a more consistent form for their data tags.
Change-Id: I04d1060cfec822cfcdc0bce6d15b636fc165fe36
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The old way relied on the order of enums within the type; using
fromType() makes the enum specific.
Change-Id: I418473a6983861ca105ccc5eb249f441dbbb28cf
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Changed function names to include parentheses so that they can be auto-
linked to getters and setters for bindable properties.
Pick-to: 6.9 6.10
Change-Id: I72a06a7def55348bd1295e559751a16c62c93a84
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
This commit introduces support for generating Java code for
multi-argument QML signals.
Pre-existing code remains unchanged, and the new code is only executed
when the number of params in a signal is above 1.
Multi-arg signals are handled with a new generated interface type,
named after the signal, which has a default method that takes an
Object[] array and calls the user-implemented signal method with the
arguments cast to the desired types.
For example, a QML signal with the following signature:
signal manyTypeArgSignal(intValue: int, boolValue: bool,
doubleValue: double, stringValue: string)
Is generated into this Java code:
@FunctionalInterface
public interface manyTypeArgSignalListener {
default void onSignalEmitted(Object[] args) {
onSignalEmitted((Integer) args[0], (Boolean) args[1], (Double) args[2], (String) args[3]);
}
void onManyTypeArgSignal(Integer intValue, Boolean boolValue, Double doubleValue, String stringValue);
}
public int connectManyTypeArgSignalListener(manyTypeArgSignalListener signalListener) {
return connectSignalListener("manyTypeArgSignal", new Class[]{ Integer.class, Boolean.class, Double.class, String.class }, signalListener);
}
Task-number: QTBUG-124489
Change-Id: I94e3e88e807017bcbeba16cf0e34263e28e5885f
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
After some of the RST stream handling was updated to more closely
follow the RFC it was accidentally not updating the handleHEADERS
function, and the handleDATA function was handled incorrectly leading
to a potential nullptr dereference.
Amends d17d260948e16549d82f1fdd4dec98d246b0622e.
Pick-to: 6.10 6.9
Change-Id: I345448efd7da92f4f74033b03a5c040b5db9d271
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
It will do this when it gets deleted, but due to deleteLater just adding
an event to the event queue the events that are ahead in the queue may
use the stream in question. This would lead to a variant of
'stream not found', or specifically in the case of the bugreport, a
'HEADERS on non-existent stream' stream error.
Amends 6b4e11e63ead46dde5c1002c123ca964bb6aa342
Fixes: QTBUG-137427
Pick-to: 6.10 6.9
Change-Id: I5f2b2d5660866f1ad12aaafbb4e572b08ed5a6e4
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
...when it comes to dropping them in the swapchain's createOrResize().
There is no wait for command completion normally, unless the
code path that calls destroy() is hit. Therefore, handling msaaTex
like the textures behind any normal QRhiTexture is important. Use the
deferred release mechanism that QRhiTexture's destroy() would use on its
backing textures.
This avoids the occasional validation message when resizing Qt Quick
windows that have both multisampling and Metal validation enabled.
Task-number: QTBUG-112355
Pick-to: 6.10 6.9 6.8
Change-Id: I34549ce47e675d5869239b9330a166b80b40b30d
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Keyboard visibility is now tracked via OnApplyWindowInsetsListener,
which provides reliable visibility state changes starting from API
level 30. In this setup, manually updating the visibility property
is unnecessary and may lead to inconsistencies.
Task-number: QTBUG-98984
Pick-to: 6.10 6.9 6.8
Change-Id: Ife80898e20d4038efeae3438fb89b593bdaa056a
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
The m_keyboardIsVisible variable already reflects the current
keyboard visibility state. This commit simplifies the
isKeyboardHidden() method by using it directly, removing
unnecessary logic.
Task-number: QTBUG-98984
Pick-to: 6.10 6.9 6.8
Change-Id: I6bba90e6fbfb1191415e7ee812517ca15ac1c937
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Starting with API level 30, keyboard visibility can be easly checked
using [0]WindowInsets.isVisible(int). This eliminates the need for
relying on callbacks to detect when the keyboard opens or closes.
This commit updates the logic to track keyboard visibility by
observing changes via OnApplyWindowInsetsListener and checking for
visibility changes using the new API. From now on, for API 30 and
above, the internal keyboard visibility property should no longer be
updated manually.
[0] https://developer.android.com/reference/android/view/WindowInsets#isVisible(int)
Task-number: QTBUG-98984
Pick-to: 6.10 6.9 6.8
Change-Id: I40f3ccc4e652f1ae0c6c0ebd154d690d1a9d7ca8
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
When doing a streaming conversion, it is not enough to check whether
there are errors. Once all input has been consumed, one must also check
whether there has been any data that was consumed, but not converted
yet. Provide finalize() to do the check, set an error if there was
incomplete data, and to optionally write replacement characters for it
to an output buffer.
[ChangeLog][QtCore][QStringDecoder] Added finalize(), a function to
force the converter to consider the sequence of inputs as complete,
flushing potential partial character sequences.
[ChangeLog][QtCore][QStringEncoder] Added finalize(), a function to
force the converter to consider the sequence of inputs as complete,
flushing potential partial character sequences or restoring state for
stateful text encodings.
Change-Id: I5fe26ae8e5d1477a86b365cc49c430b057876893
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
It is not that important to warn about the DXGI factory being stale
when a screen gets connected or disconnected. It is not an error,
and happens every time if a screen gets added or removed while the
application is running.
Pick-to: 6.10 6.9 6.8
Change-Id: I414668dc7aa0279f63fc79799ea53101065ab013
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Until C++17 (inclusive), a default-constructed std::atomic object can,
officially, only be initialized with a call to std::atomic_init, for
which QBasicAtomic doesn't have API. It is even unclear whether
zero-initialization of static and thread-local objects will cause the
object to be initialized.
To fix, port from QBasicAtomic to QAtomic (which initializes to zero).
Task-number: QTBUG-137465
Pick-to: 6.10 6.9 6.8 6.5
Change-Id: I31a95b36506c376ef0817ef3d61bd8ca02371585
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
All callers of QContiguousCache<T>::allocateData() followed the call
with a storeRelaxed(1) to the ref member. So we can just drag that
into the function itself.
Next, it's UB to storeRelaxed() into a default-constructed std::atomic
(and, therefore, into a QBasicAtomicInt), because until C++17
(inclusive) you're supposed to use std::atomic_init to assign the
first (and only the first) value to a default-constructed
std::atomic. QBasicAtomic doesn't have API for that, so you can never
assign anything to a default-constructed QBasicAtomic.
To fix, use placement new to be able to create a QBasicAtomic directly
with an initial value (replacing QBasicAtomic with QAtomic wouldn't
help here, either, since a malloc doesn't run ctors).
A proper fix has to wait until we can depend on C++20's atomic_ref,
which decouples the underlying type from the atomic operations
performed on it, letting us depend on malloc's zero-initialization
of an int member properly initializing it even for a following atomic
operation on it.
Task-number: QTBUG-137465
Pick-to: 6.10 6.9 6.8 6.5
Change-Id: Ic22d0766bcffb967a86c8ec28b63ee480aebd4a0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
On Windows, macOS and iOS both text and description are read out. On
Android the description is only used, when there is no name/text and
the result is used in AccessibilityNodeInfo::setContentDescription
while AccessibilityNodeInfo::setText is ignored. Using the content
description only is right, because Android will prioritize description
over text. So we need to do our own concatenation to use both.
Using ", " as separator looks like the right way, because Android use
it to separate the text from the role too. This was checked by enabling
TalkBack settings -> Advanced settings -> Developer settings -> Display
speech output.
Fixes: QTBUG-128494
Pick-to: 6.10
Change-Id: Ib25e993ffc8614b9c9ccdc37207f2c3c496ecb1f
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Until C++17 (inclusive), a default-constructed std::atomic object can,
officially, only be initialized with a call to std::atomic_init, for
which QBasicAtomic doesn't have API. It is even unclear whether
zero-initialization of static and thread-local objects will cause the
object to be initialized.
But initialization with = {} is definitely fishy, because that, by
definition, invokes the problematic default constructor. So make the
initialization explict with Q_BASIC_ATOMIC_INITIALIZER(0) instead.
Amends 4a154170773199f5b3376496c7b1a1c4530744e9.
Task-number: QTBUG-137465
Pick-to: 6.10
Change-Id: I177e05c09e20e0830af7bf1ccb650afc860ab9d5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Avoid some code duplication by using a template parameter for
qMakeError() and qSqlWarning().
Pick-to: 6.10
Change-Id: I698ab063fce6c7be1cb3debdb9e83978eac10409
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
This reverts commit 7796ad3face5246ad62a959b61fdd3a92cea2803.
Reason for revert: the code is not doing critical data parsing.
Pick-to: 6.10 6.9 6.8
Change-Id: Ic07b98c3866b65d0575e29abe97ca6b284c981bb
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Replaced the manually defined copy constructor with = default to
improve clarity and maintainability.Added a default copy assignment
operator to ensure consistency,as copy constructor and copy
assignment should be defined as a pair.Also included defaulted move
constructor and move assignment operator in accordance with the rule
of 6,ensuring the example is modern,complete,and suitable for
educational purposes.
Fixes: QTBUG-111392
Change-Id: Ia7cfccfc46182d8d9102868fc93dc0ebd9649a32
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Clarified the Paint System introduction to better convey
its purpose and highlight its flexibility across different surfaces.
Fixes: QTBUG-136487
Change-Id: Ib636087b9bae4d08541566145c4a0943dccb5432
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
The escaping for '{' was wrong in the previous commit.
Amends 38277a88f1dd69de6e031bc8313c8d5beadf6bd0
Pick-to: 6.8 6.9 6.10
Task-number: QTBUG-122642
Change-Id: Ia363c76b27e527114769b4a923418cddad5586f1
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
The kludge that was added to argumentTypesFromString() for Qt 6 to
support merging QVector into QList—specifically, the replacement of
QVector< with QList<—was unfortunately not removed before the Qt 6.0
release. As a kludge, it has unintended consequences, as Thiago
pointed out in a comment on a related patch.
This change adds a reproducer that demonstrates cases where the
kludge causes correct code to fail incorrectly. We need this test to
ensure that we do not silently change behavior when deprecating and
eventually removing the kludge.
Adapt the MyQList normalization test, which was carefully written to
avoid hitting the kludge, to use template arguments. This will allow
it to trigger the buggy code path and avoid confusing the reader with
the mention of a non-template MyQList, given that MyQList is now a
template.
Reported-by: Thiago Macieira <thiago.macieira@intel.com>
Pick-to: 6.10 6.9 6.8 6.5
Task-number: QTBUG-135572
Change-Id: I91d769d494489fe63dbbb67f849b78fc7aa39ec6
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
As already happens in the implementation for the
handling of all other AT-SPI interfaces
(called from AtSpiAdaptor::handleMessage), also
warn when an unimplemented/unknown method gets called
for the Application interface: increase log level
to warn and align message with the one used for
the other interfaces, so this can be more easily
identified.
Task-number: QTBUG-137344
Pick-to: 6.10
Change-Id: I33d3811fd34ca0f9f4b1ab9d809f505c12c6517c
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Accidentally used clientStream instead of clientStream2.
Test still passes though.
Pick-to: 6.10 6.9
Change-Id: I118f1e429faa0367f0b4d02c74a221027ecb2b4d
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
This class was never pimpled in Qt 5.
Amends the start of the public history.
Pick-to: 6.10 6.9 6.8 6.5
Change-Id: I5761bb0e8401dd654a885b5edcf821be9e4c2694
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Initialize the shared QColormapPrivate on first call to
QColormap::instance, in a thread safe manner for good measure,
and clean it up on app exit if needed.
The cleanup now also accounts for the possibility of QColormap
instances outliving the cleanup. We still reset to a new QColormap
on next use, following the existing behavior.
Change-Id: Ia16a84994b3ee05f9431ba24dd9126f2dc271b61
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
This reverts commit 38279dea558b06cef6c1d345962df3063fd12c5b.
Causes endless complaints about old GPUs (e.g. PowerVR) on Android and
embedded Linux.
Qt 6.8.2 restored the Qt 5 behavior of writing program binaries to files
every time a GL shader program is linked. That is in addition to the Qt
6 pipeline cache, which writes out all collected program binaries once
in one go, when the QQuickWindow is closing.
The Qt 6 abstractions are modeled after the VkPipelineCache-style
system, meaning no way to query and write out individual
program/pipleline binaries, just an ever-growing blob containing
everything encountered so far, which we then want to do rarely due to
the potential cost and the size of the blob, so e.g. when the Quick
scene is shutting down.
Before 6.8.2, Qt 6 did the logical thing and disabled the Qt 5 legacy GL
disk cache code path, since we do not need two caches concurrently. From
6.8.2 on, when running with OpenGL, there are now two parallel disk
caches. Because the Qt 5 style one works even if the application is
killed. Which is unexpectedly common on mobile/embedded.
Pick-to: 6.10 6.9 6.8
Fixes: QTBUG-133904
Fixes: QTBUG-134245
Fixes: QTBUG-134089
Fixes: QTBUG-135411
Fixes: QTBUG-134496
Fixes: QTBUG-135810
Change-Id: Icbd880898941195fcbc2da544e1599867c6d5f51
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
These can be set on the font directly, but had not been added to
QTextCharFormat, so there would be no way to override them by
formatting in a rich text document.
Fixes: QTBUG-134060
Change-Id: I4494e24cb9b99d84fb376ba895e2461fc3cd054b
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Previously QT_CMAKE_EXPORT_NAMESPACE was set by calling
find_package(QtBuildInternals) at repo dir scope, even in a top-level
build.
Starting with ddcafa0a51c65d86f6b5481f06fce5faeb75920d in
qtdeclarative, we now have a deferred call of
_qt_internal_write_deferred_qmlls_build_ini_file in the
CMAKE_BINARY_DIR scope, which lacks the QT_CMAKE_EXPORT_NAMESPACE
variable.
This caused errors in a top-level standalone tests build:
Error evaluating generator expression $
No target "::qtpaths"
CMakeLists.txt:DEFERRED
To avoid the error we now set QT_CMAKE_EXPORT_NAMESPACE in the
top level scope.
To avoid duplicating the code into the QtBaseTopLevelHelpers,
we extract the qt_internal_top_level_setup_cmake_and_export_namespace
function into a new QtBuildInternalsHelpers.cmake file, which is
included by both QtBaseTopLevelHelpers.cmake and
QtBuildInternalsConfig.cmake.
We also copy and install that file.
This has less side effects than trying to call
find_package(QtBuildInternals) in the top-level scope.
Pick-to: 6.10
Change-Id: I8e54e21d3f07ee86860cad49d6e43e0fdefbcee3
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
We didn't copy the standalone test template files into the build dir
when configuring a prefix build.
We also need to copy the mkspecs.
Pick-to: 6.8 6.9 6.10
Change-Id: I517165b2b8db84b0766935e3d535a7a1ef2b6ad9
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
most convenience functions in qfiledialog.cpp (e.g. getSaveFileUrl, getOpenFileUrl) open modal dialogs, with the exception of getOpenFileContent and saveFileContent. This makes every function consistently open modal dialogs
Fixes: QTBUG-137329
Pick-to: 6.10 6.9
Change-Id: I48952144ed15596b9acba3230c63cece613fb045
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
d4c518b210ad56cb51c17e6e1b4a81b0deb7253c has implemented a reset of the
icon on a style change.
This has caused a regression, because it overrode an icon set by a
style sheet.
Do not reset the icon if the new style is a QStyleSheetStyle.
Amdends d4c518b210ad56cb51c17e6e1b4a81b0deb7253c.
Fixes: QTBUG-137011
Pick-to: 6.10 6.9 6.8
Change-Id: Ib77faa03c867b2660a45bdc3ab94e7d739eed4f8
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
The patch 732962d604e7469f9a9f02fe0cd3d1fd04caddb8 enables drawing a
border around cells within the table when set through CSS styling. But
this caused a regression when border-collapse is enabled without setting
the cell border. This patch enables drawing borders for table cells
when either of those conditions is satisfied.
Fixes: QTBUG-136590
Pick-to: 6.10 6.9 6.8
Change-Id: Ibf43c404439c9fee1cfd2b40789150edb76c6971
Reviewed-by: Nils Jeisecke <nils.jeisecke@saltation.com>
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
Once is fine. We don't need to set the environment before each test
function.
Pick-to: 6.10
Change-Id: Id27938950c196d6d3397fffd2fbf1a66fe7504f9
Reviewed-by: Liang Qi <liang.qi@qt.io>
Reviewed-by: David Redondo <qt@david-redondo.de>
Mark qtandroidplatformfiledialoghelper.cpp as security critical with
"data-parsing" as a reason.
Data parsing in nameFilterExtensions() using QRegularExpression.
Fixes: QTBUG-136820
Task-number: QTBUG-135178
Pick-to: 6.10 6.9 6.8
Change-Id: I378698327a36496317782d6dc0acd092c19de7ca
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
After e115c60b6da0db7013229e678720f36632c2e614, the comparison with
a type which is different from QProperty::value_type, but is comparable
to it, could result in ambiguous operator==() overloads.
Fix it by adding a new overload for operator==(QProperty<T>, U), where
operator==(T, U) exists.
Explicitly delete operator==(QProperty<T>, QProperty<U>) for such
types T and U, because the implicit conversion might be unwanted here.
The user should manually call .value() at least on one property, if
they want the comparison. Note that GCC does not allow to do it,
treating `= delete` as declaration and complaining about a default
template argument in friend template declaration. So, do it only for
Clang and MSVC.
Amends e115c60b6da0db7013229e678720f36632c2e614.
Task-number: QTBUG-134921
Pick-to: 6.10
Change-Id: Id3ed48738cc462b5b0820fa3b25d80d4d4414548
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
As a last resort for users who have existing Qt 5 applications and
see differences in line metrics when porting to Qt 6, we introduce
an environment variable which lets them restore the old behavior
as a last resort.
This is primarily meant as a porting tool, since we do have other
tools, such as QFont::PreferTypoLineMetrics to work around issues
with fonts that by mistake do not explicitly set the
use-typo-metrics flag even if these are valid.
Pick-to: 6.8 6.9 6.10
Fixes: QTBUG-134602
Change-Id: Id1d7829888d55247d2f07ee0a49b91ff34f26889
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
If we move from landscape to inverse landscape orientation, the window
will not lay out, so we won't hit viewWillLayoutSubviews, but we still
need to reflect the new orientation of the screen.
Task-number: QTBUG-137249
Pick-to: 6.10 6.9 6.8
Change-Id: I9655052772990ca524c5b94e25b2c58cc058ff67
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
In bc014d5fc705e95bb34b7729b2c3bb5f9539d777 we stopped using the device
orientation as source for the QScreen orientation, as the former reports
the orientation independently of any locked orientation, while QScreen
is supposed to reflect the logical window-manager orientation.
However in doing that we lost the inverse orientations, which can be
useful in some cases.
We now use UIWindowScene.interfaceOrientation as input, and fall back
to the primary orientation only if we can't resolve the window scene's
orientation.
Interestingly, for visionOS, UIWindowScene.interfaceOrientation reports
portrait orientation, which should be investigated further, but for now
we trust what the system gives us.
[ChangeLog][iOS] QScreen::orientation() now reflects the inverse
portrait and landscape orientations, as long as system allows
rotating the UI to those orientations.
Fixes: QTBUG-137249
Pick-to: 6.10 6.9 6.8
Change-Id: I8d20f05e72abcec446fd39342c8632960337943a
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Doris Verria <doris.verria@qt.io>
QTreeViewPrivate::doItemsLayout might get triggered when accessibility
elements query properties of items, such as the state or geometry. If we
reset the model immediately, then the items that are currently querying
might get destroyed, resulting in crashes.
Instead, use a queued invocation to reset the model only once control
returned to the event queue. This leaves current elements intact.
Amends 6a4afebc5ce8db69a6c9fb398cada31e6bad5e3c and follow-up commit
a86321cb665b1af03b245b3b0fe0b57faa4a678f.
Pick-to: 6.10 6.9 6.8
Fixes: QTBUG-136074
Task-number: QTBUG-133855
Change-Id: I2c6acda3b31105447393a6efcb85ddf737161fe8
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
The windows vista style sets the widget attribute for certain widgets to
have the Qt::WA_Hover attribute, which makes the widget eligible for
receiving hover events from QApplication::notify(QObject*, QEvent*).
However, if the windows system had enabled a high contrast theme,
the QWindowsVistaStyle::polish(QWidget*) function would return early,
without making any widgets eligible for receiving hover events.
Fix the issue by enabling hover events for select controls first,
before potentially returning early due to using a contrast theme.
Pick-to: 6.10 6.9 6.8
Change-Id: I5562f46385c6f1b498bc659c65e501f9e9376db3
Reviewed-by: Santhosh Kumar <santhosh.kumar.selvaraj@qt.io>
Check that a slot that was declared using QVector ends up stored as,
and can be called with, QList (and QVector).
Also check that the various indexOf*() methods do the QVector</QList<
normalization, even though they're documented to require normalized
input. A subsequent patch will deprecate that behavior, so make sure
we don't break it as we change it.
Amends 1fa31be7ce3a6899f1c1597311d7593648ecd1d8.
Pick-to: 6.10 6.9 6.8 6.5
Task-number: QTBUG-135572
Change-Id: Id28bf3c4163099f07213bfbf7d296b4fd76b71a5
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Coverity complains that the =default'ed default ctor leaves
m_decorationsContext and m_api uninitialized, which is true.
To fix, use NSDMI for the former.
For m_api, initialize it in the default constructor's member
initializer list, because the default value is closely related to the
other constructor's choice of value¹, and so should be more proximal
to the other constructor's initialization of m_api (which is
dynamic). Using NSDMI for m_api would also remove tooling's ability to
detect faults in the other constructor.
¹ I had to track into QSurfaceFormat to verify which of the possible
values is the correct one (= the one that gets mapped from
DefaultSurfaceFormat by the switch in the other QWaylandGLContext
ctor).
Amends 7c0a96785fee4fea8ef1452166b1dde88957445c.
Pick-to: 6.10
Task-number: QTBUG-110758
Coverity-Id: 481857
Change-Id: I837d0a3a63bd6e2948ef1c9757e250bfba7dd957
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
beginBatchEdit() means the start of a batch of related input operations
from the Input Method Editor. We should not restart input until
endBatchEdit() is called. Restarting it before may cause issue with
inactive InputConnection.
This commit fixes an issue where calling
InputMethodManager.restartInput() during a batch edit (e.g., between
beginBatchEdit and endBatchEdit).
Pick-to: 6.10 6.9 6.8
Fixes: QTBUG-136229
Change-Id: I408e6dfd8a91f2d0f1dd8c18dc0dcc2d13cc3e38
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Remove the obsolete reference to the atomicfptr directory in the error
message.
With the improved error reporting of the parent change, the build
system will now dump the output of the atomicfptr test in case of
failure, which should provide more information about what goes wrong.
Pick-to: 6.8 6.9 6.10
Fixes: QTBUG-133687
Change-Id: Iaffc992f90c06425113cc2ef721d87d31e97bbc6
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
TEST_x86intrin_OUTPUT is not set anymore since we lazily evaluate
compile tests after 605913f9d7a60461939c1a8fb8dac05054cade2d .
Use the new qt_configure_add_report_entry
COMPILE_TESTS_TO_SHOW_ON_ERROR option to dump the test values in case
of an error.
Amends 9e9099865a0881ac5bb6035237e0a0c86962c45f
Pick-to: 6.8 6.9 6.10
Task-number: QTBUG-122596
Change-Id: I48d1c57145ad5d9418631025927581c4eb5ec93c
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Starting with 605913f9d7a60461939c1a8fb8dac05054cade2d we run
configure.cmake compile tests lazily during feature evaluation.
This means that qt_config_compile_test() calls will no longer set
TEST_foo_OUTPUT variables in the scope of configure.cmake files and
thus the build output of compile tests is no longer available for
configure summary error reports.
Instead of setting the output variable in the caller scope, save the
output in a global property.
Then, when we add error reports that mention compile tests either in
CONDITION or in a newly introduced COMPILE_TESTS_TO_SHOW_ON_ERROR
option, dump those outputs in the error report.
We continue to set the output in the parent scope, in case if
qt_run_config_compile_test is called manually.
Amends 3334a77ecfb792fba0144e99887f11cd0fa2506d
Amends 605913f9d7a60461939c1a8fb8dac05054cade2d
Pick-to: 6.8 6.9 6.10
Fixes: QTBUG-137198
Change-Id: Idc0470556a053123286983c44063e17b7eb9949d
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Capture the output of the check_cxx_source_compiles calls in
qt_internal_add_link_flags_no_undefined like we do for
qt_config_compile_test.
Amends 3334a77ecfb792fba0144e99887f11cd0fa2506d
Pick-to: 6.8 6.9 6.10
Task-number: QTBUG-137198
Change-Id: Ic7dd4eae0ac1af0f8293f2ce285d2987e4e26249
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
- quuid.cpp parses the string representation of a UUID
- qfactoryloader.cpp parses metadata from loaded plugin
- qcoffpeparser.cpp, qelfparser_p.cpp and qmachparser.cpp as they are
binary object files parsers
- qlibrary.cpp, qlibrary_unix.cpp, qlibrary_win.cpp, qpluginloader.cpp
are responsible for finding and loading plugins from untrusted
locations.
Fixes: QTBUG-135193
Change-Id: Ibbcefeab80e7455225ade620bdba45dbc592c581
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Matthias Rauter <matthias.rauter@qt.io>
Amends commit fddb6fceaa28df2a24f7bdd216792985bf8141d1 - the code in
qtestcrashhandler_unix.cpp is written to compile for WASM, and some
declarations in the _p.h aren't excluded on WASM, so the exclusion of
the .cpp when WASM lacks threads lead to linker errors.
Pick-to: 6.10
Change-Id: Idb941643302ed5a4c084d0fd2b4dfc07a44122e3
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Piotr Wierciński <piotr.wiercinski@qt.io>
Amends commit 35adb74ddd915831789f0175423660f8e898942e (from 5.15) to
reflect the improved precision of 64-bit int when stored as a JSON
value.
Task-number: QTBUG-28560
Pick-to: 6.10 6.9 6.8 6.5
Change-Id: I07915bc190dd7696e58356143e8857f91e888c67
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Got the name of the numeric tokenizer helper wrong, making the
cross-reference comment misleading.
Pick-to: 6.10 6.9 6.8
Change-Id: I88b850975aa77b6175e8d95afa2960e589c42d8d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The default value is 0x070000, via qtdeprecationdefinitions.h
Pick-to: 6.10 6.9 6.8
Change-Id: I78586231e123321a11d41ec8c1324ab928e5fdc8
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
This reverts commit 6854ea63365ae419a04a470eb17e5f7662f00931.
This caused errors in a Qt Declarative test. It's possible the test
is depending on assumptions that are not strictly true (such as
QFontDatabase::styles() never returning an empty list), but it's
a surprising side effect and should be investigated. So we revert
until it can be addressed.
Pick-to: 6.10 6.9 6.8
Reopens: QTBUG-135817
Fixes: QTBUG-137398
Change-Id: I2e673b316f3d5fc14342b36095f9983ad55ea796
Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
Adding in the wrong order yields a QIcon that does not provide the
expected or desired behavior.
Fixes: QTBUG-135652
Pick-to: 6.10 6.9 6.8
Change-Id: Ie1f6e50ee82ddaae8857b076c383ede20ab872df
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
Currently the QIOSScreen::grabWindow implementaton relies on
UIGraphicsBeginImageContextWithOptions to do a screenshot. This API
is deprecated and produces a few warnings logs that we can't silence
even when we handle the errors. The current approach also has a memory
leak when taking screenshots in rapid succession (i.e 60 FPS).
This patch modifies grabWindow() to use UIGraphicsImageRenderer, which
replaces the deprecated API. This no longer produces warning logs when
errors are handled. This API can be used in the future to let us take
HDR screenshots once Qt has support for this. This patch solves the
mentioned memory leak.
Pick-to: 6.10 6.9 6.8
Change-Id: Ifbc8503482886246ce9611d0b7a19462fc830ecd
Reviewed-by: Tim Blechmann <tim.blechmann@qt.io>
putenv/setenv are not thread safe. The Qt wrappers lock a mutex
but this only works if all users use it.
Fixes: QTBUG-136450
Pick-to: 6.10
Change-Id: I9a46b5be607c84436864afcf7eb063275e065738
Reviewed-by: Liang Qi <liang.qi@qt.io>
Add option MYSQL_OPT_SSL_VERIFY_SERVER_CERT to disable ssl for MySQL
5.7.x and MariaDB. This is needed as MariaDB does not support the
SSL_MODE options but defaults to ssl nowadays.
Also enhance the documentation for MYSQL_OPT_TLS_VERSION and
MYSQL_OPT_SSL_MODE by providing the needed MySQL/MariaDB versions for
those options.
Pick-to: 6.10 6.9 6.8
Fixes: QTBUG-136550
Change-Id: If570cf8e92d0df7c9e2c4d0e009857eaf33f4f2d
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Don't create a QString when comparing the strings from
knownPseudoElements - a QLatin1StringView is enough.
Pick-to: 6.10 6.9
Change-Id: I69e207bac0fb3d3df12ae9d4bebc9cd30cde30de
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
They don't need to be BFFs.
Change-Id: I7017347b348bd8e63dfb5f664c95597f84190e7c
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
The d'tor of QCocoaMenu calls dismiss() to remove the current menu.
dismiss() calls cancelTracking, which doesn't always remove the
menu from its parent.
Remove the menu from its parent in addition.
Fixes: QTBUG-135634
Pick-to: 6.10 6.9 6.8 6.5
Change-Id: Ic8e9b4172c3b2035b7e9ad1b576725923987abf2
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
There is no reason to allocate the OrgA11yAtspiSocketInterface
object only used inside AtSpiAdaptor::registerApplication on
the heap.
Pick-to: 6.10
Change-Id: I2985acb5bd3e2f89c60de2b4ffa77b2a78cb4eff
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
The Android target API level was bumped to 35 in
997a1fae98d35cd0d4d16f37ab68afe2729ff551 so we can
bumb the version of the androidx dependency too.
Pick-to: 6.10 6.9 6.8
Change-Id: I30d561cc0b74645c939e7d3dd595926b6013caf9
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
It means the data contains bits outside the [0, size()[ range.
Found while debugging why these data rows fail in the 5.15 cherry-pick
of 78f8dfc5427457783ceef7d85885cddbec035ebe.
Amends the start of the public history.
Pick-to: 6.10 6.9 6.8 6.5 5.15
Change-Id: Ic21d15da25944d4897357dd27e2986d448b5ee60
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
If the environment variable is empty, we have a couple of fallbacks, one
for Apple Darwin systems and one for everyone else. A non-absolute path
in the environment or the Apple API makes no sense, but this code
retains this defensive measure for them; for _PATH_TMP from <paths.h>,
we assume it is absolute.
Pick-to: 6.10 6.9
Change-Id: I3e486f73276a3ae288d1fffdbfe20a74271f73f2
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Temporary paths coming from the environment must be real filesystem
things, never a Qt file engine, so we don't need to create QDir with its
QDirPrivate, in order to call QFileSystemEngine.
The replacing of canonicalPath() with QFSE::absoluteName() is fine
because canonicalizing *after* cleanPath() is the wrong thing. For
example, if you had:
$ ln -s $HOME/tmp /tmp/symlink
$ TMPDIR=/tmp/symlink/..
then
cleanPath($TMPDIR) = /tmp
absolute($TMPDIR) = /tmp # QFSE::absoluteName calls cleanPath
canonical($TMPDIR) = $HOME
canonical(cleanPath($TMPDIR)) = /tmp
The lack of canonicalization now only affects when the final path is a
symlink. Doing so bought us little security if it is a symlink and it
could change, because the result is not cached and could change from
call to call. That changing is probably worse than any attack, because
you could end up with
QDir::tempPath() != QDir::tempPath()
[ChangeLog][QtCore][QDir] tempPath() may now return a non-canonical
path. This means going up from it (cdUp()) may result in different paths
from string manipulation (adding "/..").
Pick-to: 6.10 6.9
Change-Id: Iddf6f46edf6f3b6c3222fffd1e1e5479f0be92a9
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
xcb-image includes xcb_aux.h, which is part of xcb-util.
0.3.8 is enough for the dependency, it also make Debian 10
(Buster) satisfied. xcb-image is from xcb-util-image, which
should follow same version number as xcb-util. Not sure how
Debian 10(Buster) got xcb-image 0.3.9 with xcb-util 0.3.8
combination.
See also https://lists.x.org/archives/xorg-announce/2012-May/date.html#1965 .
This reverts 92a57e0b016f811876ec1d62328ca8edfe452a3a .
Fixes: QTBUG-86287
Pick-to: 6.10 6.9 6.8 6.5
Change-Id: I838b1e06a25fa1e45470466de17cbb6b6da851a4
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
The only mWaitingForUpdate is checked is to show a debug. The only
public way to call requestUpdate is via QWindow::requestUpdate which has
a guard already.
Change-Id: I542e0f470ec2134f0a9fd415aab6ac7832e77263
Reviewed-by: David Redondo <qt@david-redondo.de>
When sending an object:children-changed:add AT-SPI2 event,
set the actual index of the child instead of always using
the child count of its parent.
If the new child were added at the end, its index would be
"[child count] - 1", but the new child doesn't necessarily
have to have been added at the end.
Therefore, use the actual child index either already used as loop
variable or retrieved via QAccessibleInterface::indexOfChild
instead.
The mismatch could e.g. be demonstrated with a simple pyatspi
script when typing Enter in LibreOffice Writer to create
new paragraphs.
Script:
#!/usr/bin/python3
import pyatspi
def listener(e):
if not e.host_application.name.startswith('soffice'):
return
print(e)
print(f'index in parent set in event: {e.detail1}')
print(f'index in parent reported by child: {e.any_data.get_index_in_parent()}')
pyatspi.Registry.registerEventListener(listener, "object:children-changed:add")
pyatspi.Registry.start()
Sample output without this commit in place:
object:children-changed:add(4, 0, [paragraph | ])
source: [document frame | Untitled 1 - LibreOfficeDev Document]
host_application: [application | soffice.bin]
sender: [application | soffice.bin]
index in parent set in event: 4
index in parent reported by child: 2
Sample output with this commit in place:
object:children-changed:add(2, 0, [paragraph | ])
source: [document frame | Untitled 1 - LibreOfficeDev Document]
host_application: [application | soffice.bin]
sender: [application | soffice.bin]
index in parent set in event: 2
index in parent reported by child: 2
Pick-to: 6.10 6.9 6.8
Change-Id: I30316c59f8ad6fd018089a8dca8e7a8d1d92d7ec
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Remove unused include of qtableview.h in the source - this also fixes
the compilation with feature_tableview = OFF.
Move the missing include of qlist.h into the header.
Pick-to: 6.10 6.9
Change-Id: Ie443cf6f3bf6b76dedc994bf1b8c16daebf9022d
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
There is no non-template overload of LocalFrame::convertToJni, and
clang 18 complains about an explicit .template without a template
argument list. We call convertToJni without either in other places, so
do so here as well.
Pick-to: 6.10
Fixes: QTBUG-136967
Change-Id: I2b4bbc8a4e2056bd2a8bff390ea0847f2e18202e
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
As the AT-SPI XML spec for the Application interface says,
this should currently always be "2.1" [1]:
<!--
AtspiVersion: You should return "2.1" here.
This was intended to be the version of the atspi interfaces
that the application supports, but atspi will probably move to
using versioned interface names instead. Just return "2.1" here.
-->
<property name="AtspiVersion" type="s" access="read"/>
This makes the expected value show up in Accerciser with
pending merge request [2] in place instead of triggering a fallback
path in Accerciser handling the null case for Qt applications.
[1] 2d83e3a6df/xml/Application.xml (L19-26)
[2] https://gitlab.gnome.org/GNOME/accerciser/-/merge_requests/95
Pick-to: 6.9 6.10
Change-Id: I0d849d5d6d160c48fd4fc2d443e4fde43cde5606
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Don't paint through stylesheet code when a combobox label has no
stylesheet set at all.
This should be done also for others but may break existing painting
stuff so only fix this here as it's a regression from
a77a7c157d5cdcc88bf0a02caed2aa5ff8850d06.
Pick-to: 6.10 6.9 6.8
Task-number: QTBUG-131761
Fixes: QTBUG-137108
Change-Id: I462ba198821692aa60e6869df9c8e92332422c44
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
There have been places where regex support has been implied and bootstrap
always builds with regex enabled. Therefore, disabling
`FEATURE_regularexpression` currently produces an error. Until a need
for building without regex emerges, we are enforcing it as a
requirement.
Users must either use system or bundled pcre2.
Fixes: QTBUG-136346
Change-Id: I9e92bb4e7f0dfb84884a2a23f45b20d18ddc8985
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Emit a warning if `FEATURE_*` variable is set. The "feature" is not
registered as a true feature after deprecation.
Pick-to: 6.10 6.9 6.8
Change-Id: I715af231c228c73d70b037ee31aa61edcd45c21e
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
One can now run "ninja android_docs" to generate HTML docs for Android
Java sources of Qt. This is done with javadoc.
One can now run "ninja android_source_jars" to generate source jars for
Android. They're supposed to be loaded into an IDE.
The targets are enabled automatically for Android builds.
For non-Android builds, set QT_BUILD_HOST_JAVA_DOCS=ON to create those
targets. In that case you must also set ANDROID_SDK_ROOT.
Fixes: QTBUG-117028
Change-Id: I2df51153359a95870c055d3ee373b8381f10cb51
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Nicholas Bennett <nicholas.bennett@qt.io>
iOS prl files for static frameworks were previously placed at a path
like
6.8.3/ios/lib/QtCore.framework/Versions/A/Resources/QtCore.prl
This caused qmake to silently fail to find iOS framework prl files.
The failure could only be seen when calling qmake with -d -d:
DEBUG 2: QMakeMetaInfo: Cannot find info file for
6.8.3/ios/lib/QtCore.framework/Resources/QtCore.prl
This in turn can lead to various build failures if a different non-iOS
prl file is found in a system path.
Place the prl file into the root of each framework, e.g. at
6.8.3/ios/lib/QtCore.framework/QtCore.prl
We didn't have this issue in 6.7 and earlier, because by default iOS
was built with static libraries rather than static frameworks.
Amends 291817b0bf3f351843b0c1d0de237dc8df5c0fa5
Pick-to: 6.8 6.9 6.10
Fixes: QTBUG-137297
Change-Id: Idff8e808e9bfc009f82d2a59e5e6752ed8a55714
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
In addtion to 1cf03c974c433b7a5330b56bd9e519287fce6f7f we should also
enable all warnings in the template as a recommendation for users.
Pick-to: 6.10
Change-Id: If60a3d9f3c1fd97b49ec7513f781bdfe1775d9d4
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
...not only on the next frame.
Pick-to: 6.10
Change-Id: Iad31a3d80576c5cd8fa3ba7f64a39d7a6a01337a
Reviewed-by: David Edmundson <davidedmundson@kde.org>
If CMAKE_OSX_SYSROOT or QT_APPLE_SDK was set, we still reported the
default platform sdk path, rather than taking into account the set
value.
Improve the reporting by considering these values.
The implementation is incomplete because we don't handle explicit sdk
paths, but this is not critical for the current use cases, because the
value of the function is only used for reporting purposes.
Amends ab7eb492cba64fe985ea80b2f0be22c1c18f3c5e
Pick-to: 6.8 6.9 6.10
Change-Id: Ic69aec3641d435736018c96f72ba7f75a0f74508
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
All configure events should be acked, and that acknowledgement is double
buffered with the surface commit.
If a window is not exposed, for example being in a suspended state, us
sending an expose event is semantically wrong. It also ends up not
resulting in a commit as at some point it no-ops, we have to commit
manually.
Change-Id: I020b06f04030c1209f2fc768adc8bd66d57975b1
Reviewed-by: David Redondo <qt@david-redondo.de>
appImports can have the same directory added multiple times - first if
it's found in the xxx_conf.rsp file and secondly for the inner qmldir
scanner. This is because the xxx_conf.rsp file can have both the
qmlModule directory and the parent of that directory as importPaths. For
example like this (the paths are truncated to save characters):
-importPath
.../build/qt_generated/qtquickview/qmlModule
-importPath
.../build/qt_generated/qtquickview
In this case when the "inner qmldir" finder processes the later path,
it would go to ./qmlModule, find the qmldir and add another
.../build/qt_generated/qtquickview/qmlModule to appImports. Also, if
there were other qmldir files somewhere under qmlModule those would
also get added twice, which would increase generation time yet again.
This commits solves the issue by removing duplicates from appImports.
Amends 7ed88eb565d40b195aa868e67777872ef07a5ea2.
Pick-to: 6.10 6.9 6.8
Fixes: QTBUG-137316
Change-Id: I641065479aec0f3d9ae1a8727a03bf62eb169ad6
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* qmimeprovider.cpp parses file names to identify the Mimetype,
* qmimemagicrule.cpp parses the file to identify its Mimetype.
* qmimeglobpattern.cpp implements a pattern matching algorithm, i.e.
glob parser.
All involve parsing of data that might come from untrusted sources.
QUIP: 23
Task-number: QTBUG-135191
Pick-to: 6.10 6.9 6.8
Change-Id: I97d4cd8d635f05613d5a979c61038cef9c759989
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Normally `INSTALL_DATADIR` is the canonical place for
`share`/`CMAKE_INSTALL_DATADIR`, but this standard is not well
enforced.
In 834d92a, `INSTALL_SHAREDIR` was introduced to better enforce this
standard and allow to install into third-party program's
`CMAKE_INSTALL_DATADIR` (e.g. wayland). This ended up being used as
`INSTALL_SHAREDIR/qt6` instead, but this leaves little room for
configuration and renaming.
This change introduces a namespaced variant that is guaranteed to be
owned by Qt.
Pick-to: 6.10
Change-Id: I25c0e5b47c402b178120e9e628fdfaf4aaad27ad
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
When a paint event is dispatched from the platform, application code
should redraw contents and submit a frame regardless of whether contents
have changed.
This fixes an issue where the window does not always update after being minimized on wayland, and would also be needed for non-composited X11 when exposure changes.
Pick-to: 6.10 6.9 6.8
Change-Id: I506872f439e0c16d71ad13def1c8b58a0491dd73
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
There seems to be a case that qWait() is a source of eventual pain.
Add \note to encourage the use of the QTRY_*() macros.
Fixes: QTBUG-136538
Pick-to: 6.10 6.9 6.8
Change-Id: I52daa8c38a55f8db66d8c941c7cbfff7b7060a5b
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
setLayer will increment the reference count, so QContainerLayer is
leaked, as it is not autoreleased.
Pick-to: 6.10
Change-Id: I43cef8bbf9ccb9b849322edfb1e7ab75f5ae9898
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
QNSViewMenuHelper is leaked, as dealloc did not nil it to decrement the
reference count.
Pick-to: 6.5 6.8 6.9 6.10
Fixes: QTBUG-131655
Fixes: QTBUG-137161
Change-Id: I783c400d1300046118ad3e12816e84709cc9d793
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
If a font has an em square size of 0 it is not going to be useful.
However, if one was encountered we returned a default value to
avoid division by zero. The default implementation called ascent(),
which would depend on the em square size again and we would get an
infinite recursion for these fonts.
To avoid this, we simply return a default value of 16 in the case
of a broken font. (The Apple spec gives the range 64 .. 16384 for
the em square and the Microsoft spec says 16 .. 16384, so we use
the smallest of the two.)
Fixes: QTBUG-137277
Pick-to: 6.5 6.8 6.9
Change-Id: I63779e44c10c7021486787d1e1e818f4c6e47835
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Remove dependency to Wayland::Client as it's not needed and
prevents building qtwaylandscanner for Windows where Client
is not supported but scanner is needed for cross-compilations.
Change-Id: Ia38dda58c0800799673ae2d1e29626ce6b399f04
Reviewed-by: Liang Qi <liang.qi@qt.io>
2025-06-02 05:22:52 +00:00
84 changed files with 1673 additions and 352 deletions
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.