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.8
Fixes: QTBUG-136990
Change-Id: I72adbeaca46cd9dd99c54368257268dc8db6bfdc
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: David Boddie <david.boddie@qt.io>
(cherry picked from commit a9a68a87b9d54c528c6a9784095636ef54ac53be)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 8959c5055a4b6b14a5d5c310d10b3b6eb63f2333)
Propagate the `_Qt6CTestMacros` variable so that
`_qt_internal_get_cmake_test_configure_options` can be used
inside the RunCMake tests
Pick-to: 6.8
Change-Id: I2b7f3996315169d840bab3dff011927288c9782d
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 00a96237fd8b40c42744d41c6d545a140c816dee)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 6375c935a5cf59ee41c95534e11c79681c2bdc16)
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.8
Change-Id: I1817ec4da947cd91729d0ce35defc9f63cd784d9
Reviewed-by: Mate Barany <mate.barany@qt.io>
(cherry picked from commit 25df8042a4ac23e32037dfc1c20c599992febd66)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 3e0bcaeea22f83148df3d36b25cd55a7717c09f6)
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.8 6.5
Task-number: QTBUG-132097
Change-Id: I1efc0c2d2f474f6644261575a745aa8f7e5ac4b2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 26bf2bedca96c2362e7b29f08e9ca978d9496883)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit c9d597f5db5a88fa3b9f7f9f56e6a0013a9ed903)
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.8 6.5
Change-Id: I7cc150eb96b4aac40abcf7076bb82049a209f837
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit e45916fadaa4e0d98ef83b3ae32f87cda436c93e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 4cd2ff822607588dfce980df59ff7d74310b024a)
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.8 6.5
Change-Id: I6f6804261cd56a5a8bbb276ed7a0ac360c94195e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit f4e7eebd27c1fed7bbeb646b38ea020c97731466)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 5430116ed3504aa5d44cd314bedb3441701263f2)
The class docs should include a discussion of salient API, not leave
that only to \fn's.
Amends 9229452e574e603aa86fd5adb28da33cf5879db9.
Pick-to: 6.8 6.5
Change-Id: I53144c7e56eca21ceeda0c1bca0028e987da9e18
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 902e0a723acd24f1126af4d64fe37f8d6bbf079d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 453aaf5759b99b21ede3263d6e4914070ebb8bcb)
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.8 6.5
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 9a7d06f0d4551ef393eab6da21ad162582dccda6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit ce0e4ca6fe5ec21275c3884216800521fc6280f5)
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.8 6.5
Change-Id: Ie661f7361a8d86648b21fffdaf9e7d076f86ebe9
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 54069d37efa047de5ad7bdf1580720de61b9acd2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 8bb365b0c57bef1267c8453176e3a34c7b7e54f9)
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.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>
(cherry picked from commit 3416d28c8b0fa8e5cd6622fc86fe6fc5aae9222b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 0e0db3eefdfdde8480bf80304056d6e129168bf8)
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.8
Change-Id: I61398a3773ef8c25aab21df3e78b71f3ab11d488
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit 94f0ff704ead631114ecd2e10ba0839dad1aae10)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 617625ab0494336daf22b5a5cfb82b629e383089)
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.8 6.5
Fixes: QTBUG-25938
Change-Id: I2aa37600ec932cd4ce721bfa98f63169eb0d0beb
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 9f93ddd2f3ce77a6d4ccd2de93bff95244d381d8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 35fe0a0b6f18564676025851ecee692c0de64bd3)
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
Change-Id: I2e53ab8de08575f13c950dd92d24ad3017a7dc0a
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit 444e5b63c30abb61c052e3ad84c144cc42b9a7e2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 282ce8fbbc34cc4c18ae488c51f33c3b737924cd)
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.8 6.5
Fixes: QTBUG-137157
Change-Id: Ifa485734b290284bd5a1286e3b3c18454442fa10
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
(cherry picked from commit 5dc261357e44ac9e15423997748e28ae659a3623)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit c75046876642663acb58aed0998702bece8b1e12)
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.8
Change-Id: I6cb9c63718790eda153bc5202ed4eb1d23f032bc
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 60841478d3a5de10f279c77f3c722d666c51656a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 17eb1432b02532b8ab62bdf1671cb6d9e4aa13c8)
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.
Change-Id: I55d69bbedc027893f6ad125c29468a34e7fb406f
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit 3af5e42bdd6ffcf6d9ca386583add2329372056f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 43e249cba8af8ab34e39fa63adbbbef29251d673)
There were some artifacts added (white pixels and bad anti aliasing)
when the icon was changed in e771e5e2d7ae77f46d01f087242e0f777fdc02ac
Pick-to: 6.8 6.5
Change-Id: I12a8658090a1f081321e53433d17fc19ad3e5f12
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit c15e9740b3abf6f4a76c6b958d883808f03c29e0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 78dd82396a7b4cd69de3ac1c8968a1e1de2b0864)
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.8 6.5
Change-Id: Ia0e35e87934abebc76b719e3bd8124ac77ea07f5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit b9a43e7767987a0c3bba0ac57fe497fd97418d19)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit da96dfdacc751f8b6c01a1b93300e26e9787b542)
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.8
Change-Id: I8d93f6db83a28d70a192fffd6668734a8024b88b
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit e1d418bcd07aba891da79c653f5b0e3c6852fb30)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 8e7ddf261ed13197c6f9cd864ef9d39ed75be75e)
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.8
Change-Id: I59c7a322ecbcc564baa1263e02b234bc53563fac
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 901a6e7986c1f6323eae8550f7085e4ba1513f20)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit da212685ee629c202579a43e834b06831ec5baec)
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.8
Change-Id: I489e7c9ee1327fb98510fffd315c66948956534f
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit c5e6034bbd99459373279f8ae3dcac0f87c1f39c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 5f758f7af6705d4b7f12bac1a0e16782e1b7126d)
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.8
Change-Id: I7732465f222032b2833396576873fed370f71d11
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit c51a0386151d32edbf2ed4a23f8512e430518b5b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 536856f99e1f4a0429381a97dff1d2042a218ba9)
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.8 6.5
Change-Id: I27d94763058e1dcea3a65d4ff2c859b40336446f
Reviewed-by: David Faure <david.faure@kdab.com>
(cherry picked from commit 668d81f73a5c2f4ec14764d1892f2eaf6494c0f1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit cf1a20df70cb7049085b07555b593565fa437e7f)
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.8
Change-Id: I414668dc7aa0279f63fc79799ea53101065ab013
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
(cherry picked from commit 619ea080364cce9a4b390e75796809f454b80dd3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 52a1447842637db36238a9cc695e59ddf6f79766)
We already have the alias for it, we just never updated the stored
member to use it.
Pick-to: 6.8
Change-Id: I850c9f0b899a15603b4c5ac83693019b856effb2
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit f9fbdba3a1d8cc40681f3df5fcccc05a76b5211e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 00ecb3b6f5a80bdf37997a85fb8f42a0230c643a)
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.8
Change-Id: I3f1f09edfd9fb3135ccc12bf98e06254327e76fe
Reviewed-by: Mate Barany <mate.barany@qt.io>
(cherry picked from commit 1bcfbfa3bc75d2a91752497e59dd6c1b7a287e2b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit e3fcc5403cead363d855e7b85315aae33ef19944)
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.8 6.5
Change-Id: Ib76b4bc00b08289bb8d6d58096b43501b47814d1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 184d0bf2ec03dd3707b4b6326f6ba7e657afadc8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit d6fb65adb0c4467cf8795dcf08b7278b87332da3)
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.8 6.5
Change-Id: Iee0d75ce10a589390afdd9069b7040a1c9c608e1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit e4b0549a4c3f55828488fad6e6f5723072d6a291)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 6b77b43b1a231dc0aafad15fb3220e86c6787eea)
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.8 6.5
Change-Id: I4b765aed329211984c35c40fbc5648bf104990ce
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 5aefe2d9a1d56f6134fcbbdff260c79082eea661)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 2b0ec367c75bc30762ae3482c431311518b35b7b)
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.8 6.5
Fixes: QTBUG-126743
Change-Id: If45766152c6cbf9e2ee916baa5a15282d3fedaf2
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 3047d6a8a19fed870597d6c482f6c1a826ffb9f2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit ee0cb525cda59bc25b248440225838197a888871)
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.8
Change-Id: I83d7a3ea7b9bab98889791bb807988a74e355b93
Reviewed-by: Santhosh Kumar <santhosh.kumar.selvaraj@qt.io>
(cherry picked from commit 5aa1bc46217dc6f53fde8fe17608cf0e5f7a5e78)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit da9ac3bf1d2c2d7259563918f5e665d421957ec5)
Particularly for the no-parameter case, which fails on any warning, it
makes no sense to not also fail on a critical.
Change-Id: I36f02a7dfb195616ce68babedbccc61480935fb9
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
(cherry picked from commit 5e9efe45dfe1319b41300b0d3ea7b243ea2c8f73)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 5fc456bfe28c6acadf81397ead7d50598738fad9)
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.8 6.5
Change-Id: I0c3203f92851ad9fa862aed237823f0e1e28f6ff
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit b9c77b968589fe9fd5c1dbfde60bfa0524a1f24f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 603e0710afbc1914ab6d54f3b885a24458ad364e)
It's no longer available on macOS 26, and we don't use it anymore
anyways.
Pick-to: 6.8 6.5
Change-Id: Ia1d0e37dda177f333646e598e517f4af20215dad
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit cdb33c3d5621ce035ad6950c8e2268fe94b73de5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 42b0903c34bd049729f85fcd6236e64f28898b34)
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.8
Change-Id: I1810f90c7cf6e3760f1d99e026b291311501c3aa
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit fe7f01019c75fb872a0036e956684d06ca7444db)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 7f2f005d4fb6a08045c7e9f3fd436244d49cc8d3)
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.8 6.5
Change-Id: I363f2f34a06cc5de031fa87c6274322bf03bd77f
Reviewed-by: David Faure <david.faure@kdab.com>
(cherry picked from commit 3f0261ebe3010f12a887869ff5adf7ad30f5e4c7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 64407cc9ce322017b8435c701265f08bbc1f8d2b)
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.8 6.5
Fixes: QTBUG-137041
Change-Id: I268f3bad669df77351fc458f56e318db75ecac7b
Reviewed-by: Mate Barany <mate.barany@qt.io>
(cherry picked from commit 9ed754e754a8769c6d3a7291dbfe45f38a7dd20a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 1256098113fec2fc0a95dc8a6519208c34eea859)
QVERIFY that the file could be opened, fail the test if it couldn't.
Change-Id: Iab9b819e70b71fade6a58286edff8e022748d9f6
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
(cherry picked from commit 33dc247b6a553a5e4a6038189359d459d9019edf)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit e9a941053ff84be7d1fcfb86043d26633883d9f7)
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.8 6.5
Change-Id: Ic22d0766bcffb967a86c8ec28b63ee480aebd4a0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 49db71bb1995d8fa71afedb9b461d5203fbe49b1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 32c17c459879aea2aadd77f08f2851c7e73d13a1)
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.8 6.5
Change-Id: I31a95b36506c376ef0817ef3d61bd8ca02371585
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 8f4ffb72f9e49702f878222b785cf0efc871ee9c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 2d55125018a24a19dc07e317c06179dd083e8694)
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.8 6.5
Task-number: QTBUG-135572
Change-Id: I91d769d494489fe63dbbb67f849b78fc7aa39ec6
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit a97ac8507e39a421f530f5ad612a7e4bb58f6718)
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit fdc070c3b0bce2d7aa5c568cf45555a1697822d7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
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.8
Change-Id: I40f3ccc4e652f1ae0c6c0ebd154d690d1a9d7ca8
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 33cf82c13d6e3e9fc6d15b725f7ebe15be3d4631)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 3f72e55bca1a368d6432c516b5048b4f6f8fc1b9)
Starting with API level 30, Android introduced new
[0]WindowInsetsController.show(int) and [1]hide(int) methods for
controlling the keyboard visibility. This commit updates the code to use
these methods on devices running API 30 and above.
[0]https://developer.android.com/reference/android/view/WindowInsetsController#show(int)
[1]https://developer.android.com/reference/android/view/WindowInsetsController#hide(int)
Task-number: QTBUG-98984
Pick-to: 6.8
Change-Id: Icfcad3430cd269353572f66f72114238045f7756
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 3823d99a688813d2692eb0d4b99939a65bb6ee6a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 75e575e18f0fbfa8571d9044beea3cf3939881ab)
Changed function names to include parentheses so that they can be auto-
linked to getters and setters for bindable properties.
Change-Id: I72a06a7def55348bd1295e559751a16c62c93a84
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
(cherry picked from commit d02ac6b3e02d8a5822fc772e456249afaf00dfb3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 57baa91ec2ad0964a9da0f1cf0a7caa9e8536d28)
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.8
Change-Id: Ife80898e20d4038efeae3438fb89b593bdaa056a
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 21616e1447fb8583d81cb46b34ad25de4bd29d18)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit af519f5d8a93a13b267b0561dac038021d1fc1d5)
...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.8
Change-Id: I34549ce47e675d5869239b9330a166b80b40b30d
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
(cherry picked from commit 97fe141f25655d2debd9f3f9ca278aaa759f15e0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit d7b80c9c9bb09e6c51301318d192f054f5b1d70e)
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
Change-Id: I5f2b2d5660866f1ad12aaafbb4e572b08ed5a6e4
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit 904aec2f372e2981af19bf762583a0ef42ec6bb9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit a0ab39b24b763d8d44badf2512a859e3d6351cc3)
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.
Change-Id: I345448efd7da92f4f74033b03a5c040b5db9d271
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit 8d5db24c14d5c7ea8a2abf55e4fd88472dd9ca8b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 4235f0587b144ef90e4736861b4b25371efc49b9)
This reverts commit 7796ad3face5246ad62a959b61fdd3a92cea2803.
Reason for revert: the code is not doing critical data parsing.
Pick-to: 6.8
Change-Id: Ic07b98c3866b65d0575e29abe97ca6b284c981bb
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 2b4effeec8e3c347e1bab01f3635fb6c71a7521d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 1e3eb1203abc8215ae5e1f4c045b29ef351838a2)
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
Change-Id: I48952144ed15596b9acba3230c63cece613fb045
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 25fdc044f58d426c3056409e2883becdc3cf0bd1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit e7a9bb77fe8b0717491480dc2ca976ec3ce9f633)
The escaping for '{' was wrong in the previous commit.
Amends 38277a88f1dd69de6e031bc8313c8d5beadf6bd0
Pick-to: 6.8
Task-number: QTBUG-122642
Change-Id: Ia363c76b27e527114769b4a923418cddad5586f1
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit d2cd406b349a7c58c3af953c9c7dbf47137c0c73)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit deda96666d0ebf4b4b903a37555fbb70edc55e52)
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.8
Change-Id: Ib77faa03c867b2660a45bdc3ab94e7d739eed4f8
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
(cherry picked from commit 839d569dc27cfa5188db477893899d849ac26ea5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit fcd76f6d2461bea19e18a117056910755e0f7221)
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.8
Change-Id: I378698327a36496317782d6dc0acd092c19de7ca
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 0a4c11633ba963d8f3a0d64009af0617a3ab3151)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 3df9be0f96aad05a339ae3d0185a0a1ef032f509)
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.8
Change-Id: I52daa8c38a55f8db66d8c941c7cbfff7b7060a5b
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
(cherry picked from commit f27588348bccc0e36236500f2257f8006609318f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 121f5105fd5f4b456a1cbedd378d81f3bc6b5e31)
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.8
Change-Id: I8d20f05e72abcec446fd39342c8632960337943a
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Doris Verria <doris.verria@qt.io>
(cherry picked from commit a8dab6eb652a634393a668ac7127f566ef35f2a2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit b695743b7e60a2da63adc9deabd2a4da08fba477)
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.8
Change-Id: I506872f439e0c16d71ad13def1c8b58a0491dd73
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
(cherry picked from commit d08f1d7dbc7b3fc23b81db1ded3314c1cf0dfeb2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 91225ad81e64094662fc1fd32526f8a6c3dd8728)
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.8
Change-Id: I9655052772990ca524c5b94e25b2c58cc058ff67
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit c604f2031a2147f1257f7f19edfb5c2487a379d7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 1d9432cf79df07a47f77596461bd90cbda9f383f)
Emit a warning if `FEATURE_*` variable is set. The "feature" is not
registered as a true feature after deprecation.
Pick-to: 6.8
Change-Id: I715af231c228c73d70b037ee31aa61edcd45c21e
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 618053e27907369c92fbf5aac37ced07fb6e16c6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 17c522418466a53b9fb7ea7bc1c8d4aa90692e4f)
Unlike chaining a feature into its `CONDITION`, it has a guaranteed
one-to-one equivalence with the original target.
- An alias cannot be set if the main feature is already set
- Multiple aliases of a feature cannot be set at the same time
Pick-to: 6.8
Change-Id: I5b17ec3af51761880a7edb0c47ad8144815f1f93
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 4bbd324a0a4a488b9ff4272888cc6b7f516d78ff)
Accidentally used clientStream instead of clientStream2.
Test still passes though.
Change-Id: I118f1e429faa0367f0b4d02c74a221027ecb2b4d
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit 1a870f4bf2efdd0c0dd6f3d7a13edccf8c6701cf)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 9ff93f75c06b85408d9132eab0beebdc785085d2)
This class was never pimpled in Qt 5.
Amends the start of the public history.
Pick-to: 6.8 6.5
Change-Id: I5761bb0e8401dd654a885b5edcf821be9e4c2694
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit ab7c1386d54732e50c0d9603ae5c013f3da81b12)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit a01e8d0d5c4bd856e1a14af76c0d8bcc5e07095a)
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.8
Change-Id: Ibf43c404439c9fee1cfd2b40789150edb76c6971
Reviewed-by: Nils Jeisecke <nils.jeisecke@saltation.com>
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
(cherry picked from commit 2e0dc22bdb46f94a516e834ad4fda2b93aada352)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 999dbe5734278cf4df062eea6b640287a4c2f5e7)
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.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>
(cherry picked from commit a589ef5cff160701316b3eebf2139ea9b55b0de5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit cdb2b134bc3cd45ae164ae6ee310ece6c1f339f8)
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
Change-Id: I517165b2b8db84b0766935e3d535a7a1ef2b6ad9
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 587649deb7188d6944c31d991d0fd2a71f17ab4e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 20dfcf4c59becea25d62121f617d7aacf099fc76)
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
Fixes: QTBUG-134602
Change-Id: Id1d7829888d55247d2f07ee0a49b91ff34f26889
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
(cherry picked from commit 9a950b1ecb901cc885995d128768cc04cb55cfb1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 488e21860409b1f09b187c94e6e318f4ff8ff0a7)
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.8
Fixes: QTBUG-136074
Task-number: QTBUG-133855
Change-Id: I2c6acda3b31105447393a6efcb85ddf737161fe8
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 9b9511c3548c43ce30117edb800af0c824fae26e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit e40d85403ff72921e3f68edd73def85547c98cd7)
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@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.8
Change-Id: I5562f46385c6f1b498bc659c65e501f9e9376db3
Reviewed-by: Santhosh Kumar <santhosh.kumar.selvaraj@qt.io>
(cherry picked from commit 4720b592d729982faf85093b7511457b4945cf8d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 6874de0e509b59acafe8ff9b67bb3aa7ab4756fc)
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.8
Task-number: QTBUG-131761
Fixes: QTBUG-137108
Change-Id: I462ba198821692aa60e6869df9c8e92332422c44
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit db07a0387497cc56d4c3a82bbbc2150ec19d2e96)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit eae538fa065ea3b3175f593bd37a9f420ee8727f)
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
Fixes: QTBUG-137297
Change-Id: Idff8e808e9bfc009f82d2a59e5e6752ed8a55714
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 89e7facc2e3095684e64f16103cfce017235e504)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit d12cdac9bd2e7694da598f20ebf566a439f1aaaa)
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.8 6.5
Change-Id: Ic8e9b4172c3b2035b7e9ad1b576725923987abf2
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 36ebec92e81fb8ee7d965ad1a84221d6c779f562)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 641422686dc82627af829a405c4af570d78ab8cc)
The default value is 0x070000, via qtdeprecationdefinitions.h
Pick-to: 6.8
Change-Id: I78586231e123321a11d41ec8c1324ab928e5fdc8
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 4d4843df42007cac645ac2ec0caa83602da49a0c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 43d8bf3c28d009caa99591ddb4b4c5f1fc864b10)
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.8
Fixes: QTBUG-137398
Change-Id: I2e673b316f3d5fc14342b36095f9983ad55ea796
Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
(cherry picked from commit 2d82e845ccfcb2b5ae8ef96d79fb32d76dd89b23)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 3915e017e77d5052958c03dc624c439540244de7)
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
Change-Id: Ic69aec3641d435736018c96f72ba7f75a0f74508
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 747741119ab5fa0bdcdb923e9088ffe287875ebf)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 98ac864cabf6cdbca6691446e8b6fd49659f15d1)
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.
Change-Id: Ie443cf6f3bf6b76dedc994bf1b8c16daebf9022d
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit e0130876ba376faf681b80d4a7dbb20a5e3c3bdb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 03d478d5a9cd4ded7a72057d7070fd047b84c195)
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.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>
(cherry picked from commit 5c563a98a5ffe2a72a641bfa9ed30e17ecffd893)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 023e36e0e7d9b46fb683df6039c4552d70eb8995)
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.8
Change-Id: I30316c59f8ad6fd018089a8dca8e7a8d1d92d7ec
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 5e7891f73fb1ba33a08ac9bd3fbcdab01d8a1193)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 33f8d0834320ffed5b5dd60fcc2fcfe378933d29)
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.8
Fixes: QTBUG-136229
Change-Id: I408e6dfd8a91f2d0f1dd8c18dc0dcc2d13cc3e38
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit a4850d0e0f42229afe2af10cee5794d0de70416c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit ddd53192d348d2c2751ca3b492bead42619f8200)
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
Fixes: QTBUG-133687
Change-Id: Iaffc992f90c06425113cc2ef721d87d31e97bbc6
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 86d843be47d04ca2d5c2ab1f052cd2a822a2979c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 88c7f0250ae26270116a7a54ed86860856d99ca8)
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
Task-number: QTBUG-122596
Change-Id: I48d1c57145ad5d9418631025927581c4eb5ec93c
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 5220685a11afcc02ae92e7fdd17c9efc72975e83)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 2ee633a17af572ec54265f922c342fc759ecac56)
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.8
Fixes: QTBUG-136550
Change-Id: If570cf8e92d0df7c9e2c4d0e009857eaf33f4f2d
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit a66dbb19e6915d8bb560ac2bbfe64eb6850f7bbb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit b01b4b1e409bf9f9c170f73ec5d4bc91e8e34039)
Adding in the wrong order yields a QIcon that does not provide the
expected or desired behavior.
Fixes: QTBUG-135652
Pick-to: 6.8
Change-Id: Ie1f6e50ee82ddaae8857b076c383ede20ab872df
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
(cherry picked from commit 472306523a9706ccf363c349edecccaadacfe5b1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit fe7a4b7bf85d1a47b8b22d7a0c60130f4e602802)
Got the name of the numeric tokenizer helper wrong, making the
cross-reference comment misleading.
Pick-to: 6.8
Change-Id: I88b850975aa77b6175e8d95afa2960e589c42d8d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 65365e9bb796c9921441bdb20655cf8224ee1b8b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit e359fc7ec5689501240f5d14773ef8c1b07f32c3)
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.8 6.5
Change-Id: I07915bc190dd7696e58356143e8857f91e888c67
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 9be6e51a501dfbee1c058616b9e81b1731640e3e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit ad55e57c6e4c52e58dea87373de00e71588a49c0)
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.
Change-Id: I3e486f73276a3ae288d1fffdbfe20a74271f73f2
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit ae973dc2de5ce3b5a7d18018691479013d91053d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 17f5cdd39ed8a6e9cf25e99003478adfef572485)
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.8
Change-Id: Ifbc8503482886246ce9611d0b7a19462fc830ecd
Reviewed-by: Tim Blechmann <tim.blechmann@qt.io>
(cherry picked from commit cb09be1512e5f932af1744773a7638f23ebd57f9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 3f42b65818f502f73814fd1f04081dfed44d4018)
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
Fixes: QTBUG-137198
Change-Id: Idc0470556a053123286983c44063e17b7eb9949d
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit a20a40095a0d699ea07981845a190b90dc4830e4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit c39a3edb50c4d00adc7df7c90c8400bc715eb04f)
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.8 6.5 5.15
Change-Id: Ic21d15da25944d4897357dd27e2986d448b5ee60
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit c485c07c6d7e29eae5e633adb9429e293f63b63b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 8ff03d14cc70f4f480618e78916213b8d8a3e2cb)
Don't create a QString when comparing the strings from
knownPseudoElements - a QLatin1StringView is enough.
Change-Id: I69e207bac0fb3d3df12ae9d4bebc9cd30cde30de
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 15c2ec5344fb8a1e5d4a8e93d410c54563fb86b4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit fe777849c95ca66bdfe29e65016669e349909e49)
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.8
Change-Id: I30d561cc0b74645c939e7d3dd595926b6013caf9
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 36b5854af53650132738cd950a220b45669ae5bc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 5ded95d6590e79f4a665194a9ed1224fab2ecb58)
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 "/..").
Change-Id: Iddf6f46edf6f3b6c3222fffd1e1e5479f0be92a9
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit 7bd7df5aa170c240061144a9210a13b62949935c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit c617cc95934ae3c0896082d61a88487b34cf96be)
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
Task-number: QTBUG-137198
Change-Id: Ic7dd4eae0ac1af0f8293f2ce285d2987e4e26249
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 7542aaea604907ff69ed03f650421403388b5463)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit f35f45642c96581ebeed06e0dba7451fec36fe26)
* 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.8
Change-Id: I97d4cd8d635f05613d5a979c61038cef9c759989
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 7d163200f9d6f47bce941969869c54369fc26056)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 924b8dd5847664313610d4016c49537538cb28ab)
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
Change-Id: I0d849d5d6d160c48fd4fc2d443e4fde43cde5606
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 6cca30bb11c5d612c73e12e2dfcf1d473b17b6d4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit a276ce620857aab15f60db17868abe86986f338b)
Non-normalized signatures passed to SIGNAL or SLOT macros require a
normalization step before the actual connection can be made, which
takes extra time and extra memory.
Also, a normalized signature is generally smaller than a
non-normalized one, so we save even in executable code size.
Amends d0b4e8a601bc2f81ddb23c124acc99defa26c02f.
Superseded by 2fe9eed3fdd5e7a7a3ebd16f5f683dc84a1eab4c, which,
however, wasn't picked to 6.9 and 6.8, so this patch only targets
those branches.
Task-number: QTBUG-116197
Pick-to: 6.8
Change-Id: Ic937639b1e1583261e0def4d583e53ce03f4a7b9
Reviewed-by: Axel Spoerl <axel.spoerl@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.8 6.5
Change-Id: I63779e44c10c7021486787d1e1e818f4c6e47835
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit ab7a80a9557e12735f4e3c3fe76ccc72feba2fc8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 9237cdf98fc6f20471aaeec27eef2f5100e9b82f)
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.8
Fixes: QTBUG-137316
Change-Id: I641065479aec0f3d9ae1a8727a03bf62eb169ad6
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 3bf9047a342ed2699339c29f84f4d60e39353102)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 44913432ce1193ec5b08f6882939a377b38cc73a)
QNSViewMenuHelper is leaked, as dealloc did not nil it to decrement the
reference count.
Pick-to: 6.8 6.5
Fixes: QTBUG-131655
Fixes: QTBUG-137161
Change-Id: I783c400d1300046118ad3e12816e84709cc9d793
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit c8ebe2e5cd71250d4515e09c29a3045b0cbe49a1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 46c82ac228befdd47d659631f4c32503f7d8008e)
Non-normalized signatures passed to SIGNAL or SLOT macros require a
normalization step before the actual connection can be made, which
takes extra time and extra memory.
Also, a normalized signature is generally smaller than a
non-normalized one, so we save even in executable code size.
Amends a833d5682ac44571e13568336f2bd3ec7deb1d6d.
Task-number: QTBUG-116197
Pick-to: 6.8
Change-Id: I942f5ac262f05ca4486b2ed2a22654d1a12a3ef0
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 71842cfb89da0bed1efd6cf7a567550d9e8119f6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
finished signal was being sent before native fetch was destroyed
which, in some instances, was causing a crash.
Fixes: QTBUG-136710
Change-Id: I2134431cbf9af0511d888dc5db3f589f5259c88a
Reviewed-by: Piotr Wierciński <piotr.wiercinski@qt.io>
Reviewed-by: Even Oscar Andersen <even.oscar.andersen@qt.io>
(cherry picked from commit f5d888b44a5d418a601d8d7920dc5826617f9e90)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
We have implementation divergence with libc++'s ~unique_ptr()
behavior, so make sure QScopedPointer behaves the same way as
unique_ptr is spec'ed, even though to check it, one has to rely
on UB, at least according to LLVM devs (I don't think the test
as written invokes UB).
Code's a bit duplicated. I tried making the struct a template,
but it's just too much of a fuss (needs a variable template,
which we can't use in Qt 5), so I decided to use cut'n'paste.
Task-number: QTBUG-137069
Pick-to: 6.8 6.5 5.15
Change-Id: I8b55718eaf3c6ad9a4d89d4fc9d64f0c41bb21fa
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit 82015992c853b50dac167da26b8b858ac4794c66)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Remove unused member 'image' from QStyleSheetBorderImageData and replace
c array with std::array<>.
Change-Id: I149ef72e443027a6b6d30f25e8c7b1adf4138fc5
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit d34754ea81ffa8a25909ba56c2684da04fe722f8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
In commit 1f6d7cbb341bd79826d3f6d69e1f1a427ebb8f1b, we introduced
support for the full-screen software keyboard.
However, this revealed issues with text not updating correctly in the
view, particularly with composing text.
This commit addresses the problem by adding calls of [0]restartInput()
in three methods: setComposingText, deleteSurroundingText and
setSelection.
These calls help synchronize the editable state with the input method
and ensure the displayed text remains consistent and up-to-date.
There is one more issue that needs to be solved: QTBUG-136229
[0]https://developer.android.com/reference/android/view/inputmethod/InputMethodManager#restartInput(android.view.View)
Pick-to: 6.8
Fixes: QTBUG-135376
Fixes: QTBUG-128745
Fixes: QTBUG-130058
Change-Id: I3f905dd02cb3bfe5046b01164412f328160b7a8b
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit ab98013efc16766bb7a538f86b0b9de8db6634ff)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This makes the different functions more similar to each other, thus
facilitating adding a warning about non-normalized arguments to them
in the next step.
Task-number: QTBUG-135572
Pick-to: 6.8 6.5
Change-Id: Ia2b82928e9a24fb9d43b43933b9a9c5308fa2835
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit e4f86012360b20938be8f34e6966a577dae6c049)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This changes the error message I get when configuring with
-DFEATURE_sanitize_thread=ON from:
CMake Error at cmake/QtFlagHandlingHelpers.cmake:183 (message):
Platform linker doesn't support erroring upon encountering undefined
symbols. Target:"Core".
Call Stack (most recent call first):
cmake/QtModuleHelpers.cmake:898 (qt_internal_add_link_flags_no_undefined)
src/corelib/CMakeLists.txt:30 (qt_internal_add_module)
to:
ERROR: detected a std::atomic implementation that fails for function pointers. Please apply the patch corresponding to your Standard Library vendor, found in qtbase/config.tests/atomicfptr
CMake Error at cmake/QtBuildInformation.cmake:240 (message):
Check the configuration messages for an error that has occurred.
Call Stack (most recent call first):
cmake/QtBuildInformation.cmake:59 (qt_configure_print_summary)
cmake/QtBuildRepoHelpers.cmake:393 (qt_print_feature_summary)
cmake/QtBaseHelpers.cmake:287 (qt_build_repo_end)
CMakeLists.txt:36 (qt_internal_qtbase_build_repo)
Pick-to: 6.8
Change-Id: If6243362521802d8b1348ae53d744c33add814f1
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit c29868830c5e1fc208f8055157dc0fcdb8f1e13d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
While porting some of these tests to QUtf8StringView, Thiago suggested
to add the comparison tests from qcomparisontesthelper_p.h.
Pick-to: 6.8
Change-Id: Id8f2c1c5690f7219ac000eebb637f48acbc5662d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 1ecbad8da9828dc561268d0fce8c24239f0a7f2d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
In commit ff51ea5418d131248b07e327513b41dad1231f37, lazy initialization
was introduced for QPlatformServices, including
QAndroidPlatformServices. However, this approach causes a regression.
When QAndroidPlatformServices is lazily initialized, the intent listener
registration is delayed. As a result, handling custom URL schemes is
affected - especially those coming from external applications.
To address this issue, this commit removes lazy initialization for
QAndroidPlatformServices.
Fixes: QTBUG-135489
Pick-to: 6.8 6.5
Change-Id: I24becdf4ac573e7a2ca101cfbc27560d1eb4adef
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 393c294e102bcd733141539552fda2f148e8b51b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
On top of handling ActivateWindowEvent,MouseActivateWindowEvent and
PointerActivateWindowEvent events and returning MA_NOACTIVATE we can
also set the window extended style to prevent windows from stealing
focus in special cases.
Also on top all those mentioned events, when the window is requested
to get keyboard focus, it should check if the window accepts focus
or not. If it does not, then it should inform the underlying system
that the window does not accept the focusIn event.
[ChangeLog][Windows] Windows with flag Qt::WindowDoesNotAcceptFocus
no longer have a taskbar entry.
Fixes: QTBUG-131714
Change-Id: I79f767b1622449ba05b41f8b80bf390d8cecfff8
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Zhao Yuhang <2546789017@qq.com>
(cherry picked from commit c2bdf7636eb46e56760f3e2f6d457c8f14627576)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Timers can't unregister when the dispatcher object is no longer of a
dispatcher type. It's too late even at ~QAbstractEventDispatcher,
because unregisterTimer() is a pure virtual. To prevent their attempting
to unregister, we set the thread's dispatcher to nullptr if it is this
object.
This has been a latent bug, so it's worth fixing. This started happening
for me with an un-pushed change that changed the order of how
QCoreApplication and QGuiApplication destroy the main thread event
dispatcher (namely, in their destructors, not waiting for ~QObject to
deleteChildren()).
Drive-by relax the store in QThread::setEventDispatcher().
Fixes: QTBUG-137130
Pick-to: 6.8
Change-Id: I8845736c38a931af62e3fffdfd3554874df89e8e
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit c8d3d7a7af73d97e0415b99df8d8378edb3117f5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Fonts have multiple name fields that users may expect to be able to
use for referring to them. In particular, on Windows it has become
common to use a legacy font family name which contains the sub-family
of the specific font, because of backwards-compatibility reasons.
This is not technically the family of the font, but native
applications will typically list them as such anyway, and Qt would
also do this prior to Qt 6.8 because the GDI backend prioritizes
these.
When we moved to DirectWrite as the new default, these legacy names
for system fonts disappeared from the families list, which is
perceived as a regression.
Now, there was already an implementation for getting the legacy names
for fonts for application fonts, but this had not been implemented
for system fonts when populating the font database.
We rectify this by sharing the code which gets the additional font
names and also calling this when populating system fonts.
[ChangeLog][Windows] Fixed an issue where legacy names such as
'Arial Narrow' would no longer be listed as separate font families.
Fixes: QTBUG-135817
Pick-to: 6.8
Change-Id: I2e1b42b7be926e3b5af7bb2aab3ebe5a1fbe29de
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 6854ea63365ae419a04a470eb17e5f7662f00931)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
These classes, too, are usually in the first line of defense, handling
tainted data before anything else had the chance to verify it.
Amends 8df072fc8006510c9b743e8ffedaaf51a876883a.
QUIP: 23
Task-number: QTBUG-135187
Pick-to: 6.8
Change-Id: I21dbea39078a583f0bbf7737bd7151893fb98d17
Reviewed-by: Matthias Rauter <matthias.rauter@qt.io>
(cherry picked from commit dc45850c1e64565af5bcd8446389fd558131e58b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
It's no longer used. It was used by QByteArray{,View}::toDouble() but
that caused an all-space string to be considered a valid conversion. Now
that those functions do the trimming themselves, we don't need this
mode.
Change-Id: I2c24d3011fd7969bcc92fffd802a5d78ca28c157
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit 7838a57d2937070bb1a83122491f25b2b396553b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This does not affect leading and trailing spaces, which remain allowed.
This is only about a string containing only spaces, which used to be
rejected prior to Qt 5.9 and are rejected with QString (unit tests added
to confirm).
Drive-by indent one QString test row, which I've also reordered so null
comes before empty.
[ChangeLog][QtCore][QByteArray & QByteArrayView] Fixed an old regression
that caused toDouble() and toFloat() to return ok = true for a string
containing only whitespaces.
Pick-to: 6.8
Fixes: QTBUG-137038
Change-Id: Ia6f7714c5e289317de60fffd0f8aa6d2198a91ef
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 61b17127ae50516323d64523e6cfdf524ae8e974)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
tst_QMdiArea::currentSubWindow() is flaky and fails when the
dummyTopLevel window is not marked as active before verification.
Verify that the dummyTopLevel is active, before checking what is the
active topLevel window.
Fix the flakiness of tst_QMdiArea::currentSubWindow() on Ubuntu 24.
Pick-to: 6.8 6.5
Change-Id: If5b85713d0bfec40e2722c471f7c3ba5ac73171c
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 6c7f61f0817754b0abcf0a93ce5cf26fd5251cb4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
tst_QFocusEvent::CheckReason_ActiveWindow is flaky on openSUSE where
the childFocusWidgetOne is unable to receive focus after d has been
hidden.
This is due to some asynchronicity when setActive is being called
while d is already active.
Remove the call to activateWindow on d as it is already active by
calling show.
Pick-to: 6.8 6.5
Change-Id: Id01c6704122df42982d65d28ddb94d184d00d9aa
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 4db3961ee140867e14f8e1d20173e85060bc6c50)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This is fixed in Qt 6.10/dev, by one of many changes affecting the event
loop and threading, so it's not obvious which one. It's been flaky on
6.9 for the GUI Glib event loop and has been XPASS'ing.
1133: ********* Start testing of tst_QGuiTimer *********
XPASS : tst_QGuiTimer::crossThreadSingleShotDestruction(1s) 'deadTimerDestroyed' returned TRUE unexpectedly. ()
Loc: [/home/qt/work/qt/qtbase/tests/auto/corelib/kernel/qtimer/tst_qtimer.cpp(1328)]
Pick-to: 6.8
Change-Id: Ibbe5373a1f36eaab9830fffdac20c042682c583e
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Amends commit 6763e25cbc16cf8c54ab9b1ef97030aab9bb0eec, which refactored
static struct Cleanup {
to move the body if said cleaning up closer to the rest of the clean up
code in QThreadDataDestroyer::EarlyMainThread. But it accidentally
forgot the static keyword. As a result, we attempted to clean up before
::currentThreadData was set yet, resulting in a no-op and no clean up.
Task-number: QTBUG-135044
Task-number: QTBUG-134080
Task-number: QTBUG-133861
Task-number: QTBUG-132697
Task-number: QTBUG-102984
Task-number: QTBUG-132381
Pick-to: 6.8
Change-Id: Ibe40567bba8dea205401fffdb71f7e6a3be130e4
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit b5e47fa433f218a47db98a370fbad97c70455e85)
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 08325952eeb3a5cc9410a1b45e3445e97af51941)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This reverts commit 731d9a13956ef40e3f563f5ff5ff5c250b8d6d94.
Reason for revert: ${pcfiledir} cannot be used, because this
leads to wrong prefix values if PKG_CONFIG_SYSROOT_DIR is set.
See the comments of the associated task for instances of this
problem in other projects.
Pick-to: 6.8
Task-number: QTBUG-136210
Change-Id: I2a60946828f07866b931dacfe0ef81346f1aac9d
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 286e3093731cd82d4fa6b4d39fadeff21b71f9dc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
We set the CMP0156 policy to NEW for Apple platforms for each created
Qt target, but the debug message is generic, so we should only show it
once.
Amends c20d7bcb86361d0c9f8af3807dcad9db1a3a5ca0
Pick-to: 6.8
Task-number: QTBUG-135978
Change-Id: I332bd357999647df1d5f715d154fb568911889b1
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 674a6dc5f66fce1cbe77a593e1fc942290d3f9b1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
If a developer configured Qt with
-DQT_GENERATE_SBOM=ON
-DQT_BUILD_TESTS=ON
-DQT_BUILD_TESTS_BY_DEFAULT=OFF
The would get the following error upon installation of qtmultimedia:
CMake Error at
qt_sbom/SPDXRef-PackagedFile-qt-plugin-MockMultimediaPlugin.cmake:5
(message):
Cannot find 'plugins/multimedia/libmockmultimediaplugin.a' to
compute its checksum.
This happens because QT_BUILD_TESTS_BY_DEFAULT == ON sets the
EXCLUDE_FROM_ALL directory property on the tests directory, which
means all plugins created under tests/ subdir are not installed by
default, and the SBOM code could not read the installed files to check
the checksums.
In such a case, set a QT_INTERNAL_TEST_TARGETS_EXCLUDE_FROM_ALL
directory-scoped variable in the tests/ subdir, and use that as a
marker for the sbom code to know it should skip the checksum check.
Pick-to: 6.8
Fixes: QTBUG-137168
Change-Id: I970c3bc5732cc648549e5099fa1d50b3b39cb26f
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit d2ed84514d935aea412b6944866aeb41aa97ea89)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Otherwise we might run the risk that the observed object dies before
we try to do removeObserver.
Change-Id: I2b54ff32728fc40fd47be2d14070fc43640f81bf
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit b6ffbebbbe75c53f8dd9a7afd97032f7f4fd8f5c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
By moving the implementation to qcore_mac.mm, and using a union
for the object pointer, we can build qcore_mac.mm with -fobjc-weak
to take advantage of the automatic weak-tracking. This allows us
to drop the manual handling via ObjC associated objects, while
also allowing non-Objective-C code to use QObjCWeakPointer.
In particular we want to use it for QMacKeyValueObserver, which
today runs the risk of removing the observation on an object that
is long gone.
Change-Id: I5d605e5ac82b39223b246d6758d0da88a1702357
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 1c98b3fe403aaa7b57813070f3bd690af7bd4e43)
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
It seems that try/catch and ignoring the exception is not enough
to silence the error message about no implementation found for the
native method updateNativeActivity() when it's invoked at the start
before the libraries are loaded. To fix that we can call it only
if m_stateDetails.isStarted assuming that it would mean the libraries
were loaded since the app has been started.
Pick-to: 6.8
Change-Id: Ic23ce16439000090e2661b2e6956bcd9954bf33f
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
(cherry picked from commit 054dfb50a0c6b2bc9e2c227579eb6782e65e2134)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Set the initial safe area margins based on the decor view as a
workaround since setOnApplyWindowInsetsListener() is not being called
reliably at startups. This way we can get the app's initial insets at
startup, then after that rely on each window reporting its insets.
And apply this initial inset only for top level windows that match
the screen size, i.e. we assume edge-to-edge is enable in that case.
Task-number: QTBUG-135808
Fixes: QTBUG-135283
Fixes: QTBUG-135227
Change-Id: Ic5771809c94302b927ccc67ccc07c73ccc73b91d
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit e96a4b84e136d065054600c07bf5fae17f3049ce)
The QtConcurrent module applies user-provided map-, filter-, and reduce-
functions (or their combinations) to user-provided data.
It does not make any assumptions about the provided functions and
data, apart from input/return type validation. It also does not parse
the provided data and does not have any way to sanitize it.
Mark all the source and header files in the module with the default
security-significant score to confirm that the code was reviewed.
QUIP: 23
Fixes: QTBUG-135179
Pick-to: 6.8
Change-Id: I2c1b315b837111627c2f0ce6e2ade704415972e2
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit ca50d727785544237eb9f2d9d9a1d1d465772f2f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
We only call UpdateLayeredWindow in setWindowOpacity if the window
has an alpha an no native frame, which means we need to use the
same condition in the backingstore when choosing how to flush the
window.
Amends 9a45fea9d1f6e445fb488693b107cdec6e42cccd.
As a follow-up we should refactor this code to avoid the duplicated
logic that must always be kept in sync.
Pick-to: 6.8
Change-Id: I2bd79bdc4a726339fc486d0892ff4e1960a5a10e
Reviewed-by: Zhao Yuhang <2546789017@qq.com>
Reviewed-by: Nodir Temirkhodjaev <nodir.temir@gmail.com>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit 26f92a333e3caf575e79058e42d0b091e7f10fe1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Put all URL open handling behind desktopservices-feature flag.
Move the few remaining function (desktopEnvironment()) a bit to
keep #ifdeffery simple.
Fixes: QTBUG-135722
Pick-to: 6.8
Change-Id: Id210f99f905719b8c5dc0a5fa5ac3cf10181ae84
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit bed78605e7611252a784e7501806518edba32f0e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
A call to find_package(Qt6 COMPONENTS LinguistTools) would fail with
CMake Error at Qt6Config.cmake:212 (get_target_property):
get_target_property() called with non-existent target
"Qt6::LinguistTools".
Tools packages don't have a module, guard the get_target_property
call.
Amends 1d4c4400537537656997d3f000df6e9bdc5e720c
Fixes: QTBUG-137146
Change-Id: Idb70b427d0762ed64c2ef77133a2ae56f310483d
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 37e85c0ff3ee1f01d94942c35c0b13fe34fa4c7e)
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
moves setting QMAKE_DISTCLEAN to wasm/=.prf and only
remove files we create.
Fixes: QTBUG-134110
Done-with: Morten Johan Sørvig <morten.sorvig@qt.io>
Change-Id: I4b62cd423fe7814f8a39d67ae98bb61111b0618e
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
(cherry picked from commit 5ff542493dba52934d92f86463395e33b874906e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Previously, when a TextInput field was pre-filled with text,
focusing the input would cause the keyboard to behave incorrectly.
Typing any character would duplicate the last word. This appeared
to be caused by the keyboard reapplying a composition segment
(e.g., the last word), without a proper pre-edit region
defined—resulting in the word being appended again.
This issue is resolved by correctly setting
EditorInfo.initialSelStart and EditorInfo.initialSelEnd when the
InputConnection is created. Properly initializing these values
ensures the IME (input method editor) can synchronize with the text
field correctly. It can be found in [0]documentation:
"Also, take good care to fill in the EditorInfo object correctly and
in its entirety, so that the connected IME can rely on its values.
For example, EditorInfo.initialSelStart and EditorInfo.initialSelEnd
members must be filled in with the correct cursor position for IMEs
to work correctly with your application."
[0]https://developer.android.com/reference/android/view/View#onCreateInputConnection(android.view.inputmethod.EditorInfo)
Pick-to: 6.8 6.5
Fixes: QTBUG-135481
Change-Id: I5ae5a2fb22f285154ba3857033506d367bfd7642
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
(cherry picked from commit 6de8ce2af383c8d164c65ffca7dc845c52e4f2d2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Grabbing a QQuickWindow (software backend) cleared to something
semi-transparent is not going to be correct otherwise.
Pick-to: 6.8
Task-number: QTBUG-136755
Change-Id: I59f378b177154af25b1d7bff878435c715e3d114
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 97f7819f1d9a2f97e61e50defc93c466bcc7cfe6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Skip the goodToCopy check for the libraries that do not belong to
the main ABI. The rationale of this descision - goodToCopy was passing
in per-ABI build already, so we don't need to take care about this
check in main-ABI build. Also we indroduced the last-stand check of
bundled libraries in 7499fd0229d63f969bf6ca58d3b764b96395bed2.
Fixes: QTBUG-136493
Pick-to: 6.8
Change-Id: I438af867b0f25e0ea557bb5066f1c243bb6ab356
Reviewed-by: Bartlomiej Moskal <bartlomiej.moskal@qt.io>
(cherry picked from commit a867a16ef0a29f9b8b7196d0959e980ee17d7876)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Don't call style->unpolish()/polish() when the old and new style did not
change which might happen when setting a style sheet as this might
create an infinite loop and the style (re)sets some window attribute.
Bailing out early is not an option here as newStyle might be a nullptr so q->style() will fall back to the application default style.
Fixes: QTBUG-133332
Change-Id: Ifa9ee4fdfa64b2768337e2d90b7bbaac5f3fcd70
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit 3252e1808c12c21f27bb4844a1497d18587a64b5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Add the main Android ABI to the deployment settings. It's useful
for skipping functionality that is done in per-ABI builds.
Task-number: QTBUG-136493
Pick-to: 6.8 6.5
Change-Id: I9f59ffb1cae3107bbe695d99c33dd3426c163e6e
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 7aa2d1f5deb5eab2408d7bcf08d741f6c1c9a131)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Fetching a node that was a drive root path (C:/) ended in a wrong result
on Windows. Instead of the drive root the QFileSystemModel returned the
current working directory. This was due to the fact that the code in
QFileSystemModelPrivate::node stripped the /s from the "path elements".
As "C:" (in contrast to "C:/") is seen as a relative path on Windows
that lead to wrong results.
Pick-to: 6.8 6.5
Fixes: QTBUG-133746
Change-Id: I642a67853f31ad9b6710e2b5f696f22b1f60ead3
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Miguel Costa <miguel.costa@qt.io>
(cherry picked from commit 73c5c15d68dabce918a42d424ed31607bc9a20cf)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Custom titlebar input handling is done on WM_NCHITTEST, which is handled
at the WinAPI level. The WinAPI does not take into account the swapped
mouse buttons when querying the state of VK_LEFTBUTTON and
VK_RIGHTBUTTON with GetAsyncKeyState, so this behavior has to be
implemented manually. In case of swapped mouse buttons,
GetSystemMetrics(SM_SWAPBUTTON) will return true. This patch inverses
the meaning of Right and Left buttons in case
GetSystemMetrics(SM_SWAPBUTTON) returns true.
Change-Id: Ie46e130dc0bb49de318c8d04a3cc426f7a346b5b
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Zhao Yuhang <2546789017@qq.com>
(cherry picked from commit 6273e2e0edfc0eba148889158b2d06ad5a6eb0b9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Move all the helpers into the function so nothing else can call them
(out of contract).
As a drive-by, adjust the comment to mention this is Qt 5 QHash
snippets; Q6Hash is different these days.
Pick-to: 6.8 6.5
Coverity-Id: 11295
Change-Id: Id1a23030e325076d81592e351dfe804742a21a87
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit 0a9d5bd4767d2dc5900707e23790d79e6f5e0bd0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Ignore vertical constraint and use the horizontal one for the
property.
Task-number: QTBUG-17730
Pick-to: 6.8
Change-Id: I6317ce8c1c1e2ac2bf6ae3b24a60735a72dcb7bc
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit 977b6daa92309e73493e996330bee4d65061a8dc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Processes usually crash due to invalid pointers, but sometimes it's hard
to know if a given value is valid or not just by eyeballing it. So let's
ask GDB to print it.
I don't think LLDB has a way to do it.
Change-Id: I35e35bd3b79eeba49192fffd61474054cd089301
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit 2da64908c250203c7d17031a6b5c1d769b6215a2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This patch marks following files as security sensitive
-QtAndroidBinder.java - parsing data in onTransact(.., Parcel data,...) from
external source over IPC mechanism
Fixes: QTBUG-136815
Task-number: QTBUG-135178
Pick-to: 6.8
Change-Id: I022ee98be57a1a5b09beb7ccd07b4c04da612d2e
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 7796ad3face5246ad62a959b61fdd3a92cea2803)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The QFile object is only used in its scope:
- `remove(url)` indirectly removes the file from the disk
cache (by constructing another QFile) then immediately returns
- if the file could be read, all the read data is stored in a QBuffer,
the QFile isn't needed after that
Amends c254d73be63033497838807119cb9cb47ca6c1fa.
Change-Id: I714dcc619b8f5ed887f111395967d674ec875d6e
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit b9c92154062a1d6c0f62860a9fa775cba6bac9ef)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
...in _qt_internal_find_qt_dependencies. In the case where a package is
loaded via its own dependencies (Qt6FooPrivate -> Qt6Foo ->
Qt6FooPrivate) the inner _qt_internal_find_qt_dependencies call did
unset the backup value of QT_NO_PRIVATE_MODULE_WARNING. This could lead
to an unwanted display of the private module warning.
Treat the backup variable as a stack to deal with this situation.
Change-Id: I0ee3700a040b0df8c6090470ea6fc515cb93a7d6
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 66803a863ec58852617978733790a45a7c86e0fc)
If users set QT_FIND_PRIVATE_MODULES we may assume that they know
what they are doing and it's the conscious decision, and the
Private module warning is not needed.
Ammends a9f26c3f9a9eb6758e3ef116e319a6cca8715a1c
Change-Id: I2d7bf86060b87365bda0a8355427c52b1b38c456
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 14d1651d15b629701b6de407ee98a9fcd93808f4)
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
If a private module package is pulled in by another Qt module we showed
the private module warning message. The user couldn't act on the warning
other than disabling it completely. This doesn't seem useful.
Now, we only show the warning if the user explicitly does
find_package(Qt6FooPrivate).
There's the situation where a private module is pulled in as dependency
and later pulled in by the user. For example, in a static Linux build
find_package(Qt6 REQUIRED COMPONENTS Gui CorePrivate)
will pull in CorePrivate as transitive dependency of Gui's plugins.
To still see a warning for CorePrivate in this case we need to trigger
the warning in Qt6Config.cmake when handling the COMPONENTS.
To achieve that, the warning code has been moved to a function which is
called in Qt6Config.cmake and Qt6FooPrivateConfig.cmake
Task-number: QTBUG-87776
Change-Id: Ie9cc2d287d1fcb94db77045165f703cebcb6983d
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit a9c18e5df240ce4a8bdc4dd3e7b8d5289227d2d9)
When the additional path did not point to cmake path, the
loop was using non-existing variable.
Pick-to: 6.8
Change-Id: Ie9599231599c3b90125825414956e345634c85ef
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit c18a773355056dae7b02ff9935c3f829ccca2c02)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Qt 5 compatibility details are not relevant for Qt 6.
Instead, make it explicit that the binary builds require
OpenSSL 3.
Change-Id: I610254026e35def8f8206cd7c7e3015b2197852c
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Alexei Cazacov <alexei.cazacov@qt.io>
(cherry picked from commit e89912460fe79bfbdf64b8d2e94a075205e012a1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Most of QString's API take by signed values, so let the tests match
reality.
Also, as pointed out in the code review, use qsizetype instead of int.
Pick-to: 6.8 6.5
Change-Id: I03cba8e35d080454506a35a956ad106fd9bb3246
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit ef0b8bc7307ac9d7d56a9e7c356df3ecc12a0a87)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
If QXmlStream isn't security-criticial, what is?
qxmlstream.h contains the definition of the QXmlString work-horse, so
it has to be security-critical, too (until we remove it).
Amends 8df072fc8006510c9b743e8ffedaaf51a876883a.
QUIP: 23
Task-number: QTBUG-135194
Pick-to: 6.8
Change-Id: Ib366e63fb89aa0b69ad437f6688285b2c390c5c1
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
(cherry picked from commit 0a7ee06b27c55f10b65b053cabdc893ae8f23893)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The push_back(get()) / Q_UNUSED(release()) was an attempt to separate
the reallocation from the release of the unique_ptr, to avoid memory
leaks in case the reallocation fails inside push_back(), at a time
when unique_ptr::release() had already been called.
Coverity doesn't understand this pattern (and many human readers
won't, either), so change this into an emplace_back(), followed by a
release() into the return value of emplace_back().
Since assignments evaluate right to left, we need to separate these
two actions into separate statements, otherwise we'd end up in the
same situation as described for push_back(release()) above. Add a
comment explaining the problem.
Amends the start of the public history.
Coverity-Id: 425479
Pick-to: 6.8 6.5
Change-Id: I727aaf791d7b523cd6e7301c49c152b4b6e80dd2
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 603499d2e7cd2830f0d3ff7b97f1c2fb430f2118)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This patch updates the clang compiler detection to
allow Clang version 2010 and above to use C++26
macros.
This will allow Qt Android x86_64 build on dev to compile.
Fixes: QTBUG-136968
Change-Id: I0988169e6e10357f0e210c3911843e6d04a43c0d
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
(cherry picked from commit f9af480ed2b10a1fd6b692befbebcbecb9e1f429)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The fix for QTBUG-131574 aimed to make it possible to have
multiple fonts in the same family with the same style name.
It, however, inadvertedly made it impossible to have multiple styles
of a font for which the typical font properties did not differ. This
was especially bad for variable fonts.
So in the case of e.g. Roboto Flex, where the "Italic" is not
recognized as an italic font, as it does not set the "ital"
axis, we would overwrite the default subfamily (Regular) with
the Italic, because these would be seen as the same.
This was not intentional, and this patch fixes it so that when
we enter fonts into the database, they have to match both on
style name and properties, otherwise we will register them as
a new font. So identical subfamilies will still be supported.
Pick-to: 6.8
Fixes: QTBUG-135977
Fixes: QTBUG-135315
Change-Id: I9fd673e7b1061af69cd27049311565a14a145aa4
Reviewed-by: Lars Knoll <lars@knoll.priv.no>
(cherry picked from commit 306e68939cb29151c8333f9940dd48fa686efee7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Space-assignment syntax in Groovy DSL has been deprecated.
This is scheduled to be removed in Gradle 10.0.
Change-Id: I2029af79b25351337c32db96053548ce5f4f47ae
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit ed76f816e6aa64ec164857e794d3255616bff7f0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
When left-alt + num lock activated + number pressed the number
was inserted in the text. However in this input mode a 4 digit
keycode is used to insert a special character, it is wrong to
insert the individual digits in addition
Fixes: QTBUG-136799
Pick-to: 6.8
Change-Id: Iebafd1dfe5df1701a87a824ed99a440b122f0c57
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
(cherry picked from commit 5c82db79d98d456a9299314fab2e7576db227fd0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Not the default constructed QSurfaceFormat.
If the window had alphaBufferSize set to some value, we want that
value returned from the platformwindow too.
Pick-to: 6.8
Task-number: QTBUG-136755
Change-Id: Ie0b51b773e0127cac797607a52947bba7ec5eba0
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit d22660a09d36818d4c39a6e6b85430c377849dfe)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Prior to switching the protocol handler to use QHttp2Connection this
particular issue (see bugreport) was not a problem because the handling
of the IO-device being destroyed was simply to drop any pointer to
it.
QHttp2Stream, however, also has to keep track of the lifetime of
the IO-device, because it needs to abort the stream if the data
it's uploading is destroyed earlier than expected.
Now, since QHttp2Stream might also have other errors come up, we
have to connect to the generic 'errorOccurred' signal from it and
handle whatever issues arise, notifying our users that the request
for some reason cannot be fulfilled.
It's thanks to this part that we were now, in certain cases,
grabbing a stale pointer to the HttpNetworkReply and trying to
call functions on it.
We fix this somewhat indirectly. Because, after a HttpReply is
destroyed, we shouldn't even have any references to it in the
first place. And while it would usually be done as part of
handling the deleted() signal, we actually disconnect from
HttpNetworkReply's signals when we have processed one of the
finished*() functions. But since we were still connected to the stream's
signals we would still try to handle it.
For the http1 protocol handler this was already handled in
QHttpNetworkConnection::removeReply, which the HttpNetworkReply itself
calls at start of destruction. The function will go through any place
that the reply can be referenced and removes it. For http/2 it would
remove it from the list of requests yet to be sent, but not from the
in-progress list. So, we now add a new virtual function to the
AbstractProtocolHandler and specialize it in Http2 to handle exactly
this.
Fixes: QTBUG-136549
Pick-to: 6.9.1
Change-Id: Ie41863677a3b163f77d10bc3904ca515f6840be3
Reviewed-by: Mate Barany <mate.barany@qt.io>
(cherry picked from commit b0b9adf06675c5caa37105ceee157245e3dcca21)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The WS_EX_LAYERED state of a window can be determined on creation, and
the logic to do so should be centralized to QWindowsWindow::setWindowLayered,
so that we don't have divergence.
This fixes an issue where child windows would only support transparency
if they had Qt::FramelessWindowHint set, as the QWindowBackingStore had
a different idea about when to enable WS_EX_LAYERED than QWindowsWindow.
Task-number: QTBUG-122590
Task-number: QTBUG-135859
Pick-to: 6.8
Change-Id: I453967a5a2ce8974cdd1dbf6e36327e97384c33d
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Zhao Yuhang <2546789017@qq.com>
Reviewed-by: Pavel Dubsky <pavel.dubsky@qt.io>
(cherry picked from commit 876bf141cf987d80f20b74367de9ec69a04305ba)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
High contrast themes not only change the colors that native applications
use, but they also make various UI controls look different by adding
additional outlines and other elements.
The following improvements are made in this patch, for users using high
contrast themes:
* Menus have an outline, similar to native applications.
* Selected MenuItem's text and background uses different palette colors,
in order to look more similar to native applications.
* The ComboBox popup menu will have an outline.
* ComboBox will highlight the outline with the accent color when
hovering over it with the mouse.
* MenuBarItem's have an outline, similar to native applications.
Pick-to: 6.8
Task-number: QTBUG-133595
Fixes: QTBUG-134978
Change-Id: Ic99a76a6986bc987e6b6b9f6a6db4d3efc432b33
Reviewed-by: Wladimir Leuschner <wladimir.leuschner@qt.io>
(cherry picked from commit bc20065cf354def78fb018a14c502c76bcc013e6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Backstory.
1) Starting with Qt 6.8, the prebuilt Qt for iOS SDK is built as
static framework bundles instead of static libraries. That is done so
that we can embed a privacy manifest into each framework bundle.
2) Up until CMake 3.28, CMake would not attempt to de-duplicate static
libraries (or frameworks) on the command line. Starting with CMake
3.29, the CMP0156 policy was introduced to allow such de-duplication.
3) Since a while ago, Qt had its own policy handling for CMP0156,
which it force sets to OLD, to disable any de-duplication. That was
done to avoid possible regressions on platforms where link order
matters.
4) A developer might add the -ObjC linker flag to a project, to ensure
the linker retains all Objective-C categories it encounters in all the
static libraries that were provided on the link line. Retaining in
this case means that the /whole/ object file of a static library will
be linked to the final executable.
5) The Apple ld linker (both the legacy and the new ld_prime one)
can't cope with duplicate static frameworks on the link line when the
-ObjC flag is used.
It ends up throwing duplicate symbol errors, from trying to link the
same object file from the same static framework more than once.
The linker works just fine if the link line contains duplicate static
libraries, rather than static frameworks.
6) When a project links against Qt6::Gui and Qt6::Core, the link line
will contain Qt6::Core twice. This gets even more involved, when
linking plugins, which cause static framework cycles, and thus a
framework might appear multiple times.
Thus, we have the situation that Qt forces the CMP0156 policy to OLD,
Qt6::Core appears multiple times on the link line, no de-duplication
is performed, the project adds the -ObjC flag, and the linker throws
duplicate symbol errors.
We can fix this by force setting the CMP0156 policy to NEW when
targeting Apple platforms and using CMake 3.29+.
A potential workaround for a project developer is to set the policy
to NEW manually in their project.
Unfortunately that doesn't work for older Qt versions.
That's because CMake applies the policy value when add_executable is
called, and the policy value in qt_add_executable is the one that is
recorded when the function is defined. And the recorded policy is
always OLD, because Qt6Config.cmake calls cmake_minimum_required with
VERSION up to 3.21, which resets the policy value to OLD.
So we have to force set the policy in qt_add_executable /
qt_add_library via the existing __qt_internal_set_cmp0156 function.
The __qt_internal_set_cmp0156 had some diagnostics to show a warning
when the user modifies the policy themselves, but this never worked
because of reason stated above: the policy value was always overridden
in Qt6Config.cmake.
To actually make the diagnostic work, there is now new code to save
the policy value in the current directory scope, before Qt resets
it.
This only works if a project uses the find_package(Qt6 COMPONENTS Foo)
signature. It won't work with a find_package(Qt6Core)-like signature.
The policy value is not modified for platforms other than Apple ones
for now.
Amends 9702c3c78b2c16db6a9d0515d7d7698d9b064cd8
Pick-to: 6.8 6.5
Fixes: QTBUG-135978
Change-Id: I4d6e6c2a01e7092b417fc669d2aea40cf2dca578
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit c20d7bcb86361d0c9f8af3807dcad9db1a3a5ca0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
The setup:
- build Qt with '-static -qt-zlib'
- configure a user project with plain cmake and -DQt6_DIR pointing to
the Qt6 package
In this case, the implicit find_dependency(BundledZlib) call will
fail with:
CMake Error at lib/cmake/Qt6/QtFindWrapHelper.cmake:120 (message):
Can't find Qt6::BundledZLIB.
Call Stack (most recent call first):
lib/cmake/Qt6/FindWrapZLIB.cmake:6 (qt_find_package_system_or_bundled)
cmake/share/cmake-3.31/Modules/CMakeFindDependencyMacro.cmake:76
(find_package)
lib/cmake/Qt6/QtPublicDependencyHelpers.cmake:36 (find_dependency)
lib/cmake/Qt6Core/Qt6CoreDependencies.cmake:39
(_qt_internal_find_third_party_dependencies)
lib/cmake/Qt6Core/Qt6CoreConfig.cmake:42 (include)
lib/cmake/Qt6/Qt6Config.cmake:233 (find_package)
CMakeLists.txt:7 (find_package)
For example it would fail for the rasterwindow example configured with:
cmake ~/qtbase/examples/gui/rasterwindow \
-DQt6_DIR=$HOME/builds/dev-mac-static/qtbase/lib/cmake/Qt6
The failure happens because we don't pass any additional paths to the
find_package call that looks for BundledZlib, as opposed to how we do
it for module packages.
The project configuration does not fail if it is configured with any
of the following variables:
- Qt6_ROOT or
- CMAKE_PREFIX_PATH or
- the Qt generated toolchain file.
That's because these implicitly add relevant paths where to look for
Qt packages.
This came up in qtdeclarative RunCMake CI tests, where we only pass
Qt6_DIR to the test projects. It didn't come up in qtbase, because
none of the current qtbase RunCMake tests try to find Qt6Core.
To fix this particular case, conditionally pass the same paths that
Qt6Config.cmake uses when looking for module packages, to the
find_package call that looks for the bundled target.
We do it conditionally for bundled targets only, because for system
libraries we want to default looking for the module
FindWrapSystemFoo.cmake files.
Add a RunCMake test which will try to find a few Qt modules solely
based on having only Qt6_DIR set.
Pick-to: 6.8
Change-Id: I4d4e548f4c10370c4964ab8968b5772e26855dd4
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 15178c991997d15da23bbb072cbc7b426edab47a)
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
C++26 deprecated it[1]. Like the paper, we don't need the trivial
default constructibility for most uses. Even some of the
QTypeInfo::isComplex checks don't need it.
[1] https://wg21.link/p3247
Pick-to: 6.8 6.5
Fixes: QTBUG-136083
Change-Id: I0caafc5a15df732b9640fffd72fb1c598563a91b
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 97f3d41fa15a1dcaa17993436b9385ebd0fd274b)
Pass the correct devicePixelRatio to QIcon::pixmap() to make sure the
best pixmap is used for the current dpr.
Change-Id: I70014b649457cee819228fa0ead7beb7de944471
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Wladimir Leuschner <wladimir.leuschner@qt.io>
(cherry picked from commit e34db561cfa61f409313c80311d9890d115c0d8e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Amends 2c67d47ea15c6dc34cc20d8fbdb406efb19f11d7, after which we emitted
the signal, as the setParent(nullptr) call in the destructor would call
back into the QDockWidget::event override.
That change was correct, but we are now emitted signals while in the
destructor, after a potential subclass destructor was already completed.
This crashed applications that had slots connected to those signals.
While arguably an application problem (PMF connections need to be
disconnected explicitly), we can avoid this regression by blocking
the emission of that signal when already in the destructor.
Fixes: QTBUG-136485
Pick-to: 6.9.1 6.8 6.5
Change-Id: I6d5e98136beedc94c22287ccfd1198dd80f4f95e
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 7869593119ffaea6002e6668814af159a2077398)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
If Qt is configured with a custom value for INSTALL_QMLDIR, e.g. via
"configure -qmldir lib/qml", then we must adjust the rpath for QML
plugins. Otherwise they won't be able to load Qt libraries.
We had general code that adjusts the rpath for plugins, but that only
triggered if INSTALL_LIBDIR was different from the user project's
CMAKE_INSTALL_LIBDIR.
Now, we always adjust the rpath of plugins on Linux. The operation is
cheap, and I don't quite see how to add a robust condition for all
desired cases.
Pick-to: 6.8
Fixes: QTBUG-125223
Change-Id: Ib511fbc2b733deac804191773e56be9b6adf5e68
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit ecd63d469f453d4fef6e807388e68451cdc2c043)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
apply() of various classes sadly take a boolean argument, to indicate
whether an animation should be triggered.
Removing this bool trap would require central enumeration.
At least document in apply() calls, what the boolean argument is for.
Task-number: QTBUG-136716
Pick-to: 6.8 6.5
Change-Id: I5de59fb2813207c09d9de3cfb9ca147c18d943de
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit bf38ab9990f30151c148dbff77c8c9bf3982f097)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The deployment api was using hardcoded paths for qml and plugin files
by default. This led to problems when deploying to embedded linux where
those paths were configured differently ('lib/qml' instead of 'qml').
Pick-to: 6.8
Fixes: QTBUG-136678
Change-Id: I2c3eb10858350062c86cea62fc812f095796527e
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit b2985828a37acb9420ed396ffb7b1a850f943683)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Constify variables where possible.
Store conditions in const booleans with meaningful names.
Rename local variable "index" to "dockPosition" and type it
accordingly.
Add code comments to explain code paths for internal and
external separators.
Task-number: QTBUG-136716
Pick-to: 6.8 6.5
Change-Id: I21b950f6790cfa49c822dcd4de2eaadfa2ffdce9
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit ca41ace3578e6e49e5e85dc951a336e8d1832b1a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Qt doesn't support VxWorks DKM since 4.8, removing DKM specific check,
so it is the same as in Qt for VxWorks 5.15.
Pick-to: 6.8
Task-number: QTBUG-136722
Change-Id: I86cf54e8eadbb78365b7c58cb72b0675714fb37a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 312215ba87b00b0065babe1cf190980e2d9dbc4a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Setting focus and contentEditable on m_window causes
innerHTML to build up with characters.
This does not happen when using the m_canvas
The downside is that m_canvas is aria-hidden, but this
should, in principle, not be a problem since
m_canvas should not be focused when a11y is in
effect.
Later aria-hidden might be set only if a11y is in
effect.
It turns out this also fixes tabbing between textfields
and buttons bug.
This is a candidate for manual cherry-picking to
6.9 6.9.1
Task-number: QTBUG-136687
Task-number: QTBUG-136562
Change-Id: I08a9db2c39f9b0b0038c75fd06d3504b736ea031
(cherry picked from commit 83916851850bf41d9840a88d12112a20937da5f1)
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
It was not clear that the function will return true even when the
result is not yet ready, so mention it explicitly.
Amends 44ceb56455c82df3e6b1c9a2fa373cac14a039f8.
Fixes: QTBUG-136530
Pick-to: 6.8 6.5
Change-Id: I03b79f2b28c4bb755e6f56147cc7af1413ed4e57
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit a7d8d3ecdd934b4fcce6fd2658f0ac6a38a7dde1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
In some situations where the model is set sufficient late
an auto resize would never be applied. See bug report for
further details.
This is solved by moving to the normal memory model when
the global resize mode is changed to resizeToContents or stretch.
Fixes: QTBUG-136453
Change-Id: Ie0448042a7d23b059eaf7464a662f0f551d89fd9
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit 0d61e8ec5341b1642b63c34d5b2ce96ada54bd73)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
While technically true, those don't assert while qBound does,
so it gives you a false sense of security that
qBound(min, val, max) is safe for unsanitized input ranges.
Pick-to: 6.8 6.5
Change-Id: Ie26f5eba586a3cd2d3e0cd769427f518e1bc92b9
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
(cherry picked from commit 427bd9a42c68f6cc7afd9b9c13036873916cbfa0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The spacing betwen the border and text in a QPushButton is a little bit
to small because the CE_PushButtonBevel is drawn with 4px less than the
size hint due to the rounded border. Therefore add the 4px for
CT_PushButton.
Pick-to: 6.8
Fixes: QTBUG-126515
Change-Id: Ie64225ad4734399b5da8bc4e73738592f32a7982
Reviewed-by: Wladimir Leuschner <wladimir.leuschner@qt.io>
(cherry picked from commit d205844e51059c91395cf73ecd04ccc9382ff72c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Internally QDirListing uses the name filters to create
QRegularExpression objects which are then used to do the matching. Here
we are looking for files that have ".pem" or ".crt" extensions, so basic
string matching should work the same and is inherently faster.
Change-Id: Ib19b1eb8717b21c3b96a52e7036665c40fb24caf
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 6dcf1483940cb180cbe59e0ea8781d722ae6cddd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Regexp was renamed to RegularExpression.
Amends 813111689629a71e51d7d149a5f689b2961f2716.
This looks like a "dead" code path, QT_FEATURE_regularexpression is
most likely always enabled.
Pick-to: 6.8 6.5 5.15
Change-Id: I99af481bb41a197a0b7d00c750440a93d8e6a3fe
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 6952cfe7a0a0a23997189b73cd08e8871afeb2ea)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
`path` may contain wildcard glob patterns or regular expression ones,
so this method tries to get a path prefix without those special
characters, but that prefix could end up being empty, to counter
that, "." is used as a prefix. This led to iterating over the
current dir, which isn't the intended behavior. If the current dir
has many files, this could end up slowing things down (which is what
happens in the bug report).
Fix the issue by returning early if `path` is empty.
Amends 49f143e19ca11ef48260a3aaaa4ddbe490cf81ab.
[ChangeLog][QtNetwork][QSslCertificate][Important Behavior Changes]
fromPath() no longer accepts an empty path, which would previously
result in searching the current directory.
Fixes: QTBUG-134419
Pick-to: 6.8 6.5
Change-Id: I29224c3a47794b4095db5feae32a964dd9b854ff
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit 2875c4358beedd0997b60d21df4b95dbfec4f9a6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
When the app process is restarted (e.g. after revoking a permission), Qt
isn't running yet, so we must not restore the saved bundle state.
Fixes: QTBUG-136497
Fixes: QTBUG-136077
Fixes: QTBUG-135961
Pick-to: 6.9.1 6.8
Change-Id: I5ec594ec93dd3ba13b088d63ec77a3649e21d798
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 270d59f65be53a13263ba840b077b47026df4d0e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
We have a function to check if a stream was locally reset - we should
realistically only process HEADERS on RSTed streams for a limited amount
of time. I forgot we had this mechanism in place already, let's update
to use it for the recent fix.
Amends 9224fdd3f4cccce7a8123ab398f6ff8745d759ce
Pick-to: 6.9.1 6.8
Change-Id: I4826100704542f681341ceb84c4f85332f8ae03d
Reviewed-by: Matthias Rauter <matthias.rauter@qt.io>
(cherry picked from commit f95805670161b38da60602ada6128f03f7f9ceb2)
Reviewed-by: Mate Barany <mate.barany@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
VxWorks has POSIX pipe2 functions, but doesn't pass threadsafe-cloexec
because it doesn't have threadsafe-cloexec dup3. By default on VxWorks
POSIX pipes are used, but now it's possible to switch to PipeDrv
pipes using "configure -feature-vxpipedrv ...".
dup3 and accept4 test are now separated from threadsafe-cloexec test.
Task-number: QTBUG-132889
Pick-to: 6.8
Change-Id: I9e4514e2795917e8f3685a1760ea82a0022e9ca2
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 53756dcfbcb717327e26ee65cea995c2794e01fe)
Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
Add CMake variable to allow use of DESTDIR when installing examples
in a standalone example build and skipping the fake prefix that would
be otherwise used. Similar variable is already used for tests.
Pick-to: 6.8
Change-Id: I427cbb5c198f8e89b1685792b7c1d90413213254
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 406d5c6315b5c2500473883baea7d8db70d9eb78)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Don't write an absolute prefix into generated .pc files but one that's
relative to ${pcfiledir}. This makes the files relocatable, and we don't
have to patch them in the Qt online installer.
Pick-to: 6.8
Fixes: QTBUG-136210
Change-Id: I5c2f9398917be03f6c63286e553c87ff52971285
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 731d9a13956ef40e3f563f5ff5ff5c250b8d6d94)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QtCreator automatically removed this symbol when saving the file,
polluting my patch.
Therefore I put it into its own patch. As a driveby, I remove another
space at the end of the line.
Pick-to: 6.8
Change-Id: I407f9ebe5fb6c8bfa0285c0fcba929c8866b2251
Reviewed-by: Magdalena Stojek <magdalena.stojek@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit 1c0f02f3687054859c100a661cacfac883e4044d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Replace all standard media icons with the icons from Figma/Qt Icon
Library.
Pick-to: 6.8
Task-number: QTBUG-128665
Change-Id: I8e3944f6536cac81a415e4891dcd2e0203fc2863
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit 7951eba61ef45ef1e0e0b6645f242f42ac6128f6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Use QIcon::paint() instead retrieving a QPixmap from the icon and paint
it 'manually'.
Change-Id: I4e8e47bf8d7fdffa8e65f93e3b8501074d831c43
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit a3b24c2842cf48bf0d82d8d52ce2dc0edd441fc4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Currently scalable images are rendered with the default size set in the
image and not the size they were added with QIcon::addPixmap(). This
might give scaling artifacts when the both sizes do not match at all.
Therefore set the wanted size through QImageReader::setScaledSize() when
(and only when) the reader supports this. Setting it unconditionally
will also force the scaling of pixel-based formats which is not what we
want.
Task-number: QTBUG-135652
Change-Id: I2dc78587854b4c7c32438e0386385e980a9c4059
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 9eddf930a274757c91290d56d10177f4ff94c4bb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This reverts commit be93c06758260b1e0738ab17a2ecc4ee8f90e87e.
The assumption was that using a QVarLengthArray was equivalent to
the existing C-style VLA, as we initialized the QVarLengthArray
with defaultStackSize as the Prealloc template argument.
However we failed to take into account that we adjust the stack
size via Stack::computeSize(), by adding space for our memory
guard, so we would effectively always end up with the user-main
stack on the heap.
This caused problems for Qt Quick's V4 engine, because it checks
for C++ stack overflow by comparing the current stack pointer to
the base and limit given by pthread_get_stackaddr_np and RLIMIT_STACK,
resulting in "RangeError: Maximum call stack size exceeded." errors
and failure to load the QML.
We can't tweak what pthread_get_stackaddr_np reports for an already
started thread, so in practice we can not put the user-main stack
on the heap, so we revert back to the use of C-style variable length
arrays, which should be fine for this specific use-case.
Change-Id: I05a4bd32697abee71aa9e70f9f5a011cc338f915
Pick-to: 6.8
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit ccce91461a39adebde7ec7803b4cc0b97093f77f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This is a port from QLatin1StringView to QUtf8StringView.
Some functions of QL1SV have no counterpart to QU8SV:
* first() and last()
* count()
* indexOf()
* toUtf8()
that were not included.
Tests for user defined literals have also been removed. Some tests were
extended for utf8 string literals u8"".
Pick-to: 6.8 6.5
Task-number: QTBUG-132097
Change-Id: I0ceee00a7457360b430d13c3199f642f8e4c0036
Reviewed-by: Mate Barany <mate.barany@qt.io>
(cherry picked from commit 9319f790604c89acafdefd8c7dd97f90bcc9a37b)
The release is handled by the cache now.
Amends b1ed5f656f064e553b33752f8e87d2f5b9553e38.
Pick-to: 6.8
Change-Id: I1d4e13bbdffc732247f08a3d87dae6298155ba58
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
(cherry picked from commit 1b435685be1d56eee75cc444d9321793c40d63e0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
If we RST a stream then we may still have to process HEADER frames for
those streams (at least for a while) that was likely already in-transit.
This is due to HPACK, which manages header compression state. Missing a
frame desynchronizes the server and client, eventually leading to an
error where one party is referring to a header the other party doesn't
have.
Fixes: QTBUG-135800
Pick-to: 6.8
Change-Id: I5b4b510225ce6737fec7128c4bad38219404b196
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit 9224fdd3f4cccce7a8123ab398f6ff8745d759ce)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Unconditional linking breaks build when widgets are disabled.
tst_localfileapi, tst_qwasmwindowstack, and tst_qwasmwindowtreenode
tests link against Qt::Widgets, but does not use them => remove.
Task-number: QTBUG-136101
Pick-to: 6.8
Change-Id: I6d895b5ddd85b3ace98e0e398d034006aee236e0
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
(cherry picked from commit 464e9298e24f3769f0eb776eb443fc7eb98271c0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
It's not obvious how to correctly quote arguments with spaces when using
the DEPLOY_TOOL_OPTIONS argument of qt_deploy_runtime_dependencies. Add
an example for the -codesign argument of macdeployqt.
Pick-to: 6.8
Fixes: QTBUG-136348
Change-Id: Ic7f11c52f234bd3022976289a8facc7627e20c67
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 86d93cc349ca9f1205f5e48bdf3d6d16a935118f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Fix the logic in setOffset() which was accidentally reversed during
fixing of UB during signed overflow.
Amends 49fcac99deea390901000a74deea1c0c690b6ae2.
Coverity-Id: 479557
Pick-to: 6.8 6.5
Fixes: QTBUG-136362
Fixes: QTBUG-136477
Change-Id: Ifc9c80346355b0a9e516effe2ff8b60b1966d67a
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
(cherry picked from commit e808b38d4bb894f42b7dfe52f1ef67a0d48c23ff)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Ammends commit 61343b5a3f10f5b9166729176d4b95a4c538c278 (which was too
big a change to back-port to 5.15), checking narrow != short in
Chinese month names.
Pick-to: 6.8 6.5
Task-number: QTBUG-10506
Task-number: QTBUG-84877
Change-Id: Ib9c26df751c0add517bc94218db04d32d8d135eb
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 591dccddbbd4bc3c6b1bc4e85319b866022213bc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Amends commit 0278a80d6876f38bb37f1d504e6b24a3512efb7a - I developed
the new test as part of adapting the earlier change to 6.8.
Task-number: QTBUG-131894
Change-Id: I711e62db7e35fa26c396498354ffbb5aa23920a8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit dabc113cc89c9b15e76ba8448e8abba3c9722f47)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The concept of stripped vs unstripped files in the API
stems from Qt 3, but got abandoned already in Qt 4.
Change-Id: I449ddfd7ff3b8b3d50ab0252fabcab974d83a5ed
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Masoud Jami <masoud.jami@qt.io>
(cherry picked from commit 6ff833c04a2e7b46acfad6e9dd4e168ed527b9b7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The location of the input field was wrong leading to empty space
inserted in the user interface.
Fixes: QTBUG-136233
Pick-to: 6.8
Change-Id: Ic8c9faf5c4dbb8cec43a43c25c1cce8d7809f140
Reviewed-by: Piotr Wierciński <piotr.wiercinski@qt.io>
(cherry picked from commit f016201b6d66408a4dd7427d2b9234909b8f1f92)
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
This reverts commit 845aa1e9d1c60ecff38cbb2d0e98414ac1d9cc68.
Reason for revert: This breaks cell phones and tablets on chrome
Change-Id: I832f5b0d4b690b45168d6a3368f82317e97829d2
Reviewed-by: Piotr Wierciński <piotr.wiercinski@qt.io>
contenteditable on the window caused characters to be inserted.
Instead create a div as a child element, and set contenteditable
on that.
Fixes: QTBUG-136050
Change-Id: I4ccf3589ea19876f68bb9c7077c3a13ae5f989e6
Reviewed-by: Lorn Potter <lorn.potter@qt.io>
CMake MR #10626 doesn't consider the MSVC compiler as valid assembler
anymore, thus unconditionally requiring ASM breaks with CMake > 4.0.1 on
MSVC.
Enable ASM only on non-Android Unix.
Remove the ASM language where it's not needed.
Pick-to: 6.8 6.5
Change-Id: I5df71edfce0f4920e39262f722e4bf95a735f31b
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 25b040acc1e93ba4dd36f307271994be0f0604af)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
In order to properly show a popup the Wayland QPA needs a parent window.
Currently it has to guess the parent, which might not work in all
circumstances. To address that explicitly set the widget as transient
parent of the popup.
Fixes: QTBUG-130474
Pick-to: 6.8
Change-Id: I99ea14a1a9ec25ee8a929cf61a6744957a850374
Reviewed-by: David Edmundson <davidedmundson@kde.org>
(cherry picked from commit 81f8eee6a1e1cfcf4bf1f2dac863e94e0f872559)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
When creating an NSImage from a QIcon to show the icon of the action in
native menus, then we so far didn't take the state (on/off) or mode
(normal/disabled) of the UI element into account. This resulted in a
menu item showing the Normal/Off icon of an action, even if the
underlying action was disabled or checked.
Icons in menus are not common on macOS, but since we have the
information we need in QCocoaMenuItem, we might just as well use it to
get the right pixmap from the QIcon (even if that pixmap is generated
from the Normal/Off pixmap).
Add an overload to our NSImage::imageFromQIcon helpers that takes a mode
and state, call that from the existing overload, and use it in
QCocoaMenuItem::sync.
Pick-to: 6.8
Fixes: QTBUG-135934
Change-Id: Ifce73daf49ce34c874fa5bf652d84b3102a06709
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 84da5450c342655a7e426c5bb07d9accf7a222a1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Check:
- data: urls with a host are treated as malformed
- if the mime type is omitted, it's set to
"text/plain;charset=US-ASCII" as per the RFC[1]
- the mime type of urls with a `charset` attribute are
normalized by adding "text/plain;" (Qt implementation detail) if it's
missing
[1] https://www.rfc-editor.org/rfc/rfc2397.html
Pick-to: 6.8 6.5 5.15
Change-Id: Ifd9736b7808226c8462e3d39798abda7b245c6d8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit f8987b2d0a0835bdc2e6e4f2204e6e40db33da5f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This is necessary to have correct focus handling on webassembly/ubuntu
without this change tabbing from text input to f.ex a button would
not work.
Fixes: QTBUG-136562
Change-Id: I78eaa6202d8bdb87b1195d5c38a3f73570a49c90
Reviewed-by: Piotr Wierciński <piotr.wiercinski@qt.io>
The correct define to check for MariaDB C Connector is
MARIADB_PACKAGE_VERSION_ID, not MARIADB_BASE_VERSION (which is a string
describing the server version the c connector relates to).
Pick-to: 6.8
Task-number: QTBUG-136550
Change-Id: I844900d9b6622fd3a72db63298e5c34de8a2f3dc
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit dbbe65fb262cce0379660e38ab71b27044015d27)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Clean up QWindowsVistaStyle::standardIcon a little bit by using
separate icons for SP_TitleBarMaxButton and SP_TitleBarNormalButton
Change-Id: I876d41f0373268a0a8888f00392a8e32d0f413a1
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit aed4307a1f3e0bea9aac6013e3ba6ef32a47a989)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Currently, configure fails late with
Qt requires at least version 15 of Xcode, you're building against
version . Please upgrade.
Change-Id: Ic4f44d37429ac9def785a50909a25b0bcb4b72a5
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit d1e030f6f53f630819c7ec0729f83ede1e37e3b0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Recent changes to date-time formatting arranged for time-zone names to
be localized appropriately. Teach the datetime parser to recognize the
long names that now implies, as well as IANA IDs, and ensure these
last are also used as a fallback when no localized long name is
available. Discrepancies between the platform time-zone backend and
our CLDR-derived name L10n (where needed, due to the backend lacking
it) make the naive approach to this (find any zone that matches,
expect them all to have the same offset history) fail, so take care in
this case to select as canonical an IANA ID for the named zone as we
can find. Add a round-trip test and adapt an existing test to
round-trip when it can.
[ChangeLog][QtCore][QDateTime] The tttt format specifier now uses the
full long name of the zone, falling back to its IANA ID only if this
cannot be determined. Both forms are now recognized when reading a
datetime from a string.
[ChangeLog][QtCore][QLocale] When serializing a datetime, the tttt
specifier now uses the localized full long name of the zone, falling
back to its IANA ID only if this cannot be determined. Both forms are
now recognized when reading a datetime from a string.
Pick-to: 6.8
Fixes: QTBUG-130278
Change-Id: Ia28529790c0f600930d55c92a606adbcdfa852b9
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 2edd9286cf386675be76032424248e60216f6331)
Prior to 84a5f50c7766c99f62b22bb4388137e0aa8dd13d
QWidgetWindow::handleMouseEvent() did its own synthesis of
QContextMenuEvents. Then we moved it to
QWindowPrivate::maybeSynthesizeContextMenuEvent() and didn't preserve
the code to accept the QMouseEvent if the QContextMenuEvent was
accepted. It turns out that the WASM platform depends on checking
whether the QPA mouse press event was accepted: if not, it closes
all popups, including any context menu that was just opened by a
right mouse press.
Fixes: QTBUG-136241
Change-Id: Ibe01763a6af19d65629dc77eb61ffc1af581efbe
Pick-to: 6.8
Reviewed-by: Even Oscar Andersen <even.oscar.andersen@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
(cherry picked from commit b01fe1390cd22165104aba5eb49dae90c0b91618)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Missing 'e'.
QHttp2Connection is private API so the API can be changed.
No known external users.
Pick-to: 6.8
Change-Id: I4f3daab9deff3250ff66066dc3e088edfbbfc5ef
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Matthias Rauter <matthias.rauter@qt.io>
Reviewed-by: Mate Barany <mate.barany@qt.io>
(cherry picked from commit 70d3293d72a1a612d375447a6f46ea223be1f9cd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
In some extreme cases we can return a finite float, and then turn it
infinite when multiplying it to calculate the index positions.
Avoid the whole thing by clamping to a brightness of +-32768 times the
white point standard, which is well within current HDR standards.
Credit to OSS-Fuzz which detected the assert.
Pick-to: 6.8
Change-Id: If007732a8d59ea27514f17674d318a099a057281
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Reviewed-by: Robert Löhning <robert.loehning@qt.io>
(cherry picked from commit 2b7ecfab7d8cb149ffc02285906f95906f2f1343)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Move the usage of the corresponding QStyleOption classes into a
QT_CONFIG() guard to fix compilation when these options are disabled.
Change-Id: I68e791f20bbc8389974878e765b08a97eb347b92
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 0d4e04416554d9b2f03f325616052be06dd85a44)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Remove some unused includes in source files.
Change-Id: I5c43fd10fa1a179664ad8cbf4988f9bdb96d8af8
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 69053eea3fa858e7885dbac5e5d0bcd6ed618174)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Even though the member is named 'menuBar', it's a plain QWidget. Also
the setter are not guarded so the functionality should not be guarded
too.
Change-Id: I5fa19ab955d9794aa3d344ba0cfc8a0a3d22b61e
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 33c2931429ea0557607627ec452b093d273a9f95)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Replace some QCOMPARE(value > x) with QCOMPARE_GE(value, x) to get
better output on failure.
Change-Id: I3f7fc80cf25776adab40cd61c08c58a49f6af0c5
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 29238407af94fd651900d18031c8ae1392d96f12)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Make sure to not compile the stylesheet sources when
FEATURE_style_stylesheet is disabled, also don't include the relevant
headers in this case.
Fixes: QTBUG-136341
Change-Id: I4fc2de2fcba004b93140809ef79374401209f14a
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit e57fff63419867d59b6067fc1a5a3495678708dc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QDoc generates warnings for images that do not have an alternate-text
associated with it. Alt-text is required for to increase accessibilty
options.
This patch adds alt-text to images in the Qt Network
Fixes: QTBUG-135122
Pick-to: 6.8
Change-Id: I690f1d381ef5a9052e189dd1f3906243df557da0
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
(cherry picked from commit ae6ba06e55dbdae98eb05069e007044bf70f45da)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The 'syslocaleapp' test helper application was built only when
jalalicalendar is enabled. The tst_qlocale on the other hand
depends on 'syslocaleapp' if process-support is enabled.
Thus if jalalicalendar was disabled and process-support
enabled, the CMake configure fails because tst_qlocale won't meet
its 'syslocaleapp' dependency.
Fix by building a more limited version of the syslocaleapp when
jalalicalendar isn't supported, and adjust the testcase accordingly.
Pick-to: 6.8
Task-number: QTBUG-136101
Change-Id: Ic809b0124d47754105ca09b69e2b3c12856ba63a
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit 3bbe9d8ec7ab49a44b1ba661b0930d5d3506bce6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
It is a precondition violation to call QByteArrayView::at() with
size() as argument. The code used that, though, as an implicit
end-of-string check, assuming == ' ' and == '=' would both fail for
null bytes. Besides, QByteArrays (but most certainly QByteArrayViews)
need not be null-terminated, so this could read even past size().
To fix, use higher-level API (startsWith()), consuming parsed tokens
along the way.
Add a test that would crash in debug mode before the fix.
Amends the start of the public history.
[ChangeLog][QtCore] Fixed a bug in the handling of data: URLs that
could lead to a crash if Qt was built with assertions enabled. This
affects QNetworkManager and links in QTextDocument.
Pick-to: 6.8 6.5 6.5.9 6.2 5.15
Change-Id: I4331c88051dfbb0a18fe7da4f50858c707785d09
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 4d839093b480d30eef8a89c0f864ee3f340adaa1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
With CMake 4.0 the CMAKE_OSX_SYSROOT is no longer automatically set
based on the CMAKE_OSX_DEPLOYMENT_TARGET or host platform, so the
variable will be empty by default.
Pick-to: 6.8
Change-Id: Icad8e044a9d58e995882672b27340c83eb0ae0a8
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 91ec68313ae8a90fcc97e669e1cf386c952aa41f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Network errors and SSL errors are provided as invokable methods.
The end user can collect the errors after download is finished.
Task-number: QTBUG-136035
Pick-to: 6.8
Change-Id: Ic8bd9b84d331752c096998683b44b85be3cd6b10
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
(cherry picked from commit 124f05bd10c1ce2a5104394712fae54c0659fccb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
When highdpiscaling feature is disabled, a default dummy
QHighDpiScaling class is compiled in. This dummy class missed
the roundScaleFactor() method used by qwindwswindow.cpp, causing
a compilation error.
Pick-to: 6.8
Fixes: QTBUG-135893
Change-Id: I754878b9bbd55f68f07a19618fc275f89f7f839f
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
(cherry picked from commit 581e39b35f5a09640959112779514b3f11bc5c82)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Most feature guards were already in place, this commit adds the
missing ones.
Pick-to: 6.8
Fixes: QTBUG-135890
Change-Id: I1fbfad6552b2896d867a29134a2add693dbd136f
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit 4790a06b1684244841c4be90369561df0a9f97c8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Correct a member comment in LocaleMetaZoneLongNames.
Remove a superfluous else in QUtcTimeZonePrivate::displayName().
Add a TODO comment to QUtcTimeZonePrivate::isTimeZoneIdAvailable().
Pick-to: 6.8
Change-Id: Iddc144a267ca8fb33a6577e8d671ef3da53ca525
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 7983b9bd9a56cdb6c8ec6c0ae907329eabde39fc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Petty tidy-up, just to disentangle it from other work.
Pick-to: 6.8
Change-Id: Ifa7543585af35e494185be8faf637e3d48670c4b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit bb8c1b85afec82240026bd85dcc52b0734ffc25f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
tst_android depends on widgets, and parts of the test
needs to be excluded if Qt is configured without them.
Pick-to: 6.8
Change-Id: Iaca5b4228c0a7bd7c3a2efe9da04f354ac7e7c1c
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit bdacb87cef17ff9bab69d843b8c5c14e2a749715)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Use constexpr and const where we can.
Use Qt-defined string literals in a few more places.
Include GenericTime in a displayName() test, and make overt that we
are simply discarding the returns, with no further testing.
Pick-to: 6.8
Change-Id: Id120fdfe66267b01ff019fe13ac80f37390c106f
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 4702868677b4d09edc65b869ffd11756a20e6671)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The QT_BEGIN_NAMESPACE macro was inside the "#if networkproxy" code
block, whereas the QT_END_NAMESPACE was outside of it.
When networkproxy feature is then disabled, the file will only
effectively have the QT_END_NAMESPACE macro. This fails to compile
when the build is an actual namespace build.
Pick-to: 6.8
Change-Id: Ic0b0fd2d086811664a4f66e2c46424d370641355
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 8d659669b248908b28dd51d07054cbb1ce91a35a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Add a feature guard for test function relying on networkproxy.
Pick-to: 6.8
Task-number: QTBUG-136101
Change-Id: I69d97c84fb7d68f33f4b74fc8fd6665b1b8d6717
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 11b54b85ce74d59173afd297b780d3170b331548)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Test case relies on transitive include and fails to compile if this
include chain is broken e.g. by disabling features.
Pick-to: 6.8
Task-number: QTBUG-136101
Change-Id: Id34c9f8ec86468aaf4dda116be8d46591ebd9185
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 2542d79281a2c7f7d065c234438b866299ec4b7d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-A new Export Controls page has a larger overview
-Edited parts of the section
Fixes: QTBUG-134259
Change-Id: Iaceb2501eeb848544f8004bfae03a3cdf36908af
Reviewed-by: Andreas Eliasson <andreas.eliasson@qt.io>
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
(cherry picked from commit 03efecf818374f95d1387649f35cd4da8c9636ae)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Various checks for whether a locale was suitable for use of ASCII
offset formats were expressed in terms of QLocale::C. One was wrongly
expressed in terms of isDataLocale(), which is meant to be true for
the locale the backend thinks its data is suitable for. Write a new
method of QTimeZonePrivate to check for this, accepting en-Latn-* as a
good enough match, and deploy where it's the right test.
Pick-to: 6.8
Change-Id: Ieab129eb5c252732b8916fce017ec0a22684eba8
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 023a8d48e28f27da9fab097ecbe9acfbb8323544)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
It is out-of-sync with the actual implementation in qmetaobject_moc_p.
we could change the parameter types, but it will only go out-of-sync
again if the implementation is changed in the future. So just remove the
whole comment.
Amends 916460929d1de315262d4a9ee91280ecaf3f58f1 and
4dbac23e5354638224d8d99ba3342067c015a04b.
Change-Id: Id41d2818266cf22765f0ae7f11265c0e840d5af3
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 637a2a29833e31635eb42841e235f24e3589972c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Amends eced22d7250fc7ba4dbafa1694bf149c2259d9ea
tst_QTextMarkdownImporter::frontMatter(yaml + markdown with CRLFs)
now does explicit replacement of LF with CRLF: git may convert the file,
so we can't rely on the CI test system checking out a true copy of
yaml-crlf.md; but QFile::open(ReadOnly | Text) ensures that we will
have LF line endings, not CRLF.
Pick-to: 6.8
Task-number: QTBUG-135284
Change-Id: I7eee5f41e7aea902a59ac06238e591ece016d2d3
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
(cherry picked from commit 66595c3efe125cc92333d7a71317cce529c52e92)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
If one of the interface link libraries of a target is
"$<LINK_ONLY:$<BUILD_LOCAL_INTERFACE:Foo>>"
this will be exported by cmake as
"$<LINK_ONLY:>"
in the exported INTERFACE_LINK_LIBRARIES property.
When walking the dependent libraries of a target using
__qt_internal_walk_libs(), this value will become empty after
unwrapping the LINK_ONLY genex.
In such a case, we should skip further processing of the library.
Otherwise in some weird unknown conditions, CMake might consider the
empty name to be a valid target, and cause errors when trying to read
properties from it.
Amends ad7b94e163ac5c3959a7e38d7f48536be288a187
Fixes: QTBUG-136039
Change-Id: I143dec697e10530379486462697cd299940ee463
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 9bc8ce6608eff2bd07b0044be80db4e9b6d8f5cd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Make NColorRoles constexpr and use static_assert() to verify that it
has a proper size.
Pick-to: 6.8
Change-Id: I40351e4815e248fe8cc07e906099172d5be531d0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit f12115e97ca8875a2577eebc67b8c8dc03441996)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
As a RAII class, QtPrivate::StreamStateSaver's ctors should be marked
as [[nodiscard]].
Amends 3c93286f08a80b6e1821d7d63d361742b25c6578, but not picking all
the way back since 959800f6de137f6a77c7d5a2741a5bae0638cbd9
(Q_NODISCARD_CTOR) was only added in 6.6.
QUIP: 19
Pick-to: 6.8
Change-Id: If39fd79d21c52d60481973a416ae5f7da1858f7a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 6079d7cd9c6f27cf49c63895771cdb3f87bdaee6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
It's used to determine whether a non-equivalent prefix of a locale
gets added at the end of the block of equivalent locales, or at the
very end of the list. Thus it should be initialized for each prefix as
it is processed, not before the name is trimmed to its first prefix.
Added the test-case that caught this.
Amends commit cbf49f735e3cca85922a85d6548666816686db78
This should work as-is in 6.9 but may be hard to back-port to 6.8.
None the less, I shall try for the latter, too.
Pick-to: 6.8
Task-number: QTBUG-131894
Change-Id: I75ab27153133d2608cf57f0bc998c1e3d0d1432c
Reviewed-by: Mate Barany <mate.barany@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 0278a80d6876f38bb37f1d504e6b24a3512efb7a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Allow generating files from template file. The signature first
expands the '@' wrapped variables in template file and then generates
the resulting file using file(GENERATE command.
Pick-to: 6.8
Change-Id: I0b4cf557da1d5161ffcde1c44aea98c440427980
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 5c30ae2c9f57d58b52effa1460c4bc38da29952a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
When processing multiple attribution files to collect all attribution
ids, the values of the previous iteration extracted keys were not
reset.
This caused the values to leak to the next processed attribution id
target if the specific id key was empty.
Make sure to clean up the values before parsing the next attribution
key.
Pick-to: 6.8
Change-Id: I386fc9c09276c49207382b06605efeb0d939b6da
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 3c80dd518a3bdc5f2c4df64c5330678294e06eb7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
We should only pass PROJECT_COMMENT if it has a value.
We also need to escape semicolons, because the project comment might
contain the qt configure line, and that might have passed arguments
like -qpa offscreen\;xcb
Pick-to: 6.8
Change-Id: I934cf75c376b3466ba91a433d009e6eaa77a60fa
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit ea575585e7eaccb628cdb342c8dd49396a3c52a2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
In one case, the code simply checked for isOpen afterwards; refactor
it to use QFile::open's result. In another case, a file was opened
from the resource system, so add a check.
Pick-to: 6.8
Change-Id: I5f4c22dd5ce678f15c9c1609c4228d50a2b32a1d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit eeead68995653ab38e43e9f1494feaaa679dfd07)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
When stopped, an animations's currentValue can change as a result of
changes to the the start- or end value. The target property will not
be updated, however.
Fixes: QTBUG-125586
Pick-to: 6.8 6.5
Change-Id: Ib03133db80e92b4d73a1140e9a94d6d7a6b68fc4
Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com>
(cherry picked from commit 25fbbb56122d95a9dce004ee6e9de8d144a46032)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The code was already partially behind the feature flag, but not fully.
Pick-to: 6.8
Fixes: QTBUG-135693
Change-Id: Iad76221837aa37b90b3be998afc41ce9bbc05c55
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit f5b5f16bfa0bf0889c1d77af3e9840e67a2e851c)
A QDataStream* is not a faithful representation of a
QtPrivate::StreamStateSaver, so the ctor should be explicit.
Amends 3c93286f08a80b6e1821d7d63d361742b25c6578.
Pick-to: 6.8 6.5 5.15
Change-Id: I63f8fa19070960bf70c965ffbc270070d10eacd7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit bb38a2929dfc00b202fe169b69c80e7854f47ad1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Put lcQtGuiDrawHelper logging category declaration behind the same
feature flags as its users, to suppress a warning when neither
feature is defined:
qdrawhelper.cpp:38:27: warning: unused function 'lcQtGuiDrawHelper'
Pick-to: 6.8
Change-Id: Id6eab4e9ab7313475eedfeb20d8d29f84a47f291
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 40595f8063ff18fd3b3e810ffc799fb081e33a1b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The QT_BEGIN_NAMESPACE was inside "#if TEXTHTMLPARSER" code block,
whereas the QT_END_NAMESPACE was inside a nested "#if CSSPARSER"
block.
Therefore if cssparser was disabled, the file will effectively
have just QT_BEGIN_NAMESPACE, and the build will fail (if it's an
actual namespace build).
Pick-to: 6.8
Change-Id: Ibd750a71c154cb9596a7227327b7d5b3ab307001
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 8f940ca197249d89a4a6ff1958c8d4c95ff88077)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Put both declaration and definition of tst_qimage::mirrored() behind
the same deprecation flags.
Task-number: QTBUG-136101
Change-Id: Ib54ee21f7944f1e2b7f9fe35aea9fd8d9e908f95
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 262a92244be71f622b5fa3e6e7c4fb60295efc0c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Place the calls to QTextDocument::toMarkdown() behind the same feature
flag as toMarkDown() function itself.
Pick-to: 6.8
Task-number: QTBUG-136101
Change-Id: I7468f6172cab613695504d7c50075169b46c4bc9
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
(cherry picked from commit 3f5023aada2cc2450592a5434b6d6534468429e8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Note this would ideally use androiddeadlockprotector.h, but since
it's living under the plugins directory it won't be accessible for
this code without some refactoring.
Fixes: QTBUG-133841
Pick-to: 6.8 6.5
Change-Id: I9b62e7a9809ba5e0782a82b9c07d122de544aece
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
(cherry picked from commit e8aa9ff63850a6ddcac739bc773463d61ec4567f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Apply NSDMI and move initializations to the constructor initializer list
Fixes: QTBUG-135897
Pick-to: 6.8
Change-Id: I7adff41fa006669677df457704d20c02f1af7197
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 3265f409394e821605cfd1888a26f7fbdd4ba682)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Rename QOCIResultPrivate::sql to QOCIResultPrivate::stmtp to avoid
shadowing of the sql member from base class.
Remove some useless casts as a drive-by.
Task-number: QTBUG-136024
Change-Id: I2a5951991039c4de7aecc29f9161dede7b4f3473
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 3208ad494c7c03b964487787e246aedc444397dc)
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
QLoggingRegistry relies on any Qt code it uses not having category
logging in it, because it causes a global variable to be recursively
initialized. This has been the case so far, but with CTF tracing
enabled, there is Qt code that uses category logging if the first
tracing event originates from a logging category, causing the tracing
library to be loaded.
It is undefined behavior to recurse into the initialization.
Here is the backtrace of the situation:
QGlobalStatic<QtGlobalStatic::Holder<()::Q_QGS_qtLoggingRegistry> >::instance
QGlobalStatic<QtGlobalStatic::Holder<()::Q_QGS_qtLoggingRegistry> >::operator()
QLoggingRegistry::instance
QLoggingCategoryWithEnvironmentOverride::registerOverride
QLoggingCategoryWithEnvironmentOverride::QLoggingCategoryWithEnvironmentOverride
QtPrivateLogging::qt_lcDebugPlugins
locatePlugin
QPluginLoader::setFileName
QPluginLoader::QPluginLoader
loadPlugin
initialize
_tracepoint_enabled
QtPrivate::trace_QObject_ctor
QObject::QObject
...
QFile::QFile
loadRulesFromFile
QLoggingRegistry::initializeRules
QLoggingRegistry::QLoggingRegistry
(anonymous namespace)::Q_QGS_qtLoggingRegistry::innerFunction
QtGlobalStatic::Holder<::Q_QGS_qtLoggingRegistry>::Holder
QGlobalStatic<QtGlobalStatic::Holder<::Q_QGS_qtLoggingRegistry> >::instance
QGlobalStatic<QtGlobalStatic::Holder<::Q_QGS_qtLoggingRegistry> >::operator()
QLoggingRegistry::instance
QLoggingCategory::setFilterRules
main
Add a recursion guard in the QLoggingRegistry that causes
QLoggingRegistry::instance to return null if recursion occurs.
The internal code appears to handle nullptr well, while external code
should always receive a non-null pointer.
Fixes: QTBUG-135326
Pick-to: 6.8
Change-Id: I91f1ff341b096031930004cca8421f2ee0bab9b1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 07255301eaa288fde3d550e0119b4d3ed2c39d22)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The windowsvista style increased the width for SE_ItemViewItemDecoration
by 4 pixels which lead to a non-square area for the decoration item.
Since the item is painted centered on the given area, this did not
change anything for squared pixmap-based icons. But when using a svg,
the image is automatically stretched to fill the complete area.
Therefore a svg is not painted quadratic but stretched which is not what
a user expects. Looking for other usages of SE_ItemViewItemDecoration
did not reveal another usecase for this so it should be safe to remove
the handling within windowsvista style.
Fixes: QTBUG-131955
Change-Id: I65f8e2afd1c2fb310d6a23b1405a920adcbf42c3
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 298e8119222174cfb253272699e7fd90c1abf255)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The refactoring in 82681fd8a2af1113da5bd13875ba71c1efd45afb added a
d_ptr of type QOCIResultPrivate. This shadowed the d_ptr from
QSqlCachedResult and an unitialized QOCIResult::d_ptr variable which in
the end made the whole plugin unusable.
Fix it by removing the unneeded d_ptr member.
Fixes: QTBUG-136024
Change-Id: I5ecacba8079eadbfae25a32720b43b4465c096d8
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 87bbcddb1d68142b3b8a21d20ec19e38c55a5e93)
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
MySQL does understand ISO 8601 formatted datetime strings with
milliseconds so use Qt::ISODateWithMs instead Qt::ISODate within
formatValue().
Pick-to: 6.8 6.5
Task-number: QTBUG-95071
Fixes: QTBUG-136042
Change-Id: I182475c706c8eda0e3f97e23d98d3f91e372244a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 5b6cbb9c4e4b897a79962ddd52287259391b0b5e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Delivery of the update request may be circumvented temporarily by the
platform window, or the user may request another update during the
delivery, so wait to stop the timer until we know we don't need it
anymore.
Pick-to: 6.8
Fixes: QTBUG-135950
Change-Id: Ie6d1f0f726b66ab6a8036f281b46e525084d90e8
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
(cherry picked from commit 2e6032188fee4430afbea377350c55dde46bfb43)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
For a reason still unclear to me, the PDF engine refuses to
embed fonts if the file name is empty (so fonts that are loaded
directly from byte arrays typically). It could be that this in
itself is outdated.
However, embedding fonts that are loaded from the file system has
worked so far, but in Qt 6.8 we moved to the DirectWrite engine on
Windows and this stopped working there.
The reason is that our custom file loader did not support tracking
the file name and thus it would always be empty. This is experienced
as a regression and can only be worked around by manually selecting
the GDI engine instead (with the limitations that implies).
We fix this by implementing the loader as a IDWriteLocalFontFileLoader
instead, which supports the API which we currently use to retrieve the
paths of system-wide fonts.
Pick-to: 6.8
Fixes: QTBUG-134695
Change-Id: I1411b0617fd1c113c7c28154968c234920f5289e
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
(cherry picked from commit 09805f355c7eb2ece70bcc58e731433980e31126)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The include is required since code now accesses the respective types.
Amends 7a238e1225f49b81772516ed5d0a5a4f4f2e9268
Fixes: QTBUG-136079
Change-Id: I3c8fb8cd5b46875613b866bcb9c6bf7cded926a3
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
(cherry picked from commit bfdedb260e019244cf199ed76915811ff69c9582)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
After 0a1c1711453697a88eee7fdb6f4cf082bfd433e2 a QDateTimeEdit with and
without a popup has different heights in some styles. Fixing the styles
may break existing layouts so we only get the needed width when the
popup is enable from CT_ComboBox and let the height being calculated
by CT_SpinBox to make sure both variants have the same height.
Pick-to: 6.8
Fixes: QTBUG-135029
Task-number: QTBUG-11967
Change-Id: I01c6f598d34a0b73125e60650c61a84b27d79ac8
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 105ddadffeecf2370785ccd9bffde42fdbe25d1c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
These classes, too, are usually in the first line of defense, used to
check tainted data for validity before anything else gets to see the
result of validation. In fact, in Perl, retrieving regex matches is
the main way to untaint data.
Amends 8df072fc8006510c9b743e8ffedaaf51a876883a.
QUIP: 23
Task-number: QTBUG-135195
Pick-to: 6.8
Change-Id: I1716f3c95ef110d5e20f3cdb303d4e70db16a6f1
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Matthias Rauter <matthias.rauter@qt.io>
(cherry picked from commit 3651442e6b6641a7d7a167c5397a54ba2f068b34)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
These classes are usually the first line of defense, containing
tainted data before anything else had the chance the verify it.
Amends 8df072fc8006510c9b743e8ffedaaf51a876883a.
QUIP: 23
Task-number: QTBUG-135195
Pick-to: 6.8
Change-Id: I91413e022b9794e21b6816b80962f5169ce8cd78
Reviewed-by: Matthias Rauter <matthias.rauter@qt.io>
(cherry picked from commit ef8d3e91d88e886cb12ccee9604e561b7699072b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
We can't compare to the effective appearance, as we'll then fail to
set an explicit appearance if the requested appearance matches the
current appearance, which results in the requested appearance not
sticking when the system appearance changes.
Pick-to: 6.8 6.5
Change-Id: Ibd8f7825051f1a67bed25a0abb2f1a13356f32d8
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit 05e59e37c83a15997fa20c10566a7be693fa07bc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Tell me this isn't confusing:
Got keys from plugin meta data ("QMYSQL3", "QMYSQL", "QMARIADB")
QSqlDatabase: driver not loaded
QSqlDatabase: available drivers: QSQLITE QMARIADB QMYSQL QMYSQL3
This also merges the two messages into a single line, which is nicer for
rich logging environments.
Pick-to: 6.8
Change-Id: Ieb80c6571213dddc518bfffdb6c86632df8f932c
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
(cherry picked from commit 4216ba7c37dbdf67bfb5dc793d01a232ce4ea762)
As the code comment says, ~QMainWindowTabBar will removeOne(this) from
QMainWindowLayout::unusedTabBars. It doesn't assert that it was
included in it, or something special like that.
So we can optimize the whole thing by making sure that
~QMainWindowTabBar doesn't find anything to remove here, avoiding a
detach from the copy 'bars' and potentially also avoiding quadratic
behavior, as we delete the items in order.
Found by Coverity, but it only saw this as an optimization opportunity
because it doesn't understand that the copy is needed.
Amends 23357e59bb4dc54e76a237b290aa64a620db2ea1.
Pick-to: 6.8 6.5
Coverity-Id: 479705
Change-Id: I6c31e028c0c39813768e8c71076471b39bd8ef5a
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit fb7670f193712fae2d4c03d6ee2a6c30101b886f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The use of '/$<CONFIG>/' component in .rc path leads to undefined
behavior caused by CMake internal conflicts. Replace the path component
with the filename suffix.
Fixes: QTBUG-136019
Pick-to: 6.8 6.5
Change-Id: I73ae7f89ac65d00661148fcf41c973945bd2cc4f
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 7ce4a8a8c977688144efb94d41e20ed2420aa74b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QAbstractSlider::sliderChange() is not a signal, but a protected
function, carrying an enum (also protected) to inform subclasses about
changes in the base class.
A user reported (QTBUG-135597) that in 5.15 the function was not
called for SliderOrientationChange. A prior test addition confirmed
that this bug is in all active branches.
Add the missing call in setOrientation().
This _should_ replace the update() call, because the default
sliderChange() implementation already calls it (and setPageStep(),
e.g., relies on this behavior), but since SliderOrientationChange was
not emitted since Qt 5.0, I minimize regression risks and keep the
update() call, just in case a user wrote code where they forgot to
call Base::sliderChange() for SliderOrientationChange (and this never
showed because we never "emitted" that, up to now). The duplicate
update() calls will be merged by Qt's event loop, so are harmless.
A dev-only follow-up change will remove the update().
[ChangeLog][QtWidgets][QAbstractSlider] Fixed the missing "emission"
of protected sliderChange(SliderOrientationChange).
Amends the start of the public history.
Pick-to: 6.8 6.5 5.15
Fixes: QTBUG-135597
Change-Id: I4545d47d315a98a9a51134901a00fa369f720754
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit c35f6851bfe8ba71c26d3896498c1510fcd4e42b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
We fixed the first line of defense in
03d1e81516be9af37fa08900f9a2d88d34abc4df, but that commit didn't rule
out ndelta == INT_MIN, in which case -ndelta overflows a few lines
below.
Coverity pointed this out.
Add a check that exposes this problem to ubsan, and avoid the overflow
by using qMulOverflow<-1>()¹ and not scrolling when it overflows, but
emitting a qWarning().
¹ There's no qNegateOverflow()...
When state == QHeaderViewPrivate::ResizeSection, we assume that
everything happens on the actual screen, which has physical limits to
the setOffset() argument, and therefore these arithmetic operations
don't need to be protected.
I fully expect that this will just be a rat's tail, one we can only
hope to control by using Peppe's safe integers everywhere, at which
point we've probably blown our executable code size out of any
proportions. So leave it at this, for the time being.
Amends 03d1e81516be9af37fa08900f9a2d88d34abc4df.
Coverity-Id: 479557
Pick-to: 6.8 6.5
Change-Id: I2e31fc9be21e7d59563b67f3cd26c29dcea61b55
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 49fcac99deea390901000a74deea1c0c690b6ae2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Coverity complained that the Qt::strong_ordering(std::strong_ordering)
ctor may leave m_order uninitialized, which is true if you assume that
'stdorder' could be anything else but {less, greater, equal}, which,
however, should not happen™.
Standardize on the pattern that QPartialOrdering(Qt::partial_ordering)
was using: init m_order to equivalent, and then check for the other
possible states.
I would have preferred adding 'else Q_UNREACHABLE()', but these are
constexpr functions, so we'd need the GCC 8 protection, and then the
else would have a body longer than one line, and I don't know whether
violating the coding style and adding {} only on the else would fly
with reviewers, so that's done in a follow-up.
Amends several changes (this code has seen a lot of churn over time).
Pick-to: 6.8
Coverity-Id: 475148
Change-Id: I3d88cdaaffbdfb8720161470b5f89046a3a15088
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit f6d878d5ce4d6e41c088698bd337cf7f4438433e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
On VxWorks POSIX access() returns always false if it is called on file
which is not on POSIX file system, like DOSFS for example. Qt for
VxWorks 5.15 had similar patch omitting all access() calls and returning
true. This fix takes it a step further and checks if the file is on
POSIX filesystem or if it is DOSFS with read-only setting or not,
in case omitting access() call and returning true. Failure became
visible using QTranslator::load() method on DOSFS mmc card.
Task-number: QTBUG-134627
Pick-to: 6.8
Change-Id: I9c257d3cba1a2b976f2775ad129aae0e09f68ffd
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit fd73b220897e5b6faf012f2812e7eb9eab6c3955)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
gtk-cursor-blink-time is in an interval 100..2500ms, GTK uses a
dedicated boolean to determine whether blinking is on in the first place.
Pick-to: 6.8
Change-Id: I8a5dff70b6b3fbeeab599cf50402532052afe8b7
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit e2035be13d4d834fb179b7228e176ff5d4aa1721)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Amends 353ce5344fbde5a6cecbdd2c131e1cf0f4b7f383 after which QMenu::popup
returned early and without showing the menu if none of the actions had a
valid geometry in the menu.
This broke use cases where QMenu was used as a regular container widget
with child widgets (possibly in a layout). To fix this, take the result
of QWidget::childrenRect() into account, and only return early if that
rect is also empty.
Task-number: QTBUG-129108
Fixes: QTBUG-135933
Pick-to: 6.8
Change-Id: I05977044411df236146bb81dc08a30c176dfb6cb
Reviewed-by: David Faure <david.faure@kdab.com>
(cherry picked from commit 7ffa6f1dd5c47196ac05300bd990b673c7cca976)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Instead of repeatedly resetting of the static pointers after (or before)
calling deleteLater(), use a unique_ptr with a custom deleter.
Since we use deleteLater(), nothing will happen if one of those widgets
does leak to the point where static objects are destroyed; we'd at most
call deleteLater() at this point, which won't do anything (if we enqueue
a DeferredDelete event at all, then it will never be processed).
Pick-to: 6.8
Task-number: QTBUG-135976
Change-Id: I36a4780093eafd064dcb1a72696c1d9b21483b77
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit b50a2761e735208eeb62042ecfaba7a76e580454)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This seems to agree with current Gnome documentation.
[ChangeLog][Platform Specific Changes][Linux] The fullscreen keyboard
shortcut is now F11 on Gnome, not Ctrl-F11.
Pick-to: 6.8 6.5
Fixes: QTBUG-135854
Change-Id: I8ee0bd34152ce8ef112fd3226d17adc89f2a408e
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Liang Qi <liang.qi@qt.io>
(cherry picked from commit 30fd101b558112b8829d3ae63b58e8504bbe9297)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
We don't need the pointer, as it's the same as "this", we just don't
want the event to own the object anymore.
Nevertheless, silence code checker warning about the unused return.
Amends 96ef0004111b47cec239846b169942bbc885c181.
Pick-to: 6.8
Change-Id: I6a3c73e971f1b9e10f5754018a1fa5941dca6172
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 920a490d659836785f03d51edc11da1711ade965)
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
QSingleShotTimer instances are usually destroyed when they receive their
QTimerEvent, and otherwise are children of the creating thread's event
dispatcher so that they do get destroyed even if they never fired.
However, if the receiver object lives in a different thread than the
thread that started the timer, then we move the QSST instance to
that thread to make sure that it starts in the right thread. We then
reparented the QSST instance to nullptr (it can't continue to be a
child of the creating thread's event dispatcher), and connected to
QApp::aboutToQuit as a fall-back in case the timer never fires.
This has two problems: if the timer never fires (e.g. because the
receiver's thread stopped before the timeout), then we created a
soft leak (until aboutToQuit). And since the QSST instance was
moved to the receiver's thread, the connection to aboutToQuit()
is always queued, and also never got processed if the thread was
stopped before (especially since we connected to deleteLater(),
which would require another event processing cycle). So in
practice, we ended up with a hard leak.
To fix this, we have to reparent the QSST instance to the event
dispatcher of the receiver's thread. We can do that reliably
once the receiver thread processes events. Simplify the code to
replace a meta-call with a posted event to ourselves, receiving
which starts the timer (or immediately fires timeout if it has
taken long enough to get there). To avoid memory leaks in the
unlikely case that this posted event never gets delivered (e.g.
because the thread is shutting down already), give that event
ownership of the QSST instance until the timer is started.
This turns out to be leaking anyway on most platforms, which
requires further investigation.
To be able to reparent safely away from a parent in a different
thread, clear the sendChildEvents flag first.
Amends 87535e4e4337596066258e361143cb9906e89512.
Fixes: QTBUG-135636
Pick-to: 6.8
Change-Id: I8188160d54cfb63cb1765c5de8a6c0728dabb7e5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 96ef0004111b47cec239846b169942bbc885c181)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Blacklist tst_QFileDialog::clearnLineEdit() on vsworks as it is
preventing the integration of other patches by failing too often.
Task-number: QTBUG-135966
Pick-to: 6.8 6.5
Change-Id: I9a2b9596a9d4783bcc7307c31c5faf8353f49257
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit b760967a938f409b36395c31b44f443136e5b6a2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Coverity apparently mixes bootstrap and non-bootstrap builds: it
complains that Encoding::Latin1 indexes encodingInterfaces[]
out-of-range (apparently taking the size of the latter from a
bootstrapped and the value of the former from a non-bootstrap build).
That should somehow be fixed in the Coverity configuration, but it
highlighted the fact that we have a narrow-contract function in this
security-critical class that can trivially have a wide contract, so
widen the contract by returning nullptr for invalid Encoding values.
Consequently, mark the function as noexcept.
As a drive-by, mark it also as Q_DECL_PURE_FUNCTION.
[ChangeLog][QtCore][QStringConverter] The nameForEncoding() function
now returns nullptr for an invalid Encoding value. Before, such a call
resulted in undefined behavior.
Pick-to: 6.8 6.5
Coverity-Id: 480251
Change-Id: Ie1c5c9df6881147a1ff44fe549e50748b2f5b7da
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 48959f7e5b670396805d4d62a44dd4fefac91611)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The creation of the ExternalRefCountData was published with
testAndSetOrdered() but the loadRelaxed() would only load the pointer
value, not the effects of the constructor.
Pick-to: 6.8 6.5
Fixes: QTBUG-135640
Change-Id: I3acbc51e763e8a291be3f7036e0d9cd3965a2ce8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
(cherry picked from commit 253f34082f526ff1ffd9eaefac73cc9aa616ab2a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Note this change has no impact on it own on current integrations,
as it barely adds tests compilation.
It is required for qtwebengine on WoA story.
Do not run some tests:
(required for qt5 patch introducing woa test node)
* cmake test as host tools are provided by mingw,
but tests are run natively by WoA platform.
* dbus as this does not run natively on Woa anyway
due to missing dbus service.
Change-Id: Ifdb3e1b76a7feb906a9031815984c716618e3882
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 04d17b2e229cee5e63596832b021c2316d9e4a05)
The test fails almost daily.
Task-number: QTBUG-119205
Pick-to: 6.8
Change-Id: Ice5d14701cc72cd6b0a0fb73bf85b5edddd019f6
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 3a21b4bcaf99ee705ab8f8ed0fc413d117edd1e1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Before this patch we ignored every non Qt dependency we encountered
while scannig the binaries. That led to missing Qt dependencies for more
complex setups.
With this patch we also take "local non Qt dependencies" into
consideration. One example would be:
- A developer has a project that consists of an executable and a dll,
where both are built/copied into the same folder before deployment
- The dll has different/additional Qt dependencies
The old approach just ignored these additional Qt dependencies.
The new approach checks for these local dependencies and finds the dll
in the same folder as the executable. In this case windeployqt will
now also scan this dll (and other local dlls) for Qt dependencies and
deploy these as well as their plugins.
[ChangeLog][Tools][Windeployqt] windeployqt now takes local non Qt
dependencies into consideration during deployment.
Fixes: QTBUG-135079
Pick-to: 6.8
Change-Id: Ia916dea78c6a5707ccecb61d996a0b7490215798
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 5ce44934b3cf07f4bfbf006bb4666cd481577c2c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Starting with CMake 4.0, CMake doesn't initialize the
CMAKE_OSX_SYSROOT variable with any value when running on a macOS
host and no explicit CMAKE_OSX_SYSROOT or CMAKE_SYSTEM_NAME is set.
CMake expects the platform compiler wrapper /usr/bin/c++ to pass an
appropriate -isysroot flag to the underlying compiler, without CMake
explicitly setting one.
This mostly works, but the configure output will not show anymore the
active sysroot path.
Query the active path from xcrun, and display it in the configure
output.
Pick-to: 6.8
Task-number: QTBUG-135621
Change-Id: Ic9b9a43e25bb88bb83165dce52356c77ea8fffe1
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit ab7eb492cba64fe985ea80b2f0be22c1c18f3c5e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Introduce two new functions _qt_internal_get_apple_xcrun_output
and _qt_internal_get_apple_sdk_name, to allow reusing them in the
future.
Make sure to set the output variables to empty even
outside Apple platforms.
Show an error when xcrun is called when targeting a non-Apple
platform.
Pick-to: 6.8
Change-Id: Ic3895f74cfcac337bff069f8e6ec1517aec6c8d0
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit c0f0a275b379b97f3ddccdaa9fd8aa8f10cf0adf)
The xcrun binary may be installed in a different location when cross
compiling to macOS using osxcross.
Pick-to: 6.8
Change-Id: I47398e8da19c42e5e9d1b595673048c56662ea2e
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 80d680e82f545d3a0ae23aa65d07befbab57b71a)
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
As part of updating UCD for Unicode 16 there was a need to support this
data anyway.
Task-number: QTBUG-121907
Pick-to: 6.8
Change-Id: I1d58a856de9b2aaff28917bd067914227bcffd9d
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 541ff8e15cfe34056671410122ad21975b9d000d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Other test loggers just output things immediately, but the junit test
logger appends messages to a vector, so this needs to be
mutex-protected.
In case of qDebug()s from long-running threads, we also need
to protect creation/destruction of systemOutputElement and
systemErrorElement -- and in case of qFatal(), currentTestCase.
Pick-to: 6.8 6.5
Change-Id: If35055fc232276a778951ebbfeaccd185b04f46b
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Jason McDonald <macadder1@gmail.com>
(cherry picked from commit b4d6892ba5a745c1836daf34c850d13ef61e7ae0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
These were using an offset of 123456 seconds = UTC+34:17:36, which is
outside our supported range. This wasn't actually causing a problem,
as it wasn't being checked, but we should stay within 16 hours of UTC.
In the process, modernize the use of strings involved in its tests and
change an initial value to something further from what shall overwrite
it, rather than a neutral value.
Pick-to: 6.8
Change-Id: Ife4e082f1f00665d3203641508f5d30b34aaae75
Reviewed-by: Magdalena Stojek <magdalena.stojek@qt.io>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 53ad78a636e4ca4f840213125c99841b7817195a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
As long noted in the QIcuTimeZonePrivate constructor, we can't trust
ucal_open()'s non-null return to mean it actually recognised the ID we
passed it. So break out the "is available" check to a function in the
QtTimeZoneLocale namespace so the check can be shared with
localeName() when compiled with ICU but some other backend. We were
previously getting GMT as display name for zones unknown to ICU.
Pick-to: 6.8
Change-Id: I57d57f94d8db7df76f24193a8ef1b5c71b08b0fc
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit fc9a26ea3a0b76de8a437d6417af334a7a9dfde5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The function is the internal public counterpart of the
qt_configure_file command, but also supports two modes:
GENERATE and CONFIGURE. The CONFIGURE mode is plain replacement
of file(CONFIGURE or configure_file command depending of specified
arguments.
In the GENERATE mode the function allows using the generator
expressions when evaluating the CONTENT. The function doesn't support
INPUT argument as its counterpart(there are no limitations, author left
this unimplemented).
Pick-to: 6.8
Change-Id: I9bef2265210404113596db95085b6e0d5f03ae13
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 1c886724bcb70f706e2a729461e4f1ea88e27ae3)
These are hidden members, and visible under the QFlags class in the
Clang AST - even though semantically they belong to the parent (global)
scope.
Adjust the \fn signatures accordingly and remove the \relates commands
as unnecessary; QDoc recognizes the `friend` qualifier and marks the
functions as related non-members of QFlags automatically.
Pick-to: 6.8 6.5
Fixes: QTBUG-133923
Change-Id: Iaca74971bde8b313c573e75688bf57d3ff42b59d
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 39358791f0553b2efbe3ee181e54694c2b72a6b9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Initialize the variable with the default value, to avoid the type
mismatch warnings.
Fixes: QTBUG-135648
Pick-to: 6.8
Change-Id: I3ae2c59fb42676b373bcbbe06d3e6636203e283b
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 52e2a89c63a059935f438209242a0065d5ac3cf5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
::connect on wasm seems to be returning 0 in the instance that the
server url does not exist.
So we ignore that and look at errno, which returns ENOENT
which makes no sense here.
Fixes: QTBUG-132191
Change-Id: I2ff6642dd836324e1af6c288c53880de028ce158
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
(cherry picked from commit 1a8c8ffb0c45644c05ea1474df48bfdeea563524)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Reviewed-by: Lorn Potter <lorn.potter@qt.io>
In Android's manual URI content test, there is a test case for moving a
file to another directory. While the function works and the file is
moved correctly, the URI is no longer usable after this operation. The
file must be reopened with a new URI.
This commit updates fileOperations test case to use the new URL after
moving file to another directory
Pick-to: 6.8
Fixes: QTBUG-134881
Change-Id: I114d76d6851815e7ee3d94ddc28d677d7c1ccea9
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 1a35a560ddcaf03d9e2f5f91cd6bcd006c6d0951)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
To increase accessibility for the documentation, provide altenative
descriptions for the images.
Pick-to: 6.8
Fixes: QTBUG-135116
Change-Id: Id2d97251af9af0d4222f0dc15aa5b8e266ca36f4
Reviewed-by: Safiyyah Moosa <safiyyah.moosa@qt.io>
Reviewed-by: Andreas Eliasson <andreas.eliasson@qt.io>
(cherry picked from commit 8e36dcf4c861033f4675e37383c847b2ae03d23d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QDockWidgetGroupWindow::destroyIfSingleItemLeft() cleared the item list
without checking for gap or separator items. When a QDockWidget was
deleted during an active drag, these items were leaked.
Call deleteAllLayoutItems() before clearing the item list.
Amends e6d85cf28bc4f750b69c33b72c006b067ae1190f.
Task-number: QTBUG-135442
Pick-to: 6.8 6.5
Change-Id: I94dffe162023c12bda1f801236ae4462229601b5
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 12dfc8d5ed4756f15a9ce5252af80d3daa9fa074)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Its code was just casting to int, which no longer compiles.
Call toInt() on the fiag first.
Pick-to: 6.8 6.5
Change-Id: I74971f37841b44879cffdb480a173561798f8fa7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit a9e2f5d0dc93bbc171b9c0d014f7b00c9e87a8f7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Credit to OSS-Fuzz, this fixes issue 406541912. When rendering the svg
image from that report, an integer overflow happend while calculating a
QRect which is empty anyway. To avoid that, return an empty, default
constructed QRect instead of calculating further.
Picking back to 6.5 which is the oldest maintained version which
contains this function.
Pick-to: 6.8 6.5
Change-Id: I1a0d1310c55f7be613a6292f36481ac7c7e5b56f
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
(cherry picked from commit d1b88f8b73c16e1ee362fa4cc853bcaadae0df6a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QDockWidgetGroupWindow (aka "floating tabs") can have a single
QDockWidget child only, when a second QDockWidget is hovering over it.
When the QDockWidgetGroupWindow detects the disappearance of its second
last child, it reparents the last child to the QMainWindow and makes it
floating. It removes its last dock widget child from its own
item_list and itself from its parent's (the main window's) item_list.
Then the QDockWidgetGroupWindow removes itself by calling its
deleteLater() slot.
A removal from an item_list calls the d'tor of QDockAreaLayoutItem,
which deletes the item's subinfo and placeholder item, if they exist.
It does not delete the item's widgetItem. In fact the layout accesses
the widgetItem member to draw placeholders and decorations.
As a consequence, both the QDockWidgetGroupWindowItem and the
QDockWidgetItem are leaked, when the corresponding record is removed.
Implement QDockAreaLayout::takeWidgetItem(), which transfers ownership
of QDockAreaLayoutItem::widgetItem to the caller by returning a
std::unique_ptr.
Call this method in QDockWidgetGroupWindow::destroyOrHideIfEmpty() and
QDockWidgetGroupWindow::reparentToMainWindow().
As a drive-by, use static_cast<QMainWindow *>() and assert a
qobject_cast in debug mode.
Fixes: QTBUG-135442
Pick-to: 6.8 6.5
Change-Id: I055c998f515f2bb461518b7516f56db4673687da
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit 40766380224b3a38bbf92b72d8d9baa3762bc06a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
tst_QSizeGrip::hideAndShowOnWindowStateChange is flaky on Ubuntu where
the widget is not set to fullscreen when it should. Wait for the the
widget to be exposed when shown the first time.
Fix flakiness on Ubuntu 24.04
Pick-to: 6.8 6.5
Change-Id: I9f5ea9ebb58c7505f841e5420dd2c15e5f0f2799
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 5ced648febe51b8788bbc38d7a578d4f43b720aa)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
If the interface has a method with a specified return value, the
generated adapter will contain a code like:
bool out;
QMetaObject::invokeMethod(parent(), "Func", Q_RETURN_ARG(bool, out));
return out;
In this case Q_RETURN_ARG macro makes sure that the variable `out` is
properly initialized before being returned from a function, but only
if invokeMethod() call is executed successfully.
Update the generator to zero-initialize (or value-initialize) the
return variable, so that it returns some reasonable value even if
invokeMethod() fails.
Extend the unit-tests to make sure that the generated adapters always
initialize the return variables.
Coverity-Id: 479703
Pick-to: 6.8 6.5
Change-Id: I4d15ccc6844b5ca454ab9f0cf72fd8e3f0c1b704
Reviewed-by: Matthias Rauter <matthias.rauter@qt.io>
(cherry picked from commit 92c2ebdbcca9cfae6e4048004b3bdb58af972209)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
We want tst_qfloat16 to be built in C++20 mode, even if Qt itself is
not built in C++20 mode, which means we can't use QT_FEATURE_cxx20 as
check in tst_qfloat16's CMakeLists.txt.
In addition, even if the compiler supports C++20, the standard library
may not support all features we need. Specifically, due to the
deployment target of macOS being 12 we can't rely on std::to_chars
being available, as is only available since macOS 13.4.
This patch introduces a separate QT_FEATURE_cxx20_format, and
adjusts the tst_qfloat16's CMakeLists.txt to use this feature.
Note that we intentionally do not add QT_FEATURE_cxx20 as a
hard condition to the new check, because it might be disabled
during the Qt configuration, but we still want the test to be
built in C++20 mode.
Note also, that we cannot use the QT_CONFIG(cxx20_format)
check in the qtformat_impl.h header, because the std::format
support is header-only, and user project might be compiled
for a different minimal macOS version, so we do not want to
rely on the Qt-specific config.
Pick-to: 6.8
Change-Id: Ibc43d243dbb24fcb922647fe2d90f61491144eb7
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit f0573e93dff25c74287b3083d2c525c2daaa317c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Currently all the tests are expected to pass because we always
convert everything to UTF-8.
This is a pre-requisite for the follow-up patches that would try to
optimize the internal logic to minimize the number of encoding
conversions.
Task-number: QTBUG-124636
Pick-to: 6.8 6.5
Change-Id: I0ac9212aeb8ccc768393e80c9e0d704fdc227b56
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 900d1daaebb703f4478c7cfedcda30b532291264)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The addData(QASV) overload was unconditionally converting UTF-16 and
Latin1 data to UTF-8.
However, if we already started reading the XML document, and we know
that its encoding is UTF-16 or Latin1, then we know for sure that the
new data has to be added as-is.
Amends 6bc227a06a0d1392d220aa79ddb1cdc145d4f76e.
[ChangeLog][QtCore][QXmlStreamReader] Fixed a bug when
addData(QAnyStringView) was incorrectly recoding UTF-16 and Latin1
data to UTF-8, thus potentially mangling it.
Fixes: QTBUG-135129
Pick-to: 6.8 6.5
Change-Id: Ie1171a5e5596b72a6f160031a4c5a9df3baae4fd
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit b6b725aef59390f403a1a39f49d1318c48f13c07)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
In some cases the QNX events can be stale ie. referring to a window
object that is already destroyed. This is not necessarily a fatal
condition, but there are some qFatal() statements in this case which
could be removed.
Fixes: QTBUG-135076
Pick-to: 6.8 6.5 5.15
Change-Id: I885fa95c323590a814176b8a70ef5b7ee332012c
Reviewed-by: James McDonnell <jmcdonnell@blackberry.com>
(cherry picked from commit 1e10ede244b70455201df1c459b9586f3c015552)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
We don't need to apply QDir::absolutePath() on the diretory that
QLibraryInfo::path() returns, because that is already an absolute path
(and if it weren't, it wouldn't make a difference anyway). That means we
are only doing path concatenation here. For code this low-level, it's
better to stick to QString.
This commit also rejiggles the string variables so we avoid one of the
memory allocations when calling QStandardPaths.
Change-Id: Ic3405877155a15ac4ac6fffdc92463ae0bff0bd9
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit e0cdcf66cad739af808ae952c125030e9ad52de4)
Not on values. That is, it indicates whether there is a conversion path
from origin type to the destination type, not that the conversion will
succeed when attempted. For example:
QObject *o = new QAbstractItemModel;
QVariant variant = QVariant::fromValue(o);
qDebug() << variant.canConvert<QAbstractItemModel*>();
This conversion *will* succeed for this particular value of a QObject*,
so canConvert() must return true for conversions between QObject* and
QAbstractItemModel*, despite not all such conversions being possible.
This is also done in preparation of changes being done to the conversion
routines that may cause some FP->integer conversions to fail depending
on the value of the FP.
Fixes: QTBUG-135619
Task-number: QTBUG-135285
Pick-to: 6.8
Change-Id: I138e34fb61a8b8772c8bfffdf75787a2e007d847
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Lars Knoll <lars@knoll.priv.no>
(cherry picked from commit 7cf49085eb47ae660d05e8579c08a3ad3be75021)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
MSVC is pedantic that read() (a POSIX function) is not an ISO C function
so insists that we use the underscored version. As if Microsoft followed
that rule for their own APIs...
Amends e6a6757c1485d09a4b7a124d67260f06d8022fef.
Pick-to: 6.8
Change-Id: If51fd8564a3c415e1f7efffd7fde18a830c97e3b
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 9ffbeae50e768c37865ec08e7d8716b9fa75f575)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The former will try to normalize the type name, but everything stored
in a QMetaObject is already in normalized form. So, if the first
lookup fails, the normalized one won't succeed either.
Use qMetaTypeTypeInternal(), which doesn't normalize.
At a minimum, this will fail faster. If we're lucky, the missing
round-trip via QMetaType(int).id() will help the positive case, too.
But if it does, it's lost in the statistical noise of the benchmark.
IOW: no measurable performance impact.
Task-number: QTBUG-135572
Change-Id: I23834c201fbcd1780c50e85cf8a15ea5e4a94c74
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
(cherry picked from commit a481a79a97c6e63a77cfae8a15e060e203afdc40)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The only caller of the function, QArgumentType, passes
QByteArray::constData() to it, and the function then goes around and
performs a strlen() in order to feed it into qMetaTypeTypeInternal().
Pass the name as a QByteArrayView, to save the strlen() over a string
we already knew the length of.
No measurable performance impact.
Task-number: QTBUG-135572
Change-Id: Ifccea7644ce86308df5fb7063c0269a579785504
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
(cherry picked from commit cac63042b1303511ef41642b3290e6d54d1a76b8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QMetaType::fromName() takes a QBAV, so don't feed it rawStringData()
(a const char*, causing the QBAV ctor to run strlen() on it), but
stringDataView() (a QBAV already, whose length is determined by offset
difference in the string offset table and not by strlen()).
No measurable difference in runtime speed.
Pick-to: 6.8 6.5
Change-Id: I583bea9d818deeaac6f62803f7ac5ab4766cb8a5
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 1445a33b6fd4c7a401edf68e325e4527e18a667a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Amends 22ce92f8040183faf9e1ba53c59c6b0b9172fb26, which apparently
changed the method name stored in the moc data from unqualified to a
qualified name. The original commit message doesn't mention it, but
the change in QMetaMethodPrivate::name() suggests as much.
Unfortunately, the search for the colon causes the name() call to
increase to 25% of the total methodMatch() runtime, up from 6.85%
before the change.
Since name() now always strips a possible prefix, re-add the original
name() as qualifiedName() and use that in methodMatch().
This is faster because we don't need to perform an a-priori search for
colons; instead, we can first check for endsWith(), and only if we
have a match, can we a-posteriori check that the match was preceded by
an (optional) colon.
Results on my machine:
********* Start testing of tst_QObject *********
Config: Using QtTest library 6.10.0, Qt 6.10.0 (x86_64-little_endian-lp64 shared (dynamic) release build; by Clang 15.0.3 (github.com:llvm/llvm-project.git 48b23aa469b8cfdb6cde1c55bf3361cabcdef6bc)), ubuntu 20.04
PASS : tst_QObject::initTestCase()
PASS : tst_QObject::connect_disconnect_benchmark(normalized signature)
RESULT : tst_QObject::connect_disconnect_benchmark():"normalized signature":
- 923.542494 nsecs per iteration (total: 461,771,247, iterations: 500000)
+ 880.558792 nsecs per iteration (total: 440,279,396, iterations: 500000)
- 4,340.832532 CPU cycles per iteration, 4,7 GHz (total: 2,170,416,266, iterations: 500000)
+ 4,093.487614 CPU cycles per iteration, 4,65 GHz (total: 2,046,743,807, iterations: 500000)
- 13,706.07561 instructions per iteration, 3,157 instr/cycle (total: 6,853,037,807, iterations: 500000)
+ 12,779.02463 instructions per iteration, 3,122 instr/cycle (total: 6,389,512,318, iterations: 500000)
- 2,201.185595 branch instructions per iteration, 2,38 G/sec (total: 1,100,592,798, iterations: 500000)
+ 2,208.176500 branch instructions per iteration, 2,51 G/sec (total: 1,104,088,250, iterations: 500000)
For a ~5% overall speedup in both ns/iter and instr/iter, keeping in
mind that this data contains the disconnect() call, too.
As a drive-by, remove a second call of QMetaObjectPrivate::get() on the
same object, and reuse the previous call's result.
Task-number: QTBUG-135572
Change-Id: Ide253b323e7b826f8fa09d2f5f57496861c12f75
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit 8e98a3a82602016b2e9bfe2435031ae6ff8010e7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
For the thread that calls ::exit() (usually, the main thread).
Otherwise, depending on construction order, it is possible for the
QThreadStorage's destructor list to have been destroyed by the time
destroy_current_thread_data() → QThreadData::finish() calls our
finish().
Fixes: QTBUG-135044
Pick-to: 6.8
Change-Id: Ic5a10367ff31e7faa039fffdc2067eba9642fbf9
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 81a7a4c2d94fca6fc595dcb147831b9585eaee5f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
By using QStringView.
Drive-by, explicitly use QBA::constData() to fix the build with
QT_NO_CAST_FROM_BYTEARRAY.
Pick-to: 6.5
Change-Id: I57bcd877048f3b9889ab8d638979f893857af396
Reviewed-by: David Faure <david.faure@kdab.com>
(cherry picked from commit f7db58335b78c296624e65ea119ef4cec6334815)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Specialize the cast template for QGraphicsItem, where we can skip the
runtime comparisons of the type.
In addition, replace the runtime check for QGraphicsItem::Type with a
compile time check in the main template.
We need to do both so that we correctly cast up to QGraphicsItem for
custom item types that don't provide their own Type alias.
Pick-to: 6.8
Change-Id: Ic1bff3404fe890747865ce1349cddbcfebb3b77b
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 7af5912e61160681be736ff07a1cd0a0f6b28944)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Popups aren't automatically positioned, so use the screen at the initial
geometry for scaling. Otherwise we may end up with the wrong geometry on
systems that have multiple screens with different scales.
Pick-to: 6.8
Fixes: QTBUG-134139
Change-Id: I686b1c8ab6cf458d9b849b529ba247ac8c3be064
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 7dc2532bed8977dd4166e9aa4be021b0ec39b5ba)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Got two independent bug reports where people got hit by that and had
to do a long and difficult debugging session to find out what was
happening (and still thought it was a Qt bug).
Fixes: QTBUG-54484
Fixes: QTBUG-50821
Change-Id: I0041fccebbb7070fccf8014288c62d89f117ae7d
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 687422abde1444031e507112b6e6c5b3c0fe6b63)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Building without shortcuts would fail due to a missing QKeySequence.
This was already handled in the implementation but required an ifdef in
the header.
Change-Id: I12c92ca480d0abdb518aae00b5b7e259133ef9ca
Pick-to: 6.8 6.5
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit 0a281beaa76a04665930b1e1cd5349c26ae7f0d1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QAbstractSlider::sliderChange() is not a signal, but a protected
function, carrying an enum (also protected) to inform subclasses about
changes in the base class.
A user reported (QTBUG-135597) that in 5.15 the function was not
called for SliderOrientationChange.
Add a test that verfies that the function is a) called for all other
enum values and b) add XFAILs for the (still) missing
SliderOrientationChange.
Amends the start of the public history.
Pick-to: 6.8 6.5 5.15
Task-number: QTBUG-135597
Change-Id: I959077f030976937dd279897748025afa06e74dd
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit f4e892d79768a6c4da8acf42da954a8f2e611f4b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The process by which the QDockAreaLayout changes a QDockAreaLayoutInfo
from representing a QWidget that's being deleted to representing a
QPlaceholderItem involves the construction of the latter from the
former. If a QDockWidget is being deleted, however, at the time the
QDockAreaLayout notices, the ex-QDockWidget has been demoted to a
QObject, causing the calls to QWidget member functions to be UB:
Says UBSan:
qdockarealayout.cpp:46:25: runtime error: member call on address 0x7ffe74a429d0 which does not point to an object of type 'QWidget'
0x7ffe74a429d0: note: object is of type 'QObject'
33 7f 00 00 c0 ea 73 6e 33 7f 00 00 00 12 00 00 70 61 00 00 40 cd 41 83 33 7f 00 00 00 00 00 00
^~~~~~~~~~~~~~~~~~~~~~~
vptr for 'QObject'
#0 0x7f339546e251 in QPlaceHolderItem::QPlaceHolderItem(QWidget*) qdockarealayout.cpp:46
#1 0x7f33955169a8 in QDockAreaLayoutInfo::takeAt(int*, int) qdockarealayout.cpp:1780
#2 0x7f3395517175 in QDockAreaLayout::takeAt(int*, int) qdockarealayout.cpp:3432
#3 0x7f33959e38a8 in QMainWindowLayoutState::takeAt(int, int*) qmainwindowlayout.cpp:927
#4 0x7f33959e38a8 in QMainWindowLayoutState::takeAt(int, int*) qmainwindowlayout.cpp:919
#5 0x7f3395a42cdd in QMainWindowLayout::takeAt(int) qmainwindowlayout.cpp:2238
#6 0x7f3393fae246 in removeWidgetRecursively qlayout.cpp:485
#7 0x7f3393fb8300 in QLayout::widgetEvent(QEvent*) qlayout.cpp:544
#8 0x7f3393bde28a in QApplicationPrivate::notify_helper(QObject*, QEvent*) qapplication.cpp:3298
#9 0x7f3393c5f74a in QApplication::notify(QObject*, QEvent*) qapplication.cpp:3259
#10 0x7f336b784ada in QCoreApplication::notifyInternal2(QObject*, QEvent*) qcoreapplication.cpp:1111
#11 0x7f336b7874e3 in QCoreApplication::sendEvent(QObject*, QEvent*) qcoreapplication.cpp:1551
#12 0x7f336bcc624a in QObjectPrivate::setParent_helper(QObject*) qobject.cpp:2271
#13 0x7f336bccd76c in QObject::~QObject() qobject.cpp:1146
#14 0x7f339434e126 in QWidget::~QWidget() qwidget.cpp:1584
#15 0x7f33955b5815 in QDockWidget::~QDockWidget() qdockwidget.cpp:1362
[...]
qwidget.h:816:25: runtime error: member call on address 0x7ffe74a429d0 which does not point to an object of type 'QWidget'
0x7ffe74a429d0: note: object is of type 'QObject'
33 7f 00 00 c0 ea 73 6e 33 7f 00 00 00 12 00 00 70 61 00 00 40 cd 41 83 33 7f 00 00 00 00 00 00
^~~~~~~~~~~~~~~~~~~~~~~
vptr for 'QObject'
#0 0x7f339546e0bb in QWidget::isWindow() const qwidget.h:816
#1 0x7f339546e0bb in QPlaceHolderItem::QPlaceHolderItem(QWidget*) qdockarealayout.cpp:47
[... rest as above...]
Fix by dragging the setParent(nullptr) up into ~QDockWidget().
Ordinarily, that call happens only in ~QObject(). But that's what
caused the layout to react to the ChildRemoved element too late. When
doing it here, the dock widget is still itself, and all the
QDockAreaLayout machinery can still access its QWidget-ness.
Amends the start of the public history.
After consulting with QtWidgets maintainer, not picking to 5.15,
since, even though slim, there's a non-zero chance this might break
something, somewhere.
Pick-to: 6.8 6.5
Change-Id: I5472bbb0fcab9fb74272a1da6c2a2896226e12bb
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit 2c67d47ea15c6dc34cc20d8fbdb406efb19f11d7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
When I ported the QTimer::defaultTypeFor() helper from ms to ns
granularity, I failed to account for MSVC, in which inline functions
of exported classes are themselves exported.
As a consequence, the private QTimer::defaultTypeFor(milliseconds)
symbol went missing.
To fix, re-add it as REMOVED_SINCE API.
We don't need to play tricks with QT6_*_NEW_OVERLOAD here, since the
overloads have a different signature and the only callers¹ are either
passing an exact ms or ns argument² or are in dependent names in
templates³ which removed_api.cpp does not instantiate.
¹ this is a private function, so we don't need to look very far...
² the string-based singleShot() overloads
³ and so name lookup (and therefore overload resolution) happens only
at instantiation time, not at template parse time (so Integrity and
VxWorks compilers will, that is)
Amends a60e341145a3b8a106e556e17ae62d2f45ac5d74.
Pick-to: 6.8
Fixes: QTBUG-135578
Change-Id: I375e6f04a3af3824f980fe59775d3eea94250987
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 27ed0014b491f457469914847f0a41926af998f4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
GCC, with ubsan and optimization enabled, issues -Warray-bounds for
the cast from &polygonItem to QGraphicsTextItem*, because the latter
is-a QObject and the former is not, so the cast has to adjust the
pointer value to correct for the fact that QGraphicsItem is not the
first base class of QGraphicsTextItem:
qgraphicsitem.h:973:56: warning: array subscript -1 is outside array bounds of ‘QGraphicsPolygonItem [1]’ [-Warray-bounds]
973 | || (item && int(Item::Type) == item->type()) ? static_cast<T>(item) : nullptr;
| ^~~~~~~~~~~~~~~~~~~~
tst_qgraphicsitem.cpp:3193:26: note: while referencing ‘polygonItem’
Check the implementation is correct in this respect by not just
checking for nullptr or non-nullptr, but checking that the result
matches what dynamic_cast produces.
We can assume dynamic_cast works on QGraphicsItems because QPA is
using dynamic_cast, so both QtGui and QtWidgets need to have been
compiled with RTTI enabled.
This doesn't eliminate the GCC warning, but confirms that it is a
False Positive.
Pick-to: 6.8 6.5
Change-Id: Ifc262cb6e715e8e68c180855adc2467960da89a1
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 101427957b59b715d0865cbdba12590fe11d1d10)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
... instead of QByteArray.
This is part of a quest to improve string-based connect() performance.
Needed to port a few consumers of decodeMethodSignature()'s result
from QByteArray to QByteArrayView, too. All private API, so doesn't
affect users.
This doesn't change anything in tst_bench_qobject's
connect_disconnect_benchmark:normalized signature, yet.
Task-nunber: QTBUG-135572
Change-Id: I1cd5b410ee090ab9c6f3aa8095a4d9efae516ac0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit f2747c62d4732694e0d03638ba0ed7af7ebeaa7a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
A QWidget* is not a faithful representation of a QDockWidgetLayout, so
the ctor should be explicit, even if this is but a private class.
Amends the start of the public history.
Pick-to: 6.8 6.5 5.15
Change-Id: Ib69d72540f094542dbcfc0684e2eec5f90aa532a
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit 21c9aac20abd700cf9f4bcacbbbe7751eb0aa364)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The function can be called from ~QMdiSubwindow(), and we checked for
QWidgetPrivate::data.in_destructor before proceeding with the removal
of buttons from the menubar, but we called
QPointer<QMdiSubwindow>::data()->window(), which, at this point in
time, had already been demoted to a QWidget:
Says UBSan:
qpointer.h:75:14: runtime error: downcast of address 0x6040000aca10 which does not point to an object of type 'QMdiSubWindow'
0x6040000aca10: note: object is of type 'QWidget'
00 00 00 00 28 01 99 bc ff 7e 00 00 80 dc 0f 00 90 61 00 00 d8 02 99 bc ff 7e 00 00 00 00 be be
^~~~~~~~~~~~~~~~~~~~~~~
vptr for 'QWidget'
#0 0x7effb955f95a in QPointer<QMdiSubWindow>::data() const qpointer.h:75
#1 0x7effb955f95a in QPointer<QMdiSubWindow>::operator->() const qpointer.h:79
#2 0x7effb955f95a in QMdi::ControlContainer::removeButtonsFromMenuBar(QMenuBar*) qmdisubwindow.cpp:795
#3 0x7effb9563031 in QMdi::ControlContainer::~ControlContainer() qmdisubwindow.cpp:717
#4 0x7effb9566595 in QMdi::ControlContainer::~ControlContainer() qmdisubwindow.cpp:723
#5 0x7eff8f4f2b7a in QObjectPrivate::deleteChildren() qobject.cpp:2226
#6 0x7effb7bf732d in QWidget::~QWidget() qwidget.cpp:1557
#7 0x7effb95cc02c in QMdiSubWindow::~QMdiSubWindow() qmdisubwindow.cpp:2254
#8 0x7effb95cc1d5 in QMdiSubWindow::~QMdiSubWindow() qmdisubwindow.cpp:2254
#9 0x7eff8f4f2b7a in QObjectPrivate::deleteChildren() qobject.cpp:2226
#10 0x7effb7bf732d in QWidget::~QWidget() qwidget.cpp:1557
#11 0x7effb7bffba5 in QWidget::~QWidget() qwidget.cpp:1584
#12 0x7eff8f4f2b7a in QObjectPrivate::deleteChildren() qobject.cpp:2226
#13 0x7effb7bf732d in QWidget::~QWidget() qwidget.cpp:1557
#14 0x7effb85f0dc5 in QFrame::~QFrame() qframe.cpp:235
#15 0x7effb859c747 in QAbstractScrollArea::~QAbstractScrollArea() qabstractscrollarea.cpp:478
#16 0x7effb93c08a6 in QMdiArea::~QMdiArea() qmdiarea.cpp:1703
#17 0x7effb93c0e55 in QMdiArea::~QMdiArea() qmdiarea.cpp:1703
#18 0x7eff8f4f2b7a in QObjectPrivate::deleteChildren() qobject.cpp:2226
#19 0x7effb7bf732d in QWidget::~QWidget() qwidget.cpp:1557
#20 0x7effb920a425 in QMainWindow::~QMainWindow() qmainwindow.cpp:338
Fix by deleting the ControlContainer already from ~QMdiSubwindow(),
ie. when we have not yet been demoted to QWidget.
Amends the start of the public history.
Pick-to: 6.8 6.5 5.15
Change-Id: Ia43c857bc1842b2b4957cc79e00f790b045d8f94
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 2e3d39130c318da54d77775e82c6c699f236ddf8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QVector instead of QList is currently still treated specially, being
considered normalized even if a signature piped through
normalizeSignature() would have changed.
We'd like to get rid of this special treatment, so add some tests for
invokeMethod() + Q_ARG, which we should continue to support.
Pick-to: 6.8 6.5
Task-number: QTBUG-135572
Change-Id: Ie09c80d2a8603a268859f395797196013efd8c0f
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 1fa31be7ce3a6899f1c1597311d7593648ecd1d8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Static variables are only initialized once, when control passes over
their definition for the first time¹. If they are initialized with
non-static data, like the contents of a non-static data member, or the
address of one, then all following uses of the object will continue to
use the first control pass' data, even if the data members were from
an object that has since been deleted.
This whole construct appears to have worked merely because these
functions are only executed once, or at least not on different
objects. But better remove the dangerous construct while it hasn't
broken something, yet, and before we e.g. make syncqt a library² or
add a mode that makes it scan multiple modules at once.
Requires to capture more variables in the parseArgument() lambda; more
than fits into an explicit capture list, so use a [&] catch-all
instead.
As a drive-by, use CTAD to not have to mention the number of elements
in a std::array, but have the compiler deduce them, and add const,
where it's missing.
Amends b89d63515bb352cecfd87e709320a2db5b6a1906 (and maybe a few
in-between, we'll see when cherry-picking).
¹ Except corner-case like when initialization fails by throwing an
exception.
² see similar ideas for moc, e.g.: QTBUG-132820
Pick-to: 6.8 6.5
Change-Id: I65a73059151e3d39341939f613080e6d833a4c30
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 01ced9d45ab87f5d3fd41525621c680965517ee7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QEventStorage<E> will slice if you call store(e) where typeid(e) !=
typeid(E). But if they are the same, no slicing occurs.
So change the code comment from "always slices" to "may slice".
Amends dd264cc9c00e09eb995f1c6f9b1fd651f1d4b2f4.
Task-number: QTBUG-99563
Task-number: QTBUG-133321
Change-Id: Ic69d2d3e6b5491c2d3e61d8da131f4bda628fe95
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit 5d2164382cfaa6458731714e335b56002f865a33)
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
QPointer is used to track whether a QObject is still alive, and so
it's unsurprising that checking whether the pointer is null is
sometimes done in situations where the QObject is already in the
process of being destroyed and therefore already demoted from T, the
QPointer template argument, to some base class.
Because of the way we made QPointer SCARY¹, calling data() will cast
from QObject* to T*, which is UB if the T was already demoted.
It's hard to fix this in the general case, but the various ways to
spell isNull() should all be equivalent to isNull() (which does not
cause UB, because it doesn't cast).
This patch fixes the relational operators against nullptr and adds an
explicit operator bool() so that if (p) and if(!p) no longer have to
go through (implicit) operator T*(). This does not appear to cause
disambiguities, so it's SC.
Don't document the operator, it's an implementation detail (and not
documenting it lets us pick it back). A follow-up will add the
documentation for 6.10+.
Add tests, even for stuff that's currently still UB (but marked by an
early return). A follow-up patch will try to make as many of these
other operations non-UB as possible, too.
¹ Originally 3f7741fbe7ab4140f8f971c0cf88bb04e7feea6b, then changed in
cc7239da8d1ab95e68e12a64df3ca3051419cb34 and
351c738fc4586bf354c9363fb78e190bdfca4617.
Amends the commits mentioned in the footnote.
[ChangeLog][QtCore][QPointer] For `QPointer<Derived> p`, `!p` and
comparing `p` to nullptr no longer perform invalid downcasts when the
object held in `p` is in the process of being destroyed and has
already been demoted from Derived to one of its base classes. Before,
these expressions invoked data(), which casts from QObject* to
Derived*, a cast which is invalid.
Pick-to: 6.8 6.5 5.15
Task-number: QTBUG-135626
Change-Id: I1b59062345e1b6933958c7e030d9253d69e7591c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 51cd57116b7465f732253d3f38a2dd78fc704088)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
... not just 'derivedChild'.
This doesn't change anything for the test right now, but will enable
an extended test to be added on top.
Pick-to: 6.8 6.5 5.15
Change-Id: Id52f785168c97c43433fb15a6a71a9d1fb140036
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 4c610300e34d0bbbd1dac912f34127ff08ea04be)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This updates the documentation for QXmlStreamReader and QXmlStreamWriter
to explicitly state that only XML 1.0 is supported. While the writer
allows specifying arbitrary version strings, it does not implement
XML 1.1 features. The reader strictly enforces XML 1.0 and rejects
unsupported versions.
Fixes: QTBUG-43029
Pick-to: 6.8 6.5
Change-Id: I771de29e7915d7a4daafe2fe14d600adfbbac4ac
Reviewed-by: Mate Barany <mate.barany@qt.io>
(cherry picked from commit 6551bef9d978d195c8824110d8a4ef050a833107)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Fix the condition that decides whether to build InputSupportPrivate. The
conflict resolution went wrong for
b3b836e70388edcf1d18b114cd128c7b89a79199. The point of the commit is to
disable InputSupportPrivate if QT_FEATURE_libinput is enabled but
QT_FEATURE_xkbcommon is not.
Change-Id: I58a924abcf9ab5469e14182d1fdbb3fd69c1e74f
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Avoid the duplicated data tags in removeAt() tests by adding the
orientation to the tag.
Pick-to: 6.8 6.5
Fixes: QTBUG-135294
Change-Id: If31d719e4a9b1c90e591cedc149848bbb9c99657
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 0b668c2f55f0fc797a2366b3dc73395f79e1b585)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The test function created a parent-less QGraphicsWidget, and while it
added a bunch of child objects to it, that initial graphics-widgets
never got an owner so it and all the children were leaked.
Fix by holding it in a unique_ptr. That is the minimally-invasive fix.
Amends the start of the public history.
Pick-to: 6.6 6.5 5.15
Change-Id: I3ab9db721e1343f2bd8d9fdd0ee6e86733a66da2
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 2e0988190febe65b6d12b7956bd22b04843e2e6d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The populateLayout() function adds parent-less QGraphicsWidgets
(RectItems) to the layout. If the layout had a graphics-widget parent,
it would reparent the items added to it onto the parent. But it
didn't, so it didn't.
Therefore, the last part of the test function (as denoted by the
re-creation of `layout`) leaked a lot of items, including `layout`.
To fix, give the layout the existing graphics-widget parent. Then the
layout itself isn't leaked anymore, either.
Amends the start of the public history.
Essentially the same commit for columnCount() that
b9836518a367a31a48027a5bf81c4973b847b442 was for rowCount().
Pick-to: 6.8 6.5 5.15
Change-Id: Ic38dfccfa41049d96eb0cf5811271ac17f2b1f91
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit d21434d1876fc778aa5dea6696b145bd6d86d03c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The test function creates a bunch of QGraphicsWidgets without parents,
and adding them to the QGraphicsGridLayout doesn't make them owned by
it. Besides, the layout was without a parent itself, so all these
objects were leaked.
To fix, give the layout a stack-allocated QGraphicsWidget parent. Now,
the layout will reparent the widgets added to it to its own parent
widget, which will delete layout and child widgets when it itself is
deleted on all exists from the test function.
Amends the start of the public history.
Pick-to: 6.8 6.5 5.15
Change-Id: I8d80713f4ff6b1055bc396d855f98bc1873aee3b
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit fe0b29a45c19ad401ab5e4d17bec2e2d3e2c618c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The test function created a parent-less QGraphicsWidget on the heap,
and didn't otherwise transfer ownership of it to another object, so
the object was leaked.
The minimal fix is to hold the graphics-widget in a unique_ptr. This
requires to change the following line, too (as would the alternative,
allocation on the stack), but the rest of the function can stay as-is
(unlike with stack allocation, which would require further s/[.]/->/.
Amends 4f072e2d3d7e429359ff15a615d02712bff7ee51.
Pick-to: 6.8 6.5 5.15
Change-Id: Ide305dde7934747dbc3acdb49f5a75e98563828c
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 45f317fba09e98c1fb5f0456ce6309d59d1161cc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The test function contains a negative test where we're trying to
remove an item that isn't in the layout.
Unfortunately, the object we're passing is heap-allocated and has no
parent, so was leaked.
To fix, pass the existing `widget` as a parent. This doesn't change
the test's outcome: Like in QWidget, a graphics-widget is not
automatically added to its parent's layout.
Amends the start of the public history.
Pick-to: 6.6 6.5 5.15
Change-Id: Ic110ea7b93aa0023c0903c776a30dc5c377ce0c5
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 4d0f979610b961e3dd4e86060fc05456c9d1447d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The `form` graphics-widget has no parent and is not otherwise added to another
object that would take ownership of it, so it was leaked, together with its children.
To fix, simply create it on the stack. This is the minimally-invasive fix.
Had I held it in unique_ptr instead, I would have had to touch the line
creating `layout`, too. Creating it on the stack is simpler than make_unique(), so do that.
Amends the start of the public history.
Pick-to: 6.8 6.5 5.15
Change-Id: I4027dcb0c0650eb7556de96e6d1d20b98c14dc9a
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit cba8f19ff83674e7396ce4e5daa086d473be70bd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Both `layout` and `wid` were created without parents, and not otherwise added to
objects that would take their ownership; only `layout` was explicitly deleted
at the end of the function, `wid` was leaked.
The usual solution, giving them a stack-allocated graphics-widget as
parent that will delete them, doesn't work here, because the layout
does refuse to add the widget in some test rows.
Since there are no checks in-between the allocation and de-allocation
(this test is only checking for expected warning messages), do the
minimal fix and explicitly delete `wid`, as it was already done for
`layout`.
Amends the start of the public history.
Pick-to: 6.8 6.5 5.15
Change-Id: I5c7356ac93c04d648eb31888105b480791fbe155
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit b518a385ad03c3b199f4704088d688b9bf1f3cc6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The deleted 'widget' was added to a stack-allocated QGraphicsScene,
which owns it and will delete it as its child if it itself is deleted.
There's no check following the manual delete, and the test function's
name shows no indication that deleting graphics-widgets from a scene
in a show()n QGraphicsView is being tested here, so it serves no
purpose.
Remove it.
Amends the start of the public history.
Pick-to: 6.8 6.5 5.15
Change-Id: I4e5405cd6212d2a318a567d99ef42c99261d431a
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit fc89096bcb28036cd12c0aaa690f3607e96f5e3b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The populateLayoutWithSpansAndHoles() function adds parent-less
QGraphicsWidgets (RectItems) to the layout. If the layout had a
graphics-widget parent, it would reparent the items added to it onto
the parent. But it didn't, so it didn't.
Therefore, the last part of the test function (as denoted by the
re-creation of `layout`) leaked a lot of items, including `layout`.
To fix, give the layout the existing graphics-widget parent. Then the
layout itself isn't leaked anymore, either.
Amends the start of the public history.
Pick-to: 6.8 6.5 5.15
Change-Id: I063c0e3336d943a35592fa62a5d16cbddb6b920e
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit b9836518a367a31a48027a5bf81c4973b847b442)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The populateLayout() function adds parent-less QGraphicsWidgets
(RectWidgets) to the layout. If the layout had a graphics-widget
parent, it would reparent them onto the parent. But it didn't, so it
didn't.
Therefore, the 2nd and 3rd part of the test function (as denoted by
the top-level scopes in the function) leaked a lot of items.
The first part of the function already used a widget, itself without
parent, but added to a QGraphicsScene allocated on the stack, so was
not leaking.
To fix, give the layouts a graphics-widget parent. Then the layout
doesn't need to be deleted anymore, either.
Amends the start of the public history.
Pick-to: 6.8 6.5 5.15
Change-Id: I7e63c51cf037818fb1e519dab5394ad75c74d67d
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 5a559758d18627c7adb9df81ac8e0eb43eb1e7c3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The event filter was still active when the QDialogButtonBox in its
destruction process had already been demoted to QWidget. The
ignoreShowAndHide guard came too late, because by the time we check
it, in Private::handleButtonShowAndHide(), we had already cast q_ptr
to QDialogButtonBox.
Says UBSan:
qdialogbuttonbox_p.h:26:5: runtime error: downcast of address 0x7fffefab47e0 which does not point to an object of type 'QDialogButtonBox'
0x7fffefab47e0: note: object is of type 'QWidget'
00 00 00 00 28 c1 5b 6e 6d 7f 00 00 80 22 10 00 90 61 00 00 d8 c2 5b 6e 6d 7f 00 00 00 00 00 00
^~~~~~~~~~~~~~~~~~~~~~~
vptr for 'QWidget'
#0 0x7f6d6b51141d in QDialogButtonBoxPrivate::q_func() qdialogbuttonbox_p.h:26
#1 0x7f6d6b51141d in QDialogButtonBoxPrivate::handleButtonShowAndHide(QAbstractButton*, QEvent*) qdialogbuttonbox.cpp:913
#2 0x7f6d6b51436c in eventFilter qdialogbuttonbox.cpp:127
#3 0x7f6d40c1a8f1 in QCoreApplicationPrivate::sendThroughObjectEventFilters(QObject*, QEvent*) qcoreapplication.cpp:1248
#4 0x7f6d690b23d5 in QApplicationPrivate::notify_helper(QObject*, QEvent*) qapplication.cpp:3303
#5 0x7f6d69132a3a in QApplication::notify(QObject*, QEvent*) qapplication.cpp:3259
#6 0x7f6d40c1da6a in QCoreApplication::notifyInternal2(QObject*, QEvent*) qcoreapplication.cpp:1111
#7 0x7f6d40c20473 in QCoreApplication::sendEvent(QObject*, QEvent*) qcoreapplication.cpp:1551
#8 0x7f6d690fe76c in QApplicationPrivate::setActiveWindow(QWidget*) qapplication.cpp:1857
#9 0x7f6d695ac796 in QWidgetPrivate::deactivateWidgetCleanup() qwidget.cpp:2326
#10 0x7f6d6976f8ce in QWidgetPrivate::hide_sys() qwidget.cpp:8256
#11 0x7f6d69814579 in QWidgetPrivate::hide_helper() qwidget.cpp:8199
#12 0x7f6d69887c1f in QWidgetPrivate::setVisible(bool) qwidget.cpp:8406
#13 0x7f6d69775d23 in QWidget::setVisible(bool) qwidget.cpp:8314
#14 0x7f6d695fb018 in QWidget::hide() qwidget.cpp:8179
#15 0x7f6d6981a183 in QWidgetPrivate::handleClose(QWidgetPrivate::CloseMode) qwidget.cpp:8580
#16 0x7f6d699e6fc6 in QWidgetWindow::closeEvent(QCloseEvent*) qwidgetwindow.cpp:871
#17 0x7f6d52ef9f5d in QWindow::event(QEvent*) qwindow.cpp:2721
#18 0x7f6d69a575f8 in QWidgetWindow::event(QEvent*) qwidgetwindow.cpp:398
#19 0x7f6d690b2491 in QApplicationPrivate::notify_helper(QObject*, QEvent*) qapplication.cpp:3309
#20 0x7f6d69132a3a in QApplication::notify(QObject*, QEvent*) qapplication.cpp:3259
#21 0x7f6d40c1da6a in QCoreApplication::notifyInternal2(QObject*, QEvent*) qcoreapplication.cpp:1111
#22 0x7f6d40c205b3 in QCoreApplication::sendSpontaneousEvent(QObject*, QEvent*) qcoreapplication.cpp:1565
#23 0x7f6d5287415b in QGuiApplicationPrivate::processCloseEvent(QWindowSystemInterfacePrivate::CloseEvent*) qguiapplication.cpp:2911
#24 0x7f6d528b543f in QGuiApplicationPrivate::processWindowSystemEvent(QWindowSystemInterfacePrivate::WindowSystemEvent*) qguiapplication.cpp:2259
#25 0x7f6d52fb5b02 in QWindowSystemEventHandler::sendEvent(QWindowSystemInterfacePrivate::WindowSystemEvent*) qwindowsysteminterface.cpp:190
#26 0x7f6d52fb5b02 in bool QWindowSystemHelper<QWindowSystemInterface::SynchronousDelivery>::handleEvent<QWindowSystemInterfacePrivate::CloseEvent, QWindow*>(QWindow*) qwindowsysteminterface.cpp:102
#27 0x7f6d52fb5b02 in handleWindowSystemEvent<QWindowSystemInterfacePrivate::CloseEvent, QWindowSystemInterface::SynchronousDelivery, QWindow*> qwindowsysteminterface.cpp:138
#28 0x7f6d52fb5b02 in bool QWindowSystemInterface::handleCloseEvent<QWindowSystemInterface::SynchronousDelivery>(QWindow*) qwindowsysteminterface.cpp:351
#29 0x7f6d52cb6f1e in QPlatformWindow::close() qplatformwindow.cpp:348
#30 0x7f6d52e7e158 in QWindow::close() qwindow.cpp:2449
#31 0x7f6d6981b4d2 in QWidgetPrivate::close() qwidget.cpp:8632
#32 0x7f6d698205c6 in QWidget::~QWidget() qwidget.cpp:1508
#33 0x7f6d6b4f6bf0 in QDialogButtonBox::~QDialogButtonBox() qdialogbuttonbox.cpp:496
To fix, don't delay the Q_Q to until after the ignoreShowAndHide
check, since that woould be brittle. Instead, do as we for signal/slot
connections, which we disconnect explicitly in ~QDialogButtonBox(),
and delete the EventFilter explicitly there, too. This way, it's more
natural, and also prevents all those useless event filter invocations
from having to be processed later on.
Amends aff0915352dda0cfaa11a249b665fbe47be21d69. The original code,
using QDialogButtonBox::eventFilter(), was not affected, since by the
time QDialogButtonBox was demoted to QWidget, QWidget::eventFilter(),
not QDialogButtonBox::eventFilter() would been invoked. Which just
goes to show that one needs to be very careful with delegating too
much responsibilites to the Private class, as it lives, fully derived,
until ~QWidget() executes.
Pick-to: 6.8 6.5
Change-Id: I04f36fd6d7d160932bfe1494fdff464786b85047
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit dceff0ace4d16344eec3ad4a27dec92f8a55c63e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The constructors didn't initialize all fields, leading the
compiler-generated move contructor to read invalid enum values:
Says UBSan:
tst_qmainwindow.cpp:1645:8: runtime error: load of value 32675, which is not a valid value for type 'Orientation'
#0 0x55b1bd283e2e in AddDockWidget::AddDockWidget(AddDockWidget&&) tst_qmainwindow.cpp:1645
[...]
tst_qmainwindow.cpp:1645:8: runtime error: load of value 72, which is not a valid value for type 'DockWidgetArea'
#0 0x55b1bd284024 in AddDockWidget::AddDockWidget(AddDockWidget&&) tst_qmainwindow.cpp:1645
[...]
(ubsan does not direct uninitialized memory accesses directly).
Fix by vale-initalizing the two members. This is the most natural
initialization for these members: Given that the test passed even with
random data before, 0 is surely good enough.
Amends the start of the public history.
Pick-to: 6.8 6.5 5.15
Change-Id: I6fc0b2f79679fd0f69024066c1e66b4434a5ebe6
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit af71de2036728091b432d7b4284368188961b680)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The test function contains two completely separate tests: The old
setFloating() method from a910daf52678469b7e595da5fe54aa09ba2373c3^,
and the additions of said commit, which don't reuse any objects of the
old function.
Turn the latter into a new test function, setFloatingReparenting(), to
help code readers understand that these two parts of the test function
have nothing in common.
Case in point: setFloating() is now ubsan+asan-clean while
setFloatingReparenting() inherits both asan and ubsan errors of the
old, combined function.
Amends a910daf52678469b7e595da5fe54aa09ba2373c3.
Pick-to: 6.8 6.5
Change-Id: Ib0d54d47e74d4c3b70637bef95fa81d4da83dd76
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit b724c3708bfd94e2f3ec01ccec8de6779f0adb33)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The RegisterWindow request expects a window id. The QDBusMenuBar uses
the QWindow::winId() property for that. On X11, the winId() returns
the XID of the window. On Wayland, the winId() returns an integer that
has meaning only to the application, there are no global window ids on
Wayland. The menubar should be registered using other means, for
example using the kde-appmenu protocol, which QtWayland already does.
The QDBusMenuBar can skip synchronously calling the RegisterWindow
request on Wayland because the menu will be registered using a different
api.
Change-Id: I6b2968624c5c9ddbdc93807f65eac369dc7a993a
Reviewed-by: David Edmundson <davidedmundson@kde.org>
Reviewed-by: Liang Qi <liang.qi@qt.io>
(cherry picked from commit fa1fab994e76c19a08903e9b641732ce388a30bd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Using MSVC 19.43 in C++20 mode leads to a compile error in
tst_qstringview. MSVC interprets QStringTokenizer as
std::ranges::sized_range because it found size() in the namespace
QtPrivate::Tok. QStringTokenizer is derived from a class in that
namespace.
Naturally this leads to a compile error because QStringTokenizer has no
size member function as required in QtPrivate::Tok::size():
qstringtokenizer.h(118): error C2039: 'size': is not a member of
'QStringTokenizer<QStringView,QStringView>'
qstringtokenizer.h(232): note: see declaration of
'QStringTokenizer<QStringView,QStringView>'
qstringtokenizer.h(118): note: the template instantiation context
(the oldest one first) is
tst_qstringview.cpp(680): note: see reference to function template
instantiation ...
The problem can be avoided by renaming QtPrivate::Tok::size() to
tokenSize. MSVC 19.43 interprets QStringTokenizer as std::ranges::range
that do not need the size() member function.
Pick-to: 6.8
Change-Id: Ib94db8e4d840a143bbf693c89e3714e1528a0267
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit eabbc15a5b0cb1b1866778fa014bd599d38f1695)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The bootstrap lib doesn't build qfilesystemengine_mac.mm, and that's
where QFileSystemEngine::supportsMoveFileToTrash and
QFileSystemEngine::moveFileToTrash are implemented.
Make sure that the preprocessor picks up the QT_BOOTSTRAPPED condition
first to define implementations for the two methods.
Fixes: QTBUG-135650
Change-Id: Icf7995abfae368b9f5bd5c4ccfcf4c3c6664d519
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit fc277e3ff655780622bcbc0b664efc69fbc33537)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The combination of
-no-feature-evdev
-no-feature-tslib
-no-feature-libinput
led to the creation of the InputSupportPrivate module without source
files.
This triggered CMake upstream issue 23464 when using CMake < 3.25.
Fix this by adjusting the inexact condition that decides whether to
build InputSupportPrivate.
Pick-to: 6.8
Fixes: QTBUG-99957
Change-Id: If23d029f21811b6ff7c92ac9ecd2882aedb309d6
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit cf2efa90fa92898f71861fca8100d7ac72244dae)
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
We have our own implementation of the atomics API in Harfbuzz
for broader platform support. This is done through the mechanism
in Harfbuzz where you make a file called config.h with the
implementation and then define HAVE_CONFIG_H.
In Qt, we have this in src/3rdparty/harfbuzz-ng/config.h,
next to the CMakeLists.txt.
However, on some platforms, a different config.h has been found
earlier in the include paths and included instead, causing us to
use the default atomic implementation instead on these platforms.
This causes problems with the upgrade to Harfbuzz 11, where the
atomics have been written to depend on some template syntax which
is not properly supported on the Integrity OS compilers yet.
This was also a random inconsistency, so rather than try to work
around the compile issue on Integrity, we add the CMakeLists.txt
directory as the first include path, to make sure the correct
config.h is picked up on all platforms.
Pick-to: 6.8 6.5
Change-Id: I5fc2d57e740ea0a59700ebe319213fe716f8490e
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 66fae045cd289e2f1525c7c4e4ce7a3069ec97ee)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
To follow the system we map key events that include ⌘ as if they had
been made using a Latin/Roman keyboard layout. However when looking
for the ⌘-keymap, we were not taking Qt::AA_MacDontSwapCtrlAndMeta
into account, and since the keymap differs whether the attribute is
set or not we ended up pulling the Meta-keymap instead.
Fixes: QTBUG-133963
Pick-to: 6.8
Change-Id: I32dd06025e1e1d93f3792952e6ad842efc6245a6
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit 2e5a881d347b2b20cfe19f0a9d9cb89f2c441408)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This does mean that if a custom stack size has been requested which
is larger than the default size, we'll end up with a custom stack
on the heap instead of on the existing stack.
I don't remember exactly why we opted for our custom stack to live
on the stack in the fist place. The commit message for the change
that introduced it (59601e06d96edb5661a3dd91341d74e16dc6b229) does
mention garbage collection as once use-case, but iOS hasn't used
GC itself, and a GC's mark-and-sweep would have to include the heap
in any case.
However, for compatibility we keep the custom stack on the stack
if we can, as we pass the default stack size to QVarLengthArray,
which covers 99,9999% of apps use anyways (GitHub shows no hits
for the QtRunLoopIntegrationStackSize override that would trigger
a heap-allocated custom stack).
In testing on both simulator and device a custom stack size that
results in a heap-allocated custom stack does work, so we should
be good in either case.
Fixes: QTBUG-135609
Pick-to: 6.8
Change-Id: I86251da005ebca8a1cad5cabd2835e83486b3f8e
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit be93c06758260b1e0738ab17a2ecc4ee8f90e87e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
When the radiobutton/checkbox has no text, the size is to small as the
check rect is enlarged by 2px due to the rounded borders. This is only
visible when they have no text as otherwise there is enough space
between the checkbox and the text.
Therefore add 2px in width when no text is available.
Pick-to: 6.8
Fixes: QTBUG-135628
Task-number: QTBUG-133117
Change-Id: I8e3342fdc980485ab1494ef7f6df044f42883619
Reviewed-by: Wladimir Leuschner <wladimir.leuschner@qt.io>
(cherry picked from commit 696f9adaa4b7a293ff1bfe3fa47dca62b4fdc710)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QDoc generates warnings for images that do not have alt-text associated
with them. Alt-text is used to add context to images for users who use
screen-readers.
This patch applies alt-text to images in the Qt SQL module that do not
have any alt-text associated with them.
Fixes: QTBUG-135114
Pick-to: 6.8
Change-Id: Iead375852d30219db7dfed12bb1f383eb55713e6
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
(cherry picked from commit 7b66c906bf7a8c32650157fdd13221822ec1558e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
source_group is used by various IDEs, including Qt Creator,
so it makes sense to do that for other generators too.
Amends 06ea3e3994b38e5fe9ac4f33044b0efa1f1be294
Change-Id: I32334d658ea5a74a9e5f2a7fab2c1f531c099901
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit f302a312dcf1005e147193e12fbfc4677aa7af30)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
A QGraphicsEffect is not rendered inside a QGraphicsView so we must not
set it on a QComboBoxPrivateContainer. We have to do some checks for it
when a stylesheet is set as polish() is then called before the proxy
widget is set on the QComboBoxPrivateContainer. But luckily QComboBox
has the proxy widget already set so do the check there.
Pick-to: 6.8
Fixes: QTBUG-135340
Task-number: QTBUG-128916
Task-number: QTBUG-128329
Change-Id: I2426701f3aa44a2eb14b66846628dbb9cd16dc9f
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 847c0bf07695942271f9a0cf2b3eb63fa19c7d72)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The EXECUTABLE argument must point to the full path of the created
executable, not just the file name. Otherwise,
qt_deploy_runtime_dependencies won't file the file.
Pick-to: 6.8
Change-Id: I18b6214b9f46c0ad4b99ca57468fe272efb9d718
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit e07b4d4394be2885cb35ed2c08a3eaedb6fd26e4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
_qt_internal_set_rpath was using CMAKE_INSTALL_PREFIX instead of
QT_DEPLOY_PREFIX for the destination path, which ends up trying to
adjust the rpath of plugins in the regular install destination, rather
than in DESTDIR.
Change the code to use QT_DEPLOY_PREFIX where appropriate.
Amends 5430fb22439db9fc1ad1df4cbf0319b63346b0a5
Pick-to: 6.8
Fixes: QTBUG-135620
Task-number: QTBUG-109553
Change-Id: Iea1c0b69ba93fa5e81c463df57f8c2e19703a66a
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit ae4f9fe0cf6acded39020b8fbefd35df20ffff7d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Map PageTabList controls (i.e. QTabBar) to the TabGroup role, and
report the list of PageTabs as the tabs. Add a predicate-argument
to the unignoredChildren() function so that we can re-use that
logic to return the list of tabs, while also ignoring otherwise
accessible children, such as the scroll buttons.
Change-Id: I57472e9213dd178e018449e542de276051097073
Fixes: QTBUG-134807
Pick-to: 6.8
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 0475bc57d699ac3bc82e2970b97ff267922bd15e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Use qobject_cast<QComboBoxPrivateContainer *> instead
QObject::inherits() as this should be slightly faster and we have access
to the type so no need to use error-prone string comparison.
Pick-to: 6.8
Task-number: QTBUG-135340
Change-Id: I90ebb2323f21c2f5f9dd65bd7b1beeb32f1a91cc
Reviewed-by: Wladimir Leuschner <wladimir.leuschner@qt.io>
(cherry picked from commit 7fdf7ad7e578675b32deb399b51ec6392c66cb2d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Replace an if-chain with a switch statement, and remove the duplicate
test for QAccessible::Client - we already ignore all such elements,
no matter their special role name.
Compare an object's className as a QByteArrayView, no need to expand to
a UTF16 QString just to compare with a Latin1 literal.
Pick-to: 6.8
Change-Id: I79f52277e4177f2a688216b7f5ef7469cfe0534c
Reviewed-by: Albert Astals Cid <aacid@kde.org>
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
(cherry picked from commit e88940941f8ffe8236d281d5e0e46205f5c405ee)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
We don't need to QUrlPrivate::appendPath() to a temporary variable under
QUrl::FullyEncoded mode and then setPath(). We can simply ask
appendPath() to write to the destination variable once and for all, so
long as we take care to ask it to use the encoding form that setPath()
uses (QUrl::PrettyDecoded, which is 0x0). That avoids the side trip
through FullyEncoded mode.
Pick-to: 6.8
Change-Id: I7908b9cf75742db07145fffd9499ce3b79492fdb
Reviewed-by: David Faure <david.faure@kdab.com>
(cherry picked from commit 7ed94ef2b510a51d81dbe8aa4700dc8a283b21aa)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Amends (reverts) commit 5e936b60fc921e21b8153a83113886a1de333b57, which
forced the encoding of the square brackets ("[]") into their percent-
encoded forms only in QUrl::fromLocalFile(). This commit expands the
functionality to all uses of decoded paths by applying the change
directly to recodeFromUser().
[ChangeLog][QtCore][QUrl] Square brackets ("[]") are now transformed to
their percent-encoded forms ("%5B" and "%5D") when present as inputs to
setPath(), setQuery(), and setFragment() if the parsing mode is
QUrl::DecodedMode (the default).
Pick-to: 6.8
Fixes: QTBUG-135433
Task-number: QTBUG-134073
See: https://bugs.kde.org/show_bug.cgi?id=502280
Change-Id: Id2b41559af08b5f228e4fffdb9c6f23120f856b5
Reviewed-by: David Faure <david.faure@kdab.com>
(cherry picked from commit f3da9d3c858e8dc28a5dc91047b592ed5becbd62)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The __has_cpp_attribute() refers to the attributes supported by the C++
language. GCC returns its knowledge of the C++ attribute in C, even when
the C code doesn't support it.
N2335[1] added the C++ attribute syntax to the C language and N2553[2] added
the __has_c_attribute() query syntax.
Known attributes:
From https://en.cppreference.com/w/c/language/attributes#Standard_attributes:
* [[deprecated]] (from N2334)
* [[fallthrough]] (from N2408)
* [[nodiscard]] (from N2267, with message in N2448)
* [[maybe_unused]] (from N2662)
* [[noreturn]] (from N2764, which also deprecates _Noreturn)
Drive-by remove C++11 & 14 support from [[nodiscard]]
[1] https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2335.pdf
[2] https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2553.pdf
Change-Id: Ifd32b2557683218e0d26fffd5b58dedf7911f77a
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 4cd66686e4fcf31ca1c8038c11125f90dc0b4782)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Ensure the target is not an ALIAS target when adding the
transitive properties.
Pick-to: 6.8
Change-Id: Ic9cb4f1a6e110596e430176cfa9b7f742d2c3446
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit d9ce5184c28b7d00330939f9907be5d0a069e68d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
endFrame(SkipPresent) followed by beginFrame() would sometimes end
up waiting up to a second. We should not wait at all in this case.
D3D12 patch will follow separately.
Pick-to: 6.8
Change-Id: I3a5605c3fb672f9d68f2afb69645c5c47a5214b3
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
(cherry picked from commit f2437c9d8ca0d4b4af7e917ff18cd0bc6ca83bcc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
...to match 6.8 that has this added as part of a backport.
The D3D12 backend has this already. Still, move the
resetting of the variable to the outer scope in that one
too, to cover both code paths.
Change-Id: Ie4ba22ff9f2a2f6882dd2d5e3063c4e6701fa95c
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
(cherry picked from commit 35dd681f2ba00e7196e59309d76f920ad8807205)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Naming the private API "reparent()" was unfortunate. It is ambigous, as
it suggests that the QDockWidget argument may be parented to the group
window. In fact the opposite is the case: It is removed from the group
window and re-parented to the QMainWindow.
Rename the API into reparentToMainWindow(), which is what it does.
Amends e6d85cf28bc4f750b69c33b72c006b067ae1190f.
Task-number: QTBUG-135442
Pick-to: 6.8 6.5
Change-Id: I6f9f37c190f3550348b1e4e14a8612d8880170dd
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit a0e0425a107aebf8727673505ea2376400b54b07)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
With the SH_ComboBox_AllowWheelScrolling style hint introduced in [1],
it's possible for combo boxes to not react to wheel scrolling. However,
since the event isn't explicitly ignored, it gets "eaten" by the combo
box instead of propagating up. This leads to upper level scroll areas
not receiving the event (and thus not scrolling).
By ignoring the event, the scroll area now scrolls if the hint is set
to false instead of nothing happening. This feels more intuitive and
mimics system behavior on both macOS (where the hint is set to false by
default) and Windows 11.
[1]: 5e9e4ccdc363297f70d4ebfbbb3e279670eca553
Pick-to: 6.8
Change-Id: I2207af8aad81fb76f3b1bbe074c3c4fbf22e3eca
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit 9c966d837fe33b1e32f5e95f29a380dd3063055b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
INSTALL_DATADIR and INSTALL_ARCHDATADIR have the value "." by default.
CMP0177 in CMake 3.31 now warns when paths that have "." as a
component are passed to install().
To avoid the warning, change the implementation of qt_path_join, to
filter out "." components.
That way all install() calls that build up their paths via
qt_path_join() will avoid the warning.
Pick-to: 6.8
Change-Id: Ib82aa9fe6b5d32e374e8b1acf05402312b6dbe1a
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit a20f28121264bfe18af13bfe14be7fd29d33a2fe)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
If we add the first part of the XML document using a QBA overload of
the constructor or addData() method, the encoding of the document will
be extracted from the "encoding" attribute of the XML prolog.
This way, if the encoding is different from UTF-8, appending the data
with the QASV overload of addData() will always result in reading the
data incorrectly, because the implementation converts the input data
to UTF-8.
This test explicitly highlights this behavior.
In some cases the current behavior is probably fine. However, cases
like appending Latin1 to Latin1-encoded document or appending UTF-16
to UTF-16-encoded document should just work instead of doing the
unwanted conversion to UTF-8 and failing.
Task-number: QTBUG-124636
Task-number: QTBUG-135129
Pick-to: 6.8 6.5
Change-Id: Idf0571083e56032145478631538f09d251cb1022
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 046b8523f20bdc86373eff7dfc2a1c0f7bb297d4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The tst_QXmlStream::runTestSuite() had two issues which resulted
in non-wellformed files not being checked in the incremental
parsing mode.
The first issue is that the TestSuiteHandler::endElement()
function calls isWellformed() twice with two different modes,
passing a pointer to a previously opened QFile to both calls.
As a result, the first call uses ParseSinglePass mode, which reads
the entire file at once. After that, the second call with
ParseIncrementally mode already uses a file which has
atEnd() == true. So, the call to readAll() simply returns an empty
QByteArray. So, the ParseIncrementally test was effectively a no-op.
This commit fixes it by explicitly calling seek(0) at the beginning
of the isWellformed() function and also changing the type of the
input parameter to be a QFile pointer instead of QIODevice pointer,
to make sure that seek(0) actually makes sense.
After that issue was solved, I noticed that in the incremental mode
the algorithm that was feeding the data to QXmlStreamReader
byte-by-byte was always skipping the first character (and also
reading past the end of the buffer). As a result, all the XML files
parsed in this mode were malformed.
This was fixed by moving the increment of the index after the
addData() call.
Finally, after these two things were fixed, six test cases from the
XML test suite started to fail, because the non-wellformed files
were incorrectly reported as well-formed.
Fix it by using StreamEOF instead of 0 in
QXmlStreamReaderPrivate::fastScanContentCharList().
The test case fixes amend the beginning of the public history.
The parser fix amends 817800ad39df10ca78e2c965a61d4d2025df622b
which introduced StreamEOF instead of 0.
Fixes: QTBUG-135471
Pick-to: 6.8 6.5 5.15
Change-Id: I885166252d40819a4460ec246db10bf448e4a8e2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 633278fe1c9991237e02233b32f825b2506187c3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The fix [*] means this already passes on dev; and the belated pick to
6.8 should get there before this does (it landed before 6.9, so did
not need picked there).
[*] commit 5d656e5085303bd427a4e8564818c65ec1d0ac26
On 6.8, without the fix, the ISODate test passes (that's handled by a
sui generis parser) but all three of the fromStringFormat tests of
QDate, and the QDatetime exact reproducer from the bug report, provoke
assertion failures.
Task-number: QTBUG-135382
Pick-to: 6.8
Change-Id: I303df9215873e37a9f2cbf5a78aab8ffa48f67aa
Reviewed-by: Albert Astals Cid <aacid@kde.org>
(cherry picked from commit 79a1986e86243e94e8558ab5805a75b424916c89)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QMainWindowLayout::unusedTabBars contains unparented tab bars.
They are leaked when QMainWindow and its layout get destroyed.
They still are in QApplication::allWidgets(), which attempts to delete
them eventually. When that happens, they try to remove themselves from
an already deleted QMainWindowLayout::unusedTabBars.
Delete all unused tab bars in the d'tor of QMainWindowLayout.
Task-number: QTBUG-135468
Pick-to: 6.8 6.5
Change-Id: I5ac7748ef738955522567db585e9505e3ba435ad
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 23357e59bb4dc54e76a237b290aa64a620db2ea1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Amends b6b489db6968fbc3b4aab3755d0166ee09712ff0, which introduced UB
(invalid downcast):
By the time the
QMainWindowTabBars are destroyed, and they want to unregister
themselves from the QMainWindow, the ex-QMainWindow has already been
demoted to a QWidget. Says UBSan:
qmainwindow.cpp:63:47: runtime error: member call on address 0x6040000267d0 which does not point to an object of type 'QMainWindow'
0x6040000267d0: note: object is of type 'QWidget'
00 00 00 00 28 c1 e6 f3 c7 7f 00 00 80 24 00 00 60 61 00 00 d8 c2 e6 f3 c7 7f 00 00 00 00 be be
^~~~~~~~~~~~~~~~~~~~~~~
vptr for 'QWidget'
#0 0x7fc7f06da8c5 in QMainWindowPrivate::mainWindowLayout(QMainWindow const*) qmainwindow.cpp:63
#1 0x7fc7f06da8c5 in qt_mainwindow_layout(QMainWindow const*) qmainwindow.cpp:69
#2 0x7fc7f07bb4ed in QMainWindowTabBar::~QMainWindowTabBar() qmainwindowlayout.cpp:2042
#3 0x7fc7f07bf4e5 in QMainWindowTabBar::~QMainWindowTabBar() qmainwindowlayout.cpp:2047
#4 0x7fc7c69f9c2a in QObjectPrivate::deleteChildren() qobject.cpp:2226
#5 0x7fc7ef0b7f3d in QWidget::~QWidget() qwidget.cpp:1557
#6 0x7fc7f082c7c7 in QDockWidgetGroupWindow::~QDockWidgetGroupWindow() qmainwindowlayout_p.h:343
#7 0x7fc7f082c7c7 in QDockWidgetGroupWindow::~QDockWidgetGroupWindow() qmainwindowlayout_p.h:343
#8 0x7fc7c69f9c2a in QObjectPrivate::deleteChildren() qobject.cpp:2226
#9 0x7fc7ef0b7f3d in QWidget::~QWidget() qwidget.cpp:1557
#10 0x7fc7f06ce495 in QMainWindow::~QMainWindow() qmainwindow.cpp:338
#12 0x556a6180a84c in std::default_delete<QMainWindow>::operator()(QMainWindow*) const unique_ptr.h:85
#13 0x556a6180a84c in std::unique_ptr<QMainWindow, std::default_delete<QMainWindow> >::~unique_ptr() unique_ptr.h:361
#14 0x556a6180a84c in tst_QDockWidget::setFloatingReparenting() tst_qdockwidget.cpp:492
Use qobject_cast to verify that the mainWindow is not pointing to a
QMainWindow that is being destroyed (and has passed the ~QMainWindow
destructor). If the main window is destroyed, then removing the tab bar
from the list of unused tab bars is unnecessary.
Pick-to: 6.8 6.5
Change-Id: I25e12d79198137b75cd2576ff1440b6c94277eba
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 1bbbacbecb0bd03a58fea889215850dfffebeb3b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Instead of aggregating a QMutableSinglePointEvent by value, which
depends on the QEvent copy assignment operator, and casting it to a
QMouseEvent that it isn't, introduce QEventStorage which is a bit like
std::optional, but, by each event subclass befriending it, can store
event copies by-value, unlike clone(), which is restricted to the
heap. We could have befriended std::optional<QMouseEvent>, too, but by
adding our own type in _p.h, we can better control which code uses
this dangerous construct.
Added a guard to avoid clobbering lastMouseEvent with a copy of itself
in storeMouseEvent(). Before, we'd self-assign to lastMouseEvent,
which didn't invalidate the reference. Now, a store() is the
equivalent of a dtor + copy constructor, so we need to be a bit more
careful.
Fixes UBSan reports when running tst_qgraphicsview:
qgraphicsview/qgraphicsview.cpp:612:27: runtime error: downcast of address 0x61a000035e90 which does not point to an object of type 'QMouseEvent'
0x61a000035e90: note: object is of type 'QMutableSinglePointEvent'
00 00 00 00 30 47 ef 8b 99 7f 00 00 02 00 00 00 00 00 00 e0 d0 91 00 00 20 60 00 00 00 00 00 00
^~~~~~~~~~~~~~~~~~~~~~~
vptr for 'QMutableSinglePointEvent'
#0 0x7f99a27c7a47 in QGraphicsViewPrivate::replayLastMouseEvent() qgraphicsview.cpp:612
qgraphicsview.cpp:653:39: runtime error: member call on address 0x61a0000fe290 which does not point to an object of type 'QMouseEvent'
0x61a0000fe290: note: object is of type 'QMutableSinglePointEvent'
00 00 00 00 30 47 ef 8b 99 7f 00 00 05 00 00 00 00 00 00 e0 d0 91 00 00 20 60 00 00 00 00 00 00
^~~~~~~~~~~~~~~~~~~~~~~
vptr for 'QMutableSinglePointEvent'
#0 0x7f99a27c3609 in QGraphicsViewPrivate::mouseMoveEventHandler(QMouseEvent*) qgraphicsview.cpp:653
#1 0x7f99a27c7832 in QGraphicsViewPrivate::replayLastMouseEvent() qgraphicsview.cpp:612
qgraphicsview.cpp:654:37: runtime error: member call on address 0x61a0000fe290 which does not point to an object of type 'QMouseEvent'
0x61a0000fe290: note: object is of type 'QMutableSinglePointEvent'
00 00 00 00 30 47 ef 8b 99 7f 00 00 05 00 00 00 00 00 00 e0 d0 91 00 00 20 60 00 00 00 00 00 00
^~~~~~~~~~~~~~~~~~~~~~~
vptr for 'QMutableSinglePointEvent'
#0 0x7f99a27c358b in QGraphicsViewPrivate::mouseMoveEventHandler(QMouseEvent*) qgraphicsview.cpp:654
#1 0x7f99a27c7832 in QGraphicsViewPrivate::replayLastMouseEvent() qgraphicsview.cpp:612
Task-number: QTBUG-99563
Change-Id: Ib642d416b8aef98c7fd8b1fa164ec2449189992a
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
(cherry picked from commit dd264cc9c00e09eb995f1c6f9b1fd651f1d4b2f4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
On my machine, the window manager opened the QComboBox always at y = 0
(top edge of the screen), where the popup, being confined to the
screen geometry, had no chance of "open[ing] up centered on top of the
current index".
Fix by centering the widget on screen.
Amends 8393922e7071221a9c6c0811eb714f20bf4ed02b.
Pick-to: 6.8 6.5
Change-Id: I7b4d066aa1e555f3d5cc1d5e0c88b1d835bf2b26
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit e2790a6758be18add2bcab42cc7dfebdd74daae1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Purely from a symmetry argument, we should be disconnecting the old
item delegate, not the new one.
I didn't find a case where this actually causes test failures, nor did
I take the time to implement a test where it does.
Amends a126d3627cc347500c1a6bd82027efa6d451ccbd. That patch landed in
Qt 6.7, but that branch is "closed" at this point in time, so not
picking there now.
Pick-to: 6.8
Change-Id: I06b704e699616d61c65ad676ffe45dfbd9f8a870
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit e5f11eebc89ec041995cbbbc9b3db9eb3c6968c2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Tidies up the test output by removing expected warnings from the log
(and alerting us if they're missing).
Amends 64f6169f61ce8c982a1b92b20f930518a5f0d477, which introduced the
warning.
Pick-to: 6.8 6.5 5.15
Change-Id: Idcef99d556b11035307e6e207cf31fc2f13ed291
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit e55479ea4a2dca266b73a2a17ff77ec44e1c2135)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The minimumContentsLength() is user-settable, and tst_QComboBox
actually sets it to INT_MAX as some point. As such, the implementation
needs to defend itself from UB, either by limiting what values it
accepts as minimumContentsLength() or by making sure it doesn't cause
signed overflow in calculations involving this user-controlled
variable.
The former doesn't really work as long as the test checks that INT_MAX
is accepted as-is, so we need to do the latter.
Do the calculation in qint64, and use the result only when it doesn't
exceeed good old QWIDGETSIZE_MAX.
Amends the start of the public history.
Pick-to: 6.8 6.5 5.15
Change-Id: I8aac7bda593095638c9c09db3b70b4c84e698419
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 00fdf9e432c78e7d7f1a491f7bc1f375fcbde8da)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QProxyStyle's ctor arguments are not QObject parents, but the proxied
style, which becomes the proxy's QObject ... get this ... _child_.
What a broken concept... It means that this test function took
ownership of QApplication::style(), and the only way it wasn't going
to wreak havoc on the rest of the test functions was to leak it after
use.
To fix, create the style on the stack, so it gets automatically freed
by the compiler on all exists from the function. As a drive-by, use {}
instead of () to call the ctor (not to prevent C++' Most Vexing Parse,
just because it's easier on the eye).
The meat of the change, however, is in making the helper proxy-style
defend against QProxyStyle's grabbing of the baseStyle() as its child,
and managing baseStyle()->d->proxyStyle so we properly dissociate from
qApp->style() after we're done. Needed to use ctor delegation to
extract original parent and proxy model from the incoming style before
QProxyStyle, our first subobject, gets first picking on the style,
destroying the very state we're trying to preserve.
This should be become some QTest::LocalProxyStyle, if we find more
users of this pattern.
Amends 5cff7d2b679d48a247b4630cb9e3d5b04fab0b55.
Pick-to: 6.8 6.5 5.15
Change-Id: I2abf4a0bf54158254fd8d526de55ad486ca4e296
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit d88459139119b898e81c1a104e6fd3e28c8f01cf)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Both the QCompleter and the QSortFilterProxy objects are not owned by
the QComboBox merely by setting them as completer and model. Having no
other QObject parents, and having being allocated on the heap, they
were leaked.
To fix, give them the combo-box as QObject parent.
Amends 8b6d6d4832ea8ed5f9857d5ddf06408ee9d0b4e0.
Pick-to: 6.8 6.5 5.15
Change-Id: I5c3594272a5283a3fbaeb9885d315047b04f30de
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 27279e01d2794bba8c69db4b987c3351a2daa619)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
A QComboBox does not own the model set on it, because models can be in
many views at once. So the QStringListModel, allocated on the heap
without a QObject parent was leaked.
Fix by giving the model the combo-box as QObject parent.
Amends the start of the public history.
Pick-to: 6.8 6.5 5.15
Change-Id: Idd9057c8f796937d9d3c5c4ef99b329124d2192d
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit c41592c900257177849758ef31212a83fc813be5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QItemDelegates are owned by neither the QComboBox directly, nor the
QComboBox::view(), upon a mere setItemDelegate() (the docs of this
function is pretty clear about that). Since the objects didn't have a
QObject parent, either, they were leaked.
To fix, give it the comboBox as a parent.
Amends the start of the public history.
Pick-to: 6.8 6.5 5.15
Change-Id: Ic8bc2603072070b458bd79a6129af6c76811f8ec
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit fda3526f9c6c34f509ebaba67a27e5c32235d7e9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Contrary to what the code comment suggested, a QComboBox does not own
the object passed in by setItemDelegate(). After a nullptr check, the
function merely forwards to QComboBox::view()->setItemDelegate() and
QAbstractItemView::setItemDelegate() documents very clearly that the
item delegate ownership does not change. Consequently, the test
function leaked the object.
To fix, hold it in a unique_ptr and reset() at the end of the code
block.
I opted to not merely comment in the delete there, because that would
still leak in case one of the QCOMPARE()s in-between failed. While it
is not the purpose of the current work to make tests leak-free even on
failure, it likewise makes little sense to not reap this small benefit
now, albeit at the cost of a bit of git history mess-up, itself
mediated by the fact that we're picking this all the way back, since
this...
Amends the start of the public history.
Pick-to: 6.8 6.5 5.15
Change-Id: I1e604b795f5a12dc8829bf5913b88bc7c7110352
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 0de7cafabc6d71cf3c129e7a67792d2a3ff1c864)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QLineEdit remembers whether a QWidget size-widget came from a
QWidgetAction or is just one of its own QLineEditIconButtons. On
removal of the action, if QWidgetAction, it will ask the action to
deal with its widget, calling QWidgetAction::releaseWidget(),
otherwise it just deletes the QLineEditIconButton itself.
This is fine if the action is being removed from the line edit, but
not immediately deleted. But if the action is being deleted while its
widget is still in a QLineEdit, then the QLineEdit is informed of this
only by ~QAction(), at which point the QWidgetAction has ceased to
exist and the cast, in QLineEditPrivate::removeAction(), to
QWidgetAction is UB.
Says UBSan:
qlineedit_p.cpp:656:10: runtime error: downcast of address 0x6020000c3950 which does not point to an object of type 'QWidgetAction'
0x6020000c3950: note: object is of type 'QAction'
00 00 00 00 70 57 49 81 3d 7f 00 00 80 bc 0c 00 50 61 00 00 03 02 00 00 10 00 00 00 a6 01 00 71
^~~~~~~~~~~~~~~~~~~~~~~
vptr for 'QAction'
#0 0x7f3d93910686 in QLineEditPrivate::removeAction(QAction*) qlineedit_p.cpp:656
#1 0x7f3d938b44bc in QLineEdit::event(QEvent*) qlineedit.cpp:1469
#2 0x7f3d91c50211 in QApplicationPrivate::notify_helper(QObject*, QEvent*) qapplication.cpp:3309
#3 0x7f3d91cd160a in QApplication::notify(QObject*, QEvent*) qapplication.cpp:3259
#4 0x7f3d697f6ada in QCoreApplication::notifyInternal2(QObject*, QEvent*) qcoreapplication.cpp:1111
#5 0x7f3d697f94e3 in QCoreApplication::sendEvent(QObject*, QEvent*) qcoreapplication.cpp:1551
#6 0x7f3d92345199 in QWidget::removeAction(QAction*) qwidget.cpp:3215
#7 0x7f3d92e47202 in QtWidgetsActionPrivate::destroy() qaction_widgets.cpp:35
#8 0x7f3d7f75d5fb in QAction::~QAction() qaction.cpp:451
#9 0x7f3d92e4cc76 in QWidgetAction::~QWidgetAction() qwidgetaction.cpp:94
#10 0x7f3d92e4e965 in QWidgetAction::~QWidgetAction() qwidgetaction.cpp:94
#11 0x558c993da3b0 in tst_QLineEdit::sideWidgets() tst_qlineedit.cpp:4693
To fix, check the dynamic type of the action (using qobject_cast)
before calling QWidgetAction::releaseWidget(). If the cast fails, the
QWidgetAction will have dealt with the widget itself, in its own dtor,
so QLineEdit needn't do anything.
Unfortunately, fixing this centrally by just dragging destroy() down
from ~QAction() to ~QWidgetAction() causes use-after-free in other
test functions of tst_QLineEdit, so I deciced to fix this at the
QLineEdit level only.
Amends 9ce12cc8de940cdd450a28f4bd079acfc3621aa3.
Pick-to: 6.8 6.5 5.15
Change-Id: I3c514dbd1f1a4e1510df3dd9ac67b4bab50e63e9
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit bf62a9762b04689094d1411168ad785b2152cba4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The test uses the old-but-invalid trick of inheriting from a class X
to gain access to its private or protected parts, but then just
casting an object of dynamic type X to the newly derived class. This
is invalid, because the object is not actually of the newly-derived
type.
Says UBSan (excerpt):
tst_qtextedit.cpp:2273:5: runtime error: downcast of address 0x60400013c190 which does not point to an object of type 'PublicTextEdit'
0x60400013c190: note: object is of type 'QTextEdit'
00 00 00 00 70 bc 57 df b1 7f 00 00 80 66 30 00 90 61 00 00 70 be 57 df b1 7f 00 00 00 00 be be
^~~~~~~~~~~~~~~~~~~~~~~
vptr for 'QTextEdit'
To fix, make QTextEdit befriend tst_QTextEdit. This is how we do it
elsewhere, too. Then remove the now-unused PublicTextEdit helper.
Amends the start of the public history, and, in one function,
56f0ebfe860e440dcbba8997f44836debc901119 (which is only in Qt 6.4+, so
the cherry-pick to 5.15 will have to drop the part in pasteFromMarkdown().
Pick-to: 6.8 6.5 5.15
Change-Id: I967238d84cae0f6dd8f05d0afb7a318292d96415
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 73fc32af1410b54fc38d7450fad04bb9dabec077)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The constructor new'ed up a MyPaintEngine, but there was no destructor
to delete the object again. Neither is ownership of the engine
transferred out of the class, so the object was leaked.
Fix by holding it in a unique_ptr.
Amends 391e3aeef45efc937979b44c32147206e389a60b.
Pick-to: 6.8 6.5 5.15
Change-Id: I0c4da10d5a1659eceac0deba32cac757579e46c5
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit de2de7e12cb82064e32197f88c8772ceeeead8ae)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QMetaType::Void is not constructible, so create() will return nullptr,
and even though sizeOf() returns 0, calling memcmp() is still UB in
that case.
Fix by guarding the memcmp() from QMetaType::Void.
Amends a59e7361714d50687d82a2d9abae9e95825a23b6.
Pick-to: 6.8 6.5
Change-Id: I55896826e6c0cad5d77e9d0ab861efa9a32f780f
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit c6c2a0bf3799c9851551bc9e1bd0919dbc64924c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
To benefit from -Wswitch compiler flag, requested by Marc in code
review.
Define supportsAlgorithm() twice, with/without USING_OPENSSL, amends
9248d0cfbee0805d670f4b6b07bd3bf4003d6263.
Change-Id: I236093532196689bc0828131360dfeeb24fac23f
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 095e6fd0840ad4cd578a022ec361ebf716dfa843)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Rename the parameter 'code' to 'nativeErrorCode' to match the getter
nativeErrorCode() with the ctor's parameters.
Pick-to: 6.8
Change-Id: Ic95b45c75a57796536d845249c719b5d0d0e7587
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 06ef995a7d348c9769091b07e4511c3c9511a104)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
We store timestamps as utc in the database but QSqlDriver::formatValue()
does not format the datetime string as utc. Fix it by converting the
datetime object to utc first.
This amends 2781c3b6248fe4410a7afffd41bad72d8567fc95
Pick-to: 6.8
Fixes: QTBUG-135135
Change-Id: Id26b251e9ed9800d6caff7f43de25fd9e9b08f43
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 219e9fe7a2312538635aaf1c0bc79b98df21723e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
After c5792dcfd631abb4f9e2b92cd6e88d7e5c373406 the last cursor position
is reflected as a QPoint(std::numeric_limits<int>::max(), ...), and
after 209a2145f94e99f99832c3a08cdf579d8f42ca55 as 1 << 23. Instead of
hard coding the sentinel value, let's use QLastCursorPosition directly.
Pick-to: 6.8 6.5
Change-Id: I24031f3cc800d2f0028eb95f4f8597019cc945c0
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
(cherry picked from commit 4ae41c225be57492d5bf0e50c58bf18091414c47)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The windows11 style, in contrast to the windows vista style, draws the
indicator on the side. Therefore call QWindowsStyle::sizeHint() for
CT_HeaderSection as the base style has the correct implementation.
Pick-to: 6.8
Fixes: QTBUG-135338
Change-Id: If84f72f9f26e87617ecebb1a01f448219d8656ba
Reviewed-by: Wladimir Leuschner <wladimir.leuschner@qt.io>
(cherry picked from commit 75c896f9b104831e40dfa6ca9aedebaa272704b5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Don't confuse the next person working on this code.
Pick-to: 6.8
Change-Id: I3f9ff59299a4150a96cc11d851d06539a5701a70
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 04fbdd25522f3a7a4b53cb553b1ac70e3f8af5e8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The WatchDog thread calls printTestRunTime() which reads the two
timers, created and started in the main thread.
Pick-to: 6.8 6.5
Change-Id: I1a337648fddf87190075b7902311544d0ab21ac3
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 9e32306daea5578ac5cff1424678da25e2a158af)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Yield a configuration error with -no-feature-desktopservices
if the platform is either Apple or Android. This should be clearer
than a compiler error later on, and also occurs earlier in the
process.
Pick-to: 6.8
Fixes: QTBUG-135152
Change-Id: I5dfb9eda12472ed9359767f17423fda63d208d9c
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit b145f23770a2f88fc54eaaa33eef579c308f4663)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Missed feature guards from:
- QXmlStreamReaderPrivate class declaration
- QXmlStreamWriter::writeCurrentToken definition [*]
[*] Function takes in a qxmlstreamreader. The declaration
of the function already had the necessary feature guard.
Pick-to: 6.8
Fixes: QTBUG-135230
Change-Id: I78741bc75a6baa8bc86ec5ce7d34a4333d8bdad4
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit 90c90d50715b7e7501b0a2153122d576656b9e4d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
In the FontConfig font database, when we registered alternative
names for the same font, we would just copy the existing user
data (the FontFile struct) from the original font.
However, this did not account for the fact that registerFont()
may in some cases delete fonts from the database if they are
being overwritten, which will also delete the user data.
Therefore the existing FontFile struct is not guaranteed to
be valid once the font database has taken ownership.
This was pre-existing, but it started happening on some
systems after 1d6f71779f05df1af3daacd48f309cd92523152a because
this change will cause some fonts to be seen as identical
which were not before.
Pick-to: 6.8
Fixes: QTBUG-135264
Change-Id: I913bf13dc8069d952a4cdc5fa5544594be1cdba1
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
(cherry picked from commit 11620f97f6fb067aa0dce2ee0b1f8ca738c66695)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Amends c7691842f743f568a073582c8f0cacd6ee188f98, and actually fixes the
other half of QTBUG-130142.
Fix the unittest, it was wrong to begin with, iterating over an empty
string with NoDotAndDotDot, next() will always return an empty string
because `currentFileInfo` has never been initialized.
Pick-to: 6.8
Fixes: QTBUG-135287
Task-number: QTBUG-130142
Change-Id: I9966428c7a143803e6e934b5970ea6b6afc8a08f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 4fd7d31e0966d52af4dc40c7e47576d40d8b00ab)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
As far as I can tell, QUuid is working correctly on big endian
platforms. But it stores the integers in such a weird fashion (I wish to
fix that for Qt 7) that this test is non-obvious.
I don't have a big-endian machine to test this with. Anyone interested
is welcome to submit patches.
Fixes: QTBUG-134634
Pick-to: 6.8
Change-Id: I2415be976d1d880d1525fffdf525dcf4f21aaa70
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
(cherry picked from commit aa872148645351a346d34db60cd0b8b1235fed1c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Move the cleanup of the temporary tables into an own function and call them during init and cleanup. this makes sure the tables are
- deleted on clean exit
- not there during init when cleanup was not run (e.g. due to debugging or a crash).
Pick-to: 6.8
Change-Id: I9013a26b0166d0756a37f0a5d50ed825adf63868
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit c833ed5711b40465a77a2d43b79e041092e638cc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This fixes a bug when addData() is used to add a full Latin1-encoded
XML document with a proper "encoding" attribute.
Once addData() is called, it immediately converts the data to UTF-8.
However, if the encoding is not locked, the parser will later see
the "encoding" attribute, and try to interpret the data according
to the specified encoding.
The QXSR(QASV) constructor is not affected, because it already locks
the encoding.
Add a unit-test for the issue.
Amends 6bc227a06a0d1392d220aa79ddb1cdc145d4f76e.
[ChangeLog][QtCore][QXmlStreamReader] Fixed a bug when calling
addData() with a Latin1-encoded string containing a full XML document
with an encoding attribute, could result in incorrect parsing of this
document.
Fixes: QTBUG-135033
Pick-to: 6.8 6.5
Change-Id: I9a35d16d743050ea4feccab3d1336747ce0abff4
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 4b8659ebf689b79ac88f5935ad662a604f0c8bea)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
If debug symbols are needed, then pass the respective flag to the
configure script.
Pick-to: 6.8
Change-Id: I99db92bdd5b7eb896e0d592117a8f218467a4bd7
Reviewed-by: Øystein Heskestad <oystein.heskestad@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 355e0d85eb4a05acd4d5c9d6b2f1cfce7ccdb144)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Implement ensurePositionTopLeft() to set a window's position
to the available top-left corner and verify that it is correctly
positioned.
Incorrect updates to window.position and window.framePosition have
been identified as one of the main sources of flakiness on
Opensuse. This test function addresses this issue and improves test
reliablity.
Task-number: QTQAINFRA-7050
Change-Id: I946f74c7d2c1db9cfe4fec7db272e12876b3ed43
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 7929852c1d39e12b7c586b5c6d257c9df27c01df)
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
The QGraphicsWidget `parent` didn't have a parent itself, and the test
function neglected to delete the object manually, leaking it.
To fix, allocate it on the stack.
Amends the start of the public history.
Pick-to: 6.8 6.5 5.15
Change-Id: Ie9814655c1a52b6dc0d15076eca591fe710d51ae
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 76e76afb83b87664aeeaf61b400e4259ce80f49a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The QGraphicsScene object wasn't used, so can be removed.
Make it so.
Seems to amend the start of the public history (and if there was a
user that has since been removed, we'll get a compile error, so no
need to data-mine the git history further).
Pick-to: 6.8 6.5 5.15
Change-Id: I9eeacde057ee5681ea86c185b66dff618a6f364e
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 235fe36de7d8789cf6f5a393df01337a59874901)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The QGraphicsWidget didn't have a parent, and wasn't deleted by the
test function, so it leaked.
To fix, hold it in unique_ptr. While we're at it, and so that it
doesn't look too out of place, also hold the other parent-less
QGraphicsWidget in a unique_ptr.
The action, OTOH, has a parent, so we don't need to change something
there.
Amends the start of the public history.
Pick-to: 6.8 6.5 5.15
Change-Id: I0597b7ecd293ac54981df9e276c38c385ac811c7
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 92c1413c087c5435858f10c0e0c878bc25211b8f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The result of QStyleFactory::create() is owned by the caller, and this
test function neglected to delete it, leaking the object.
To fix, reset() it, once created, into a unique_ptr. This is the
minimally0-invasive fix.
Amends 9bc49b0bca361646aac90cd00706588d3dcd66c9.
Pick-to: 6.8 6.5 5.15
Change-Id: I17fae174b93bd27e2cac6e5e2d2c8a4ac2de703e
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit f0a9b5b6f11dc5deaabadce0ee672530683cf0a0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
`fstyle` is already a QStyle*, so casting it to QStyle* is unneeded.
Amends 9bc49b0bca361646aac90cd00706588d3dcd66c9.
And 0 is a valid nullptr value, so we don't need to cast there,
either.
Amends the start of the public history.
Drive-by port to nullptr.
Pick-to: 6.8 6.5 5.15
Change-Id: If763b8bf42de9d8bbe988ac76773d02bb7a2b68b
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit dbfcd541552b51f831521c77fd44e753a97f04db)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
If a QGraphicsItem is removed from a QGraphicsScene, it also gets
un-parent-ed, and the caller of removeItem() is responsible for
deleting the item henceforth. The test function neglected that,
leaking the object.
To fix, use a scope-guard to defer deletion of the object to the exit
from the test function. This is the minimally-invasive fix.
Amends the start of the public history.
Pick-to: 6.8 6.5 5.15
Change-Id: Ie4f9be232674bba583f4a59908e42de096930136
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 156bd559231f06136bc368236675688b3c93d02a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The result of QTest::createTouchDevice() needs to be deleted by the
caller. The test function didn't, so leaked the object.
Fix by holding it in unique_ptr.
Amends 982b70d37db337b2c57a3cfce0f24c3d00a598d6, even though the code
that this patch replaced looked leaky, too.
Pick-to: 6.8 6.5 5.15
Change-Id: I3c7dfab31dc6ab364195381352d98fbd9c730990
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit bfd852c5025e342af3960516df2f871aa08f5982)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The result of QTest::createTouchDevice() needs to be deleted by the
caller. The test function didn't, so leaked the object.
Fix by holding it in unique_ptr.
Amends 1ecf2212fae176b78c9951a37df9e33eb24d4f2d.
Not picking to 5.15, because the cherry-pick of
1ecf2212fae176b78c9951a37df9e33eb24d4f2d to 5.15 was abandoned.
Pick-to: 6.8 6.5
Change-Id: I649357466a51e02d669b114bdfa0746bfa09fe34
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 01ee8fd7b5c93cffaeb8624ed87f5dee36e9e5e6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Like in other test functions in this class, the QGraphicsWidgets were
leaked. So the solution is the same: hold them in a QVLA.
Also like in other test functions, the child layouts _are_ owned by
the parent layout, so were not leaked.
There's a twist here, though: we're removing layout items, which may
be widgets _or_ layouts. The old code deleted the removed layout item,
but we can't do that anymore, since it may be one of the widgets that
are owned by the QVLA, and that would cause a double-delete. If we
don't delete the removed item at all anymore, though, we'd leak it
when it was a layout.
So hold the layouts in QVLA, too. _Then_ we don't need to delete the
removed item anymore.
Amends the start of the public history.
Pick-to: 6.8 6.5 5.15
Change-Id: I16c61eb18f2843ceb72a432db1bd9be29e258bfd
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 0665ae81fb33dc6f71f494ad6df92f85aad70ca4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
After the QGraphicsWidgets have been dealt with in a previous commit,
the last leak in the function is that of 'item'.
Fix by holding it in a unique_ptr.
Amends the start of the public history.
Pick-to: 6.8 6.5 5.15
Change-Id: I56986139a2b7865cf367bdd25ccde90d5e1c50ca
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 59b18d07e78be0b57c8bb7c9078e89c686ddf0f3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This test function hasn't tested anything since the start of the
public history, and leaks memory (the QGraphicsWidgets).
The dump() function, while implemented, doesn't do anything by default
(#ifdef'ed out), so there's no point in adding actual dump() calls
here, either.
Remove this function as dead code.
Amends the start of the public history.
Pick-to: 6.8 6.5 5.15
Change-Id: I6d9d224945fab0f97db0c5ea7d13a7df6c8837b2
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 891473270869a29a6efb09962cf4cb19cc4d8d9e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The tests added parent-less QGraphicsWidgets to a
QGraphicsLinearLayout, which doesn't reparent them (and cannot,
because it doesn't have an item as a parent itself onto which to
reparent them), so the test functions leaked them.
The layout items, OTOH, do get reparented, and are therefore deleted
by the stack-allocated layout as its children.
Since there's thus no object that could naturally be a parent for the
widget items, allocate them on the stack. Since their number is
variable, use QVLA, whose constructor is able to create a ... wait for
it ... VLA of non-copyable-non-movable elements on the stack (we test
for this, also in Qt 5, see e7c792ba7179c4c81fb2e26f66031ec81234b0d7).
Amends the start of the public history.
Pick-to: 6.8 6.5 5.15
Change-Id: I9b0b65efbccd1fd7e708da4d12f746d942f602fe
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 374b9fd03145acac49a96abe81a253e9b482230a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The old code used a data-driven test to check that itemAt(i), 0 ≤ i ≤
2, was returning non-nullptr. It re-created the widgets and the layout
for each data tag anew, leaking the widgets by the way.
Using data-driven test machinery here is overkill. Remove it and
create the widgets in a C array on the stack, so they're not leaked,
and iterate over them using range-for.
Also check not just for nullptr, but also that the pointer matches the
widgets we put into layout, at the position we put them in.
Amends the start of the public history.
Pick-to: 6.8 6.5 5.15
Change-Id: Ib808aa6756c6550a61a4768edfc5021f2f6ae3b3
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 159029b58753ad8a76eef9ea105275001a430ef2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QStyle objects aren't owned by widgets (or QGraphicsWidgets) they are
set on, so need to be deleted manually. The test function didn't do
that, so they style objects were leaked.
To fix, hold them in unique_ptrs. QStyle subclasses, even though being
QObjects, don't have the usual QObject *parent=nullptr constructor
parameter, so passing a QObject parent isn't an alternative, really.
Amends 66b7e7497c3b318dddeb91175d8f85f606c99eec.
Pick-to: 6.8 6.5 5.15
Change-Id: I6c43264760f7126610fe51f72e74ec341bd2e3d7
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit dd9a94a3b32327b4e0f2aaca55cd987a71dd2878)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The test function leaked all the items it created.
Unless I renamed the object and kept the pointers to them by their old
names, any fix would touch every line, anyway. The former would be
pretty contrived in such a short function, so port the complete test
to stack-allocated objects, which is how this function would have been
written today.
Amends the start of the public history.
Pick-to: 6.8 6.5 5.15
Change-Id: Ia8a67825d3a80be4574b7779c2105d53003b9e69
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 64060cbeae86b2bfeccc6fc18df56cd1e829b0e7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QGraphicsView, being a QWidget, needs to have a parent or be manually
deleted. The test function did neither, so leaked the view.
Fix by allocating it on the stack.
Amends 913ff732004c2c61c39bcdd82ff05ea1827f328b.
Pick-to: 6.8 6.5 5.15
Change-Id: If012d4b833849285b62e2a4b4089457c2aef1d88
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 9bab38b1330a4106e920b66538e4e14b795d33e2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
I honestly didn't bother to figure out the ownership relationships
between these items; the QGraphicsView docs don't help much:
> The layout takes ownership of the items. In some cases when the
> layout item also inherits from QGraphicsItem (such as
> QGraphicsWidget) there will be a ambiguity in ownership because the
> layout item belongs to two ownership hierarchies
but asan said that the AnimatedLayoutItem objects were leaked, so hold
them in unique_ptrs now.
Amends the start of the public history.
Pick-to: 6.8 6.5 5.15
Change-Id: Icd0eabc4129b57251bbec7f8e3752f99ee584cf3
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit f3a02fe39d8d0bfea8fa0f087bb95c6e65d77b45)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Several test functions use a centrally-allocated QSplitter for their
tests. This object was allocated in initTestCase(), but
cleanTestCase(), while present, was empty, so nothing deleted the
object again.
Fix by deleting the object in cleanupTestCase(). Initialize the member
variable to nullptr so that the delete is well-formed even if
initTestCase() for some reason didn't run (or didn't run to
completion).
Amends the start of the public history, where this function read
#if defined(QT3_SUPPORT)
delete qApp->mainWidget();
#endif
which was already leaking if QT3_SUPPORT wasn't defined.
Pick-to: 6.8 6.5 5.15
Change-Id: I43e5d8921a9c097f252e11709f25bc622fc8fe15
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit fbaa37633580dcf6b8ec3cd4a0da8d85902de2ea)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Depending on whether QSplitter::replaceWidget() succeeds or not, we
need to delete either the return value (an unparented QWidget) or the
argument (another QWidget without parent). The test function only
deleted the return value.
Use a unique_ptr for delayed automatic deletion at the end of the test
function, which is the minimally-invasive fix. Use it for both
candidates, which ensures that either one of them is reliably deleted,
even if a QCOMPARE() fails in-between.
One check before we reset(newWidget) is special: if (!res) fails, then
the reaper contained something we also need to delete, and the reset()
will do that, but code checkers (e.g. Coverity) are known to complain
about using a pointer value after a delete, so split the check into
the check and the QVERIFY().
Amends 2c634a132696376a0a0d7641bf05ae875c50190e.
Pick-to: 6.8 6.5 5.15
Change-Id: I8571477d9e53b85b2db041d7c9bdf2bd7aa69906
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 4513d48490f39c805644ea01a5a8e9a16d51764b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The documentation now explicitly explains that the XML declaration is
not a processing instruction according to the XML 1.0 Specification and
the W3C DOM Level 1/2 Core specifications. It advises against using
createProcessingInstruction() to insert an XML declaration and
recommends QXmlStreamWriter.
This clarification aims to reduce confusion caused by the similar syntax
of processing instructions and the XML declaration.
Fixes: QTBUG-21166
Pick-to: 6.8 6.5
Change-Id: I630e0e73bc8e4b6f145cb1e771a0a6fec54543cf
Reviewed-by: Safiyyah Moosa <safiyyah.moosa@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit d2258328e39ab8695e8034fe85cec7a18884f6d2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
And take the opportunity to explain that the finished() signal does not
indicate the end of the operating system thread. Indeed, on some OSes,
not even wait() can be sure of that: for Unix systems, see the docs at
the top of qthread_unix.cpp about timed pthread_joins.
Pick-to: 6.8
Fixes: QTBUG-135163
Change-Id: Ie00a742f0707f57c767bfffd44bdaec40df05e4a
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Andreas Eliasson <andreas.eliasson@qt.io>
(cherry picked from commit de90f2e064ffef2ed751b7805d81a93668dc67a2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The old code used XOR to combine hash values, but XOR is a bad combiner,
since it's mixing the bits insufficiently (XORing the same value again
will e.g. undo the original change).
This is a private class, so there are no users outside of Qt that would
have inlined this qHash() function; therefore, we are free to change the
algorithm.
Change-Id: I7970e52ef4bd3b6a2248fffda0d4d75eb4afdf5a
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 7bf9beb300db40835464c5b82da83cd8d49573c9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The FreeBSD-specific pdfork() code in forkfd_freebsd.c code was failing
to build because convertForkfdWaitFlagsToWaitFlags() wasn't
defined. That function is behind a check for #ifdef HAVE_WAITID, which
is only defined if _POSIX_VERSION is 2008 or later. That macro has been
stuck at 2001 for the past 23 years. I can't explain how this code
compiled with FreeBSD 14.1 and earlier, because I am sure it was using
pdfork().
So just #define HAVE_WAITID for FreeBSD. It must have been there since
much earlier than 13.0, but that seems like a reasonable starting point
today.
We also need to #include <sys/param.h> to have the __FreeBSD_version__
macro, something that also wasn't needed in earlier versions. It was
probably indirectly #include'd by something.
Pick-to: 6.8
Change-Id: I262d9922128d046221b7fffd0ec481bc0012f55c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
(cherry picked from commit 729a6f56d08e3440f18704c1cf0b5672c0b90419)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Both fillFromStatBuf() and fillFromStatxBuf() had copies of the parsing
of the st_mode / stx_mode field. This deduplicates them and sets up for
when/if other OSes get a statx() system call similar to Linux's.
Change-Id: I7c80d121c21b76d78b81fffd172d205287b595d9
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit e86b970ea4a299c444a12fb9a087909e4b7374cf)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
After finding the end marker `---`, the code expected more characters
beyond: typically at least a trailing newline. But QStringView::sliced()
crashes if asked for a substring that starts at or beyond the end.
Now it's restructured into a separate splitFrontMatter() function, and
we're stricter, tolerating only `---\n` or `---\r\n` as marker lines.
So the code is easier to prove correct, and we don't need to check
characters between the end of the marker and the end of the line
(to allow inadvertent whitespace, for example). If the markers are
not valid, the Markdown parser will see them as thematic breaks,
as it would have done if we were not extracting the Front Matter
beforehand.
Amends e10c9b5c0f8f194a79ce12dcf9b6b5cb19976942 and
bffddc6a993c4b6b64922e8d327bdf32e0d4975a
Credit to OSS-Fuzz which found this as issue 42533775.
[ChangeLog][QtGui][Text] Fixed a heap buffer overflow in
QTextMarkdownImporter. The first marker for Front Matter
must begin at the first character of a Markdown document,
and both markers must be exactly ---\n or ---\r\n.
Done-with: Marc Mutz <marc.mutz@qt.io>
Fixes: QTBUG-135284
Pick-to: 6.8
Change-Id: I66412d21ecc0c4eabde443d70865ed2abad86d89
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 25986746947798e1a22d0830d3bcb11a55fcd3ae)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit eced22d7250fc7ba4dbafa1694bf149c2259d9ea)
QDateTime::{to,set}TimeSpec and QTimeZone::setOffsetFromUtc()
shouldn't be referenced in docs aside from their own; they are
deprecated from 6.9.
Fixes: QTBUG-135238
Pick-to: 6.9.0 6.8
Change-Id: I835cfaa888dd3079f96719cd1c413dc7c2796fdb
Reviewed-by: Magdalena Stojek <magdalena.stojek@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 8c943392ae2ae554e496f11d9a3dd6c2c2e762e3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The search for a base theme was handled in 2 separate loops.
Combine those in sync with QGuiApplication.
Make list of theme names const, as it doesn't and mustn't change.
Pick-to: 6.8 6.5
Task-number: QTBUG-134702
Change-Id: If4ae8212bbefa2934639feec983b94e8e2d6b168
Reviewed-by: Jan Grulich <jgrulich@redhat.com>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 63ba867dddd5bfe3827f48eb24884c534c80541a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Finding a platform theme for the list of theme names happened in two
separate loops. The first loop checked for a platform theme plugin, the
second for a platform integration plugin. In case a theme name was
passed from the environment (with the -platformtheme command line
argument or by setting QT_QPA_PLATFORMTHEME), it was ignored if it was
a platform integration plugin and a platform theme plugin was found
in the first loop.
Combine both loops, in the assumption that the list of theme names
is always correctly prioritized.
Pick-to: 6.8 6.5
Fixes: QTBUG-134702
Change-Id: I2703236dc0f406aeb48529f8e53de76c394b7172
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 8ede178fd3427233ce368a2f69363a30a9468215)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Retain elements when storing them in the cache, so that they only get
destroyed when they are neither stored as rows/columns, and removed
from the cache. If storing an element in the cache replaces a different
element with the same ID, release that before retaining the new one.
Give the insertElement() function a bool return value so that callers
know whether the element has been retained, so that they can correctly
release their own reference.
Release elements when they are removed from the cache so that it's
easier to see that the calls are balanced. For that to work, forward
declare QMacAccessibilityElement as an NSObject type.
A special case are place-holder cell elements. Those are not inserted
into the cache until the interface is requested, so when those get
inserted into the cache, we don't have a local reference to release -
it's the reference held by the rows/columns array.
However, we don't want stale elements in the cache, so when we release
the rows and columns arrays, also remove all cell entries from the
cache. Otherwise we end up with stale elements reporting outdated
values.
As this might invalidate references that our test object holds,
refresh the test object when triggering a model update.
Amends 1f7e926411d1e0d958c37dc597f24101d410c46b.
Pick-to: 6.8
Fixes: QTBUG-134784
Change-Id: Ib3cce35058e4c80e3edc97ae578584610ee93487
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit b1ed5f656f064e553b33752f8e87d2f5b9553e38)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The feature doesn't require library nor dlopen support, even for
input context plugins (which work fine in static builds).
Task-number: QTBUG-135146
Pick-to: 6.8
Change-Id: Id171fccffa78f2d8233d800a6ea3469e9f440f79
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 5901f0ba09e4df91be3767badd8252cbdfed28e8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QSplitter::replaceWidget() is decumented to un-parent and return the
original widget (the one that the newWidget) replaces, so the caller
of the function is responsible for deleting it, which the test
function neglected.
Fix by storing the returned object in a unique_ptr for delayed
deletion at the exit of the function. This is the minimally-invasive
change.
Amends fb56a0f2ce34e95d955095c01ecf2943046be85e.
Pick-to: 6.8 6.5
Change-Id: Ia63ebfde59b1c5ef8ddb6c3f3ab10b28d5bf6cff
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit f9d9630e9ec4963b779ed98b9fc50ac03c9156d6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
In the underline drawing code in QPainter there were
some issues causing
First of all, if an underline was very thick, then we would
still just offset the drawing by 0.5 (as if it were 1 pixel
wide) causing part of the underline to appear on top of the
text. The shift here is intended to move the top edge of the
underline to the top edge of the pixel where we want to
draw it, so we need to offset it by half of the actual line
thickness.
In addition, fractional line widths look bad when drawn with
aliased painting, which is the default. Depending on where
the text would be, the thickness of a line might vary. Even
if it's very close to an integer, e.g. 1.04 as in one case,
then it will still sometimes fill two pixels if it happens to
be placed directly between them. To ensure that we always fill
the same number of pixels, we round the line thickness to
nearest integer when antialiasing is not enabled.
Pick-to: 6.8
Fixes: QTBUG-134626
Change-Id: I95bae3ac16010fc133995e5f9b6c2e5d022e3743
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
(cherry picked from commit 2b5533af920726723479557356f56d0778bcabd3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
source_to_proxy (called by mapFromSource) was unconditionally
creating a mapping for the parent of the given source index,
even if that parent is in fact filtered out in the proxy.
That mapping would then just say "-1" for the (also filtered out)
child row.
Afterwards, inserting a visible child (which makes the parent visible,
in a recursive QSFPM) would see that the mapping for the parent
already exists and fail to update it properly.
Various symptoms could ensue, such as an out-of-bounds access in
gm->proxy_rows.at(source_parent.row()) in a subsequent call to
can_create_mapping (as I had on KMail startup for years, randomly) or
a visible child that fails to appear (as in the unittest).
Fixed by using create_mapping_recursive() which returns 'end' if
the row is filtered out, going up the tree if necessary to
create mapping for parents on demand (so that the call to
filterAcceptsRow is cached).
Fixes: QTBUG-76976
Pick-to: 6.8
Change-Id: I25a3bf6b147092c1231ab6441e636264fd0c4222
Reviewed-by: Santhosh Kumar <santhosh.kumar.selvaraj@qt.io>
(cherry picked from commit 90a82ad8e59792fb430a1a11c9a0c2f94878303e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The function can be called from ~QDialog(), in which case a cast of
q_ptr to QErrorMessage is UB.
Says UBSan:
errormessage.cpp:33:5: runtime error: downcast of address 0x7fff5089a6e0 which does not point to an object of type 'QErrorMessage'
0x7fff5089a6e0: note: object is of type 'QDialog'
00 00 00 00 30 74 4e 6a 12 7f 00 00 80 aa 00 00 90 61 00 00 08 76 4e 6a 12 7f 00 00 00 00 e0 1a
^~~~~~~~~~~~~~~~~~~~~~~
vptr for 'QDialog'
#0 0x7f1267ce7d12 in QErrorMessagePrivate::q_func() qerrormessage.cpp:33
#1 0x7f1267ce7d12 in QErrorMessagePrivate::setVisible(bool) qerrormessage.cpp:410
#2 0x7f1267caaa25 in QDialog::setVisible(bool) qdialog.cpp:757
#3 0x7f12654efb28 in QWidget::hide() qwidget.cpp:8179
#4 0x7f1267caa239 in QDialog::~QDialog() qdialog.cpp:398
#5 0x7f1267ce72f8 in QErrorMessage::~QErrorMessage() qerrormessage.cpp:287
Fix by casting at most to QDialog* (QWidget* would actually have
sufficed).
Add a code comment.
Amends e0bb9e81ab1a9d71f2893844ea82430467422e21 (I think; it might
have been present in a different form before that).
Pick-to: 6.8 6.5
Change-Id: I61a8692f073c2d2f379ea02fa580f7fe46691c1c
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 0e322aa41984fb8f6259ca8249fdfff6c3ea7e13)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Same problem as in 49a87936ef50acb1ab7156809bf5f85671d36f24, same fix:
hold the result of createTouchDevice() in an owning pointer.
Amends d15d9d49ac1e5120c052bb6c7e8bac5350eea357.
Pick-to: 6.8 6.5
Change-Id: I348336d82c167d95545c9e3d46e7479606605df9
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 4981333ff3f8a5826a21ebf14c4f1e097a4d03dc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Similar to 5be58ac9271555eed3a2884d827f30c164d2277d for tst_QWidget,
this test leaked the result of QStyleFactory::create() and the fix is
the same: cache across the test function calls. This time, it's for
performance; there's like 50 different data tags for this function...
Amends a8723871ee7125b97ce5467b94198e93a528c960.
Pick-to: 6.8 6.5 5.15
Change-Id: I95cc1dc4459489904f3a5e0347570eb07ccdfde8
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 44a2d8cc2066a6230bc26d78070e75e3f19c7832)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The old code created the top-level widget on the heap, without a
parent, so the test function leaked it.
Fix by creating on the stack instead.
This means we need to move the definition to before that of the child
button box (itself created on the stack), to avoid the double-delete
that would happen if the automatic parent would delete its QObject
child and then the compiler deletes the child again because it, too,
is an automatic variable. If, OTOH, the parent is declared before the
child, the child will have unregistered itself from its parent when it
was deleted.
Amends bbb71e7e80f292c2e69faef81b1624832981147e.
Pick-to: 6.8 6.5
Change-Id: I9489daace3bbbeecfaedcb5780a6b29a82c8d4ff
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 8352112e580bad1e95de39088d673d0d8954119f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
A QButtonGroup does not own the buttons it contains, so this test
function leaked the button, despite a thing called "ButtonDeleter".
That thing doesn't _actually_ delete the button, it merely removes it
from the group.
To prevent the code from instilling same confusion in the next reader
as it did in this one, inline the whole thing and condense it down to
a single connect() statement, using a lambda.
Sometimes, another level of indirection (or two) does _not_ solve
problems...
Amends the start of the public history.
Pick-to: 6.8 6.5 5.15
Change-Id: I0002f0dd86d505d1aa089d696776051fddbf4c1e
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit bfefcec65045ab52a705d0bf5a4eef845d63dbe8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
While a QButtonGroup is-a QObject, unless it has a QObject-parent, it
won't be deleted by, say, the parent of the buttons it contains, so
this test function leaked the QButtonGroup.
Fix by giving it the dialog as parent. This is just a QObject
parent-child relationship; it does not change the behavior of the
button group, nor the dialog, except that the latter now deletes the
former as its QObject child when it itself it deleted.
Amends e7cff5bca7aefaea63e80598babf6bd7917aa1c3.
Pick-to: 6.8 6.5 5.15
Change-Id: Ic633179252c72e7ee47a57be73944a6aa589637b
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit ccd0ea0b4e402f02dee73c211d62cef70d3e001f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QCoreApplication::sendEvent() does not take ownership of the event,
postEvent() does, so this test function leaked the QKeyEvent it
created on the heap.
Fix by creating it on the stack instead. Add a scope to limit the
lifetime of the event object to just the sendEvent() call.
Amends the start of the public history.
This doesn't completely make the test asan-clean, it still suffers
from the QScroller::grabGesture() leak (QTBUG-135055).
Pick-to: 6.8 6.5 5.15
Change-Id: I8c93e03b2ea919ab80a1d508f008853779eb89af
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 0e314d34340b65f88ba5d0e6f04f844813188281)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Nothing was setting its proposedAction() and dropAction(), but they
were read in QGraphicsScenePrivate::cloneDragDropEvent(), leading
UBSan to complain about reading an invalid value for that
enum. Interestingly, Valgrind didn't find this issue, probably because
of the strong security options we're now activating by default for a
Qt build (stack protector, trivial-auto-var init, ...).
Says UBSan (excerpt):
qgraphicssceneevent.cpp:1591:15: runtime error: load of value 3200171710, which is not a valid value for type 'DropAction'
To fix, explicitly set the two properties on the locally-created
QGraphicsSceneDragDropEvent. I didn't go the way of "fixing" this by
initializing the members in QGraphicsScenePrivate, because the rest of
the test doesn't trigger any other error, so Qt itself is
well-behaved, and proactively initializing stuff prevent tools from
noticing inconsistencies.
Amends the start of the public history.
Pick-to: 6.8 6.5 5.15
Change-Id: Ibc9663e8afcd1f7ff9d0e3c646f70e0ceded67a9
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
(cherry picked from commit c0dbfe6c8776fb2f8ca1d7051a605329a9764b83)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The old code cast the event to QTouchEvent* ahead of checking that it
actually is of a type() that suggests is-a QTouchEvent.
I'm not sure this was UB, because we weren't dereferencing the result
until after we checked type(). Then again, who am I to argue with
compiler writers (= same people that write ubsan)?
Says UBSan:
qstandardgestures.cpp:402:29: runtime error: downcast of address 0x7fffedb894f0 which does not point to an object of type 'QTouchEvent'
0x7fffedb894f0: note: object is of type 'QEvent'
ff 7f 00 00 c0 db 01 cf 99 7f 00 00 15 00 00 00 01 00 00 00 01 00 00 00 99 7f 00 00 b6 c4 14 f5
^~~~~~~~~~~~~~~~~~~~~~~
vptr for 'QEvent'
Fix my delaying the cast until after we know that event is-a
QTouchEvent. All other recognize() overload already behaved correctly.
As a drive-by, use auto (RHS contains the type) and mark the result
const.
Amends the start of the public history.
Pick-to: 6.8 6.5 5.15
Change-Id: Ifa9e940232b93b2ecf666c35536519a8385c9800
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 03daf6685eda50d79b9b4598ebf6c301def73daa)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The TreeModel class was lacking the destructor, so the m_root TreeItem
was never deleted (it was held in a non-owning pointer and had no
parent).
Instead of adding ~TreeModel(), port to holding m_root in unique_ptr
instead. This creates a bit more churn, but communicates intent
better, and makes sure the item is never without an owner.
Amends e74af68654c0eb127277c73e20bda409b83d157b.
As a drive-by, fix the indent of the else clause of a ternary.
Pick-to: 6.8 6.5 5.15
Change-Id: I2f5c8852b8bee89c63933c118a4599d6a17de8e2
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 7cf8b2d0303ea81a8e22fcaee7db7bb7303d0376)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
When, like in tst_QApplication::qtbug_103611(), a QApplication object
is destroyed without calling exec(), then QDesktopUnixServices leaked
its QDBusPendingCallWatcher, because the connection to the slot that
would deleteLater() the watcher was disconnected, and the watcher had
no QObject parent that would otherwise reap it.
Fix by actually deleting the watcher in ~QDesktopUnixServices(), if
it still exists (which implies disconnecting, of course).
This makes tst_QApplication asan-clean on Linux/X11 (was: "75466 bytes
leaked in 965 allocations").
Amends de609d84b9cee4a481d1718c00b09105d8c2ae69.
Pick-to: 6.8 6.5
Change-Id: I28a08abdb1be65a8746702ad304282de4e1100d7
Reviewed-by: Liang Qi <liang.qi@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
(cherry picked from commit 567da5e3e0070b7a0dd9ba1acbe9347c6cc1d0fe)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The commit that introduced the qt_saturate call did use that old
function in order to stay compatible with Qt 6.5, which never received
q26::saturate_cast. This patch ports to the new function in branches
that have it.
Pick-to: 6.8
Change-Id: Iadd9d2c92ea1e37095b71b1647db61dec2b8333a
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit b5a87a665cbb37a09e9750449f0d2980dd035464)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
When the test functions runs off the end (or returns from a failed
QCOMPARE/QVERIFY), `activeMenu` is destroyed while it's the
QMenuBarPrivate::activeMenu, and the following focusInEvent() on the
QMenuBar causes QMenuBarPrivate::setCurrentAction() to access
`activeMenu` when it has already ceased to be a QMenu.
Says UBSan:
qpointer.h:75:14: runtime error: downcast of address 0x7fff87934860 which does not point to an object of type 'QMenu'
0x7fff87934860: note: object is of type 'QWidget'
00 00 00 00 08 f1 0e be 17 7f 00 00 80 c8 00 00 90 61 00 00 b8 f2 0e be 17 7f 00 00 00 00 62 c6
^~~~~~~~~~~~~~~~~~~~~~~
vptr for 'QWidget'
#0 0x7f17baf57be5 in QPointer<QMenu>::data() const qpointer.h:75
#1 0x7f17baf57be5 in QPointer<QMenu>::operator QMenu*() const qpointer.h:83
#2 0x7f17baf57be5 in QMenuBarPrivate::setCurrentAction(QAction*, bool, bool) qmenubar.cpp:351
#3 0x7f17baf5a200 in QMenuBarPrivate::focusFirstAction() qmenubar.cpp:245
#4 0x7f17baf5b727 in QMenuBarPrivate::focusFirstAction() qmenubar.cpp:1260
#5 0x7f17baf5b727 in QMenuBar::focusInEvent(QFocusEvent*) qmenubar.cpp:1259
[...]
#34 0x7f17b93373d6 in QWidget::~QWidget() qwidget.cpp:1508
#35 0x7f17badb4658 in QMenu::~QMenu() qmenu.cpp:1789
Since I couldn't fix the problem on short notice, I created
QTBUG-135151 to track it.
For now, simply close the QMenuBar on all exists from the test
function to avoid this code path.
Task-number: QTBUG-135151
Pick-to: 6.8 6.5
Change-Id: Id8c9ee090d8bbc5ec22ce3f2ff7485766640ab43
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit 83af06b0e5d1ca3aa348debd39f88dfbdbf117b8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
So future-me and others don't have to look through the source code to
figure it out.
Pick-to: 6.8 6.5
Change-Id: I1f6e46cec256112226cad4d24ed52e4818635ae8
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit d2d74673f3dccc04894f2ea67fc7662cc6ef400b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
A QLayout that was removeItem()ed from its parent layout no longer is
deleted by it and has to be deleted manually, which the test function
failed to do.
To maintain the rest of the test function as faithfully as possible,
don't delete the layout right after the removeItem(), but delay until
the exit from the test function, using unique_ptr.
Amends 867c0b8d8a53974074b1fff5b132f3ae9f150066.
Pick-to: 6.8 6.5 5.15
Change-Id: Ia915d29bda348849033a6b9eb282dcb26a68c383
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 20d5a3cda94e474245351542eeac526a0f759a02)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QStandardItems that were taken out of their QStandardItemModel need to
be deleted by the caller, which this test function forgot to do.
Store the item in a unique_ptr, so it isn't deleted until after the
next populateModel() call. Deleting immediately may change what the
test function checks for.
Amends 6012285e7dedb4364e2db087b7d5cbfc2973320a.
Pick-to: 6.8 6.5
Change-Id: I45a0a2f598febc75fd9ef683525c973476dcd7e0
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit a8c55cb54767bd3519c91872b0d9992dcb9b13fd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
According to the XDND spec¹, the window-ID of an XcbFinished message
is in xclient.l[0]. That's Xlib terms, though. In xcb terms, it's in
xcb_client_message_event_t's data.data32[0]. This is how all QXcbDrag
functions handle it (e.g. move()), except handleFinished(), which
casts the uint32_t array to a (misaligned) ulong one.
¹ https://www.freedesktop.org/wiki/Specifications/XDND/#index29h3
(the fragment doesn't look like it's stable, it's the section
titled "XdndFinished (new in version 2)")
Says UBSan:
qxcbdrag.cpp:1051:12: runtime error: load of misaligned address 0x60400078ba9c for type 'const long unsigned int', which requires 8 byte alignment
0x60400078ba9c: note: pointer points here
c0 01 00 00 28 02 e0 08 01 00 00 00 c8 01 00 00 00 00 00 00 00 00 00 00 93 23 00 00 00 00 00 00
^
#0 0x7fa3ea3a957c in QXcbDrag::handleFinished(xcb_client_message_event_t const*) qxcbdrag.cpp:1051
#1 0x7fa3e9e20dec in QXcbConnection::handleXcbEvent(xcb_generic_event_t*) qxcbconnection.cpp:607
[...]
I have a hard time seeing how it could have worked in big-endian
systems. In LE ones, it only works because the high bits of l[0],
which come from data32[1], are stripped again when the value is
narrowed for passing to findTransactionByWindow(). But the 'if' before
_could_ mis-detect a zero xcb_window_t for a non-zero one if data32[1]
wasn't empty...
To summarize: this is a mess (that's a technical term).
Fix by removing the pointless cast, and just read data32[0], like
elsewhere in the file.
Amends c3f9de62966d32d8e33d62eb374fe2657a4cfebe(!).
Pick-to: 6.8 6.5 5.15
Fixes: QTBUG-127517
Change-Id: Ie7c3718bada52ff82c16f814eee8ec57248fbfbf
Reviewed-by: Liang Qi <liang.qi@qt.io>
(cherry picked from commit 6ac40faa80ed2faf92ec95759baf2fde7697c207)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The text interface, like textAtOffset, parses data coming
in from the user. Therefor tagging as security critical.
Task-number: QTBUG-134483
Pick-to: 6.8
Change-Id: I3c97813d4fba719e7972693510a0b9a78cb1348f
Reviewed-by: Lorn Potter <lorn.potter@qt.io>
(cherry picked from commit 26d950bb7790ab0b4822bfe91d2a6e3daf0cb3d8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
tst_QApplication::closeAllWindows() is blacklisted but does not seem
to fail anymore.
Unblacklisting the function.
Fixes: QTQAINFRA-6894
Pick-to: 6.8
Change-Id: Ia6157cc767a191121c4026f1c17edcad3b526d5c
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit f386f8326667589d9e446282972561cfae966611)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
If we build the specific module against installed Qt syncqt cannot
detect the installed module headers, since it only checks the build
paths. This adds the installIncludeDir argument for syncqt so it
now attempts looking for the included header file in Qt install path.
This will raise early warnings in Qt per-module builds too, but not
only when building top-level Qt or for non-prefixed builds.
Pick-to: 6.8 6.5
Change-Id: I5a28ec35a776b5b39f4a8923c9bf91e857f45e4a
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 5a93c457e5b7bdbd79144270ddceb60a6f36c6de)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QIconLoaderEngine::paint() was still using QIconLoader::pixmap() to
retrieve the pixmap for painting instead QIconLoader::scaledPixmap()
which takes the devicePixelRatio as additional parameter. In the case
of icon themes this could pick up the wrong pixmap (from the wrong
folder).
Pick-to: 6.8
Fixes: QTBUG-135159
Change-Id: I69ceada35f36c64675c4147cf284a180a4c69915
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
(cherry picked from commit c5c6df40bee57cc28427d36b4c7c6860ae14b722)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This will be used in a new manual test in qt5.git, to show progress of
long-running commands.
Store the diff in a new patches subdir, to make it easier to re-apply
when we update the file from upstream.
As a drive-by, store patches from the previous modifications that were
done before this change.
Pick-to: 6.8
Change-Id: Ib73908e20fac7fe0bd620400d483625238fa37d1
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Cristian Le <cristian.le@qt.io>
(cherry picked from commit d8caf6d89f662d4b3f0c0633fcce46e0f46ec5a7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Otherwise including only the private header leads to QT_CONFIG being
undefined.
Amends 38bb72720aef4caf3de6c1c68ab46435d7c8d65c.
Change-Id: I0960d38c98d64348ebf1cec481417bdb21eed9a6
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 7293f05380f945757b30dc2eb6d10f3f4a8ec884)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
It's easy to do and makes an unremarkable user error harmless.
In the process, add a comment to make QTBUG-112006 visible in the code.
Pick-to: 6.8 6.5
Fixes: QTBUG-135109
Change-Id: I6b9cb431bf5b005fc0f9cdbb5cf30c90fa1154c4
Reviewed-by: Dennis Oberst <dennis.oberst@qt.io>
(cherry picked from commit f68240616208f4388cc219d58d618184b5db82de)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The first-group minimum size limit is only relevant when there's
*only* one separator: a smaller group is allowed when there is a later
separator. QLocaleData::numberToCLocale() was, however, rejecting a
short first group without regard to what came later. Expanded two
grouping tests, that previously checked we *generate* correct strings,
to round-trip the strings and verify we get the right answer back.
Some of those duly failed. Fixed the parsing to check the right
condition on seeing a group separator.
That let valid groups get accepted. In the process, added some
test-cases that we do correctly reject invalid forms. Made sure the
fix also gets those right.
Pick-to: 6.8 6.5
Task-number: QTBUG-134913
Change-Id: Ifa5351adba4eec232917a343d4a73fb4656d1d32
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 754666dbe8c897d16d453f96d6a1374a07462fd8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Although the number-parsing code to which the C-locale form is later
passed was already rejecting such malformed texts, it's better to
catch it earlier and to make the check overt in that parsing. Added
some tests cases that would fail if this wasn't checked; but they do
pass already in the parent.
Pick-to: 6.8 6.5
Change-Id: I5ef9e483317ce4dc519ddc7c4c016dcad5cb22c4
Reviewed-by: Dennis Oberst <dennis.oberst@qt.io>
(cherry picked from commit f1d48552e4dfbcdbfd060dd8dd924ae433e7f4c6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Thanks to Mate Barany for pointing out that the *_idx variables are
now all reduced to serving (via comparison with -1) as
booleans. Replace them with a "where in the parse are we ?" enum
variable and a "do we need some digits ?" bool.
Restructure to make that work. This needed to recognize (the letters
that make up) Inf and NaN so as to know when not to object to a lack
of digits. Since NumericTokenizer already has a matcher for those,
export its access to that as a public method and use that to simplify
its own uses of the matcher. Added some test-cases suggested by this,
that actually pass in the parent, as qt_asciiToDouble() could see the
result was malformed in any case, even when they weren't caught by bad
digit-group sizes (as "inf,000", "1,inf", "NaN,000" and "1,NaN" were).
Pick-to: 6.8 6.5
Task-number: QTBUG-134913
Change-Id: Ie1730530a4e34a76ba1836a25212e4ec27dad15f
Reviewed-by: Mate Barany <mate.barany@qt.io>
(cherry picked from commit d1879c3a399091693e690f970a113510e705d4d3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
It was a bit convoluted, making it hard to reason about parts. The end
of the whole number part can happen at the very end, after the loop,
or when we hit the exponent or fractional part. That means the check
of grouping rules at the end of the whole number part had to happen
after the loop as well as within it. To avoid duplication within the
loop, the handlingof exponent and fractional part was done within the
handling of grouping, reprising the exponent and fractional part after
they're handled earlier in the loop.
Package the decision-making for that handling in a lambda (and
document some relevant details there) so that the duplication is
harmless and move into the handling of the exponent and fractional
part separators, where it belongs. This lets the bulk of the loop body
simplify into a straightforward if/else-if cascade, making it easier
to reason about (in preparation for some imminent fixing of quirks and
corner cases).
Since reviewers needed to understand what the GroupSizes members mean,
in order to make sense of this, I've also added some comments to the
struct's declaration to at least let future readers know what's what.
This refactoring should be harmless and change nothing; it is also
needed by an imminent fix, that I shall pick back into LTS branches.
Pick-to: 6.8 6.5
Task-number: QTBUG-134913
Change-Id: Ib352aa9ab8341914e40d9c087b497db15a180ebb
Reviewed-by: Mate Barany <mate.barany@qt.io>
(cherry picked from commit cdcaaaeee3e8526faee950036bef7e8efaa60e17)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The test checks that the destroyed() signal is emitted, even in
exceptional cases. It has three degrees of freedom:
- blockSignals() or not
- QObject* or QWidget* as the connect() sender
- slot in a child of the deleted object or in an unrelated object
(one of the latter caused a leak of the DestroyTester)
The code was very repetitive and one scenario may have been checked
twice (QObject*, no child, blocked signals), which probably means we
forgot another (didn't check).
Make the test data-driven, and DRY further using templates for the
QObject/QWidget cases.
The leak fix is to use unique_ptr to hold the QWidget, and a scope
guard to delete the DestroyTester. I didn't want to use QPointer (or
qdialog_p's QAutoPointer), because we're checking a mechanism that
strikes very close to QPointer, and we should not depend on knowledge
of the exact QPointer implementation to convince ourselves that we're
not testing the same thing twice here. Besides, by making the delete t
conditional, we can use ASAN to detect if we got the need to delete
wrong.
Amends e72e5aa83a0a287ea7e19158b39917eb3daef1d9.
Pick-to: 6.8 6.5 5.15
Change-Id: I3bac9f81c33a24e1096041dfc3323e079fd46f8a
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 780c67ad80035a7347818ff7d762e6d3975ead73)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The result of QStyleFactory::create() must be deleted by the caller.
Some test functions stored it in a QScopedPointer, while others
didn't, each causing a leak of a QWindowsStyle object.
DRY the test functions (except the one that checks that 'delete
widget.style();' works) by introducing an owning pointer at the test
class level, to be reused by test functions. This is not so much for
caching the object across test functions (though this is a nice
benefit, too), but in order to keep the owning pointer out of the test
functions, and allow most functions to just do
setStyle(deterministicStyle()).
Found by ASAN.
On my machine, this test is now ASAN-clean, except a) the usual
cp-demangle.c leak and b) destroyedSignal(), which still leaks.
As a drive-by, pass a QStringLiteral instead of QL1SV to
QStyleFactory::create() and port one QVERIFY( != ) to QCOMPARE_NE().
No amends, it'd be too many. Not picking back far, because others
don't care, and I expect lots of conflicts when backporting, due to
many different amended commits.
Change-Id: Ie9e7faf21bc177e08af56c659dc58870ad3cf6ff
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 5be58ac9271555eed3a2884d827f30c164d2277d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QAIM::createIndex() takes a const void* pointer, so we don't need to
const_cast the const away.
Amends the start of the public history.
Picking all the way back, because I'm hunting a memleak here, and
can't say, yet, whether these lines need to be modified or
not. Besides, this change is 100% safe: either it compiles and works
as before or it doesn't compile. There is no silent breakage possible.
Pick-to: 6.8 6.5 5.15
Change-Id: I2f9284540beed9d1ab027ac1e24f1c527537e122
Reviewed-by: Robert Löhning <robert.loehning@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 9f2db4acd7d063b884cf3ad4f085f1644ba925db)
Reviewed-by: Daniel Smith <daniel.smith@qt.io>
In QtWindow class, the Touch Event coordinates were increased by Layout
position. That allows to move to global coordinates.
In the same time, in 15674f4ce9ea455b47f68d8871d5676d7a731630 commit, we
started mapping coordinates of Touch Event to Global position. That
cause the issue with incorrectly handled touches for example with
QDialogs.
To avoid this issue, we will stop modify Touch Event position in JAVA
code. We will send only localPosition to not make transformation twice.
With this change, all events received from JAVA have local position of
their window.
Pick-to: 6.8
Fixes: QTBUG-130576
Fixes: QTBUG-127925
Change-Id: I6b58e0369959840f869e31a3d96425c64507b39d
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
(cherry picked from commit 23fd2cfb015226d6894b9cbe5fa50b43f0134e99)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
In the touchAdd method, the mapped touch point is divided by the
platform integration screen size.
In order not to mix different coordinate systems, we should use
platformWindow to correctly calculate global position of touch event.
Pick-to: 6.8
Task-number: QTBUG-130576
Task-number: QTBUG-127925
Change-Id: Ic7653a60fb3def181f29a3e28b963878dc54a99e
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 01d25533b4f3c63c0484930e06664ad61ce24748)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Amends ceb859bf036dfdd1c54eec403006eac62a0d09b8
We'd accept negative values and keep counting downwards, reaching 0
again only after a full underflow[*]. Effectively, this meant that a
negative value was the same as zero, so this makes the behavior
explicit. The commit introducing checked_var_value() said in its
changelog:
For compatibility reasons with previous
versions, if the variable is set to any non-empty and non-numeric value
different from 0, Qt will understand as "stop on first warning".
Negative values are not "non-empty and non-numeric", so this commit
chooses to make the current behavior explicit.
[*] atomic under- and overflows are defined behavior, but only if the
atomic operation is the one producing it. The current code is doing the
subtraction by itself in the call to testAndSetRelaxed(), so underflows
are still UB. If/when this is replaced by atomicMutate, that might
change (and note to self when implementing that!).
Pick-to: 6.8
Change-Id: I594ed31f1cc7fc04ea98c6e86bdcaa3a4aa59114
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit c8ecd0eb22d5f2578439b8fed4db8879a91cb026)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Amends commit b933a5668cc5647d26378f8a9a52901d0497585d ("Make sure we
don't count down past 0 QT_FATAL_CRITICALS"), which introduced the CAS.
Apparently it was a design decision then that only one thread would call
qAbort(), while the others would happily continue. For example, for the
common case of QT_FATAL_WARNINGS=1:
// T1 T2
v = n.loadRelaxed() // v = 1
v != 0 // true
n.testAndSet(v, v - 1, v) // n = 0
v = n.loadRelaxed() // v = 0
v != 0 // false
return v == 1; // false
This commit changes that design, for two reasons. First, a semantic one:
if one thread has detected a fatal condition, it must be equally fatal
for all threads. Second, we must accept a meaningful time between the
detected condition and the call to qAbort() and thus the time until its
effects take. In the worst case scenario, T1 could get suspended
indefinitely, at which point T2 having concluded that warnings weren't
fatal will happily execute forever. [This could happen *because* of
having called abort(), and though that's a SW bug elsewhere, we should
not let our other warnings and criticals continue.]
The fix is simple: we never decrement from 1. That way, if multiple
threads start their verification at the same time, they will all see the
value 1 and will all abort. The abort() standard library function is
thread-safe, as our replacements for it.
Pick-to: 6.5 6.8
Change-Id: I03fbcbac26bd1f34d631fffd43bb9c27d51783d0
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 6e37cd4176368bee838161f5353038027bcdbe50)
Reviewed-by: Daniel Smith <daniel.smith@qt.io>
The view that's being created in init() is not a
protected_QHeaderView, but only a "normal" QHeaderView, so casting it
to protected_QHeaderView is not valid.
Says UBSan:
tst_qheaderview.cpp:3338:37: runtime error: downcast of address 0x604000087050 which does not point to an object of type 'protected_QHeaderView'
0x604000087050: note: object is of type 'QHeaderView'
00 00 00 00 d8 d2 e6 0b b2 7f 00 00 80 88 00 00 c0 61 00 00 08 d6 e6 0b b2 7f 00 00 00 00 be be
^~~~~~~~~~~~~~~~~~~~~~~
vptr for 'QHeaderView'
Fix using the usual trick: forward-declare tst_QHeaderView and make
QHeaderView itself befriend it directly.
Amends bff78163f6dc83d833b2097a51453523cfa7b00b.
tst_QHeaderView is now asan/ubsan-clean, except for some signed
overflows in calculateAndCheck(), filed QTBUG-135201 to track it.
Pick-to: 6.8 6.5 5.15
Change-Id: I718695bef26e72f442bd677c6bad05bab561163f
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
(cherry picked from commit 8beaab9483405603ffb17a3472bef8dd088227ff)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
I have no idea why setOffset() would accept all int values, but
tst_QHeaderView::getSetCheck() checks the function with both INT_MIN
and INT_MAX (albeit without having show()n the object it so tortures),
so try to make it work(-ish).
0 - INT_MIN overflows, of course, so use saturation math to calculate
the result. This might not scroll to pixel precision, but it couldn't
have done so before, either (no int value can possibly represent the
mathematical value, otherwise it wouldn't have overflown). But at
least we now don't run into UB anymore.
Said UBSan:
qheaderview.cpp:418:9: runtime error: signed integer overflow: 0 - -2147483648 cannot be represented in type 'int'
#0 0x7f183ffa4a5f in QHeaderView::setOffset(int) qheaderview.cpp:418
#1 0x55f5ca56a5fe in tst_QHeaderView::getSetCheck() tst_qheaderview.cpp:437
While q26::saturate_cast was only picked to 6.8, its predecessor,
qt_saturate(), was picked to 6.2, so use that, for now, and port to
q26::saturate_cast in a follow-up.
As a drive-by, mark ndelta const.
Amends the start of the public history.
Pick-to: 6.8 6.5
Change-Id: I118c917ccd588c0b6d407090609f4d17075bbab6
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 03d1e81516be9af37fa08900f9a2d88d34abc4df)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Says UBSan:
qabstractitemview.cpp:4442:18: runtime error: downcast of address 0x604000026790 which does not point to an object of type 'QAbstractItemView'
0x604000026790: note: object is of type 'QWidget'
00 00 00 00 08 b1 cf 9f 33 7f 00 00 80 24 00 00 60 61 00 00 b8 b2 cf 9f 33 7f 00 00 00 00 be be
^~~~~~~~~~~~~~~~~~~~~~~
vptr for 'QWidget'
I did not reserch what the problem was that the code comment referred
to, but we now have QWidgetPrivate::get() (incl. in 5.15), so use
that.
Amends the start of the public history.
Pick-to: 6.8 6.5 5.15
Change-Id: If658d21694f6806eafdf678b8d5ff7ed62e93513
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
(cherry picked from commit 3b3b5968d0a51a1aa3a402f8e042f3a5a2c3329e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
After removing the QTreeWidgetItems from the QTreeWidget, they have no
parent anymore, and so no-one deletes them and they're leaked.
Add a vector<unique_ptr> to hold such items until the end of the
function. This is the minimally-invasive fix. If we were to delete the
items right after removeChild(), we might be changing the test, and if
we deleted them only at the end of the function, we'd still be leaking
them on a failed QCOMPARE().
Amends 1d799e91082092821a04885bd9d069febefc37da.
This doesn't completely fix tst_QAbstractItemView; it still suffers
from the QScroller leak, QTBUG-135055.
Pick-to: 6.8 6.5
Task-number: QTBUG-135055
Change-Id: I2d3c661d5331ae33bb945f850fccdaa934f7a2dd
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
(cherry picked from commit 9ea9818eeb29e79e7f12505a21669902d443dc1f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QObject parents own their children, but not the other way around. So
the parent-less QWidget *parent created on the heap was leaked.
To fix, create it on the stack instead, but for that to work, it must
be declared _before_ its eventual child, otherwise the parent would
delete the child as a QObject child, followed by the compiler deleting
the child as an automatic variable = double-delete.
Amends ab536c3c71deaaa3b67ca87c47628355d9f348e8.
Pick-to: 6.8 6.5 5.15
Change-Id: Ibccf229fc056665e3b854e1a94e1f4b5bf7a89e1
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
(cherry picked from commit 3c7719f2c248a2710c75fa47e12759188abf673d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QLineEdit::setCompleter() doesn't reparent the completer under the
line edit, so this test function leaked the object (and with it,
"22260 byte(s) leaked in 214 allocation(s)"; seriously, what does a
QCompleter do with 20+KiB of memory!?).
Fix by giving the completer the line edit as parent.
Amends 24859d7deaf995e992f0d9439a1c476126d5f654.
Pick-to: 6.8
Change-Id: Ic14a32c982dd4c75ae527188e53a7f20af714038
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
(cherry picked from commit bdd2cefcf3236279986191f5d76a0af19d4d3a2b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QActions can be added to many widgets at the same time, so addAction()
doesn't reparent them.
Having no (QObject) parents, the QAction objects in this test were
consequently leaked.
Fix by giving them parents.
Passing `this` would have worked, but has the drawback that if you run
the test twice (by naming it twice on the command line), actions with
identical shortcuts would accumulate and potentially change the
result. Therefore, add an automatic QObject to act as their
parent. This is the minimally-invasive fix.
Amends 198225983df9f402bb368b449f1abeea95ff0dce.
Pick-to: 6.8 6.5
Change-Id: I59881b10076ba790502483242f620aeed3e99575
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
(cherry picked from commit ad0d6be77814dcf484f87a1d89bb30b6652dff92)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QActions and QMenus can be added to several widgets, so addAction()
and addMenu() don't transfer ownership of their argument.
Having no (QObject) parents, the QMenu and QAction objects in this
test were consequently leaked.
Fix by giving them parents.
Amends 493a85a9e468874471057910a61e7c54a45eee83.
Pick-to: 6.8 6.5
Change-Id: I2c48a55de26c5ed487d2e42e50e0b2fbb6ddf98c
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
(cherry picked from commit 850d352111d618539d5659e139cfae9f2124fc3c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
C:/qt/qtbase/src/3rdparty/D3D12MemoryAllocator/D3D12MemAlloc.cpp:144:32: error: unknown warning group '-Wnonnull-compare', ignored [-Werror,-Wunknown-warning-option]
144 | #pragma GCC diagnostic ignored "-Wnonnull-compare"
| ^
C:/qt/qtbase/src/3rdparty/D3D12MemoryAllocator/D3D12MemAlloc.cpp:9902:9: error: 'this' pointer cannot be null in well-defined C++ code; comparison may be assumed to always evaluate to false [-Werror,-Wtautological-undefined-compare]
9902 | if (this == NULL)
| ^~~~ ~~~~
C:/qt/qtbase/src/3rdparty/D3D12MemoryAllocator/D3D12MemAlloc.cpp:10053:9: error: 'this' pointer cannot be null in well-defined C++ code; comparison may be assumed to always evaluate to false [-Werror,-Wtautological-undefined-compare]
10053 | if (this == NULL)
| ^~~~ ~~~~
C:/qt/qtbase/src/3rdparty/D3D12MemoryAllocator/D3D12MemAlloc.cpp:10118:9: error: 'this' pointer cannot be null in well-defined C++ code; comparison may be assumed to always evaluate to false [-Werror,-Wtautological-undefined-compare]
10118 | if (this == NULL)
| ^~~~ ~~~~
4 errors generated.
This amends 84fb0de413ec574aab778d863c56e0d9a7f7ef6e .
See also
* https://clang.llvm.org/docs/DiagnosticsReference.html
* https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html
Pick-to: 6.8
Change-Id: I2c8d27ade8a123bc4ff2fa5082e161c042335c6c
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
(cherry picked from commit 34be5083bddffc38b3034ac8a04b5b6b698d5e4e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
With current CI Android emulation this test seems to pass.
Does not seem to be flaky either.
Fixes: QTQAINFRA-6336
Pick-to: 6.8
Change-Id: I863b2744a63b5f90fcc42570945f3f761a3da021
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 9d507910db679a150f1f06f93d617346dde08f9d)
The function is located in public CMake commands and should be '_'
prefixed.
Amends a905d26f14da1cf86b8490331c0cc41c2a45b283
Pick-to: 6.8
Change-Id: I2817105de4e60d9e5d9a65479af2d11ac6406dae
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit be5845e8ca8d4a8d5b9606295b672b591c660a01)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This regex pattern instructs QDoc to not include the matching warning in
its warning count. The warning has changed to a report, however, which
won't count towards the warning count in any case, so the regexp isn't
needed anymore.
Task-number: QTBUG-131459
Task-number: QTBUG-134219
Pick-to: 6.8
Change-Id: Ic461c63b62bd25fb2d1f3b485c46db55e52e20cf
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
(cherry picked from commit a8dab8590a611ed570d937754a66497bc88d4e49)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The namespace contains traits to check for presence and noexceptness
of compareThreeWay() overloads. One of those overloads, the (raw) ptr
one, is deprecated, and therefore throws a warning when one of these
traits hits it. But this is beside the point, because it's not
actionable by the user.
Fix by wrapping the whole namespace in QT_WARNING_DISABLE_DEPRECATED.
This fixes one of the two remaining -Wdeprecated warnings in
tst_qcompare (which the test tries its best to defend against, by
using QT_WARNING_DISABLE_DEPRECATED around the lines, too, but it
didn't help in this case), namely this one:
qcomparehelpers.h: In instantiation of ‘constexpr bool QtOrderingPrivate::CompareThreeWayTester::compareThreeWayNoexcept() [with LT = int*; RT = int*; typename std::enable_if<hasCompareThreeWay_v<LT, RT>, bool>::type <anonymous> = true]’:
qcompare.h:689:91: required from ‘auto qCompareThreeWay(const LT&, const RT&) [with LT = int*; RT = int*; typename std::enable_if<disjunction_v<QtOrderingPrivate::CompareThreeWayTester::HasCompareThreeWay<LT, RT, void>, QtOrderingPrivate::CompareThreeWayTester::HasCompareThreeWay<RT, LT, void> >, bool>::type <anonymous> = true]’
tst_qcompare.cpp:847:5: required from here
qcomparehelpers.h:1229:34: warning: ‘constexpr Qt::strong_ordering Qt::compareThreeWay(const LeftType*, const RightType*) [with LeftType = int; RightType = int; typename std::enable_if<disjunction_v<std::is_same<T, U>, std::is_base_of<Container, T>, std::is_base_of<U, T> >, bool>::type <anonymous> = true]’ is deprecated: Wrap the pointers into Qt::totally_ordered_wrapper and use the respective overload instead. [-Wdeprecated-declarations]
1229 | { return noexcept(compareThreeWay(std::declval<LT>(), std::declval<RT>())); }
| ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
qcomparehelpers.h:999:31: note: declared here
999 | constexpr Qt::strong_ordering compareThreeWay(const LeftType *lhs, const RightType *rhs) noexcept
| ^~~~~~~~~~~~~~~
The last warning actually pertains to the body of qCompareThreeWay()
calling Qt::compareThreeWay() on pointers. Even though we try to
suppress that one, too, for testing purposes, it's not clear how it
can be fixed without hiding it for all users of qCompareThreeWay(), so
this is left for another day.
Amends 3d231e27a8c38f8e840e161e76be3a153d6b0aa9.
Pick-to: 6.8
Change-Id: Id434629435ea8ea89d03e46096866283ab792b54
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 75e10a0656eca0fb8dee71be1ad504707be1f9b1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
In Qt 5 we would ask FreeType for height metrics. FreeType
always returns rounded metrics, so for e.g. DejaVu Sans at
pixel size 21 it would return ascender=20 and descender=5,
which is actually incorrect, since the actual ascender is
19.49. The descender is rounded correctly. This is likely
due to the use of fixed point math internally.
In Qt, we would account for this error by setting the
leading to -1, so that the rounded height still becomes
24. (This is also technically incorrect, since the line gap
of the font is 0.)
In Qt 6, we got the same fixed point rounding error (so
ascender becomes 20 instead of 19), but we didn't account
for the error, so we would end up with lines that were 25
high instead of 24.
To reduce the chance of getting this error, we do the full
metrics calculation in floating point numbers instead. For
the case in question, we will then get arounded ascender of
19 and descender of 5, giving us a height of 24.
Fixed point numbers are still used for storing the results,
so while it's less likely, we could still end up with the
same error. Therefore, we also apply the same trick as in
Qt 5 when this occurs: Adapting the leading of the font to
account for the rounding error if it occurs.
[ChangeLog][QtGui][Text] Fixed an issue where the line
distance for hinted fonts would be off by one for specific
sizes of some fonts.
Fixes: QTBUG-134602
Pick-to: 6.8
Change-Id: I09f1806199b7b2b02a932bb65fe4da055bd60f51
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
(cherry picked from commit 3728032e03b3bf95daa7115c734173a0070d85c8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The former is deprecated.
Change-Id: I94de7a6c6bbea61cd75820389e8039cb92c7ee6a
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
(cherry picked from commit 600388ff2ad24408d64ed5ea8fc1b793f6398f28)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
XdgDesktopPortal requires a base platform theme, which is created in
its c'tor. If XdgDesktopPortal was shipped as a plugin of its own,
it would find itself as a plugin, create itself as its own base theme
and thus end up in an infinite loop.
Factor out the key check from main.cpp as a static bool in
QXdgDesktopPortalTheme.
Ignore XdgDesktop keys when scanning for plugins suitable as a base
theme.
Fixes: QTBUG-134703
Pick-to: 6.8 6.5
Change-Id: I4aab1e77a48251581369f371e4c9af308ef0a02b
Reviewed-by: Liang Qi <liang.qi@qt.io>
(cherry picked from commit 3404a1491eaba482544cd0588c94fd29a69e1cc0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Use std::as_const() for a QStringList in a ranged for-loop.
Use auto * for a pointer.
Pick-to: 6.8 6.5
Fixes: QTBUG-134702
Change-Id: Ia092933fe959afdd6b6e0a9743e3603c29b291d8
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Liang Qi <liang.qi@qt.io>
(cherry picked from commit 22e05d74b2d01cc49c2893f66824d6e229558320)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The feature is required to check if gl_sampleID etc are available in the
fragment shaders.
Task-number: QTBUG-134999
Change-Id: Id26c75780011a7553d332ae22e69aab632891998
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
(cherry picked from commit 86e3573671ec3ea919e534957bf9dc320f853575)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The function can be called from ~QDialog(), in which case a cast of
q_ptr to QFileDialog is UB.
Says UBSan:
qfiledialog_p.h:78:5: runtime error: downcast of address 0x7ffe7a8ad5a0 which does not point to an object of type 'QFileDialog'
0x7ffe7a8ad5a0: note: object is of type 'QDialog'
fe 7f 00 00 30 44 d8 fb d2 7f 00 00 80 b4 00 00 90 61 00 00 08 46 d8 fb d2 7f 00 00 00 00 00 00
^~~~~~~~~~~~~~~~~~~~~~~
vptr for 'QDialog'
#0 0x7fd2f96d7587 in QFileDialogPrivate::q_func() qfiledialog_p.h:78
#1 0x7fd2f96d7587 in QFileDialogPrivate::setVisible(bool) qfiledialog.cpp:860
#2 0x7fd2f95465f5 in QDialog::setVisible(bool) qdialog.cpp:757
#3 0x7fd2f6d88768 in QWidget::hide() qwidget.cpp:8179
#4 0x7fd2f9545e09 in QDialog::~QDialog() qdialog.cpp:398
Fix by casting to QFileDialog only on show() (in createWidgets()), not
hide(), and otherwise cast at most to QDialog* (QWidget* would
actually have sufficed).
Add a code comment.
Amends e0bb9e81ab1a9d71f2893844ea82430467422e21 (I think; it might
have been present in a different form before that).
Pick-to: 6.8 6.5
Change-Id: I4e206f7c36c03e8cb8a36001beae283628960073
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit a6743bd3c787e03d2ee3b791260e21e539131181)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The handleDragEnterEvent() function is not only called for
QEvent::DragEnter, but also, in handleDragMoveEvent(), for
QEvent::DragMove, in which case the fully-derived event passed as an
argument is a QDragMoveEvent, and not its subclass QDragEnterEvent.
Code in Qt seems to assume that it's ok to cast an object down to a
more-derived class than the most-derived dynamic type, as long as no
extra state is being added between the two, but C++ does not chare
that view.
Says UBSan:
qwidgetwindow.cpp:1000:38: runtime error: downcast of address 0x7ffe7b34c6e0 which does not point to an object of type 'QDragEnterEvent'
0x7ffe7b34c6e0: note: object is of type 'QDragMoveEvent'
00 00 00 00 e0 62 70 42 aa 7f 00 00 3d 00 00 00 00 00 00 00 00 00 00 00 00 c0 58 40 00 00 00 00
^~~~~~~~~~~~~~~~~~~~~~~
vptr for 'QDragMoveEvent'
Furtunately, handleDragEnterEvent() doesn't actually need its argument
to be a QDragEnterEvent; QDragMoveEvent suffices, so we can just
change the argument type back to QDragMoveEvent and remove the cast in
handleDragMoveEvent().
Add a bit of \internal docs to describe the discrepancy between the
function's name and argument type.
Amends f8944a7f07112c85dc4f66848cabb490514cd28e.
Picking all the way, because this is risk-less: Either the code compiles
and then it works as before (minus the UB), or it doesn't compile.
Pick-to: 6.8 6.5 5.15
Change-Id: I5be53b023d389902b43e9a896d074edea1c4ff2d
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit e89c0a7fb54a15b8df1d2938e2f01ef14f3bf7e5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
WorkerThread needs an explicit constructor, otherwise
WorkerThread *workerThread = new WorkerThread(this);
will fail. While at it, at some infrastructure code so that the
.cpp file actually compiles.
Change-Id: I35835b1be3da2a1f75222594197f6013b41a7b4a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 68a16558171abccd15f5446ac208e105cf337dc0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Use the original functionality as the fall back solution for
the introduced by CMake 'file(CONFIGURE' command.
Pick-to: 6.8
Change-Id: I2be7e3bf80a577cdf8292c9f47bb127fa71615b6
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit ec5f4fe580975594edcf7cff42433526a6ec43ba)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The logic is generic, make it accessible from the function.
Pick-to: 6.8
Change-Id: Ib361399722dba689891d301e20b3f713450e676f
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit cda51bcd9cdffc7f5541f1bba90dc608575fb07b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Return the androiddeployqt TARGET, which can be used in custom commands
or if the target doesn't exist, fall back to old approach and use
the full path to the host androiddeployqt. If both are not found,
encourage users to reinstall Qt or report the bug.
Pick-to: 6.8
Change-Id: I9f487b0f0af8703a9387b9c0cf8baae47859658e
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 2c86eaee49ff2e02129b00ec86157aa3166d6f06)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The genex will be generic, so make it accessible from function.
Pick-to: 6.8
Change-Id: I83246890e2d81f3cdbbd8fe2b93d59968623a889
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 9819e9c2e0928094ffbb4daba3f01d8e04570b00)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Swap the argument order so the "output" is the first argument.
Pick-to: 6.8 6.5
Change-Id: I1325af97f1d6540c6897b51f1b5736b4534f6412
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit b434e0be797f8e347d58077b8ef21086d7a7d055)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Adjust the function name according to our naming convention for
private function locating in public cmake scripts.
Pick-to: 6.8 6.5
Change-Id: I3a108cdb43bd4b3d8cf29ac4c42c7c20c541afc8
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 2adf9410607ec14a56fe1ac2eefa53bf4bb4e646)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Since the deployment config type detecting is generic, move it a
separate function.
Pick-to: 6.8
Change-Id: If925b6e14ba0d64a003e7f9ae2a5d701b7886920
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit f10f609db9488629a1abf8c363f32dbd3abdf456)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The test function didn't delete the heap-allocated QGraphicsScene,
because, a comment indicated, there was some "corruption in scene
destruction".
Fix the memleak by creating the scene object on the stack. A local
asan+ubsan build is clean, and so is a valgrind run, so whatever it
was, it seems fixed by now.
Amends the start of the public history.
Picking back to verify that it's been, indeed, fixed in all active
branches.
Pick-to: 6.8 6.5 5.15
Change-Id: Ic7f96c7195d58ccbff45b17f76fb2babd1c1b648
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
(cherry picked from commit 429338154540f92a3efdbe8813a41f98dddeaa08)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The test function created QGraphicScene objects on the heap, but never
deleted them. They were added to a View, yes, but a view doesn't own
the scene it renders, so this didn't help.
Fix by creating the scenes on the stack instead.
Amends the start of the public history.
Pick-to: 6.8 6.5 5.15
Change-Id: I939e028dbfd68b216ef67c3773f085ba98817b05
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
(cherry picked from commit d8b79dc1c949cd4cb5472f53545fbdd94f6e5b3b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The test had it the wrong way around: it deleted the QWidget it had
added to the QGraphicsScene, which thus becomes the widget's owner,
but left the scene itself undeleted, leaking it and all the items (but
not the widget ;-)).
Create the scene on the stack, so it's deleted by the compiler, and
release() the widget into the scene.addWidget() call. Since
QScopedPointer::take() is deprecated, port to std::unique_ptr.
Amends the start of the public history.
Pick-to: 6.8 6.5 5.15
Change-Id: Idbf821a35a7db802a68923fc09b185ddc3181245
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
(cherry picked from commit fdcf54062cfd372d528948da4637b98b403e174e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
A QGraphicsScene owns the items added to it, but if we later
removeItem() one again, then we're also responsible for freeing the
item. The test functions didn't do that, so we leaked the item.
In order to not change the rest of the functions by deleting the item
earlier than it had been before, install a qScopeGuard() to delete it,
right after we removed it from the scene again.
Amends the start of the public history.
Pick-to: 6.8 6.5 5.15
Change-Id: I8ab50626a0b5d52825bb329233ab8efe6c1291dc
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 3651769d52108b01b142a3bcaae530e949eafa68)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
A view doesn't own the scene it renders, because scenes can be in
multiple views. So if the test function doesn't delete `anotherScene`,
no-one else does, either.
To fix, allocate it on the stack (like `scene`), and not on the heap.
Amends the start of the public history.
Pick-to: 6.8 6.5 5.15
Change-Id: I2f0bfc5dfafd68a347553335f5ac5f2d081d56ad
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 0617d177ac9d584ed6e5298e0fbe1a78ea682ce9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The items were not added to any scene, so nothing ever deleted them.
Hold them in unique_ptr, taking care to delete the parent, if any,
last, even though it was created after its child.
Amends the start of the public history.
Pick-to: 6.8 6.5 5.15
Change-Id: I9980530efb3386e15b81232e526a1d8d3bb3c36d
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
(cherry picked from commit 284283c5b286a5265d8408b543de8314f7b1aa47)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The result of QTest::createTouchScreen() needs to be deleted by the
caller, and this test didn't do that.
To fix, put the object into a unique_ptr.
Amends 982b70d37db337b2c57a3cfce0f24c3d00a598d6, though the code it
replaced seems to have had the same problem.
Pick-to: 6.8 6.5 5.15
Change-Id: I361a0b37b717ac543b003fb48a4a6934b6d79a03
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
(cherry picked from commit e9a7c4a224a5859fb954b149ea0a0d3b0e4ada13)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The function can be called from ~QDialog(), in which case a cast of
q_ptr to QFontDialog is UB.
Says UBSan:
qfontdialog_p.h:43:5: runtime error: downcast of address 0x604000026b90 which does not point to an object of type 'QFontDialog'
0x604000026b90: note: object is of type 'QDialog'
00 00 00 00 30 a4 26 31 45 7f 00 00 80 b9 00 00 90 61 00 00 08 a6 26 31 45 7f 00 00 00 00 be be
^~~~~~~~~~~~~~~~~~~~~~~
vptr for 'QDialog'
#0 0x7f452ecad24d in QFontDialogPrivate::q_func() qfontdialog_p.h:43
#1 0x7f452ecad24d in QFontDialogPrivate::setVisible(bool) qfontdialog.cpp:959
#2 0x7f452ea2b5f5 in QDialog::setVisible(bool) qdialog.cpp:757
#3 0x7f452c26d768 in QWidget::hide() qwidget.cpp:8179
#4 0x7f452ea2ae09 in QDialog::~QDialog() qdialog.cpp:398
Fix by casting at most to QDialog* (QWidget* would actually have
sufficed).
Add a code comment.
Amends e0bb9e81ab1a9d71f2893844ea82430467422e21 (I think; it might
have been present in a different form before that).
Pick-to: 6.8 6.5
Change-Id: Ic1a63ff02b1a1435499a6980772b1b75236f31f7
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 41480dbd4abadf13c26e487ae23ce681866b6af3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The function can be called from ~QDialog(), in which case a cast of
q_ptr to QColorDialog is UB.
Says UBSan:
qcolordialog.cpp:72:5: runtime error: downcast of address 0x7ffd37909750 which does not point to an object of type 'QColorDialog'
0x7ffd37909750: note: object is of type 'QDialog'
fd 7f 00 00 30 34 6e 35 4a 7f 00 00 80 b9 00 00 90 61 00 00 08 36 6e 35 4a 7f 00 00 00 00 f2 a6
^~~~~~~~~~~~~~~~~~~~~~~
vptr for 'QDialog'
#0 0x7f4a32e8738a in QColorDialogPrivate::q_func() qcolordialog.cpp:72
#1 0x7f4a32e8738a in QColorDialogPrivate::setVisible(bool) qcolordialog.cpp:2154
#2 0x7f4a32ea5675 in QDialog::setVisible(bool) qdialog.cpp:757
#3 0x7f4a306e7768 in QWidget::hide() qwidget.cpp:8179
#4 0x7f4a32ea4e89 in QDialog::~QDialog() qdialog.cpp:398
Fix by casting to Qcolordialog only on show() (in initWidgets()), not
hide(), and otherwise cast at most to QDialog* (QWidget* would
actually have sufficed).
Add a code comment.
Amends e0bb9e81ab1a9d71f2893844ea82430467422e21 (I think; it might
have been present in a different form before that).
Pick-to: 6.8 6.5
Change-Id: I006406b6cf1012fc3c7a910abcfe14bc119a2b29
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 0be1ca029cc21e72d9f5408dea99722fba9bc321)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The result of QTest::createTouchScreen() needs to be deleted by the
caller, and this test didn't do that.
To fix, put the object into a unique_ptr.
Amends 982b70d37db337b2c57a3cfce0f24c3d00a598d6, though the code it
replaced seems to have had the same problem.
Picking all the way back, since this code hasn't changed in ages, and
so conflicts are unlikely. Also, there appears to be a remaining leak
in QScroller::grabGesture(), and we don't know, yet, how far we'd pick
that one, but verifying it will likely be helped by the test not
otherwise leaking. Filed QTBUG-135055 to track the issue.
Pick-to: 6.8 6.5 5.15
Task-number: QTBUG-135055
Change-Id: I6ab3402671f768c6a33b682d456145f18629e6cb
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
(cherry picked from commit 49a87936ef50acb1ab7156809bf5f85671d36f24)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The function can be called from ~QDialog(), in which case a cast of
q_ptr to QMessageBox is UB.
Says UBSan:
qmessagebox.cpp:182:5: runtime error: downcast of address 0x7ffdccfbda00 which does not point to an object of type 'QMessageBox'
0x7ffdccfbda00: note: object is of type 'QDialog'
88 7f 00 00 30 94 4a 73 88 7f 00 00 80 8c 00 00 90 61 00 00 08 96 4a 73 88 7f 00 00 00 00 fb cc
^~~~~~~~~~~~~~~~~~~~~~~
vptr for 'QDialog'
#0 0x7f8870f9a8a3 in QMessageBoxPrivate::q_func() qmessagebox.cpp:182
#1 0x7f8870f9a8a3 in QMessageBoxPrivate::setVisible(bool) qmessagebox.cpp:1660
#2 0x7f8870c6b3b5 in QDialog::setVisible(bool) qdialog.cpp:757
#3 0x7f886e4ad4b8 in QWidget::hide() qwidget.cpp:8179
#4 0x7f8870c6abc9 in QDialog::~QDialog() qdialog.cpp:398
Fix by casting to QMessageBox only on show(), not hide(), and
otherwise cast at most to QDialog* (QWidget* actually suffices).
Add a code comment.
Amends e0bb9e81ab1a9d71f2893844ea82430467422e21 (I think; it might
have been present in a different form before that).
Pick-to: 6.8 6.5
Change-Id: Ia163483c1998924a0d9c9fd589311af24a93d1fe
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 8b4900bffff3386e108847c9e1ffe9a15e05e5d3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Update the macro so that where the supported ndk version is referenced
in docs are updated in all places used.
Pick-to: 6.8 6.5
Task-number: QTQAINFRA-6479
Change-Id: I93164f2ec48c71ab99ee2ccba02f6adb0ac4dd89
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
On Windows the "interface" is defined as "struct".
Pick-to: 6.8
Task-number: QTBUG-122980
Change-Id: I1a80c9e40d59449bb3c3773679a95405ea39d630
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 23a4b586f7137a86028e731dbaf800b1ebcf738a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
So it's easier to find in the IDE, as otherwise everything is
"main.cpp".
Change-Id: I8d4663c84603113376a1fffd2f78f87635f3310f
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit 037f6be4280ed73a3fd53ca55fb38ad10b0db3ab)
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
QComboBox destroys the container of the view in its own destructor,
before the QWidget destructor is entered. The container is a toplevel
widget, so destroying that will destroy a platform window, triggering an
accessibility update cycle that calls back into Qt. As the QComboBox has
not yet reached the QWidget destructor, it still considers itself as
visible and focused. The accessibility query will therefore operate on
it, as the focused object. Probing the state accesses the view.
The view however is already partially destroyed, as the container's
destruction has already passed the QWidget destructor deleting all its
children. As a result, we are returning a pointer to a QAbstractItemView
that's already in the QWidget destructor, resulting in a crash.
Options for fixing this would be resetting the view pointer in
~QComboBoxPrivateContainer to nullptr and to test for that in client
code. Doing that triggered crashes in tests, as QComboBox::view() so far
has never returned a nullptr no matter the state of the combobox.
So instead, close the container explicitly before destroying it. This
way, any update cycle resulting in reentrancy (such as accessibility of
backingstore flushing when the container closes) will be completed
before objects are destroyed.
This amends fde358dd9069d0695f113ec6ba98efebedd1e520, which added the
explicit destruction of the container, for similar reasons.
This seems to be a combobox-specific problem due to the combination of
explicit destruction of (toplevel) child widgets, resulting event
processing, and exposing of internal widget states through public API
as part of the widget's accessible state.
Pick-to: 6.8 6.5
Fixes: QTBUG-132310
Change-Id: I74df5b71906ce8153b12ddc35b897a44e7752907
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 74e5a51babe0a133ce0fe9b907ef77cc606fbcb9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Older CMakes error out with
CMake Error at cmake/QtSyncQtHelpers.cmake:156 (list):
list sub-command REMOVE_ITEM requires two or more arguments.
if the last expanded variable is empty.
Fix by doing an explicit non-emptiness check.
Amends e7834e90f38891382f830da7700f00ebd81f21a8
Pick-to: 6.8
Task-number: QTBUG-134672
Task-number: QTBUG-128730
Change-Id: I3c355a02519c2c450235770b2ff8c92416615a9f
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 9ff4b5341fc30a6154e20d7c83a35f594c7ec92b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
`git-review` is a command line tool for interacting with Gerrit.
Some IDEs offer support for this tool, either natively or through
plugins. The tool relies on a configuration file, .gitreview. Adding
this configuration file to our repositories simplifies initial setup
for contributors that use the tool directly or through their IDE of
choice.
The configuration file adds a remote called 'gerrit'. This is the
default for the tool, and also the name set for
codereview.qt-project.org by Qt's `init-repository` script. Thus,
the configuration should work seamlessly alongside other repository
helpers.
Task-number: QTBUG-132604
Pick-to: 6.8
Change-Id: Ic14f4ac93dae34701e2a35b1802ab2d7b740985e
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
(cherry picked from commit bf15cf1cfa9cf7ac15f521fa417b07dea9bb3ac7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Coverity complained that the default ctor didn't initialize its two
members. This is true, and it even remains true if the user of the
type explicitly asks for value-initialization (ChangeSignal s = {}) as
opposed to default-construction (ChangeSignal s;).
Remove the default ctor as the minimally-possible fix. It was only
needed because of a call to QFlatMap::value(1-arg), which,
incidentally, constitutes a double-lookup, because it is following a
contains() call. Replacing that combo with find() and it.value()
avoids the double-lookup and removes the need for the type to be
default-constructible.
Amends 0328e4297e339de8a2acd84979c667936f6fadf8.
Coverity picked this up as a new issue following
53fb13456fffe8bfd192f9197c6d1703854b49a2, so there probably is another
CID for this for the same code in the old location, but my Coverity
search-foo is insufficient to find the corresponding CID, without
undue effort, so I didn't try.
Manual conflict resolution for 6.9:
- tracked contents from qdbuslistener* back into qgenericunixthemes.cpp,
whence 53fb13456fffe8bfd192f9197c6d1703854b49a2 moved them.
Coverity-Id: 478089
Pick-to: 6.8 6.5
Change-Id: I912bf2af343b98fe62faf2d4bf8a6d1f385593e8
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit d624454586bc040c381091f45ca43dcb43f7112c)
Since the label of a progressbar is drawn right of the bar, it does not
make sense to draw a label for vertical bars. This is consistent with
windows and windowsvista style.
Pick-to: 6.8
Fixes: QTBUG-132459
Change-Id: I6610a1ef1b4074a6301aac12928c1dfe99ffd457
Reviewed-by: Wladimir Leuschner <wladimir.leuschner@qt.io>
(cherry picked from commit a37606310e397e13dba223dc858555c9f26ce9b6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Qt relies internally on connections to the destroyed() signal of
application-objects, for example to clean up accessibility interface
implementations or other data structures that would otherwise grow or
hold danging pointers.
The QObject::disconnect function is already documented to be potentially
dangerous, as a wildcard call (with signal, receiver, and method
defaulted to nullptr) will disconnect everything. However, what happpens
to work in one Qt release might break things in another if we add code
that relies on connections to destroyed().
To make users aware of the danger of a wildcard disconnect call, and to
help with fixing the issues that might arise, emit a warning when a
wildcard disconnect() breaks an existing connection to the sender's
destroyed() signal.
Do this while we hold the connection mutex, and only if all parameters
to the disconnect() call are wildcarded. This happens very rarely, and
should never happen in performance critical code.
Fix the only test I found emitting this warning due to a wildcard
disconnect (the drag'n'drop subsystem relies on the destroyed signal).
Store the only relevant connection instead so that we can disconnect
when done.
Fixes: QTBUG-134610
Pick-to: 6.8
Change-Id: I9e6dcade0d5572345b71e3e8f06902bbea1ef89a
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit a79d5b8d0856a8f6c4de56a8d982c84ea20905a6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Since the introduction of QPageRanges with Qt6, multiple/arbitrary page
ranges are broken in the unix implementation of QPrintDialog due to a
possible double application of the page ranges: on the application side
and on the server side with CUPS. Reason for this is that the
QPrinter::PrintRange is set to PageRange instead of AllPages.
The latter is needed when relying on the CUPS server-side page range.
However, the server-side page range is always applied later on.
Restore the behavior of Qt5 and set the PrintRange to AllPages for
multiple/arbitrary page ranges and rely on the server-side filtering
with CUPS.
Pick-to: 6.8
Change-Id: I1b85552a8cf2509b11a81db028f957584043f3ee
Reviewed-by: Albert Astals Cid <aacid@kde.org>
Reviewed-by: David Faure <david.faure@kdab.com>
(cherry picked from commit 2428cbf44e3e2aa4eaf00c9548ac5a74685101c4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The windows vista style modifies the palette for a QCommandLinkButton to
match the vista style. For windows11 we simply use the same color as for
a normal button so no need to modify the palette is needed.
Since the vista style does not reset the palette on style change, the
wrong color is still used in the widgetsgallery example when switching
from vista to win11 (or fusion).
Pick-to: 6.8
Task-number: QTBUG-130480
Change-Id: I963215295ee1d2e483b5b58045752474c920c64b
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Wladimir Leuschner <wladimir.leuschner@qt.io>
(cherry picked from commit 6e8b6250e73c90d1e37a8ae65ad22bc4143f6b85)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
removed_api.cpp included qabstractitemmodel.h unconditionally.
Wrap it in #if QT_CONFIG(itemmodel)
As a drive-by, add the missing blank line after the initial
#if QT_CORE_REMOVED_SINCE(6, 8)
Amends cbda9583521633fa6e8a9274d2e47aa14c8bd175.
Pick-to: 6.8
Change-Id: I6888d9a76078a2473a0a8f063cf8b93ac3025385
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 32d23904b29fcab0d7dfca3d6ac9b97563ba88ff)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Added an extra condition to only show the window (without activation)
if Qt::WindowDoesNotAcceptFocus flag is set. (Mostly from qml)
Fixes: QTBUG-130912
Change-Id: I6b7a9cd03d726315b8531600c6a8b33436a3348b
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit cf9c94e85160a9d0f03e284ff92995900076faee)
Reviewed-by: Morteza Jamshidi <morteza.jamshidi@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Generate and install the HostInfoConfigVersion file for the
HostInfo package. The package had no strict version compatibility
as Qt modules before, so we avoid adding them here too.
Pick-to: 6.8 6.5
Change-Id: Iaee43639dd87d911946c8ce72c4849f43599d08e
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit fc956519963ea962b93367523a9761f07dd16be7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Explain that the continuation should take QFuture<T> as a parameter in
order to be able to access all results.
Add notes with examples to the QtConcurrent::mapped and
QtConcurrent::filtered overviews.
Task-number: QTBUG-133522
Pick-to: 6.8 6.5
Change-Id: I65655aadc8d4623b147d22a9bf9b2189c80b14c5
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 4b18a8946bac34143a5eb85e669be01b8ced32fc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The code comment above the cast is correct, but the code wasn't: While
we're receiving the result of the cast in a QDialog pointer, the cast
is still to QMessageBox*, and whether that cast is in the Q_Q macro or
not doesn't change the fact that it's invalid.
Says UBSan:
qmessagebox.cpp:2804:31: runtime error: downcast of address 0x7ffebfd87140 which does not point to an object of type 'QMessageBox'
0x7ffebfd87140: note: object is of type 'QDialog'
2b 7f 00 00 30 94 57 b9 2b 7f 00 00 80 8c 00 00 90 61 00 00 08 96 57 b9 2b 7f 00 00 00 00 d8 bf
^~~~~~~~~~~~~~~~~~~~~~~
vptr for 'QDialog'
The trivial fix is to cast only to QDialog.
Amends 29b2506e8cf0c792821a3ddb28e62080cd66ae28.
Pick-to: 6.8
Change-Id: Ia3f6c08b62f6bed274f43baab881a0d802bd986b
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
(cherry picked from commit f4dd7e29a68c4439e3da40db4eb2d67999d316b0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Using Q_DECLARE_OPAQUE_POINTER means that the metatype system won't have
any knowledge about the type, beyond it being a pointer. That leads to
all kinds of unexpected errors in code that needs to introspect the
meta-type information to handle QObject's and gadgets, notably but not
limited to QML.
Warn about using Q_DECLARE_OPAQUE_POINTER for gadgets and QObject's, and
offer Q_MOC_INCLUDE as a potential alternative for some use cases.
Pick-to: 6.8 6.5
Task-number: QTBUG-127012
Task-number: QTBUG-134883
Change-Id: I4fe53f277d0aa51ef552d04f642364aa6613ef7c
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
(cherry picked from commit 0a567a7f926f433cbd1294131aac0e80dcfd7943)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Show the color that is dragged in, both graphically and textually.
Revert to default palette for other data types. Prioritize colors
over text: if an application (such as kolourpaint) offers both x-color
and text, the color is probably the intention, and the text may be
just a hex string for placing into a color text field.
Pick-to: 6.8
Fixes: QTBUG-134313
Change-Id: I6c19f1220712881d2057bc9758bbc8cbd9247c81
Reviewed-by: Liang Qi <liang.qi@qt.io>
(cherry picked from commit 1750acc3921148b0ffc8f9f1421b87a2f5522a2e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This reverts commit fd9c9788f73cb088229701dd92443aa04005a4a3.
This change failed to consider the fact that color fonts may
also contain non-emoji characters and can be used for regular
text. In this case, it very much makes sense to support
subpixel positioning.
If needed, a more specific optimization can be made for emoji
characters later, but for now we just revert to fix the
regression.
Task-number: QTBUG-134626
Pick-to: 6.8
Change-Id: I07fece03d02b62811c2def26c19c5225a08a0037
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
(cherry picked from commit e72b2f19300f5a5e2b4c58926024ba332d65e75c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Writing "adjusted()" would have produced a link automatically, but
since an argument is present, the function name is not a link. Add it
manually. Omit the parentheses and the argument, because that's how
QDoc renders "adjusted()", too (only the function name is the link).
Amends 1aa4ad46e4878072be9acb8389572e7f9e8198df.
Pick-to: 6.8 6.5 5.15
Change-Id: I350a277f91e486256ca014e554beea3348b6ca96
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 39aac934387afe3b50c1dff4c739080202a7a4df)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Coverity complains that the binary search algorithm can yield high =
32, which, when passed to primeForNumBits(), will overflow
prime_deltas[]. This is true, for negative 'count', or, more general,
if the MSB of 'count' is set.
Add a Q_ASSERT(count >= 0) to inform Coverity (and other readers of
the code) that this function is only expecting non-negative arguments.
Amends 4adf5e1a9ef4fe78f4b70b7462943246903f4f11, which didn't fully
solve the issue, at least not as far as Coverity is concerned.
Pick-to: 6.8 6.5
Coverity-Id: 11295
Task-number: QTBUG-134543
Change-Id: I994dd1d1850c6644188a9fc0b83973614dd51e6b
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
(cherry picked from commit 536cd1ce20a59e4daaf3a09c115f2dc5ad9cbf91)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Some VxWorks touch device drivers return improper value of min and max
ranges in both axes (both 0 for both axes). This makes any touch point
position equal to (0, 0), making touch unusable in Qt.
[ChangeLog][Platform Specific Changes][VxWorks] The user can now
override touch ranges that the driver returns, by setting the
new parameters "rangex" and "rangey" on the environment variable
QT_QPA_VXEVDEV_TOUCHSCREEN_PARAMETERS with comma-separated
min and max touch ranges for X and Y axis respectively.
For example, add rangex=10,815:rangey=15,1024
Task-number: QTBUG-115777
Change-Id: I4f4aba7ee66e76b80438888697f84c4db9896c3d
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
(cherry picked from commit 276ccda2f3e96984b392c0429a5da8b804baacdf)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The related functionality meant to be enabled by BuildInternals, which
makes the lookup of the pre-defined HostInfo version based on either
calculated or pre-defined INSTALL_CMAKE_NAMESPACE.
The PROJECT_VESION(_MAJOR) meanwhile is hardcoded by the current Qt
repo, which is not necessary aligned with BuildInternals/HostInfo.
Pick-to: 6.8 6.5
Change-Id: I61052c93ce2d6ee3c6d8025da2e078edcde48d0d
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 56ec6b4843ff1e3763ad9cb608acfb21ea4db341)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Avoid hardcoding the HostInfo package version, use the
INSTALL_CMAKE_NAMESPACE as the reference for the find_package calls.
If we assume that the package follows the versioning in the future,
we should consider the Qt version, to avoid any version related
issues.
Pick-to: 6.8 6.5
Change-Id: If84550ab82f8de51ff5af41c7f31838c4ed53a67
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit a67c13d1a68db40d1c2e9f89bcc76aa244feb8d0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
[ChangeLog][QtCore][QCborValue] Fixed conversions from QVariant when the
variant contained long, unsigned long, or qfloat16.
[ChangeLog][QtCore][QJsonValue] Fixed conversions from QVariant when the
variant contained long, unsigned long, or qfloat16.
Pick-to: 6.8
Fixes: QTBUG-134756
Change-Id: I08d069dd639c0fc5a15afffd4067762ec94d606d
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 895b1c0ab358189dd3d7330207bbc69e36427350)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Needed to make some conversions explicit, since you can't assign to a
qfloat16 from double.
[ChangeLog][QtCore][QVariant] Implemented converting of qfloat16 to and
from the other numeric types, text conversions to and from QString and
QByteArray, and conversions to and from QJsonValue and QCborValue. This
should make qfloat16 behave the same as float and double.
Also flip the order of arguments in one of the addComparePairs(): left
side is actual, right side is expected. I noticed on the copy & paste
to do the qfloat16 above it.
Pick-to: 6.8
Task-number: QTBUG-134756
Change-Id: I6a6c469d21746a07c18efffd6b3b961c73c0e2f2
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit a4daf4939644ea3a087a8c03b1ec962e2e4defa8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
No-op change. All this does is explicitly wrap the right side of the
expression in a double() function-style cast.
Pick-to: 6.8
Change-Id: I84bc14bf75b4d0a046dcfffd19f318eaf7fe0e9f
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit ab45c44fb5471cef907334a1f6d7dbad279dd707)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This makes the tests more exhaustive than they were, with far less
repetition. Also adding the testing of conversions for which we don't
have a toXxx() getter, because those exercise different code paths
inside of QVariant, and yet should produce the same result.
Pick-to: 6.8 6.5
Task-number: QTBUG-134756
Change-Id: I99664a53da674bcbd992fffd5f290cfe51259d5b
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 42e0f9811095fc73c5c1209632247446e6229b3a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Currently the QWindow::devicePixelRatio() documentation mentions that the device
pixel ratio can change, but it does not explain how to track the changes.
This patch adds that the QWindow instance receives the event of type
QEvent::DevicePixelRatioChange when the device pixel ratio changes.
Fixes: QTBUG-128182
Pick-to: 6.8
Change-Id: I2107015a07f30167c9f7324959b47ada0a75988d
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit ada114f8b37b62fe80332105507b1afc20424aa6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
To suppress clang-tidy's
bugprone-pointer-arithmetic-on-polymorphic-object
because we store a dynamically allocated array of
QHttpNetworkConnectionChannel objects in QHttpNetworkConnectionPrivate
and index into this all over the code.
Pick-to: 6.8
Change-Id: Ibcdf7c8acc4a57eaf36bca3719733655053ac818
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Mate Barany <mate.barany@qt.io>
(cherry picked from commit 930dfd11dd7d8a0135c5d80d047b95bb8a55cbcd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This allows API users sending the HEADERS and DATA frames after the
SETTINGS ACK right from settingsFrameReceived slot, and keep the
expected frame order.
Pick-to: 6.8
Change-Id: I7900e786074d1d534c2e14f00e2aedf8dbb3a9d9
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit d3292dbeb60cc4f13be06e07a7408a0d0817975d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
It was failing because making it latin-1 turned it into:
"Norwegian BokmÕl, Latin, Norway"
While we expected:
"Norwegian Bokm\xE5l, Latin, Norway"
Amends e323d46cdaecffebb3f9fa55934e4eb4868611cf.
Change-Id: I55fe21331d1cb3abd66780e103aee8b603509818
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit d359035c804021f59da70a75d962bfeafd320a71)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Before this change, if someone called ninja Gui_generate_docs, it
would implicitly depend on sync_all_public_headers -> Gui_sync_headers
which would generate dbus headers.
This caused trouble with the new 'build doc tools from
qttools/dev/HEAD' approach, because an older pre-built dbus tool might
be passed a newer option when integrating a qtbase change that passes
the new option.
To avoid that, we now filter out the dbus headers from the list of
headers that should be processed by syncqt when building a
documentation target.
We do the same for the qvkgen generated headers.
This also removes the dependency on the ${target}_sync_headers target,
which means there is a potential issue when someone manually calls
`ninja sync_all_public_headers Gui_sync_headers` or something like it,
which would spawn two syncqt processes that access the same files
concurrently. This is an edge case that should not happen, but if it
ends up happening, we will have to implement some kind of lock file
mechanism.
Pick-to: 6.8
Fixes: QTBUG-134672
Task-number: QTBUG-128730
Change-Id: I9061f9495e2faa77744f5f5c0de8fedd362ba228
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit e7834e90f38891382f830da7700f00ebd81f21a8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Caching the scaled QPixmap directly in QIcon is not a good idea
- the cached pixmap might be used as starting point for a pixmap with
another size so it gets blurry
- QIcon has no caching mechanism to throw away unneeded QPixmaps after
some time so the memory usage grows indefinitely
Pick-to: 6.9.0
Fixes: QTBUG-134930
Change-Id: Ic490ba15438a5cd07a555692e1d08cd1c211d005
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 7a238e1225f49b81772516ed5d0a5a4f4f2e9268)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Requests that may lead to a different state when performed multiple
times (non-idempotent) should not be automatically re-transmitted if an
error occurs after we have written the full request.
We assume all custom methods are potentially non-idempotent.
[ChangeLog][QtNetwork][QNetworkAccessManager][Behavior Change]
Non-idempotent requests are no longer incorrectly re-sent if the
connection breaks down while reading the response.
Fixes: QTBUG-134694
Pick-to: 6.8 6.5
Change-Id: Ie8ba7828ce9375359c2326f06426fe1a1e568fef
Reviewed-by: Mate Barany <mate.barany@qt.io>
(cherry picked from commit 4c9a4ecd358da3bf371a2441cccd8a66c86f2d3c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
When a pushbutton has a menu, the menu indicator is drawn as the glyph
ChevronDown from Segoe Fluent Icons font. But later the font is not
reset so it's also used for the push buttons label. Since the icon font
has no valid glyphs for most of the characters, a replacement is used
but this might not be the one set for the pushbutton.
Pick-to: 6.8
Change-Id: I25c9b993450e7fe740addb153259f46b570ad8f7
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 1c26a93b3d5cccd48d18ef2e8b1879c093c15794)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Handle QSG_INFO with the proper macro rather than with an invalid
const_cast
* Remove the racy bool rubLogEnabled, read the atomic from the
logging category directly
WARNING: ThreadSanitizer: data race (pid=427588)
Write of size 1 at 0x7f89d5be2530 by thread T12:
#0 QRhiImplementation::prepareForCreate(QRhi*, ...) qrhi.cpp:8863
Previous read of size 1 at 0x7f89d5be2530 by thread T11:
#0 QRhiResourceUpdateBatchPrivate::free() qrhi.cpp:9907
Pick-to: 6.8
Change-Id: Ied5171ea5bb97372daced8afe3ad894d49961069
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
(cherry picked from commit 3cc947e98f6237c86160589143e69c13c965e226)
No need to test twice whether the row's columns array is initialized.
Pick-to: 6.8
Change-Id: Iead06f98ad421202bb4b71ae8efbd784ab3e87c1
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit bd6e55c856e3c016048410f69919e443c71628bf)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The function follows various libc functions in forcing the caller to
decide the case of the exponent separator, rather than allowing them
to opt for the case the locale normally uses. At Qt 6 I changed the
code reading from CLDR to not force the case, but didn't change
toString() to force lower when that was requested. Since the function
is documented to use lower-case when that's what it asks for, change
it to do what it says in its documentation. A caller who wants the
locale-appropriate case is thus obliged to call exponential() and scan
it for lower- or upper-case letters and select the right one of 'e'
and 'E' (or 'g' and 'G') to match.
This partially reverts some test changes made in
commit d5bb8d5150498dc059e8c17f224c66fb1a6bcf32 and expands the
QLocale tests to include ones matching those it changed. Fixed some
tests of QDoubleValidator that previously turned 'e' in the input into
'E' in the output; roughly alternate between changing the input to
match the output and the other way round, to be sure we exercise both
branches of the test.
Pick-to: 6.8 6.5
Task-number: QTBUG-134785
Fixes: QTBUG-134768
Change-Id: I5cffbd772a166efab9f7a5145289771c16be1658
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 05c8a48612be38a3c50bb5ed9daf1adfc221b9f2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Some locales even have multi-character exponent separators. Scan the
actual locale-appropriate separator to determine whether it contains
any cased characters; if upper, prefer 'E' format, of lower prefer
'e'; but match the case of the input string in any case, when it has
case. Use 'e' when it has no case.
This doesn't currently change any test data, due to the bug that
QLocale::toString(double, 'e',...) uses the locale-appropriate case,
even if that is upper-case, contrary to its own docs. However, fixing
that bug breaks some of the tests of QDoubleValidator without this fix
to prepare for it.
Pick-to: 6.8 6.5
Task-number: QTBUG-134768
Change-Id: I0ba5bbdb507b8b6efdf6dc134c387fd3b4bcbeb2
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 8c88a077ccc8350a44fd97fd082dbc328b5dd11f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Extend QMimeType::comment() to support translations from .qm files as a
fallback when system-provided translations (e.g., shared-mime-info) are
unavailable.
Task-number: QTBUG-127004
Change-Id: I23060ab7a690c774691b2d96174e77a252c047ad
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 2edb56977309daff0e2bb92bb5f64f8e0ac47da9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Fix the drawing of the SC_TitleBarCloseButton for fractional dpr by only
drawing two lines with a width of 2 instead 6 single ones as the single
ones might get disturbed due to rounding.
Pick-to: 6.8
Fixes: QTBUG-133834
Change-Id: I711cef885ed04fa695c24ee3e536697a0ebb3868
Reviewed-by: Wladimir Leuschner <wladimir.leuschner@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 9b35b477f7d4b37a33204c837309a0ede0101129)
The old implementation from Qt 5 time only affected the 32 LSB of the
result. The upper bits were completely determined by the seed, and the
seed alone. To see this, note that all except the seed are at most
32-bit values, and no shifting out of that range occurs, either.
Fix by just using qHashBits(), making sure (with a static_assert())
that QUuid has unique object representation (= can be compared for
equality using memcmp()).
[ChangeLog][QtCore][QUuid] Improved the performance of the qHash()
function on 64-bit platforms by populating all bits of the output
(was: only lower 32 bits).
Amends 55d68a16aafb93aa15bcdbd78892006777b6067a.
Pick-to: 6.8 6.5
Change-Id: Ibf67350f571889fd21e0acc82639c053c0d606b6
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit bb846a22c37dcb085829676d8feb7c203d21c886)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The return value of this function is constant and some users (QML?)
may call this function often, so memoize the result of the function
instead of re-creating the QHash on every call.
Amends 40206a9f6d7635bb19305d1c8d74908808e3529e.
Not picking to Qt 5, because I'm unsure about the state of magic statics
there, and I don't want to take out the Q_GLOBAL_STATIC sledgehammer.
Pick-to: 6.8 6.5
Change-Id: I8311e93ea16982c82e8312e1e104d95ed062fe6b
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit 0d0a151e0d3a93bcd289751b56959a7655a049d2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The macro body did not use its type parameter and both uses of the
macro in fact passed float for that parameter in any case, making the
so-called double version of the test actually a redundant clone of the
float form. This code is very ancient (harald, 2006).
Pick-to: 6.8 6.5 5.15
Change-Id: Ib6b7231c2737346784385473a94f3936b08aed33
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit a52a979abd58bde5823b15324595776b1e2e62b9)
Previously, QXmlStreamWriter would incorrectly insert a newline before
the first token when writeStartDocument() was not used, while
auto-formatting was enabled.
This fix ensures that the first token is written inline without an extra
leading newline, while preserving expected formatting for subsequent
tokens.
To achieve this, two new flags have been introduced:
- didWriteStartDocument: Tracks whether writeStartDocument() was called.
- didWriteAnyToken: Ensures that at least one token has been written
before allowing newlines.
Fixes: QTBUG-28721
Pick-to: 6.8
Change-Id: I8be7e8fc6ac0e63304359d24c6c8372e5ba42bb4
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit c3295bd59cb1c3b858b6a858aba4481adeea209b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Many of the conversions are implemented by macros and may include
conversion from a type to itself. We never call the convert() function
with those parameters, so that code can be safely suppressed.
Change-Id: I31904243ae8f750a3002fffd85f944305f0eee6b
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
(cherry picked from commit 3e1d147986cfbce0da7cd0623aad5c1351642bc6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
When safe area margins are in play, such as on iOS and Android, or on
macOS in 6.8 and above when the NSWindowStyleMaskFullSizeContentView
styleMask has been set (manually or via Qt::ExpandedClientAreaHint in
6.9), then widgets with a layout will by default try to avoid the non-
safe areas.
This worked well as a safe default, ensuring widget applications filled
the entire window with its background color, while constraining the
layout of children to the safe area.
However, for those that explicitly want to put content in the non-safe
areas, by setting Qt::WA_ContentsMarginsRespectsSafeArea to false, the
story was a bit cumbersome, as we set the attribute to true by default
for all widgets. Meaning, any child widget put into the non-safe areas
that itself had a layout (such as a push button) would also need the
Qt::WA_ContentsMarginsRespectsSafeArea = false override.
We now default Qt::WA_ContentsMarginsRespectsSafeArea to true only for
top level widgets on creation, and leave it up to the user to manage the
attribute for the other use-cases, as they then need to be in full control.
[ChangeLog][QtWidgets] The Qt::WA_ContentsMarginsRespectsSafeArea attribute
is no longer set by default for non-top-level widgets. Top level widgets
still default to Qt::WA_ContentsMarginsRespectsSafeArea=true, so children
are laid out in the safe areas, but overriding the attribute for the top
level now allows placing widgets in the non-safe areas without also setting
the Qt::WA_ContentsMarginsRespectsSafeArea attribute to false for every
descendant widget that overlaps the non-safe area.
Task-number: QTBUG-133215
Pick-to: 6.8
Change-Id: I7b1d420d730ee896ec2fb61aadacd94473dc9681
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 16081f414d9cfd752c0e6152fbfa386bdbade7a4)
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
The return value of this function only changes when models are added
or removed, and some users call this function often (an earlier
version of QGenericItemModel did, possibly QML does?), so cache the
result of the function instead of re-creating the QHash on every call.
Use QAbstractItemModelPrivate::defaultRoleNames() so we don't need
an instance to get the base class' contents. Amend the comment in
QAIM::roleNames() asking to keep the two in sync.
Amends 5ffb9d7ae6d60fb370b79f8222dab7d7e628fa4f.
[ChangeLog][Important Behavior Changes][QtCore][QConcatenateTablesProxyModel] The
roleNames property is only updated (lazily) on addSourceModel() and
removeSourceModel() now (was: on every call of the function). If your
source models change their roleNames() dynamically, you need to call
invalidateRoleNamesCache() manually when they do.
Change-Id: I32edc93ff9ff7b252ca04f0d61b54b2244d0be48
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit f3256e059f4e675f6e8d0cda710c3f979d84bc2b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Instead of the RVO-unfriendly¹
auto r = std::move(it->second);
erase(it);
return r;
use map::extract(), if available. The RVO-unfriendly code now only
plagues old-fashioned compilers that, in 2025, didn't, yet, manage to
implement C++17 _cpp_lib_node_extract. The rest enjoys C++17
guaranteed RVO.
Amends 14090760a87f23509b7bb5ad846537c766cb44a5.
¹ theoretically, this code is eligible for NRVO, but embedded in a
larger function like this, it won't kick in on most compilers.
Reported-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Pick-to: 6.8
Change-Id: I6654fa7f5ed80d07369eb6a2b37f1e82cd3aa7f0
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
(cherry picked from commit ed92f6c22fa59de1e536e1631053ae5565dcc0e1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
On VxWorks there is dlopen, but the feature can be turned off for static
builds, so Qt can use EGL even when dlopen is not present. In
qeglplatformcontext.cpp dlsym needs dlopen feature. There is no dlopen
on windows neither on Integrity.
Task-number: QTBUG-134671
Pick-to: 6.8
Change-Id: I7ced5f53ca21a8b0ceb25732ed4b1dc6c0bb1300
Reviewed-by: Janne Roine <janne.roine@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Reviewed-by: Kimmo Ollila <kimmo.ollila@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 3c919b6d0df486b7319faf8e4f366ab457e9f852)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The return value of this function is constant and some users call this
function often (an earlier version of QGenericItemModel did, possibly
QML does?), so memoize the result of the function instead of
re-creating the QHash on every call.
Use QAbstractItemModelPrivate::defaultRoleNames() so we don't need
an instance to get the base class' contents. Add a comment to keep
the two in sync.
As a drive-by, port from the QByteArrayLiteral macro to _ba UDLs.
Amends 32b586864e3a4398da38c045f4ac0823c3dc3c57.
Pick-to: 6.8
Change-Id: If00b51e60930c974e6f8f928711dc78ba1f42b93
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit fde232c855d59009503fe6dbaadd10346ab0830a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
...when the return value is unused.
The code should already be safe from restart()'s preconditions: either
the timer is explicitly checked for validity before the call, or we can
reason about the code (in testlib, the functions are called after the
one that starts the timer, making it valid). Therefore, this is just a
"cosmetic" cleanup (and a super-micro-optimization), but Marc doesn't
want to think about the qtestlib changes and says to pick it all the
way, "just in case".
Pick-to: 6.8 6.5
Change-Id: I73cf287ce1314fc3626734ec64ddf5884afe3383
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit baffc8e47df15190cd85705099698a72e2bdbfa0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
It might be redundant, but I can't definitely prove that these timers
are already started by the time we call elapsed() or restart() on them;
I "just" think they are because the CI is happy with the existing code,
even when adding assertions into QElapsedTimer.
As a precautionary measure, add more isValid() protections to QNAM code.
Also replace restart() with start() since the return value is unused.
Pick-to: 6.8 6.5
Change-Id: Ic64ab27116d8b1cb6c14e18dee79a15aa40844ce
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit dd7065616665e983349263bc5d600d764e164003)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
It's illegal to call elapsed() or restart() (sic) on a non-started
QElapsedTimer, so don't do that. In QNAM code, this has been observed by
adding assertions into QElapsedTimer, which then make network tests
crash. (While I am unable to run the network testsuite, this is
reproducible locally by running tst_QNetworkDiskCache::setCookieHeader).
The QTextStream test also calls restart() without a start(), but then it
calls elapsed()+start() which is the whole point of restart(), so amend
accordingly.
Pick-to: 6.8 6.5
Change-Id: I5cfe308f64b631b68b92843b409777a6b9176828
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 585471b138b195cb9020200cae760f119903df85)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Not all flags have an affect on an already created window, depending
on the platform and existing flags. Add option to force recreating
the window.
To aid debugging we also now log platform destruction/recreation events.
Change-Id: I7822cb58eaed51d72ed4ea3244f1f4113964cff7
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit d56dbdd48cb6149b6697b1e695ee7e2de1151bee)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This fix ensures that QDomElement::setAttributeNode() correctly replaces
an existing attribute with the same name. Previously, calling
setAttributeNode() with a new attribute of the same name resulted in
both the old and new attributes being present, violating the expected
behavior described in the documentation.
Fixes: QTBUG-15125
Pick-to: 6.8 6.5
Change-Id: Ibdda37a65f6e754d9f7e68e725d3438bbb2d9e0c
Reviewed-by: Mate Barany <mate.barany@qt.io>
(cherry picked from commit 8c991345847e4b050d746a3efc28ddfa7115a130)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
We should also test removal, not just addition.
Amends 5ffb9d7ae6d60fb370b79f8222dab7d7e628fa4f.
Change-Id: I0842a6be6230362e2095f6c8b2b1ced230826c5e
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit e15ef96bcb59de31937881b8e901f94bcf98355a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The return of a default-constructed QVariant 'v' from three branches
invites NRVO, but most compilers won't let it kick in, because there
are two return statements that don't return 'v'.
Return an rvalue from each branch, so RVO is guaranteed (since C++17)
to kick in.
Amends the start of the public history.
Picking back all the way, since it's risk-free.
Pick-to: 6.8 6.5 5.15
Change-Id: I495885bee3ebba63c9e52640903c792011c1dee2
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
(cherry picked from commit 26ba78900d6dae5be24b83004f0f91db74ac95e4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The painting of the various icons for CC_TitleBar was done with the idea
to do some fancy alpha blending. But it actually was never used and just
makes the drawing code a lot more complex than needed. Therefore merge
the drawing code for textColor and textColorAlpha into one.
Fixes: QTBUG-131492
Change-Id: I89ac7bcf76f5264cb85cd8a00f0d74da4b85fd7c
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 04e00e4e6c753ae7fb5ffa67be6db65257f6dd7d)
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Adjust toe color of the close button to match the native color. Adjust
the hover text color for the close in light mode to match the native
behavior.
Fixes: QTBUG-133945
Change-Id: I2c9fafba9fee65f45f3878168b67b0d0a4b2a54c
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit b24b9bba68821d4abb905d434e4b9442c65ff0c6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
In case that no application icon was provided, use the IDI_APPLICATION
icon when Qt::WindowTitleHint was provided.
Fixes: QTBUG-133941
Change-Id: Ifb479a7056e0841215d525c2346938bda31fc1c6
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit 92a14cdc36c4b2c30e4c7dfe7568b1835cb63093)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Upstream pull requests:
- https://invent.kde.org/frameworks/extra-cmake-modules/-/merge_requests/519
- https://invent.kde.org/frameworks/extra-cmake-modules/-/merge_requests/521
Says the commit message:
> Set the max-vartrack-size parameter to 0 (= unlimited) to avoid
> GCC's "note: variable tracking size limit exceeded with
> -fvar-tracking-assignments, retrying without" message you get when
> you compile with asan sometimes.
>
> This is reported¹ to speed up compilation, not slow it down.
>
> ¹ https://stackoverflow.com/a/75704837/134841
Pick-to: 6.8 6.5 5.15
Change-Id: I2489bbe3d3cb12cc52d7041499e38bb05c73aa3a
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 39ec71237f79f1a1aecd278b8c610e70c9cd1c67)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Not sure why it worked at implementation time. But now it definitely
doesn't. We may check the EXCEPTIONS flag value, since it's the
equivalent of its presence/non-presence in the argument list.
Amends f98fd705290ac7bd9434552a07e38b775e6a6dbf
Task-number: QTBUG-118901
Change-Id: I9769b4921a2f72d31aea2b0bffd2511edd89f88f
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 7106e492bcbb4ce22bd735c56df459a9744f8c5b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
We use QCocoaWindow::windowStyleMask to compute a new styleMask for the
NSWindow, based on the QWindow flags. However, some styleMask bits we
do not control in this function, so we need to preserve them in case
they were already set on the NSWindow, as otherwise we end up clearing
those bits. We did this already for NSWindowStyleMaskFullScreen, but now
we do it for all style mask bits we don't control.
This fixes an issue after QCocoaWindow::applyContentBorderThickness()
started calling setWindowFlags to control NSWindowStyleMaskTexturedBackground,
after the introduction of the Qt::NoTitleBarBackgroundHint window flag in
a1e6fed44964a3eb14045bf819d232d6cbad9f59 and then
bddc0198297828ba29e5cf4b39e07412a506a551.
The symptom was losing the NSWindowStyleMaskDocModalWindow style mask
for sheets or other modal windows with a QTabWidget in them, as that
widget ends up calling applyContentBorderThickness().
Fixes: QTBUG-134447
Change-Id: Ie3e9ca3ff14f84ce70438d3633bd283fb78b9e8c
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit b90b473ee01bc3dfce88cce3d0f6ebb8ee0f7f57)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 027624b4d59b65f9f8b4ccf23611d988c4633614)
When building Qt with a non-double qreal type, i.e.
QT_COORD_TYPE=float, mixing types on qFuzzyCompare will result
in ambiguities since only
qFuzzyCompare(float, float)
qFuzzyCompare(double, double)
are accepted.
Pick-to: 6.8
Change-Id: I4450516ffdf019ef8288aefd99a8e729c039bcd1
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit d693a06522f660076afaa22eb7c677da290254d9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This adds rudimentary support for linking against xcframeworks. We can
now do
LIBS += /absolute/path/to/some.xcframework
and this will end up in the frameworks section of the Xcode project.
This is required for linking against the FFmpeg xcframeworks we're
providing for iOS.
Pick-to: 6.8
Task-number: QTBUG-86387
Task-number: QTBUG-129651
Change-Id: Id212700d3554689160d23eafb26d99ac43b91062
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 1185f651e3ddfacdc828a3ddd3a40cf963f6407b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
It seems that even we correctly get Uri from FileProvider, we still do
not used it. This patch started to use Uri received from FileProvider.
Additionally, to avoid the issue of case insensitivity, we started using
QString directly instead of QUrl for the openURL method.
Fixes: QTBUG-133702
Pick-to: 6.9.0 6.8 6.8.3
Change-Id: Ia3b5b6f1562194af4211b9d5bf6a0d56b43c1b05
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 7ca68d0e2eb130f7d9f6c4d8cc8cbb0bbb068746)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
hashLengthInternal() already returns the size for each algorithm, so call
resizeForOverwrite() in one place. The hash lengths are specified by the
respective RFCs, so they have to be the same with/without OpenSSL
(confirmed by looking at the OpenSSL source code). So use
hashLengthInternal() in the EVP code paths and replace
result.resizeForOverwrite(EVP_MD_get_size()) call with an assert.
MD4_RESULTLEN isn't available when USING_OPENSSL30 is defined,
hashLengthInternal() returns 16 for md4, since MD4_RESULTLEN == 16,
just use 16 directly.
Change-Id: I5526d5e840b4882f3e5229df239b86924daee475
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 8786a930d1fee3ad330166a056c87684802733b6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The current style adds padding to non-pre elements, such as any p or div
elements. The final html adds a wrapping div with a .pre class that
also gets padding added to it. This patch removes the padding from this
wrapping div.
Fixes: QTBUG-133710
Pick-to: 6.8 6.5
Change-Id: I6411dcda9cfed5f0f82d8bd9ea8dc809b1a3b4d6
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
(cherry picked from commit 9e61bd24659d7db1ac90fe3ce4f686c5cdb47874)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The qtprovider_paths.xml is used by FileProvider[0]
The file defines the different file locations that can be used for
sharing content (with other apps). Previously it used only the
files-path type (for private files inside internal storage).
According: qstandardpaths_android.cpp file, we need much more here.
This commit adds more file types to qtprovider_paths.xml
[0]https://developer.android.com/reference/androidx/core/content/FileProvider
Task-number: QTBUG-133702
Pick-to: 6.9.0 6.8 6.8.3
Change-Id: I29c8eb3d00490e9127d0aa646b4c50643b5f51ac
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 4a54c32e6bd149b7b5086fc69180b2b92c5f33fb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This line in QDirListingPrivate::checkAndPushDirectory() was causing a
call to GetFileAttributesEx() for every single directory entry when
recursion was enabled:
// Follow symlinks only when asked
if (!iteratorFlags.testAnyFlags(F::FollowDirSymlinks) && entryInfo.isSymLink())
return;
That happened because QFileSystemIterator::advance() never set
QFileSystemMetaData::WinLnkType in knownFlagsMask, because QFSMD is
supposed to contain the information about what that .lnk was pointing to
and we don't want to read it unnecessarily.
However, we *do* when the directory entry is *not* a .lnk file. For
those cases, we can set WinLnkType in knownFlagsMask, which will cause
QDirEntryInfo::isSymLink() to return false without having to make
further system calls.
This change is fragile and this code deserves a bit of refactoring
(starting with getting rid of The Boolean Trap). All calls to either
fillFromFindData() or fillFromFileAttribute() are currently protected by
a .lnk filename check (all of them are either in this function or inside
of QFileSystemEngine::fillMetaData()).
Fixes: QTBUG-134699
Pick-to: 6.8
Change-Id: I87b19f89035bcd7e1c1ffffd14eac5fb5ac3e693
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit 606ba105074cff21384e5da66f56f05d6ce49992)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Honor the palette set by the stylesheet when drawing a
QPush/ToolButton.
Pick-to: 6.8
Fixes: QTBUG-134497
Change-Id: I33b9cdf8d4999e1fccdae250543db541b66b3b7d
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit b0dec15d2d9f0b8f18c7b071a68bf0702dcc0c4a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The latter was used both as a concrete type as well as a base class,
driving Coverity nuts because it couldn't prove that we weren't
deleting derived classes (AnchorData) through a QSimplexVariable
pointer.
This is the same issue that Coverity took with QBrushData (CIDs
218724, 11772), and the solution is the same
(cf. 3bbc9e29ef59683351cf35c19a8bd4a030615c64):
Split the Janus-headed class into one that acts only as the base class
(and has a protected dtor) and one that only acts as a concrete class
(and we can mark it final).
The protected dtor in the former now statically ensures we don't
delete a derived class object through a QSimplexVariable pointer.
We don't need to modify AnchorData subclasses, because AnchorData
introduces a virtual destructor.
Coverity-Id: 390828
Pick-to: 6.8 6.5
Change-Id: I981c02e69af44ebacd4ba3aec76792e14eb15836
Reviewed-by: Mate Barany <mate.barany@qt.io>
(cherry picked from commit a405834ae694ef791d0b648b9a6bb65b67904731)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Make this explicit, with a link.
Pick-to: 6.8
Change-Id: I8b8b64c88daacba43df1eecf5a347c0a89d837e1
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
(cherry picked from commit ca26e804501d0fba45b703e281f48b3e90584335)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
It's UB (as per docs). Creating a QTimeLine and calling
setCurrentTime() will end up calling restart() without having called
start() first. Moreover, the return value of restart() isn't used,
so that's useless work.
Pick-to: 6.8 6.5
Change-Id: I53c80838f60fae406a44ffe2cf578c6c79cc9df4
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit a43453d9a2b12943cb4528a4249fce407a3318f4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
LWG4135 applies to the quoted Standard paragraph (and therefore
to our own code as well).
https://cplusplus.github.io/LWG/issue4135
Pick-to: 6.8
Change-Id: I05caa4cba001ecc473412c789738480d8eafa0c5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 41ffc92f18a1a492720d432f00761e5574076060)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
so we can use Q_LOGGING_CATEGORY_WITH_ENV_OVERRIDE outside QtCore.
Otherwise clang++/macos says
Undefined symbols for architecture x86_64:
"QLoggingRegistry::instance()", referenced from:
QLoggingCategoryWithEnvironmentOverride::QLoggingCategoryWithEnvironmentOverride(char const, char const) in qrhi.cpp.o
As Thiago suggested, don't export the whole class to autotests,
export only the symbols they need. This simplifies the code.
Pick-to: 6.8
Change-Id: Id653385376a2a7604dddd2f520a0a90de5a541f6
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 8500343037950719119968a2d64e781a5635c658)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Use EXISTS path insead of using find_path because find_path finds the
last target's generated headers, but we want to generate headers for
each target separetely.
Ammends 95c70bbc5bed906fc3d24eebfb00592d48b30a74
Fixes: QTBUG-124800
Change-Id: Ib2b9ceefbc6d11f9bf67fdc6ce25dea3366afe3d
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 15932205522fc695168f79869fc7d78d65596739)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
These final touch-ups for CID 390828 make the code easier to
understand and safer, because more unsafe operations are now forbidden
(subclassing and copying).
Coverity-Id: 390828
Pick-to: 6.8 6.5
Change-Id: I2e43be71d8c3db59d95e69ec16c41c1547a2f180
Reviewed-by: Magdalena Stojek <magdalena.stojek@qt.io>
Reviewed-by: Mate Barany <mate.barany@qt.io>
(cherry picked from commit 912388b3068e831e4fbd9b3c31a62c79ee91c72d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
std::optional::value_or() should not be used when its argument is a
non-trivial type, because the argument is created and destroyed
independent of whether it is used in the end. In this case, we don't
even need an optional, because parseScreenScaleFactorsSpec() takes
the output of qEnvironmentVariable() (not -OptionalString) as-is, so
we can just drop the unneeded optional-(un)wrapping.
Since this patch apparently removes the last user of
qEnviromentVariableOptionalString(), mark that function as
[[maybe_unused]]. Outright removal may cause cherry-picks to fail,
so will come as a follow-up.
Amends 4d1f13f3549a73f5ca4e64dac9137e83138080fa.
Pick-to: 6.8 6.5
Change-Id: Ic2bb8a3aa8e946b957047ff4faf48c4082fc9c01
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit bee49bde04777eae348aead0abc3212fa945c0ab)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Coverity complains that image.format() is used to index into
qPixelLayouts[] when it may be NImageFormats.
Most code paths (e.g. QImageData::create()) defended against that, but
e.g. QImage::reinterpretAsFormat() did not (at least not overtly), as
didn't some of the backend functions.
Add checks, document the invariant on 'format' and assert it in
QImage::format().
If this doesn't convince Coverity, we'll need to turn qPixelLayouts[]
into a function, so that it can defend itself against out-of-bounds
access.
Pick-to: 6.8
Coverity-Id: 390711
Coverity-Id: 390720
Coverity-Id: 390758
Change-Id: I29431193face3cae8be56f01da8dced19c3abb38
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit a2e60ebee3737548d1be14fdbb39b08c515ae602)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
[ChangeLog][Third-Party Code] The copy of TinyCBOR in Qt was updated to
0.6.1.
Manual conflict resolution for 6.9:
- worked around 34f60877bdb54786c62fd1bf5b44a81430aa411f not having
been picked to older branches
Pick-to: 6.9.0 6.8 6.8.3 6.5 5.15
Change-Id: If5d5ef6220874ae8858efffd1712a567597b6317
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 7df128675a22391bc3ade2a45b558bc38eee1c67)
... instead of std::pair.
This is in preparation of breaking QSimplexVariable up into
QSimplexVariable (with protected dtor) and trivial subclass
QConcreteSimplexVariable, to statically ensure that we're not deleting
derived classes (AnchorData) through QSimplexVariable pointers (which
is UB, and subject to a Coverity complaint).
This is basically the same program we did for QBrushData, culminating
in 3bbc9e29ef59683351cf35c19a8bd4a030615c64.
This second patch modernizes the code a bit and, by scoping the
variable holding the return value of createSlack() tighter, allows the
use of auto and therefore isolates the code from the changes in the
final patch of the series.
Pick-to: 6.8 6.5
Coverity-Id: 390828
Change-Id: I15b51a3118c7ef33e8351a3e198abaebf4300d61
Reviewed-by: Mate Barany <mate.barany@qt.io>
(cherry picked from commit 3aa431e3fe42d7eb943f6b9920ad47b074856abe)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This is in preparation of breaking QSimplexVariable up into
QSimplexVariable (with protected dtor) and trivial subclass
QConcreteSimplexVariable, to statically ensure that we're not deleting
derived classes (AnchorData) through QSimplexVariable pointers (which
is UB, and subject to a Coverity complaint).
This is basically the same program we did for QBrushData, culminating
in 3bbc9e29ef59683351cf35c19a8bd4a030615c64.
This first step scopes iterators of for loops in the for-loop, and, as
drive-bys, makes them use auto and the shorter cbegin()/cend(), so
they fit into a single line, and fixes the extra {} around single-line
bodies (only in touched lines).
Pick-to: 6.8 6.5
Coverity-Id: 390828
Change-Id: I439e0a10ebb316a33e92c42c255ee209139d47a2
Reviewed-by: Mate Barany <mate.barany@qt.io>
(cherry picked from commit 49809c6e41101a11b5a264c7e8b4d4ce05d3c04a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Port from explicit array sizes to implicit ones, followed by an
explicit size check. This prevents mistakes where, due to missing
initializers, value-constructed trailing elements cause lower_bound()
to be called out-of-contract, such as the one
5d8f815e101da3ae9cd6a666cc097853f52b21da fixed.
Also statically verify that the arrays are sorted. This doesn't work
on GCC < 10, e.g. QNX, so guard it the same way we did in
qhttpheaders.cpp in e3fe3997ebd2baaafdfa7aa3c1eb95e8048268f8.
Task-number: QTBUG-103721
Pick-to: 6.8 6.5
Change-Id: Ia55149102013fa4e1619be68a69bc52b46e0f006
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit ddf69669d39919b20a2710211911587353fa3dce)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Othewise there is a risk that variable is taken from other scopes.
(Random finding).
Pick-to: 6.8 6.5
Change-Id: I2517adec5d82639e95ac2758633109413811cf9a
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 6685da4ec9e3b1eb8a09052c3abb2d614f96d7cc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QTabBar draws PE_FrameTabBarBase only when drawBase is enabled,
so QTabWidget should honor this as well.
Otherwise, there will be an awkward line below the corner widgets
but not the tab bar when disabling drawBase on the built-in QTabBar.
Pick-to: 6.8
Change-Id: I7621476d66c3580282846dc924cd0b3700ce250f
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit d28881fa335f20947b0329bc8f537bf7b577a257)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
As decided with lazy consensus on the development ML¹, we'd like to
separate precondition checking from internal consistency checking.
Add a new Q_PRE/Q_PRE_X macro for the former, to leave Q_ASSERT/_X for
the latter.
As requested in review, modernize Q_PRE_X vis-a-vis Q_ASSERT_X by
skipping the `where` parameter (defaulting it to Q_FUNC_INFO).
Added as undocumented API, for now, to pick back to all active
branches without actually promising semantics different from Q_ASSERT,
a change that, realistically, will only happen for 6.10 at the
earliest. But by making the macro available to all active branches, we
avoid conflicts when picking changes back, and the change is rather
risk-less.
Apply to QStringView, to have at least one user.
¹ https://lists.qt-project.org/pipermail/development/2024-August/045588.html Items 1-3.
Pick-to: 6.8 6.5
Task-number: QTBUG-98965
Change-Id: Ia04248a64c8feba80cce10f8f5cbde580436db88
Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit eb3df4edbc0ca04a892728e54962ad0daef4a78e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
As noted in the comment, we had a chicken-and-the-egg problem with
plugins and the event dispatchers: we need to destroy the event
dispatcher when plugins are still loaded (otherwise we could and did
crash) but we also wanted the QThreadData to exist when the plugins
unload.
The solution for that is to split the work: destroy the event dispatcher
first, then unload pugins, then destroy the current thread's
QThreadData. On ELF systems, this is guaranteed to work because we set
the init_priority to call destroy_current_thread_data() to higher than
QLibraryStore. In other systems, it's a best effort with dynamic
libraries and not guaranteed at all with static builds (don't even
report bugs).
Fixes: QTBUG-134080
Fixes: QTBUG-133861
Task-number: QTBUG-132697
Task-number: QTBUG-102984
Task-number: QTBUG-132381
Pick-to: 6.9.0 6.8
Change-Id: Ifaa28bb87338f4117d51fffdf721da68c0762e5a
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 6763e25cbc16cf8c54ab9b1ef97030aab9bb0eec)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
In case that no window title was provided use the
QCoreApplication::applicationName when Qt::WindowTitleHint was provided.
Fixes: QTBUG-133942
Change-Id: Ieeff0ba97bd996225c6f83f691fc1c149e3d7172
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 5d8c3a598588a950aa8dbab7a72cc5e6de7bd3a3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Unlike in other cases of structs, Coverity doesn't say which field,
exactly, it considers uninitialized in `op` upon return from
getOperator(). Manual checking confirms that all fields are written in
all branches (and all configs, btw), with the following exceptions:
- src* fields are not written in QSpanData::None mode, but this branch
is marked as Q_UNREACHABLE()
- `linear`/`radial` are only written in QSpanData::Linear- or
RadialGradient mode, which means that their (unnamed) union is not
written in Solid/ConicalGradient/Texture modes
Assuming it's the latter branch that trips Coverity, introduce a
std::monostate member, noGradient, to said union, and initialize it
Solid/ConicalGradient/Texture modes. This makes the union a kind of
optional, but without the churn of actually introducing a
std::optional<Union>.
The effect is that in those modes the active union member is now the
empty monostate, so static analyzers will not complain about `linear`
or `radial` being uninitialized (because they're not active members).
'noGradient' being the active union member should also help statically
and dynamically (ubsan, one day?) detect accesses to `linear` or
`radial` when they're not active. Before, I believe the first declared
of the two was implicitly active.
Amends the start of the public history.
Pick-to: 6.8 6.5
Coverity-Id: 11400
Change-Id: I743363cc06af3778f85c205bfb6880c696229f92
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 8492ba01ba3e3bdf717c9e7f40ddad412c297945)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Adds a more detailed overview of behavior changes between Qt 5 and Qt 6
in the Qt XML module. This update is based on multiple reported tickets
highlighting behavior differences, where users requested further
explanations.
Fixes: QTBUG-134503
Pick-to: 6.8
Change-Id: I2e25268c6de7fd7e3a0e0244b83bb2ba616ef60e
Reviewed-by: Safiyyah Moosa <safiyyah.moosa@qt.io>
Reviewed-by: Mate Barany <mate.barany@qt.io>
(cherry picked from commit 275396b013cf10fa647c3b6a262ae46f180621d3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
On CI an Android emulator with SwiftShader software graphics
implementation is used. SwiftShader implementation is unable
to emulate this OpenGL functionality.
QSKIP the test if it is run in Android platform,
OpenGL and SwiftShader sw graphics implementation is found.
Task-number: QTQAINFRA-6333
Task-number: QTQAINFRA-6334
Pick-to: 6.8
Change-Id: I560aa796e7f364e645ebb41f89120673a0f59a5b
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Instead of a static constexpr QL1SV object (which force the compiler
to allocate storage and therefore causes relocations), use a mere
automatic constexpr object (which doesn't). There never was a need to
make this object static, as constexpr is enough to force the compiler
to constant-fold them.
Difference:
qtextmarkdownwriter.cpp.o:
- 0000000000000000 l O .data.rel.ro.local 0000000000000010 maybeEscapeFirstChar(QString&)::specialFirstCharacters
0000000000000000 l d .data.rel.ro.local 0000000000000000 .data.rel.ro.local
See
https://stackoverflow.com/questions/19067010/finding-where-relocations-originate/19338343#19338343
for the script to generate this output.
See https://www.akkadia.org/drepper/dsohowto.pdf Section 1.6 for why
we care.
As a drive-by, port from QL1SV to _L1 UDL.
Amends ca4774131b9b8ee40b4d7f5c1ba296af4700207f.
Pick-to: 6.8
Task-number: QTBUG-100536
Change-Id: I31e124962e03b8b40df9153b09f627e8e22a8119
Reviewed-by: Matthias Rauter <matthias.rauter@qt.io>
(cherry picked from commit db6f8821fcf0028f83b4c27c8de2399c99577272)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
All offsets fit into [0:255], so use uchar instead of short to store
them, cutting the storage requirement of the array in half (-86 bytes).
As drive-bys
- make the array constexpr
- fix formatting (only in touched lines)
- port from explicit to implicit bounds with explicit bounds checking
The latter has the advantage that we don't get value-initialized
elements appended silently, cf. 5d8f815e101da3ae9cd6a666cc097853f52b21da.
Pick-to: 6.8 6.5
Change-Id: I336f850a586fd2fde8f62c65223f547402fbaa75
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 67e9e2a7e2ee6a7687a5aa01214e70dffb6eb688)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QFile::addFile() was searching for '@N' - image file where N corresponds
to the devicePixelRatio of the QGuiApplication. Since we can have more
than one screen, all different devicePixelRatios should be considered.
Change-Id: I7c844e163c5b5ca8752d8461139d7abf39c2e8a5
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 9684691d51335362665e85ced591cffae3ea5360)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This avoids the need to run qt-cmake-standalone-test and then import
the test, as described in QTCREATORBUG-25389.
Pick-to: 6.8 6.5
Change-Id: Ie9694569c24dc0c714c2538819e7d9d8ff7e44e4
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
(cherry picked from commit b35ea9b974c965c01cd0a8340a7885621e4413ef)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Be symmetrical with the Data::allocate() in the constructor.
This is not strictly a no-op since we now call the exported symbol
QArrayData::deallocate() instead of inlining a free() call. However, it
allows future sized-free optimizations.
Pick-to: 6.8
Change-Id: I2ef00a897f56a32a0f1188f69f159834e6ca5b64
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 41c47fdd192cafa001b6e67defc314af5c1d6316)
It turned out that we've been maintaining both displaceFrom and its
copy, `where`, in parallel.
This is not needed, so only maintain displaceFrom.
Pick-to: 6.8 6.5
Change-Id: I8c13420ae3fd284e362c4dd1f1b06d2847780c86
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit f18e8cebfcb9053bec3221f88a3944a781114530)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Issue the event when geometry has changed to match QML.
Task-number: QTBUG-115926
Pick-to: 6.8
Change-Id: I31d87a2b07c1cbdb31063bdbf146f21310103798
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit c1fba2d4ee47d2ce69b56d69629cd13b1439a107)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
All callers of replaceOrAppend() (present and future) pass an rvalue
`value`, so take advantage of C++17 guaranteed copy elision, take
`value` by value and move it into place.
Even for implicitly-shared classes, a move (pointer swap) is cheaper
than a copy (atomic ref-count upping/downing; ca. 100x slower than a
normal int).
Amends d8f6425fef1050525480afec662a417a7645c22e.
Pick-to: 6.8
Change-Id: Ia52a2ec2c079f515f92b0890e42669d4ba435c20
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
(cherry picked from commit 8761fa5b8bec2f9b80550523e824f4e3141aca49)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Coverity complained that mapSize was used in ~FdWrapper uninitialized
when the object was destroyed before map() had been called on it. This
is a False Positive, because in that case, ptr == MAP_FAILED, and we
wouldn't be reading mapSize.
But be nice and split the FdWrapper class into two, by creating an
object managing only the mmap() part of equation and returning it from
map(). The most-natural choice for such an object would be a
unique_ptr with a custom deleter, but that has built-in knowledge of
nullptr (ie. doesn't call the deleter on nullptr), which, at least
theoretically, is a valid return value of mmap() (the error case is
(void*)-1), so write a small struct ourselves.
Coverity-Id: 390668
Pick-to: 6.8 6.5
Change-Id: I43d635617bd26120cf402241bf59680fe63d071a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
(cherry picked from commit 1d2dda041a419740dff16dbb4addc6d93583f08d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
They were left in to for easier reviewing when the old function
pointer table was changed to this switch. In this second step, we can
now collapse adjacent duplicates into one each.
Pick-to: 6.8 6.5
Change-Id: I7b7fa8991817895a01c63251ab3b0ecc95b5756b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 455e0ff42a68849b8d76dd8fbac58a35fa2dc866)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Coverity complains, for each findKnownValue() call, that "forming the
address of the element at index numValues of buffer start requires the
index to be no more than the number of elements in the buffer", citing
QCss::NumKnownValues (e.g.) as the out-of-bound index.
Since it's complaining about the initialization of `start` in
findKnownValue(), I can only assume that it is bothered by the `+
numValues` (which moves the pointer out of range) followed by the - 1
(which brings it back into range), so make sure we subtract 1 before
adding to `start`.
That array + numValues would be considered outside the array
(incl. one-past-the-end) is highly irregular, and, AFAICT, caused by
the arrays not storing the resp. "unknown" entry at index 0,
effectively turning the arrays into Pascal (base-1) ones.
Shot in the dark (and a sign of poor/overly-strict deduction
capabilities in Coverity, if this is actually fixing the issue), but
worth a try.
Amends previous fix attempt 204b6c99089bcf7893be326e7d0076402b7abf0c.
Pick-to: 6.8 6.5 5.15
Coverity-Id: 183557
Coverity-Id: 183559
Coverity-Id: 183560
Coverity-Id: 183569
Coverity-Id: 183573
Coverity-Id: 183574
Coverity-Id: 183579
Coverity-Id: 183584
Coverity-Id: 183585
Coverity-Id: 183586
Coverity-Id: 183589
Task-number: QTBUG-83817
Change-Id: I3ad1f744986fe3223571a919b8a537c544ef314c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 66081c52b5b4017ae141f8fa27bd082be1e79422)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The old code used a `<QString>` to indicate an object of QString
type. I have not seen this pattern used elsewhere, so rewrite the
expression to say "call X on the QString" instead of "call
<QString>.X".
Also, the constData() link in the expression ('X' in the previous
paragraph) was unqualified, so resolved to QString::constData(), but
the result of toLocal8Bit() is a QByteArray, and it's thence the link
should point to. Redirect it manually whereever we fell into that
trap.
Amends the start of the public history.
Pick-to: 6.8 6.5 5.15
Change-Id: I2204522351976be0f045bfd60a30c82c9e784dd6
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit ab1ce95c8ce38683477373cf84ba5686ea00efed)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
These files process raw end user provided data and
apply structure to it, through layout and Unicode algorithms.
Extra care should be taken when reviewing changes to these
files.
Pick-to: 6.8
Change-Id: Iba86aec1a185bbbcd40aa2b8d4d0d839bb99ba0d
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
(cherry picked from commit 2198cdc40630713670064334fb34dc2255980800)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
These files process raw font tables from untrusted files.
Pick-to: 6.8
Change-Id: Ie7fbfb667984e2d003b343a2ce011ad0e5aa04d2
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
(cherry picked from commit 6704e55a9c04014097cc2e90fd75b20ae5da56c8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This makes explicit that the only thing that should be changing is
displaceFrom, which tracks the hole-filling process.
Requires rewriting of the dtor a bit, to skip the nInserts
modification.
Pick-to: 6.8 6.5
Change-Id: I1f0ce17cbeb171704f789624ad1be6ef70e58245
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit 75df3a250d84a7e2680a8f229d11eec20b2d3ff0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Since the ctor is now the only caller of displace(), we can inline the
latter into the former, using ctor-init-list to initialize the
members.
Also fix decltype(bytes) to be size_t, which is what memmove(), the
only user of the value, expects, and ptrdiff_t * sizeof(T) yields
(found by GCC -Wnarrowing complaining).
Pick-to: 6.8 6.5
Change-Id: I3f93e28eebc6deefee8a182eb71a3b0958718ba0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 82d4a81df19fe9aff9d3b1790c2b371a3efc0a99)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
While QTabBar is created by the QTabWidget and therefore doesn't
need to be guarded, QTabBarPrivate::init calls QStyle::styleHint
which might result in QStyleSheetStyle querying properties on
the QTabWidget while its QTabBar isn't assigned yet.
Pick-to: 6.8 6.5
Change-Id: Ic832d3253c5dc54d8d718760c63f34f0b8bde000
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 61c2d3f10124dbf4c6ddb44bc9790431bd389567)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This is almost always the case in a typical Quick or Quick 3D rendering
sequence, since there is almost always a uniform buffer, which is almost
always a QRhiBuffer::Dynamic buffer, thus triggering double (or triple,
whatever max_frames_in_flight is) buffering and using multiple
descriptor sets.
This breaks down e.g. when using a compute pipeline and a
texture for imageLoad/store in the srb. If the texture is rebuilt
between frame N and N+1, then in frame N+1 the srb sees that the
descriptor set needs to be rewritten, but that's wrong since frame
N might still be in flight, using that descriptor set.
From now on, pretend that an srb always needs double buffering,
regardless of what kind of resources it references.
Also drop unused code paths. The updateShaderResources function's
argument was never -1, for example, so no point in keeping that logic.
Pick-to: 6.8
Change-Id: If8abb42fd9a2de5aad59ab6ceab3c8086aebae68
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
(cherry picked from commit 30dc9ed13fcc2691ed656f6f36d419133856c8cd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Have two pipelines that are used with the same srb:
setPipeline(a);
setShaderResources(s);
draw
setPipeline(b);
setShaderResources(s);
draw
If this is repeated each frame, then on the second an subsequent frames
the uniforms for the program behind pipeline b will not be set,
i.e. the glUniformxx calls will be missing.
This is due to the pipeline's own srb tracking
(currentSrb/currentSrbgeneration) works: in the second frame
setShaderResources(s) for pipeline b will do nothing, since
the command buffer's tracked current srb is already s, and
also b's currentSrb is already s.
The problem remains hidden usually because Quick or Quick 3D
does not generate sequences like the above (same srb with different
pipelines).
Pick-to: 6.8
Change-Id: I56b962f0ba12370e0de7c87fb7178a0b9e4b0178
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
(cherry picked from commit e9fa3e42444faec33a33f4c6ce673f08db2280eb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The expectation, based on what the other backends do, is that all array
layers and 3D texture slices are exposed (i.e., the whole texture).
Same for cubemaps (all six faces), that at least was in place
already.
This is what the odd-named 'layered' argument of glBindImageTexture
controls. Set it accordingly.
Pick-to: 6.8
Change-Id: If6808069dfc9f3df124e508e40abf8c3423289da
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
(cherry picked from commit 25394fab9a3a501311601e45af310b3949dff2c6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
When used with load/store, it is already correct due to using
glTexStorage3D. On the other code path however, individually
calling glTexImage3D for all the mip levels requires adjusting
the depth for each level, as it is done for width and height.
Pick-to: 6.8
Change-Id: I440cc10303687b686d78da4c614da4325840803a
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
(cherry picked from commit efc911aa58195d2538be7b0343154038f3a2c3b4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
These files should not have executable permissions.
Fixes: QTBUG-125534
Change-Id: I893d4d373ee098864b64200dc6c88b57d05d6209
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit ba103a6fee8e66748e2f3c52ce9f9e19ff89a850)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
- Introduce symbolic constants for the magic numbers 3 (= log10(base))
and 10 (= log2(base)).
- Add and use QtPrivate::log2i() instead of manual bit fiddling. This
makes the two cases nicely symmetric now.
Amends 9d23aebb271ea534a66cb3aceb2e63d9a1c870d6.
Pick-to: 6.8 6.5
Coverity-Id: 474294
Change-Id: I657f34878bc3a9b67b03a4d014b91e6d4de31e13
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 9fee7cdfcce00ce6500b8eebf67f4a6c91be98bd)
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Hold 'fbo' in a (const) unique_ptr instead of a raw pointer, so it is
deleted even if a following QVERIFY/QCOMPARE fails.
This shows that the leak (cf. QTBUG-134557) is not due to the test
itself.
Amends dcbb16a45212d263496df1e5875da6205e4f5f53.
Pick-to: 6.8 6.5 5.15
Task-number: QTBUG-134557
Change-Id: I2f854d5ff036b7ca5e51d2e9ecb1d04bf7a39a61
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
(cherry picked from commit b615c477f6472f0e3935aea05c099966c1d3ef47)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
That's what asan reported for a run of this test executable.
Create `ctx` on the stack instead of the heap to fix the leaks.
For `fbo`, use a std::optional.
After these fixes, the test still leaks 64 bytes in 2
allocations. These seem to be QOpenGLSharedResourceGuards in a
QOpenGLFramebufferObject. Created QTBUG-134557 to track the issue.
Amends
- 68974d8e647febb80a47d9cf6ce9452f3ce4fa21 (fboHandleNulledAfterContextDestroyed())
- bb760d9514ed617ee8e7344152b3fa697b2c4171 (bufferMapRange()/bufferCreate())
- 0541516907da117c391b6c8d9820209673fcd9cd (vaoCreate())
Pick-to: 6.8 6.5 5.15
Task-number: QTBUG-134557
Change-Id: Icc318cd76b9f3ddf71bc294cb96d88485c42d7bc
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
(cherry picked from commit 7a1cd692e0b36acfc005332b50d7ef3e11b94e71)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
clang-cl does not support -ftemplate-depth. so we should not pass it
when MSVC is defined.
Pick-to: 6.8
Change-Id: I7f411187c476fa275b677f96a19f782262dc4545
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 39015c049b3f39a27737236b6740f7f5038ab75b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
On CI an Android emulator with SwiftShader software graphics
implementation is used. SwiftShader implementation is unable
to emulate this OpenGL functionality.
Blacklisting removed. QSKIP the test if it is run in Android platform,
OpenGL and SwiftShader sw graphics implementation is found.
Task-number: QTQAINFRA-6330
Pick-to: 6.8
Change-Id: Ib0832f35b63540d57a273fc6dba1e310de917439
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
SH_EtchDisabledText is not widely used in fusion style and where it is
used it
- does not make any real difference for light mode
- makes the text look like one missed the glasses
Therefore disable this hint for fusion.
Pick-to: 6.8
Fixes: QTBUG-134533
Change-Id: I42fc20349603cf610ee725802f1095008eafd183
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit c8338d8e77699d1b8d239a4cba30adf22f15acf2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
clang-cl does not warn about return after unreachable, but would warn
about the unused variable after return.
Pick-to: 6.8
Change-Id: Ia0fcff4f536d51d56eb915a9130cc3f72437d8d1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 1bdf5059ceae7b202f015728bf8817b644e2e5fc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Turn the charAttributeFunction array of function pointers into a
switch. This has two benefits:
- The compiler now warns when we introduce a new QChar::Script value
and statically forces us to think whether a new attribute handling
function is needed.
- A table of function pointers requires relocations. A switch might
not. GCC uses a jump table to implement this switch, jumping to
distinct lea instructions fetching distinct function pointer values,
and thereby removes relocations, while Clang actually forms a
function pointer table and turns the switch into an indexing
operation (with compiler-generated guards). I didn't check whether
Clang's table actually requires relocations, relinfo.pl doesn't
report any reductions, but it's become unreliable over the years,
because it doesn't for GCC, either.
Difference:
qunicodetools.cpp.o:
- 0000000000000000 l O .data.rel.ro.local 0000000000000108 QUnicodeTools::Tailored::charAttributeFunction
0000000000000000 l d .data.rel.ro.local 0000000000000000 .data.rel.ro.local
See
https://stackoverflow.com/questions/19067010/finding-where-relocations-originate/19338343#19338343
for the script to generate this output.
See https://www.akkadia.org/drepper/dsohowto.pdf Section 1.6 for why
we care.
Instead of collapsing identical return statements from adjacent case
statements into one, keep the per-case return statements for now, to
aid review, and clean up in a follow-up commit.
Amends dd7d8304bbe599320b163b94e9a4ad9a6f35b740.
Pick-to: 6.8 6.5
Task-number: QTBUG-100536
Change-Id: Ic5b6bd29e3a3a88f0d194fa7d76272a4770b9840
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 74765ebe65b8b67b2d2bbe3f4fa3eb1879d030aa)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Coverity complained that ~Inserter() will access at least displaceFrom
and displaceTo uninitialized, which is correct, if none of the
insert() overloads have been called in-between. This is a brittle
construct, even though, currently, all users of the class comply.
To help Coverity (and other readers of the code) understand what's
going on, move the displace() call that creates the hole in the
container which the insert() overloads then fill from said overloads
into the ctor, original-RAII style (ctor acquires the hole, dtor closes
it, if needed). This means all fields are initialized in the ctor now.
This is safe, as displace() cannot fail by itself (just a memmove()),
but requires moving the (pos, n) (= hole) information into the ctor
instead. The displace() call in the insert() overloads now becomes a
read of its return argument, displaceFrom.
(Incidentally, that shows that we have maintained the same pointer
twice in the insert overloads, something we'll clean up in a
follow-up.)
In order to verify the insert() post-condition (ie. that we filled the
whole hole created by the ctor, or threw an exception trying),
continue to pass the count to insert().
As a drive-by, rename the insert()-overloads to insertRange() and
insertFill() to match the existing insertOne() function, and to better
express what their purpose is.
Pick-to: 6.8 6.5
Coverity-Id: 378364
Coverity-Id: 378461
Coverity-Id: 378343
Change-Id: I1a6bc1ea0e5506d473f6089818797b02d09ba13e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit aa8e8ffd321dc96650c11ebe3cd4017e7cc8edac)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
On CI an Android emulator with SwiftShader software graphics
implementation is used. SwiftShader implementation is unable
to emulate this OpenGL functionality.
Blacklisting removed. QSKIP the test if it is run in Android platform,
OpenGL and SwiftShader sw graphics implementation is found.
Task-number: QTQAINFRA-6332
Pick-to: 6.8
Change-Id: I241a2c6772291795d26b9c2a563f4f9412605cf6
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Amends 8e5ce9cd369230256045864d6fad38dbd8bee413, which introduced the
QtPrivate::equalStrings() call. At that time, equalStrings() had already
required equal lengths (see 1560e0161af70b5cf88a70e55c0b502612d433cd),
so no excuse.
[ChangeLog][QtCore][QCborMap and QJsonObject] Fixed bug that could
result in a crash or failing to find a entry in the map/object with non-
ASCII keys.
Manual conflict resolution for 6.9:
- Port from keyView() to key(), because the former is a 6.10+ feature.
Pick-to: 6.8
Fixes: QTBUG-133744
Change-Id: I6b0f8b0a2e47d3ef905afffda6c4c079814a0914
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 54daec43a041cb69cff31cbfd1dd0b7127e8ba87)
QGlobalStatic has a warning suppression for -Wtsan because of its
usage of std::atomic_thread_fence, which TSAN doesn't support.
That header is included in QtCore's PCH, and that triggers a GCC bug
that causes the warning to be emitted despite the suppression [1].
In a developer build, the warning turns fatal.
We could either disable PCHs in such a build configuration
(TSAN+developer-build+GCC < 15), or: simply make the warning non-fatal
on earlier compiler versions.
[1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64117
Pick-to: 6.8 6.5
Fixes: QTBUG-134415
Change-Id: If80a4acdb1372d00804a60361f6c3d6893b96106
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit a72077a88903fe532f6a749677eb4da4ea99f79f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
If we encounter a normal, monochrome glyph in a color font, we
go via the normal glyph rendering code path. But since we are
drawing into a color-capable glyph cache, we need to make sure
the image we draw has an alpha channel.
This was inadvertedly broken by the refactoring in
1b85143d217042876209794bf8d0361b7ce8834f, causing black
backgrounds on all such glyphs. Since the default font in Qt Creator
is a color font, it was noticed when upgrading this to 6.9.
Fixes: QTBUG-134473
Change-Id: Iee7eb73a5727324e2ff3bacc2d9ae45cb64fd0b9
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
(cherry picked from commit 54555755f8780e4e7c665a1502309da9fa807066)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 81bbbc3fc47e47b9cd77248bbaaf35477f562895)
qtwasmserver accepts a positional path argument which tells where to
serve the assets from. The argument wasn't actually used, and this
resulted in always using the cwd.
In addition add a check for the path directory existence. Otherwise
this becomes only visible as a 404 Not Found error.
Amends: 156e5c8b690d01ad3043d2163168c4ea3608a046
Fixes: QTBUG-134393
Change-Id: Iacfafe8a2fb2409169b09a17dbc9ffed0ad16fdf
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
(cherry picked from commit fcada7c5c395a7006ecef184c3ca43fff1023616)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QRect QRect rect and tableView are not used and clang-cl warns about
that.
Pick-to: 6.8
Change-Id: I35ae933b437952c6748e4b09d139cc06c9ce33cb
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
(cherry picked from commit 1d83bffb291192f04db6f33313291147472f7014)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Implemented for lldb and gdb. MSVC comes with lldb.exe (it doesn't work,
but maybe some day). I couldn't find out even how to install cdb.exe, so
that's left as a task for someone else.
Pick-to: 6.8
Change-Id: I9d93747476531d4cfd53fffddecc5b3339d2fd7c
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit 0f9860618ff9d045c8371338274f633e38994e3e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Instead of having to make changes to both tst_qcoreapplication.cpp and
tst_qapplication.cpp.
Pick-to: 6.8
Change-Id: Ib451048e40b163c2c3a3fffdf7b39bcb28c9cccf
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit b03921eb9fad7a71dc13d92af2e0e994fcc1ca67)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
By adding a way for the apphelper to let the caller know that it must
skip this test.
Pick-to: 6.8
Change-Id: I750e7188b8f54cea7278fffd584f8fbf433f496b
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 00a30f4312876f6f2919b6a47ff404d503255e2f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The class is unsafe for copy, as it would double-delete m_array,
and the move operations aren't implemented, either.
Found while fixing CID 11295.
Pick-to: 6.8 6.5 5.15
Coverity-Id: 11295
Change-Id: I8a615aaea3a8a4ad6abc8a5a9990c2dba5cfa65d
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit d429fceeebff24c112df3cf202e48bc338551554)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Instead of a static constexpr QL1SV object (which force the compiler
to allocate storage and therefore causes relocations), use a mere
automatic constexpr object (which doesn't). There never was a need to
make this object static, as constexpr is enough to force the compiler
to constant-fold them. The lambda doesn't have access without a
capture, of course, but that is easily solved my moving the object
definition into the lambda itself.
See
https://stackoverflow.com/questions/19067010/finding-where-relocations-originate/19338343#19338343
for the script to detect these issues.
See https://www.akkadia.org/drepper/dsohowto.pdf Section 1.6 for why
we care.
Amends 18aff2b424577b4560b32698038e9bcf68a54b88.
While at it, remove the static from the lambda, too. While it doesn't
cause relocations, it might, on weaker compilers, cause a thread-safe
static prologue to be emitted, and it's not needed, either.
Pick-to: 6.8 6.5
Task-number: QTBUG-100536
Change-Id: Iaede4d02a84ea2e49b42f3da93a77cb8391df5bb
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit f8647f8951207b66e3a2d7130fd5f75c3b14b5e6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Only a small early part of tst_QTimeZone::utcTest() actually needed
access to internal APIs, so only apply the #if-ery to that part.
Pick-to: 6.8 6.5 5.15
Change-Id: Ifebd70005f87bbef5d03fa24fe33134fd802e2e5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 92ec27e461ef3d3567cad11c5ca83368b985669d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Saying the code should produce no warnings is all well and good, but
testing it produces no warnings is obviously better.
Pick-to: 6.8 6.5
Change-Id: Iafa82027fde9ef6c7157b42ff3bbcccb3d097230
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
(cherry picked from commit 0b67d446566005e6409f816a6f223f26ef1994ca)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Previously it was displayed as if it had been constructed from its
language, script and territory; but it is distinct from the locale
constructed in this way and may produce different results.
Report the system locale as QLocale::system() with its language,
script and country within /*...*/ following it, instead of as
QLocale(...) with these as its parameters. Add a test of the debug
output, verifying that it has the form intended.
[ChangeLog][Important Behavior Changes][QLocale] Message logging now
distinguishes the system locale from the corresponding locale -
generated from its language, script and territory - based on CLDR
data.
Fixes: QTBUG-133922
Change-Id: Ic6fb137821fb7bf29d0f6446a46225cadd54b82a
Reviewed-by: Mate Barany <mate.barany@qt.io>
(cherry picked from commit e323d46cdaecffebb3f9fa55934e4eb4868611cf)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This reverts commit 315210de916d060c044c01e53ff249d676122b1b.
The change was not correct. If the newly-inserted reserve() call
actually grows the string, and `after` aliased a part of the old
string, it will now reference deleted data, as the q_points_into_range
check now comes too late.
Change-Id: I2e016b8b90f74126dfc7126800b7b7fde96a091e
Pick-to: 6.8 6.7
Task-number: QTBUG-127549
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
(cherry picked from commit d1539331dd813c83916a323f6cdc7fd6aacb0043)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Several \fn signatures were either incorrect or missing qualifiers
required to make QDoc match the documentation with the declarations.
These were not caught in the CI when testing documentation builds due
to a bug in QDoc.
Task-number: QTBUG-134250
Change-Id: I7a4af11d9bc3687597b348cc2d4ee15212e0281f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit b6a01d7d22583263a16242af604e74bbe694d766)
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
QGtk3Theme remained unresponsive to programmatic color scheme changes,
after QPlatformTheme::requestColorScheme() had been introduced.
Add functionality to QGtk3Theme.
Fall back to qt_fusion_palette, when the requested color scheme isn't
supported by the current GTK3 theme (e.g. Adwaita-dark doesn't support
light mode).
Functionality has to be manually tested with the widget gallery
example.
Fixes: QTBUG-134022
Task-number: QTBUG-132929
Pick-to: 6.8
Change-Id: I1160c7afc1f1fcb6ec93d65ef54cb45a65a63863
Reviewed-by: Santhosh Kumar <santhosh.kumar.selvaraj@qt.io>
(cherry picked from commit 738c180c4f03bf82efce04dc4c751cd6eb0043c7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The deslashified QString can be moved into place here.
Found by Coverity.
Amends 5e936b60fc921e21b8153a83113886a1de333b57.
Pick-to: 6.8
Coverity-Id: 477475
Change-Id: Ibdaae0a9acae56960e16d5a6fd77fc1e08036af0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Øystein Heskestad <oystein.heskestad@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
(cherry picked from commit 692f1a38a405b8bbef961b64d2577b4fbb2a03f9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Coverity has this checker where it complains if you use a T as a
T[1]. The C++ standard says that this is fine¹, but qurlrecode.cpp,
specifically, is security-critical, so we shouldn't leave Coverity
issues unfixed in there.
So replace ucs4 with a buffer[1] array and make both dst and ucs4
point to buffer's first (and only) element.
Amends 2b82923c8fba5dcff707e344acdf9db8c444a55e.
¹ https://eel.is/c++draft/basic.compound#3.sentence-11
Pick-to: 6.8 6.5
Coverity-Id: 378435
Change-Id: I8ab2f70b542088e90dc43e616a0202e8c756f204
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 7a32a2238f52217bc4f0dc4c9620a2a2d350a1ca)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Instead of static constexpr QL1SV objects (which force the compiler to
allocate storage for them and therefore cause relocations), use mere
automatic constexpr objects (which don't). There never was a need to
make these objects static, as constexpr is enough to force the
compiler to constant-fold them.
Difference:
qfontengine.cpp.o:
- 0000000000000040 l O .data.rel.ro.local 0000000000000010 QFontEngine::findGlyph(QLatin1String) const::gid
- 0000000000000000 l O .data.rel.ro.local 0000000000000010 QFontEngine::findGlyph(QLatin1String) const::uni
0000000000000000 l d .data.rel.ro.local 0000000000000000 .data.rel.ro.local
See
https://stackoverflow.com/questions/19067010/finding-where-relocations-originate/19338343#19338343
for the script to generate this output.
See https://www.akkadia.org/drepper/dsohowto.pdf Section 1.6 for why
we care.
Amends 176816f21324bf736389037c62538a25f2522808.
Task-number: QTBUG-100536
Change-Id: I3cdf42c9758ec32654b378a2b27b565a6c92c26b
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru>
(cherry picked from commit 511ee39570a104d07eb4c9fb0d8a8fb775e9b38a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Coverity has this checker where it complains if you use a T as a
T[1]. The C++ standard says this is fine¹, but qstring.cpp,
specifically, is security-critical, so we shouldn't leave Coverity
issues unfixed in there.
So replace uc1 with a decoded[1] array and make both output and uc1
point to decoded's first (and only) element.
Amends 45838673df6e64a6fd42570c4e8874c5181f7717.
¹ https://eel.is/c++draft/basic.compound#3.sentence-11
Pick-to: 6.8 6.5
Coverity-Id: 378348
Change-Id: Ib149386defd8b263df522a4f12b1af1b3fc1a20c
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 4eb9e0d3eedfc1b6de968308167af01b19f6ffe7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Instead of static constexpr QL1SV objects (which force the compiler to
allocate storage for them and therefore cause relocations), use inline
functions or mere automatic objects (which don't).
We'd normally call the inline functions fooKey() { return "foo"_L1; },
but since one of them "foo"s ends with "Key" already, put them into a
namespace instead, the name of which is taken from the comment that
used to introduce the static constexpr objects in the old code.
For the QL1SVs in the ctor: port them to QStringLiterals, because
their only use is to pass them to a function taking const QString&, so
this saves allocations. There never was a need to make these objects
static, as constexpr would be enough to force the compiler to
constant-fold them.
Unlike my earlier advice about how to create an empty QString most
efficiently, don't keep using ""_L1, use u""_s. This is because
there's no shared empty QString in Qt 6 anymore. It might still make
sense to add a more light-weight way to create an empty QString,
esp. one which is not referencing local data, but QString::_empty, to
extend the lifetime of the payload until QtCore unload time, but that
is outside the scope of the current patch.
Difference:
qgenericunixthemes.cpp.o:
- 0000000000000000 l O .data.rel.ro.local 0000000000000010 QGenericUnixThemeDBusListener::QGenericUnixThemeDBusListener()::signal
- 0000000000000040 l O .data.rel.ro.local 0000000000000010 QGenericUnixThemeDBusListener::QGenericUnixThemeDBusListener()::interface
- 0000000000000080 l O .data.rel.ro.local 0000000000000010 QGenericUnixThemeDBusListener::QGenericUnixThemeDBusListener()::path
00000000000000c0 l O .data.rel.ro.local 0000000000000010 QGenericUnixThemeDBusListener::QGenericUnixThemeDBusListener()::service
0000000000000000 l d .data.rel.ro.local._ZTV24QGenericUnixThemePrivate 0000000000000000 .data.rel.ro.local._ZTV24QGenericUnixThemePrivate
0000000000000000 l d .data.rel.ro.local._ZTV16QKdeThemePrivate 0000000000000000 .data.rel.ro.local._ZTV16QKdeThemePrivate
0000000000000000 l d .data.rel.ro.local._ZTV18QGnomeThemePrivate 0000000000000000 .data.rel.ro.local._ZTV18QGnomeThemePrivate
0000000000000000 l d .data.rel.ro.local._ZN13QMetaSequence12MetaSequenceI5QListIN2Qt3KeyEEE5valueE 0000000000000000 .data.rel.ro.local._ZN13QMetaSequence12MetaSequenceI5QListIN2Qt3KeyEEE5valueE
0000000000000000 l d .data.rel.ro.local 0000000000000000 .data.rel.ro.local
- 0000000000000000 l d .data.rel.ro.local._ZN29QGenericUnixThemeDBusListener6s_rootE 0000000000000000 .data.rel.ro.local._ZN29QGenericUnixThemeDBusListener6s_rootE
- 0000000000000000 l d .data.rel.ro.local._ZN29QGenericUnixThemeDBusListener9s_signalsE 0000000000000000 .data.rel.ro.local._ZN29QGenericUnixThemeDBusListener9s_signalsE
- 0000000000000000 l d .data.rel.ro.local._ZN29QGenericUnixThemeDBusListener9s_settingE 0000000000000000 .data.rel.ro.local._ZN29QGenericUnixThemeDBusListener9s_settingE
- 0000000000000000 l d .data.rel.ro.local._ZN29QGenericUnixThemeDBusListener10s_providerE 0000000000000000 .data.rel.ro.local._ZN29QGenericUnixThemeDBusListener10s_providerE
- 0000000000000000 l d .data.rel.ro.local._ZN29QGenericUnixThemeDBusListener9s_dbusKeyE 0000000000000000 .data.rel.ro.local._ZN29QGenericUnixThemeDBusListener9s_dbusKeyE
- 0000000000000000 l d .data.rel.ro.local._ZN29QGenericUnixThemeDBusListener14s_dbusLocationE 0000000000000000 .data.rel.ro.local._ZN29QGenericUnixThemeDBusListener14s_dbusLocationE
0000000000000000 l d .data.rel.ro.local._ZN9QtPrivate25QMetaTypeInterfaceWrapperIvE8metaTypeE 0000000000000000 .data.rel.ro.local._ZN9QtPrivate25QMetaTypeInterfaceWrapperIvE8metaTypeE
0000000000000000 u O .data.rel.ro.local._ZN13QMetaSequence12MetaSequenceI5QListIN2Qt3KeyEEE5valueE 00000000000000d8 QMetaSequence::MetaSequence<QList<Qt::Key> >::value
0000000000000000 w O .data.rel.ro.local._ZTV24QGenericUnixThemePrivate 0000000000000020 .hidden vtable for QGenericUnixThemePrivate
0000000000000000 w O .data.rel.ro.local._ZTV18QGnomeThemePrivate 0000000000000020 .hidden vtable for QGnomeThemePrivate
0000000000000000 w O .data.rel.ro.local._ZTV16QKdeThemePrivate 0000000000000020 .hidden vtable for QKdeThemePrivate
- 0000000000000000 u O .data.rel.ro.local._ZN29QGenericUnixThemeDBusListener6s_rootE 0000000000000010 .hidden QGenericUnixThemeDBusListener::s_root
- 0000000000000000 u O .data.rel.ro.local._ZN29QGenericUnixThemeDBusListener9s_signalsE 0000000000000010 .hidden QGenericUnixThemeDBusListener::s_signals
- 0000000000000000 u O .data.rel.ro.local._ZN29QGenericUnixThemeDBusListener14s_dbusLocationE 0000000000000010 .hidden QGenericUnixThemeDBusListener::s_dbusLocation
- 0000000000000000 u O .data.rel.ro.local._ZN29QGenericUnixThemeDBusListener9s_dbusKeyE 0000000000000010 .hidden QGenericUnixThemeDBusListener::s_dbusKey
- 0000000000000000 u O .data.rel.ro.local._ZN29QGenericUnixThemeDBusListener10s_providerE 0000000000000010 .hidden QGenericUnixThemeDBusListener::s_provider
- 0000000000000000 u O .data.rel.ro.local._ZN29QGenericUnixThemeDBusListener9s_settingE 0000000000000010 .hidden QGenericUnixThemeDBusListener::s_setting
- 0000000000000000 u O .data.rel.ro.local._ZN9QtPrivate25QMetaTypeInterfaceWrapperIvE8metaTypeE 0000000000000070 .hidden QtPrivate::QMetaTypeInterfaceWrapper<void>::metaType
RELOCATION RECORDS FOR [.data.rel.ro.local._ZTV24QGenericUnixThemePrivate]:
RELOCATION RECORDS FOR [.data.rel.ro.local._ZTV16QKdeThemePrivate]:
RELOCATION RECORDS FOR [.data.rel.ro.local._ZTV18QGnomeThemePrivate]:
RELOCATION RECORDS FOR [.data.rel.ro.local._ZN13QMetaSequence12MetaSequenceI5QListIN2Qt3KeyEEE5valueE]:
- RELOCATION RECORDS FOR [.data.rel.ro.local._ZN29QGenericUnixThemeDBusListener6s_rootE]:
- RELOCATION RECORDS FOR [.data.rel.ro.local._ZN29QGenericUnixThemeDBusListener9s_signalsE]:
- RELOCATION RECORDS FOR [.data.rel.ro.local._ZN29QGenericUnixThemeDBusListener9s_settingE]:
- RELOCATION RECORDS FOR [.data.rel.ro.local._ZN29QGenericUnixThemeDBusListener10s_providerE]:
- RELOCATION RECORDS FOR [.data.rel.ro.local._ZN29QGenericUnixThemeDBusListener9s_dbusKeyE]:
- RELOCATION RECORDS FOR [.data.rel.ro.local._ZN29QGenericUnixThemeDBusListener14s_dbusLocationE]:
RELOCATION RECORDS FOR [.data.rel.ro.local._ZN9QtPrivate25QMetaTypeInterfaceWrapperIvE8metaTypeE]:
See
https://stackoverflow.com/questions/19067010/finding-where-relocations-originate/19338343#19338343
for the script to generate this output.
See https://www.akkadia.org/drepper/dsohowto.pdf Section 1.6 for why
we care.
Amends 0328e4297e339de8a2acd84979c667936f6fadf8.
Pick-to: 6.8 6.5
Task-number: QTBUG-100536
Change-Id: I1fd65e3ed5bceeb2a49141834dbd12f4bf42cc8c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 1370ecf293b258ba74a1187c5bbf8e1a192765e4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Coverity complains that inflateInit2() will read stream.opaque, which
wasn't initialized by us. At least in the copy of zlib that is
contained in Qt, this is false.
But xxflate() in qbytearray.cpp value-initializes its z_stream (and
therefore doesn't manually need to set .zalloc and .zfree), so do that
here, too.
Amends the start of the public history.
Pick-to: 6.8 6.5
Coverity-Id: 310213
Change-Id: I487072a0d2375a932f3ffb9a1f252fec9e2f2d0d
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit a817ba8e9c42dfffd31eb26ac522488c2a4ec61e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Some icon engines might not be able to return a properly sized pixmap.
Therefore we must make sure within QIcon::pixmap() to return a pixmap
with the requested size. This is done by simply adjusting the device
pixel ratio instead scaling to avoid the loosy scaling until the icon is
drawn later on.
The dpr adjustment was already done for dpr == 1.0 so the function
returned different results for different device pixel ratios ...
Pick-to: 6.8
Fixes: QTBUG-133412
Change-Id: I66f2ac76ebf240a625649171b4553a3b95d7c3a1
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit f142bd121c5be67a5701c849cea25e7abe4cd720)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
MINGW's implementation of Microsoft::WRL::ComPtr lacks comparison
operators, and calling operator==() on them will implicitly convert them
to bool before comparing the resulting bool values. Two non-zero ComPtr
instances will therefore always compare equal, even if they point to
different interfaces.
This patch adds ComPtr comparison operators if they are missing, and
replaces existing includes to wrl.h or wrl/client.h with
QtCore/private/qcomptr_p.h
Pick-to: 6.8
Change-Id: I8123d9d874ae53ebfd6d381b69097e75527848b6
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 6d1384034deb681c1c4a656a1582f3e1606b1c1a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Useful to annotate certain linking expressions that need to be skipped
for inclusion in prl file generation. E.g. $<TARGET_OBJECTS>
expressions that represent propagated object libraries, which are
handled by the rcc_objects walk lib code path, and thus need to end up
in prl RCC_OBJECTS section, instead of the
QMAKE_PRL_LIBS_FOR_CMAKE one.
Pick-to: 6.8
Change-Id: Ib08b00200b6b06d32eab15ecb15c0820eec2a908
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit ce0004dff7b8a5f5030c2f060a659b9c5e6e62ea)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
On macOS custom uri-scheme opens may generate a QFileOpenEvent that
the applications can handle. However when adding support also for
QDesktopServices::setUrlHandler(), this delivery mechanism stopped
from working because the event was unconditionally consumed /
delivered to only the url handler.
Instead change the logic such that if the url handler does not
handle it, allow a QFileInfoEvent to be created.
Amends: 664c7ffb212eb898ed03f7b19c883400fa027b6b
Fixes: QTBUG-134316
Pick-to: 6.9.0 6.8 6.8.3
Change-Id: Ib1ed371ef531586bf549cf473b2a54748584d91d
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 4755f52c08aac424b18ad94404ca8f7dabf8220d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
When running on Android 15 with target sdk set to 35 (Android 15),
the new edge-to-edge behavior is enforced, so the test needs to
account for that and take the full screen size instead of deducting
the insects.
Pick-to: 6.9.0 6.8
Task-number: QTBUG-132311
Change-Id: I178265b02878206ba95c8f83507963ce0bd0d732
Reviewed-by: Petri Virkkunen <petri.virkkunen@qt.io>
(cherry picked from commit 1f3c5f8f9025057f9a7f6b6143f33a529583ab19)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
- State that both arguments must be within bounds.
- Add example.
Pick-to: 6.8 6.5
Change-Id: Ieba9c3469a2c8cf8c20d867abff5865d96c3ee6e
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
(cherry picked from commit 6b361119ef413a229b95145ed3d3f51a7388a020)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
These were supported by Qt 5's configure.
Pick-to: 6.8
Change-Id: I3d902bb9e211f1dfecbf0835203e7b9e60fb41f6
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 077412a3cfd52b326cdba768156683cd94841330)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
... when instantiating the MetaTypeQFutureHelper for QFuture<void>.
Simply enabling /W4 for tst_qfuture also generates this warning, but
also much more. So I'm not providing any unit-test here.
Amends 90d9a86c2e762c9426d0facbd54ed5dbff574ecd.
Fixes: QTBUG-133406
Pick-to: 6.9.0 6.8 6.5
Change-Id: I22a53b872818763b80f333f597ddd19a1c1e30ac
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit ff6bf61b17ee4fc8ca11e016242d7c3399a02045)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
In some setups, e.g. when using precompiled headers, the compiler will
see all definitions necessary to compile a class containing a QML
registration macro. However, moc won't be able to resolve the macro to
its expanded text, and thus miss the information.
This leads to a runtime failure when the QML engine cannot find the
type, because it has not been registered (as qmltyperegistrar relies on
the information collected by moc).
To avoid this, teach moc about the registration macros, and warn
when encountering them. We do this by comparing identifiers inside
classes against the names of the QML registration macros.
We do not error out, as a user might use the names of the macros as
normal identifiers, especially in a non-QML project (as unlikely as this
might be).
Warning out when finding a registration macro might sound
counter-intuitive, but works because moc should not actually see the
macros at this stage: When the header is included, macro expansion will
replace the macro with its expansion; only when the header is missing
will we ever see the macro as an identifier.
Task-number: QTBUG-134148
Pick-to: 6.8
Change-Id: I2f213444993a9d782a027c2dc25ffcbe0824ddca
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
(cherry picked from commit fd88f44c15e969da3228ab2b0a302e78e2ccc8de)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
TSAN does not support intercepting pthread_clockjoin_np (only join,
tryjoin and timedjoin), and will claim that an application leaks threads.
Disable the clockjoin codepath when building under TSAN.
Unfortunately I can't seem to find a version check for the sanitizers to
apply here and know if and when TSAN will get this support.
Change-Id: If12419e5d600e519bf4315d27f74d74a87dcf792
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 84d6309cf1eaf7632298d1305ce17f5f7497e1c0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
\brief tags are not used for member function documentation.
Explicitly set the prototype for qdoc instead, it doesn't seem to
know what to do with the definition in an ObjectiveC file and
produces link warnings.
Pick-to: 6.9.0
Change-Id: I89252e7b84586e987ed6d950d90142e916d8f1df
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 03efe9a21bb7a879ae51e3ad007dd2cdb8c6d981)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
When certain features are disabled, qguiapplication.h does not get
included which results in a compiler error. Therefore add it directly.
Pick-to: 6.9.0 6.8
Fixes: QTBUG-134235
Change-Id: I7836fc52c5037ca15c7ce48617c9f814d71963aa
Reviewed-by: Liang Qi <liang.qi@qt.io>
(cherry picked from commit 98653cca453fe3d88807d1a314ae17efadd7c958)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Cleanup the drawing code to avoid useless drawings by only calling
drawRect once with the correct parameters. This also removes rendering
artifacts due to e.g. rounding errors with a dpr != 1.
Fixes: QTBUG-132187
Pick-to: 6.8
Change-Id: Ib5eff89c8bdcbd0c86954e78dadaad83346c92ff
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 611031e4f069aea6a0312b5c459247094204d5eb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Don't do proxy checks for the thing you want to test. Whenever possible,
test the thing you want to test.
We can't check for the definition of certain structs, though. Those have
to remain a proxy check.
Pick-to: 6.9.0 6.8
Change-Id: I5003e785706cd66923e4fffd6b11254233d09dc5
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 9c4c5dc9f9c4358489d138dc4cf5aa6131b1bd24)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Disable text drag if asyncify is not enabled.
Fixes: QTBUG-131256
Pick-to: 6.8
Change-Id: I6589f11dda42c2f41db610e7cfece8a3db6573db
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
(cherry picked from commit 665acc02cf106071d57d012bb68250c2ea5d0a2c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
- Replace colors in offline-dark.css
- Do not use the note and attention icons in offline templates
Task-number: QTBUG-133761
Pick-to: 6.9.0 6.8
Change-Id: I55e81d6c3887764542e23c8f85f4d46e273b3885
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
(cherry picked from commit c770015876390de0cc9c77a3d5b123637204b92c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Qt CSS allows to read palette colors by using "palette(role)" but
the supported roles haven't been updated since at least Qt 5.12,
therefore placeholder-text and accent are not recognized.
An "accent-color" property has been added to *set* the accent
color on an object when it was introduced but it wasn't possible
to *read* the accent color, even though it was documented to work.
For sake of completeness, add tooltip-base and tooltip-text as well.
Also amend the comment in QPalette to mention QCss and add a
static_assert so this doesn't happen again.
Pick-to: 6.9.0 6.8
Change-Id: I59ed09dc91fa18ca0356857c8ddb43946b309035
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 9194366923e409243617c34b640e82b54a2e7e05)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This is invalid, e.g. it asserts in
QConcatenateTablesProxyModel::index()
Fixes: QTBUG-134210
Change-Id: I21acad9497d423b0366991296e8dd498d51395ea
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 93694e99c214a5166fc842f92659e42260230dce)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
When a menu has a custom font size set, the size was adjusted to reflect
this *after* the additional widths for icon or checkmark was added.
When the used font is larger, the additional width added for the icon or
checkmark will not be honored then.
Therefore the size with the new font has to be added before adding the
size for the icon/checkmark.
Pick-to: 6.8
Fixes: QTBUG-115356
Change-Id: I33e83022bea9e3a531ac8e1651d8655076d88b4b
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 5436c4a363aa856180ce2949c2f5eeed451abfa9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
When a top-level widget has a graphic effect applied,
QWidgetPrivate::clipToEffectiveMask() must not use the parent widget for
the mask calculation as this prevents the loop below from bailing out in
the first loop (w->isWindow()) and might mess up the clip region when
there is a widget with a mask in the parent chain.
Pick-to: 6.8
Fixes: QTBUG-131893
Change-Id: I5d5777e730bee309db21ad5eb65387d19321ee6c
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 49f462b7f873ecba6bb205697338a4f1eef6d307)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The spec does not allow this and qDrawBorderPixmap can not handle it.
Pick-to: 6.8 6.5
Fixes: QTBUG-107904
Change-Id: I5873dec2312865fb96ccccd3cc2292c6b9e1d4f0
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 254fc6a9782b29180cd545e18c34bcaf4cc03a7a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
When split APKs, when an AAB is used for example, the native libraries
are kept in a separate APK and not under the main app APK, thus, we
need to use that instead to get the path of the native libs otherwise
the app would crash failing to load Qt libraries.
Amends 0db5b424cdaede8724886e8a1eda1380382d9aaf.
Pick-to: 6.9.0
Fixes: QTBUG-134101
Change-Id: I930ba005aaefc15e4500b7290167892dc2428066
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 75367d1cfe564953d980b0c6917257f8ec0faa93)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
When the name/id is "UTC" then we can reuse the interned
string literals, which allows us to get rid of extra memory
allocations (and frees later on) for these strings.
This patch brings another hefty relative improvement to my benchmark.
Compare the following results for tst_QTimeZone::utc benchmark as
built on my machine with:
Config: Using QtTest library 6.10.0, Qt 6.10.0 (x86_64-little_endian-lp64 shared (dynamic) release build; by GCC 14.2.1 20250207), arch unknown
Before:
102.004937 nsecs per iteration (total: 102,004,835, iterations: 999999)
452.836869 CPU cycles per iteration, 4,44 GHz (total: 452,836,417, iterations: 999999)
1,182.801068 instructions per iteration, 2,612 instr/cycle (total: 1,182,799,886, iterations: 999999)
267.143901 branch instructions per iteration, 2,62 G/sec (total: 267,143,634, iterations: 999999)
After:
36.708812 nsecs per iteration (total: 36,708,776, iterations: 999999)
169.024518 CPU cycles per iteration, 4,6 GHz (total: 169,024,349, iterations: 999999)
601.286607 instructions per iteration, 3,557 instr/cycle (total: 601,286,006, iterations: 999999)
139.051610 branch instructions per iteration, 3,79 G/sec (total: 139,051,471, iterations: 999999)
Relative Delta:
before after improvement
nsecs 102.0 36.7 2.78x
cycles 452.8 169.0 2.68x
instr. 1182.8 601.3 1.97x
branch 276.1 139.1 1.98x
Pick-to: 6.8
Change-Id: I4aae3ac59edc173f96751d7e05335ad6b63f7275
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit c67659149f7f3a4600a211e82bfd067a8e08ae51)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Instead of using the QTimeZone ctor taking a string representing
UTC which then first needs to be parsed, use the offset-from-UTC
ctor with an offset of 0.
This approach is much faster, compare the following results for
the tst_QTimeZone::utc benchmark as built on my machine with:
Config: Using QtTest library 6.10.0, Qt 6.10.0 (x86_64-little_endian-lp64 shared (dynamic) release build; by GCC 14.2.1 20250207), arch unknown
Before:
358.686871 nsecs per iteration (total: 358,686,513, iterations: 999999)
896.524312 CPU cycles per iteration, 2,5 GHz (total: 896,523,416, iterations: 999999)
2,227.000427 instructions per iteration, 2,484 instr/cycle (total: 2,226,998,200, iterations: 999999)
560.000375 branch instructions per iteration, 1,56 G/sec (total: 559,999,815, iterations: 999999)
After:
102.004937 nsecs per iteration (total: 102,004,835, iterations: 999999)
452.836869 CPU cycles per iteration, 4,44 GHz (total: 452,836,417, iterations: 999999)
1,182.801068 instructions per iteration, 2,612 instr/cycle (total: 1,182,799,886, iterations: 999999)
267.143901 branch instructions per iteration, 2,62 G/sec (total: 267,143,634, iterations: 999999)
Relative Delta:
before after improvement
nsecs 358.7 102.0 3.52x
cycles 896.5 452.8 1.98x
instr. 2227.0 1182.8 1.88x
branch 560.0 267.1 2.10x
This is quite a significant change for such a trivial patch.
Pick-to: 6.8
Change-Id: I5872fe8f1158ff9f6bf306ca8b069559cb59beec
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 765193693982abdbc53910ff0d7d1149332ca83e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Basically this should work exactly the same as constructing the
QUtcTimeZonePrivate directly. Follow-up performance optimizations
should not change any of this behavior.
Pick-to: 6.8 6.5 5.15
Change-Id: I2a3e78965f3a553b8b70cb12f7772b9fdfbf7bf7
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 7a79ce13a93aab724e8943d83fc903c88466d053)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Don't repeat the body in the two QWidgets ctors, call one from the
other instead.
This will help fighting Coverity's hallucination that QWidget::data is
used uninitialized, or, after 58b9250aea0b1b41c8cbd1033149371a93a5b2c1,
dereferenced while it's still nullptr.
Coverity-Id: 475552
Coverity-Id: 475551
Coverity-Id: 475550
Coverity-Id: 475549
Coverity-Id: 396828
Pick-to: 6.8 6.5
Change-Id: I1f9a8b93871143b420b9c8f247e49d57510a2379
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 66268742861c3eb9b3d97c2758a1babbae850e1f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QUrl has an intentional deviation from RFC 3986 when it comes to those
characters, matching the behavior of major browsers: we distinguish the
forms '[' and ']' from their encoded forms. However, for local files,
they are definitely identical, because there's no such thing as a
percent-encoded file names.
[ChangeLog][QtCore][QUrl] QUrl::fromLocalFile() will now decode the
square bracket characters '[' and ']' to their percent-encoded forms.
This will be visible in calls to toString(), toEncoded(), or the encoded
form of path(). QUrl's comparison operator will consider the old
(created from an encoded URL string) and new forms to be different.
Pick-to: 6.8
Fixes: QTBUG-134073
Change-Id: I9eae083007103e34f73cfffd59a618069eba0e19
Reviewed-by: David Faure <david.faure@kdab.com>
(cherry picked from commit 5e936b60fc921e21b8153a83113886a1de333b57)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QStyle::styleHint() take the QWidget as optional third parameter. Add
this to calls to styleHint() where appropriate.
Task-number: QTBUG-2501
Pick-to: 6.8
Change-Id: I95b85d51ce98540920243b37473b97426eb40ab4
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 6f813bcb441ee195d88cc9fd39921bc4b5fa0192)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QStyle::styleHint() take the QWidget as optional third parameter. Add
this to calls to styleHint() where appropriate.
Task-number: QTBUG-2501
Pick-to: 6.8
Change-Id: I62aa251f7dd9d78178ea8aefc1e2882d3ac040be
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 5b320c146b2d67bb9bec92d647ec7fb5ae6b601d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This extends the test with a few more rows, and with delimiters that the
Apple APIs seem to encode differently. Rather, it's QUrl that deviates
slightly from the standard: we keep the delimiters unchanged,
regardless, like browsers do.
Task-number: QTBUG-134073
Pick-to: 6.8 6.5
Change-Id: I20a7b66a9959b17597cffffdf3652b9167d00d07
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 31753e722cd441de371be8f1e11b3bf089b187e2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The external doc references need to be appended as strings, not list
elements, otherwise there will be semicolons in the output SPDX file.
This issue was inherited as-is from the upstream SBOM generation
project.
We are fortunate the json converted files are missing the semicolons
due to implementation specifics.
Pick-to: 6.8
Task-number: QTBUG-122899
Change-Id: I2b91775d59d64709b72ff7130dd4f6b506ef8244
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 94e19f42e80fdd8bc03c2f83b351e9662cdac8a8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Helper function that groups together compiler specific options and conditions
Pick-to: 6.8
Change-Id: Ibec52a19852ad528007f50316a52d2f867b5fe37
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 167b38712d2d8157393e0753f11c6c41b1740de5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Set the initial style to be automatic, that's the default. With this
change we also get rid of the warnings shown on application startup
complaining about the application not defining an initial immersion
style:
"Since your app does not define an initial immersion style in its
Application Scene Manifest, the default immersion style will be
applied. This does not match the immersion style defined at runtime
'full'. To make sure your app's state matches its runtime behavior
define an initial immersion style."
Change-Id: I1b8bba5f919b72d4f2507a19a30de49e8bfcd708
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 08146377db8ce782bac5b9561338ba20f7101ac5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Test is flaky on macOS.
Use QCOMPARE_LT instead of QVERIFY(a < b).
Blacklist on macOS.
Task-number: QTBUG-134105
Pick-to: 6.8
Change-Id: I8f1274ad67bd9ead392ecd0f9c9b7a01dc3edb1e
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 7c7731a8229a44050c02d33c7111e4d522909c1d)
Correct previously mixed up parameters to pushSegment(). stopProgress
can be set to 1 so stopPos is the only terminating condition.
Pick-to: 6.8
Change-Id: If590555ed08170800b67063aa10e853411180aa3
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
(cherry picked from commit 84e09e060bedd37d8de7cded7e430371e335c029)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
We have divergence in the way we document function, operator and
constructor constraints. About half use \note, while the other
doesn't. Some say "if and only if" while others say just "participates
only if".
So add a qdoc macro, \constraints, to semantically mark up these
constraints. It expands to a section titled `Constraints`, and
uses a predefined sentence (prefix) for constraints.
Documentation for constraints is moved to the end of the comment
blocks to separate them from the rest of the text.
Apply them to all the standard-ish constraint documentation blocks
(grepped for "participate"). I didn't look for other, one-off, ways
documentation authors may have documented constraints, but I'm also
not aware of any.
Re-wrap lines only if the result fits into a single line.
As a drive-by, drop additional "if"s, as in "only if X and -if- Y" to
make the texts work with the `Constraints` section.
Fixes: QTBUG-106871
Pick-to: 6.8 6.5
Change-Id: I18c2f9f734474017264e49165389f8c9c7f34030
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit b7a67b46e66f161def5bf879f19c66d3fcec1d8b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Add a link to QFontMetrics, which provides more information about the
differences between QFontMetrics and QFontMetricsF and why the latter
is the preferred choice.
Fixes: QTBUG-127528
Pick-to: 6.8 6.5 6.2
Change-Id: Ib5713a9d39bf312a6eae6b8b1a6d1dc1d47e25be
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
(cherry picked from commit bdf453afd7613d3e88099defb759444537527195)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
CUPS treats the "landscape" option as a boolean value
(IPP_TAG_BOOLEAN). In this case, all values other than "true", "on" and
"yes" are considered as false. As a result, using an empty string as the
value for the "landscape" option results in the print area still being
portrait.
Currently, the problem with printing landscape images (png, jpeg, etc.)
in Qt programs (e.g. Okular, Gwenview) occurs on Fedora 41 and other
distributions using cups-filters v2.0+.
The patch adds passing the value "true" instead of an empty string for
the "landscape" option, as CUPS expects for changing the orientation.
Pick-to: 6.8
Change-Id: Ib7ad1e2debcfff10e673757c97ef5614fb59a6ca
Reviewed-by: Albert Astals Cid <aacid@kde.org>
Reviewed-by: Lars Knoll <lars@knoll.priv.no>
(cherry picked from commit a77173486aaf9d2e4107f6e1120ac2316ae1c96f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
"Android" is trademarked and needs to be referenced in a certain way.
The following steps were taken:
-Created qdoc macro.
-Updated "Qt Android" and "Qt for Android" to use \Q4A in qdoc files.
The macro will need to be adopted in all documentation projects.
Task-number: QAA-2836
Pick-to: 6.8 6.5
Change-Id: I4b52247a4ed52047242a06404e6d3aa19de9c16c
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 9c6c6d7d388bee01ea4e5ea102d3b0ed359c3f00)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
[ChangeLog][QtGui][QColorDialogOptions] The class no longer
automatically saves settings such as the custom colors to a global
QSettings("QtProject") shared by all applications and no longer restores
custom colors from there. Applications that wish to retain the custom
color settings should use customColors() and setCustomColor() with their
own settings files.
Task-number: QTBUG-133805
Change-Id: I49cd7312054f41ca4cdbfffdcb60d6ea242393fc
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 9a753fa656a9bcae4193ceb38cfaf6e21641ddc2)
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
On my machine this gives me:
```
********* Start testing of tst_QTimeZone *********
Config: Using QtTest library 6.10.0, Qt 6.10.0 (x86_64-little_endian-lp64 shared (dynamic) release build; by GCC 14.2.1 20250207), arch unknown
PASS : tst_QTimeZone::initTestCase()
PASS : tst_QTimeZone::utc()
RESULT : tst_QTimeZone::utc():
358.686871 nsecs per iteration (total: 358,686,513, iterations: 999999)
896.524312 CPU cycles per iteration, 2,5 GHz (total: 896,523,416, iterations: 999999)
2,227.000427 instructions per iteration, 2,484 instr/cycle (total: 2,226,998,200, iterations: 999999)
560.000375 branch instructions per iteration, 1,56 G/sec (total: 559,999,815, iterations: 999999)
PASS : tst_QTimeZone::cleanupTestCase()
Totals: 3 passed, 0 failed, 0 skipped, 0 blacklisted, 374ms
********* Finished testing of tst_QTimeZone *********
```
Profiling shows some quite unexpected code paths that
I will try to optimize in follow-up patches. Note that
this function can be called frequently when deserializing
QDateTime over a QDataStream e.g. - I have stumbled over
it while profiling some KDE PIM code in akonadi.
Pick-to: 6.8 6.5 5.15
Change-Id: I7439df53ae8512c766f63cb4b0d4f33d14aa3a01
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 29c7beac2e0065cc0d03b9db6a701f7c690c6f56)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Some time ago, we spent a lot of time fine-tuning the behavior of
indexOf() and split() w.r.t. matching of empty needles, or in empty
haystacks. Make sure that (QByteArray) replace() is behaving
consistently.
It isn't. Filed QTBUG-134079 to track the issue.
Pick-to: 6.8 6.5
Task-number: QTBUG-134079
Change-Id: I16af5d2bb5b309a56e81854be434fa9430ae284f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 5fc1e9fa0c1925654412af5bf46ff95da99bc190)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Move the setting up of options like QT_GENERATE_SBOM into a separate
function, that can be called by projects other than Qt.
Pick-to: 6.8
Task-number: QTBUG-122899
Change-Id: I337c4e9b0b3154ff97f494887bf88ee01e8ed00c
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit dc5c7f9ead7e47b92c5717ca24d585a718a8b5f0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Some attribution entries don't have a SPDX license id specified, in
that case it's good to at least include the free-form license name and
file path.
Pick-to: 6.8
Task-number: QTBUG-122899
Change-Id: I75bb5c30645684ea74fe94da92ea30eb29965ad4
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit cf9f09cd60e3db37643ac6cf6cfd51aa00749892)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The PQ EOTF formula for BT.2100 [1][2] was incorrect. Fix it; while at
it, rename the variables to match the symbols used in the original
formula.
The inverse EOTF was correct, but also rename the variables there (for
the same reason).
[1] https://www.itu.int/rec/R-REC-BT.2100-2-201807-I/en
[2] https://en.wikipedia.org/wiki/Perceptual_quantizer#Technical_details
Change-Id: I6ce3a609824bee82053a16b3ff3cfc7cb396ce8f
Pick-to: 6.8
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit a7ff4679facb9a44dff8b63a7e461ababa6aedfb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
It somehow concludes that asize may be negative and would then cast to
an obscenely large size_t. This produces the following warning:
.../qbytearray.cpp: In member function ‘replace.constprop.isra’:
.../qbytearray.cpp:2579:23: warning: ‘memcpy’ specified bound between 9223372036854775808 and 18446744073709551615 exceeds maximum object size 9223372036854775807 [-Wstringop-overflow=]
2579 | memcpy(d + to, a, asize);
| ^
Check for asize > 0 rather than asize != 0.
Pick-to: 6.8 6.5
Change-Id: I63bccb1bf3ff45d539af4efe6843d2c648d7cb86
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 177cd123d29f818413db4bb7a9d92b8485c95947)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Such lines are rendered by drawing a capless line that is pen-width
long, i.e. a square, to represent the two line caps. However, the line
length offset was added before any transformation, so one could end up
with a long line being rendered if the world transform had a large
scale, say.
Pick-to: 6.8
Change-Id: Idff8a2de54c97e35facc8f4e09c43dfea7397588
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
(cherry picked from commit 56de11397559af3b9694ef2b99d93a469889ae5e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The docs for D3D11_TEX3D_UAV do not mention accepting -1 as WSize,
unlike D3D12_TEX3D_UAV. Hence passing in m_depth for D3D11.
Fixes: QTBUG-129300
Pick-to: 6.8
Change-Id: I517d23e076039543361d2bca1b91cddd47abcfaa
Reviewed-by: Jonas Karlsson <jonas.karlsson@qt.io>
(cherry picked from commit 6f89357f59b507c0dcdc177bc1ecfbbc94d6fed3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QVLA preallocates space for 256 entries, and while that should be
enough for most uses, it may be too much in the way of stack usage.
Instead of using a QVLA with a non-standard preallocation, use the
more compact std::string benefitting from its SSO.
Pick-to: 6.8 6.5
Change-Id: Ia22543fb287a1976f316f7a4d27b23a22f511463
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit 7c21630ce625817f1dc8e7182023b3fc6d36ac37)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This reverts commit 22f33e1bd2c43e0223cd52b94e6ecead56a2e1b5.
Reason for revert: Needed provisioning changes are now in
Change-Id: Ibc1d1833942394efec0c24dc7e7a3e6ada5b8eea
Reviewed-by: Jukka Jokiniva <jukka.jokiniva@qt.io>
Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
It's possible for a project to install a custom file with the same name
into different destination directories, and want to include them in
the SBOM.
Previously this failed at CMake generation time with an error like:
CMake Error: Files to be generated by multiple different commands:
qt_sbom/SPDXRef-PackagedFile-foo-bar.cmake
This happened due to using a non-unique filename for the generated
SBOM building file, as well as the spdx id the file name is based on.
Include a short hash based on the installed relative path of the file
to avoid spdx id clashes, and thus generated file name clashes.
Pick-to: 6.8
Task-number: QTBUG-122899
Change-Id: I4c2ecd4652708504ef299af9b6f53d680d542382
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 9245d0a0f0761364e7b5b3d1c5c96cba16522820)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Previously one could only pass an explicit list of FILES to
_qt_internal_sbom_add_files. Add a new DIRECTORIES option, which will
glob the given directory paths, and include the found files in the
SBOM.
Pick-to: 6.8
Task-number: QTBUG-122899
Change-Id: Ia27afa93460d9f2e4462a49e30e4d6338300e8f7
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 9db03c9dca1b7e403458fd9f43adb17a0ac8e55c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Nested SBOM attribution targets were always created with the
QT_THIRD_PARTY_SOURCES type even in user projects.
Set an appropriate type depending on whether we are handling a qt
entity type or not.
Pick-to: 6.8
Task-number: QTBUG-122899
Change-Id: Id8144d1b8093de78f2987a611a6de8e6d4777084
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 0d9106bf7670b08c4bae11c3986b9cf3e0818b52)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
It mirrors the Qt-specific QT_THIRD_PARTY_SOURCES one, to be used when
creating an SBOM attribution target that references a 3rd party
library's sources, as opposed to a complete 3rd party library.
Pick-to: 6.8
Task-number: QTBUG-122899
Change-Id: I8f7f9f7386ffdc18dd8ae6ee32e39019639f5303
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 8b06d37fb08d22e9f81ae2653aeafc105fc5bb61)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Put the attribution file path and entry first, followed by the id,
and the rest of the fields.
Pick-to: 6.8
Task-number: QTBUG-122899
Change-Id: I478a48980e6207646189d6b80ec57dbc9efb4902
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit a5c7eb97ceb19ac90f8117240ad04cc717803555)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Allow creating nested SBOM attribution targets also for non-Qt targets
in user projects. This will allow using qt_attribution.json files in
user projects.
Rename PARENT_TARGET to ATTRIBUTION_PARENT_TARGET to make it clear
what the parent target is for.
Pick-to: 6.8
Task-number: QTBUG-122899
Change-Id: Ia08ee934a9dc03827fcc26d0fc90e072499e8a21
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit a2ddd4fbd88353b21617e539266196b592683a3a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Previously one could attach all attributions from a
qt_attribution.json file to a target, or a specific entry based on a
given numeric index.
This is not always practical, as the index of an entry can change, and
including all entries might be too much.
Allow specifying a list of attribution ids to include in the SBOM.
This will parse all the attribution entries and only include those
that match the given ids.
If a list of ids is provided, and any of them is not found, an error
will be shown.
Pick-to: 6.8
Task-number: QTBUG-122899
Change-Id: I2ca442fe0cd6d18773861f90f32ab7380aaeacdd
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 52045e51e7e95f31a37127215c53e430fa77c8d3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
So it can be used in other non-Qt projects.
Pick-to: 6.8
Task-number: QTBUG-122899
Change-Id: I11d81d2c6819906fffbffe81f4db1b7af28cb99b
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 6cd7f0c09b71ea49bdd3dd925b9a85dfe6cc943e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
So it can be read / used in other non-Qt projects. We don't have such
a restriction on other keys read from the qt attribution files.
Pick-to: 6.8
Task-number: QTBUG-122899
Change-Id: I225d83b26c68323761a8b13b3e6442057b5f7c7f
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 422f5d859f3056433e6ee33ea389f2ecff1543d5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Extends e75c1a00e31723f1c9deb8427725fa0a58fae2a8 because calling
receivers() in disconnectNotify() can deadlock too.
As a drive-by, some statements are generalized further:
* "expensive initialization" -> "expensive operations" since that is
what the relevant snippets actually show.
* The potential race condition is not limited to "after this function
returns and before the signal gets emitted"
Task-number: QTBUG-106025
Change-Id: Iff014706b9e8d8147e3bbb9ac51542197eec5db3
Pick-to: 6.8 6.5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit f5b874fd2d393b783dad85c95a158383420e481a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
It's thread-safe, whereas trying to load qApp isn't in Qt 6.x (will be
in 7.0) and dereferencing it to call QObject::thread() will probably
never be. It's also faster, being a single function call instead of two
or three.
This is not an exhaustive search, it's just a few places I found while
searching for QThread::instance().
Pick-to: 6.8
Change-Id: I3b4e1c75bb3966e2cd2dfffd79bfc8a40f6cf40b
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 6fb39ca2cbb111469ce09c8342997eb5375e3239)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This patch updates the macro AndroidBuildToolsVer to
version 35.0.1.
The version 35.0.1 is used elsewhere, see
b49421a984ac2b203b7995f3787b67184c990089
Amends: 9b475eadfcf04194a094454f65295c3a456000a4
Task-number: QTBUG-129462
Pick-to: 6.8 6.5
Change-Id: Ic15e12c563fa3d16315daa13b6f6b6ef19535954
Reviewed-by: Nicholas Bennett <nicholas.bennett@qt.io>
(cherry picked from commit 7a7093eb87ebc986555b855611018066e2c39bed)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Clang 20 has fixed the referenced issue. Once more this shows the
importance of versioning compiler-related checks...
Amends 1b1ae345025d1cac953985d4cfebd20fadb6bc99.
Change-Id: Iea88d466883562b0130639d7c0f2f3b984acdbc2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit fb1824a9d669c601ebd540c9ca16a9687d7d9706)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Introduce a new module `TestInternalPrivate`.
Kitware's RunCMake allows to create more granular unit tests using
`cmake -P` scripts instead of configuring, generating and building full
projects.
[ChangeLog][Third-Party Code]
Add upstream cmake's RunCMake test infrastructure module to
src/testinternal/3rdparty/cmake to aid in creation of cmake auto-tests.
Pick-to: 6.8
Change-Id: I08cb7c6dc6f61bde29f176d58295f4f660b34ca8
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 39e7946cb6562c6f9b1baf5c44b1694922d0538e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
To more easily spot white space differences.
Pick-to: 6.8
Change-Id: I1e07960f78c95ca536243ce5c4fc6c302c47a7db
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 2dd0c4520fdee50a3511ca2f83decdf807ba2cb3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
When reconfiguring an MSVC -release build with 'cmake .' after a full
build, instead of being a no-op, it rebuilt everything.
This happened because of CMAKE_CXX_FLAGS_RELEASE being accidentally
modified on each reconfiguration, resulting in extra whitespace being
added to the compiler command line rules.
Specifically, this was because we always added '-O2 -Ob3 ' as a string
to the compiler flags, but due to stripping, always tried to remove
only '-O2 -Ob3' (no trailing white space) when removing the
optimizations flags, resulting in an extra white space for each run.
Remove the trailing white space after '-Ob3 '.
Amends 2fb134f3fe8fdeb1f36c346cff3b09a2b7a095a7
Pick-to: 6.8
Change-Id: I46eb4c3b769ae6b063fe62df05c0cb92f13bda30
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit fdb9a5141446ed8aa767d88a921c24221b0704ea)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
If the source file sets `QT_INSTALL_PATH` property, it will install the
CMake files in the relative path starting from the config-dir in both
the build and install paths.
Pick-to: 6.8
Change-Id: I86197d62bfac96f9c142d8abfe85c9b6f6f1a527
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit aef789ad97ee9b8f3254a0e315a0d8a4785bcbf7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
It should be spelled UTF-8 (official name by the Unicode Consortium).
Pick-to: 6.8
Change-Id: Ib358d0870e77f0cb4cdb920ed5ca829f100707a1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 0770171dcda24a567d6f57b87fdd284011e56e16)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
- Do not use a version for the executable module target
- Rely on QTP0001 for the RESOURCE_PREFIX (via
qt_standard_project_setup)
- Do not use OUTPUT_DIRECTORY to avoid a URI mismatch, potentially
causing issues with the implicit import. Instead, use
RUNTIME_OUTPUT_NAME to avoid a conflict between folder and executable
name.
Change-Id: Ic6188d96042e7b34eb3f423daf2b57290ca18a11
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit e84145d6c14e92c3a499904f70046bc3ceee5960)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Commit 2140edaaab0bf61f354db521efca773568becc56 introduced
QWizard::setCurrentId that allows setting the property
directly, so drop the obsolete sentence in the QWizard::currentId
doc stating that this isn't possible.
Pick-to: 6.8 6.5
Change-Id: I5e7da2323e66a6e8bfd653dfebcba4363023b744
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 71246cbdc64c4a5b3b3859421221bcc36c4a61c3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
On CI an Android emulator with SwiftShader software graphics
implementation is used. SwiftShader implementation is unable
to emulate this OpenGL functionality.
Blacklisting removed. QSKIP the test if it is run in Android platform,
OpenGL and SwiftShader sw graphics implementation is found.
Task-number: QTQAINFRA-6331
Pick-to: 6.8
Change-Id: I4a7e64e464ea04409154be2e7b3135ecd88a29fc
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Amends commit be0f1af3f1829da0d321c12dbd40d5743d3b2eb5 ("CBOR: remove
the X11 True and False for good"), which removed the #define from the
top of the files, but didn't remove the checking of the macro from the
bottom of them.
Change-Id: I92e76842a4117f6feed3fffdac2fcec01367101e
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
(cherry picked from commit 00f3ca950a6cab105c95b53ce2b3b93282abcea8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The macro, as it was, makes debugging REALLY hard:
FAIL! : tst_QStorageInfo::operatorEqual()
The computed value is expected to be equal to the baseline, but is not
Computed (lhs == rhs) : 0
Baseline (expectedEqual): 1
Loc: [qcomparisontesthelper_p.h(178)]
It prints the location of the macro helper, not the line that called it,
so one has to guess which of the many uses in a function has failed. And
it prints the boolean of whether the comparison result is the expected
value, not the values of left and right.
QT_TEST_ALL_COMPARISON_OPS also needs a similar fix, but I don't have
time for it. Ideally we'd replace the qScopeGuard with a proper QTest
failure report, which would extract the printers for Left and Right.
Change-Id: I7a643066137c5fcdb9e7fffd83d9bf7cf4cccd6c
Reviewed-by: Rym Bouabid <rym.bouabid@qt.io>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 4a4c4252919d4894c7e5c6f2e636dda5dc1b1d0d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This amends 073fae097ce40bee1532c252a8c696840b5dfc16 which added
an escape before calculating the vertical metrics if they were too
big and would overflow. It missed one spot, which was when using
the winAscent/winDescent instead of the typo-metrics.
Change-Id: Ib6a7705f6676c66bfd04b37efa30fe2d1b99581c
Reviewed-by: Robert Löhning <robert.loehning@qt.io>
(cherry picked from commit f846754663aae1652e4eec9a441ee222af352319)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Previously, only 3 purl entries could be added to a target, which
tightly coupled to Qt's needs: a QT one pointing to code.qt.io,
a MIRROR one pointing to github, and an upstream one pointing to some
upstream third party location.
Rework the implementation to allow for an unlimited number of PURL
entries and to allow more flexibility when adding PURLs in a user
project.
The new syntax for adding PURLs to a target, which is also the basis
for a future public API is as follows:
qt_internal_add_sbom(<target>
PURLS
[[PURL_ENTRY
PURL_ID <id>
PURL_TYPE <type>
PURL_NAMESPACE <namespace>
PURL_NAME <name>
PURL_VERSION <version>]...]
PURL_VALUES
[purl-string...]
)
The PURLS keyword is used to specify multiple PURL entries, each
starting with the PURL_ENTRY keyword. The PURL_VALUES keyword is used
to specify a list of pre-built purl strings.
PURL_ID is an optional argument used to identify a specific purl
entry, which is mostly needed for Qt's needs, to post-process them
further.
The rest of the options are pre-existing from the previous
implementation.
Implementation-wise, there's a new custom parser to be able to parse
and validate PURL_ENTRY arguments.
The VERSION option was renamed to PACKAGE_VERSION, to avoid some
issues in cmake_parse_arguments parsing with nested VERSION options.
The NO_PURL option was removed because it makes no sense in the new
implementation, because if you specify some PURL arguments, there is
already an intention to generate a PURL entry.
Qt entities no longer have a restriction on which specific purl ids
they can have.
The new Qt specific purl IDs have been renamed:
- QT -> GENERIC
- MIRROR -> GITHUB
Amends f7e1123620b623be0c321b54eaba7a1d618a7ce1
Pick-to: 6.8
Task-number: QTBUG-122899
Change-Id: I050decece1c6d9e6e0e06547043f864d6f497ea7
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit a28a9e194cbcaf501c93df988c7dc6f5e09ee5d1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Move generic PURL function from qt-specific file to main one. It was
mistakenly added to the wrong file during the initial split.
Amends f1ac316191c010b1389f6f3549c9f0b4424b9936
Pick-to: 6.8
Task-number: QTBUG-122899
Change-Id: I1884f53ee7d30a25b873d85ee04b8c8d1e0532f5
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit fd622bc3ae90ba27069744bf61524139f1642872)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
GetSysColor(COLOR_HIGHLIGHT) did not report the right highlight color in
light mode palette, Leading to a wrong accent color on
Windows. This patch uses the accent color analog to the dark mode
palette for QPalette::Highlight.
Fixes: QTBUG-130458
Pick-to: 6.8
Change-Id: If21f392e31c3187c28e871919ff17f417c8d144b
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
(cherry picked from commit a55db2cbee914d7bdc5678f35da297b79aec7613)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Running many tests on the VxWorks in the emulator without
restarting it between can cause exhaustion of some
resources and cause an RTP spawn fail in some tests.
This change will restart the emulator in such cases, which
allows the test to try again on fresh boot.
Change-Id: I5ad715f243867d43b055271d6bc61ca4ccb3089b
Reviewed-by: Simo Fält <simo.falt@qt.io>
Reviewed-by: Michał Łoś <michal.los@siili.com>
(cherry picked from commit 5be7a9773e106f9675e8d57121c298539f4ce343)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The result of d.begin() is only used in one of the branches, so
defining it outside both branches is a bit unmotivated; instead, drag
toRemove_start out of the else branch and reuse it in the then branch,
too.
Amends 358b7a9e747549f85c1d1631dfb21210b52b36f5.
Pick-to: 6.8 6.5
Change-Id: I162d72de7097a1257c8a0a01b69c36fc87466114
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 2831ce613fdaebe94e35a8afe45a057004548991)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Don't go and build (among other things) a Boyer-Moore table for the
trivially optimizable replacement of single characters with single
characters. Just call the existing replace(char, char) overload.
Pick-to: 6.8
Change-Id: Ic69527bdaa5ce95bf937295366b94366e2ace933
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit 60af93847e365fc00ccc4bcf61bb90ef6da1f0b2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Coverity complains that qCountLeadingZeroBits() may return 64 and then
the RHS will be out-of-range for int. Of course, 64 leading zero bits
means that the argument is 0, which we excluded in the first `if` of
the if-else chain.
I can only guess (because it doesn't tell me which value of `bytes` it
is using for the analysis) that Coverity assumes bytes ==
numeric_limits<qint64>::min() and considers the overflow in qAbs() to
yield a 0, because, it being UB, it may yield anything.
Be that as it may, the fact remains that formattedDataSize() invokes
UB when passed numeric_limits<qint64>::min(), as confirmed by ubsan:
global/qnumeric.h:479:26: runtime error: negation of -9223372036854775808 cannot be represented in type 'long long int'; cast to an unsigned type to negate this value to itself
text/qlocale.cpp:5062:82: runtime error: signed integer overflow: -2147483648 * 3 cannot be represented in type 'int'
text/qlocale.cpp:5062:26: runtime error: division by zero
FAIL! : tst_QLocale::formattedDataSize(English-Decimal-min) Compared values are not the same
Actual (QLocale(language).formattedDataSize(bytes, decimalPlaces, units)): "-inf bytes"
Expected ("output") : "-9.22 EB"
So fix the overflow by using the new QtPrivate::qUnsignedAbs(). Then
sit back and await Coverity's verdict on the next run.
[ChangeLog][QtCore][QLocale] Fix issue when calling
formattedDataSize() with numeric_limits<qint64>::min().
Amends 9d23aebb271ea534a66cb3aceb2e63d9a1c870d6.
Pick-to: 6.8 6.5 6.2 5.15
Coverity-Id: 474294
Change-Id: I9a5a5acbdcf881a624bb827ca1dd970771f1bb6e
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit b93575de01760ff2ab0d817557a642c71cdb4414)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The ensureLargeData() and 'large' members were only used in BigData
tests that have since moved to a different executable.
Amends fff217824b532da7306af1ac755581e76e098a27.
Pick-to: 6.8 6.5 6.2 5.15
Change-Id: Idc99a868e082098dda4e1bee62470370c7e20f62
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 5cd046f154a0a31635c935bf6c9f1abd27837b80)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
While the idea to delay the construction of the QVLAs until we know we
need them is elegant, we're doing a lot of checks twice or thrice this
way, so merely re-set the a, b pointers and otherwise continue
executing.
This requires us to default-construct the QVLAs before potentially
assign()ing to them, but that ought to be cheap, given the compiler
can see everything that's going on in QVLA.
Pick-to: 6.8 6.5
Change-Id: I4e42d5ab48711af91cc1785171524be5fb45ae2f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit 4308ab70cafa4398aa72dfe63bc580a6ecff9e52)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Cleanup QSqlTableModelTest:
- use pmf QSignalSpy ctor
- use QCOMPARE/QCOMPARE_GE instead QVERIFY where possible
- properly close additional databases so temporary folders created for
sqlite can be deleted on exit
Pick-to: 6.8
Change-Id: I84e8960b81128c141a0e2cd6d03837c9b5ac6652
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit a47dc990793a1e299e9ba869e1d6c76fa0bf9d65)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The argument must be added in qt_cmdline.cmake to work.
Pick-to: 6.8
Change-Id: Ic256c0fda0caf3794b37ad8c5e8b6515fb45b0e6
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 5971e94bafacfebdcd28ef84a7cfea61ffd48689)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The Clang analyser in Qt Creator was letting us know that <memory> was
unused in this header. Also, this is Include What You Need.
Pick-to: 6.8
Change-Id: Id7c260818f9e84847971fffda11da096169a0047
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit 9dc8bc80de03ccf52fabf63855128c5852d51605)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
We used to call focus on the input element even for things
like pushbuttons.
This will display a keyboard on android, instead call
focus on the focus window.
Fixes: QTBUG-133781
Pick-to: 6.8
Change-Id: Ide4d6ec21a14f17b40d3d3de077c0ab073682f19
Reviewed-by: Lorn Potter <lorn.potter@qt.io>
(cherry picked from commit 442e2f4aeb2081c1b8344a8f5cc2c6f2e7bb7d5b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
We normally override the entrypoint to _qt_main_wrapper via the -e flag
to the linker, but if a Swift file is added to the Xcode project, Xcode
does some magic, building the app as a shared library, and wrapping it
with the Swift code into a custom executable. The -e flag will then be
a noop when linking our shared library.
To work around this we set the custom LD_ENTRY_POINT Xcode build setting,
which triggers Xcode to pass -e when linking the wrapper-executable.
This works in practice, but produces a warning on the console that the
entrypoint is not found, which has been reported as FB16519113.
Fixes: QTBUG-133577
Pick-to: 6.8
Change-Id: I9d8310b39ac5a4900693df55c2e5bfa346c0300a
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 430ba7c0f826ee6f91fbfdc861525cb62b8e725c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The progressbar label overlaps with the progressbar grove, when
vertically centered aligned. This patch adds a y offset to the
label, in case it is vertically centered to avoid the overlap.
Fixes: QTBUG-128458
Pick-to: 6.8
Change-Id: Iac977f83f09c2e4d12d1e0ed5f0eab3120c07b96
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit 564633f9d4e4cc8fa361de8165a9dfb203b7248e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
A potential rounding error in calculating the padded scanline length
could lead to the biSizeImage field being assigned a too small value.
Fixes: QTBUG-133782
Pick-to: 6.8 6.5
Change-Id: I251212cf2859f7268fc8ad6ca1cbc57f2bb1f1c0
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit 3d389ee2ac6478a470f19e73826a3889dd117337)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
We should only pass the VERSION option if we have a value to pass.
Fixes warnings like the one below when using CMake 3.31:
CMake Warning (dev) at cmake/QtPublicSbomAttributionHelpers.cmake:511
(cmake_parse_arguments):
The VERSION keyword was followed by an empty string or no value at
all.
Policy CMP0174 is not set, so cmake_parse_arguments() will unset the
arg_VERSION variable rather than setting it to an empty string.
Call Stack (most recent call first):
cmake/QtPublicSbomHelpers.cmake:954
(_qt_internal_sbom_replace_qa_placeholders)
Amends bc3bbb51b7b48d3c4a44a432441938863582242c
Pick-to: 6.8
Task-number: QTBUG-122899
Change-Id: I671a9153d72b21b6aed2112bea45f577a5cee4eb
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 4174f388e6804fb138f625aab3eb75b90c2c7bd4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The implementation of GET requests with body (QTBUG-112871) keeps the
body after it has been redirected. However, in case of temporary
redirect (status code 307) this seems to be an incorrect behavior.
Reset the headers and the body in case of temporary redirect.
Pick-to: 6.8
Change-Id: I10be702b017a42cca27a37dfe2249da2f59c0328
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit f6a5c7e011d24db22afa5a3bf92749b9bb9e9354)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
When the style name is included in the request to
QtFontFoundry::style(), then it will ignore the other properties
and just return the hit that matches it. This is because we want
the style name to take precedence over all other properties when
the user specifies it in a request.
However, we were using the same function to check if a specific
font already exists. If we are registering a font and it is
already in the database, we want it to replace the existing one.
But for fonts such as the variable "Noto Sans Display" there would
actually be multiple styles in the family that were called the
same ("Regular") but had very different properties.
Due to how fonts are populated on GDI, this issue did not occur
there, so the issue is perceived as a regression in Qt 6.8 when
we switched to DirectWrite as the default backend.
We fix this by ignoring the style name when checking if the font
already exists and instead prioritizing the specific properties
it has. If multiple different styles with the same name exists,
they will all be registered.
Note that it will not be possible to differentiate between the fonts
using the style name, same as before, but you will now at least
be able to select the different styles by specifying properties
such as weight.
[ChangeLog][QtGui][Fonts] Fixed an issue with font families where
only the last of multiple sub-families sharing the same name would
be registered.
Pick-to: 6.8
Fixes: QTBUG-131574
Change-Id: I86a04547065c2d9ef88d9a761af95af33eb9b3d6
Reviewed-by: Lars Knoll <lars@knoll.priv.no>
(cherry picked from commit 1d6f71779f05df1af3daacd48f309cd92523152a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
If you open a QFont on an invalid image, its dpi will be 0. In
other places we check for this before calculating the point
size, but this was missing in one spot, causing divide by
zero.
This would happen e.g. in the tst_QFontMetrics::same() test.
While it would pass normally, running this with an undefined sanitizer build would warn about the division by zero.
There's nothing useful we can do with the fonts on the invalid
image, so like in the other places, we just leave the point size
as is when this happens.
Pick-to: 6.8 6.5 5.15
Change-Id: I4769e23e2b4dbb92f675cb8a77f8554c90bc2afd
Reviewed-by: Robert Löhning <robert.loehning@qt.io>
(cherry picked from commit c136de2deb46fb5f60728bc5a4083b9439ea0a3a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
It's possible for the QVariant to have been created by an older or newer
build of the library in question in which the type in question was
relocatable but has ceased to be, or wasn't relocatable but now is.
[ChangeLog][QtCore][QVariant] Fixed a bug where QVariant could misbehave
regarding types that changed from non-relocatable to relocatable (or
vice-versa) and not all uses of it were recompiled. To benefit from this
fix, applications must be recompiled, but they will be safe going
forward.
Pick-to: 6.8
Change-Id: I222806b3804df6272abdfffd45f96312d23be1af
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit eb87b0444ac8fec4d86bc26dc4bec80f82953f7c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This reverts commit e60b493c2e5c672528efd7e0bc8f659e0fd2e2e5.
Reason for revert: temporarily revert it to pass submodule
update round.
Change-Id: I63e8cf78c93d84add4aaaee388b01f2c15cca312
Reviewed-by: Jukka Jokiniva <jukka.jokiniva@qt.io>
This fix the FatalSignalHandler destructor to restore properly the
signal handler which cause an infinite loop when a signal is emitted
like SIGABRT or SIGINT and when we are using two QTest object in same
program.
Fixes: QTBUG-132121
Pick-to: 6.8 6.5
Change-Id: Ie9476e1ff9c0f29c3e35ae6dff565fab4a77ba86
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 50d1a22e5c6361e7c1ef09432b2a151eee3e6114)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
When using alternating rows in ItemViews, the currently selected item is
hard to distinguish from the background colors. This patch uses for
ItemViews with alternating row colors the highlight color for the
selected and hovered item.
Fixes: QTBUG-133118
Pick-to: 6.8
Change-Id: Ib5dbe0f58d5970c41cc9d14cf2188a7e5b1abd1a
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
(cherry picked from commit c3d2a4972ca6bec5bfe9dbe989e2dc6e347f02c1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The checkNode(p) call relies on p being non-null, so CodeChecker
grumbled. In any case, we should be returning node_impl if we fall off
the end of the structure (which shouldn't be possible, since we
descended into the three and can't come back out on the way up without
passing through node_impl, for which we check). Include a null-check
in checkNode(), save the nsURI.isNull() check when !p->isElement()
makes it redundant and fix some coding style nits while I'm about it.
Amends commit 8609982791928a30a6d836b25810143a064f8c6f
Coverity-Id: 474724
Coverity-Id: 474725
Coverity-Id: 474726
Change-Id: Id622a91d2e443276756e50729cf155b10f7164a1
Reviewed-by: Matthias Rauter <matthias.rauter@qt.io>
(cherry picked from commit 82ae262de27534170060e61e8d1f4b045ae13fb8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Negating a negative value may attempt to negate the minimal value for
the signed type, whose only set bit is its sign; this is UB. So don't
do that. Since the non-decimal branch of the code just prepends
locale.negativeSign(), and we're passing -1 as width parameter to the
QLocalePrivate formatters (so there's no zero-padding, whose size
would be reduced to make space for a sign), we can treat decimal the
same as all other bases. This, furthermore, simplifies the code.
In the process, I noticed (because a test only done for decimal
failed) that if QTextStream::ForceSign is set, this code-path for
negatives would prepend the minus sign before a plus sign supplied by
QLocaleData. Skip the flag to include sign, for negative input, since
we'll be including a negative sign anyway. Remove the QEXPECT_FAIL()
from the test I've added for this in a preparatory commit.
Purge one now-redundant comment and revise some others. Expand on why
we need to hack octal zero to display two zeros. Add a second test row
to keep the lonely zero-row company in the test for that.
Fixes: QTBUG-133269
Pick-to: 6.8 6.5 5.15
Change-Id: I35c9bdf34b812cff578de9b0a2570a60e6145c80
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 44ddb34da07f7fdb2214cb39b56cf114d4aa209e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Coverity thinks that r may be negative and not -1 and warns that the
cast to quint64 may overflow.
Change the check for `== -1` to `< 0` to help Coverity (and other
readers of the code) understand that this cannot happen.
Amends c63420a117fe67107466d806890e901d091cb1d5.
Pick-to: 6.8 6.5 6.2 5.15
Coverity-Id: 474172
Change-Id: I7615e0ef152e1e6e9cbc6dec1b8ecd4f8879521c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 24a26ed3a3842398276ae54602e8e1936a2f2323)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
... not just int, and not just non-negative values.
Reveals a problem with bytes == numeric_limit<qint64>::min(), says
ubsan (example; all min64 fail):
global/qnumeric.h:479:26: runtime error: negation of -9223372036854775808 cannot be represented in type 'long long int'; cast to an unsigned type to negate this value to itself
text/qlocale.cpp:5062:82: runtime error: signed integer overflow: -2147483648 * 3 cannot be represented in type 'int'
text/qlocale.cpp:5062:26: runtime error: division by zero
FAIL! : tst_QLocale::formattedDataSize(English-Decimal-min) Compared values are not the same
Actual (QLocale(language).formattedDataSize(bytes, decimalPlaces, units)): "-inf bytes"
Expected ("output") : "-9.22 EB"
So exclude that from testing, for now.
Pick-to: 6.8 6.5 6.2 5.15
Coverity-Id: 474294
Change-Id: Ia1f8e87c58a9fdc2668b6745956e913384cff4c7
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit 562cb8e4d9c5e6482b8c6b85fbb6f735d3000ad2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
`SKIP_AUTOGEN` was a bit too zealous.
Hotfix for 6865c21e41be5d86b5a04889bfe28fac55c89f29
Fixes: QTBUG-133850
Change-Id: I6ec984a7a5d8eefb56e53a0f56c4f4384a56e0ae
Reviewed-by: Nicolas Fella <nicolas.fella@kdab.com>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 97517b20aaaccb9f2bfa6d571a71f40560507476)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The SHA-1 test has started to time out in CI ASAN builds recently, so
skip it there. Keep it on non-CI or non-ASAN builds, though.
Amends c6e092a5f84b7fc72556897b50c7697152967925.
Pick-to: 6.8 6.5 6.2
Change-Id: I8d653c2a8304cfae290befafda570d5c49dd4536
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 929466ba64c503cc1a7c6205f0a424350a9a201f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Unblacklist test function by skipping it with Android with Vulkan.
Fixes: QTQAINFRA-6335
Pick-to: 6.8
Change-Id: I2ee093542f09f68044baa044b697a09af066fcd8
Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Lauri Pohjanheimo <lauri.pohjanheimo@qt.io>
(cherry picked from commit 83a4128ecbc260231b942f811b34fbe7595b14bc)
childNumber() has been renamed to row() in the code, but not in
the documentation.
Correct it.
Pick-to: 6.8 6.5
Change-Id: Ibe6f1f27c0dd1982ff663dc680738babf2db87d7
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
(cherry picked from commit d0cb3c0acdd4a482fd749684f282451bdd13557f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
These warnings are false positives when testing in the CI
when a documentation module containing the base type is meant
to be loaded as a dependency; In the CI, the .index files for
doc dependencies are not available so we see this warning.
Ignore these warnings for now in the global documentation config.
Pick-to: 6.8
Change-Id: Ic1711bf7389e9f9d4a04e3b72b2c9f8b25539357
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
(cherry picked from commit 3336422289079b421797ac2d194241976929c7d8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QtC doesn't use the make_[apk|aab|aar] targets, it runs the deployment
manually. The top-level android build target for QtC is the
<target>_prepare_apk_dir target. Make it depending on
<target>_copy_apk_dependencies target, to ensure that all abi-specific
artifacts are copied before running the deployment procedure, from
either QtC or command line.
Amends 44149f9d8b62b5343a5d06628b0c9588f035ccc2
Fixes: QTBUG-133810
Fixes: QTBUG-131862
Pick-to: 6.8
Change-Id: I4f3630798658a793b0c96a99fc4644ec1dd0504b
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 7a6b3e1a9c0555e91f3e510b63bc0cc18bb1ef16)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This warning here was very confusing (so I'm also updating the language
to be clearer what it means). It is here to advise users of
QThreadStorage that they may have destroyed the object before all
threads using the object have finished. That means there will be memory
leaks, hence the user should fix the issue.
But the one time we don't care (too much) about memory leaks is when the
application is about to exit -- all memory is being released back to the
OS anyway. This may happen because of Static De-Initialization Order
Fiasco: the Q_GLOBAL_STATIC or equivalents holding QThreadStorage were
destroyed before the QThreadData for the exit()ing thread did. That
problem became more prevalent after the series of changes ending in
commit 2f69a05bd0cd7ce63890f709ff3ed7a4f78acd70, because that made the
QThreadData clean up happen very late in the execution.
Unfortunately, there's no way for us to know when we're being called
during application exit, so this is the next best thing:
QCoreApplication::instance() does not exist. We're using a private
function in QCoreApplication because in Qt 6.x, QCoreApplication::self
is not atomic and reading it would be a data race.
The QThread::currentThread() call was superfluous, because it was always
true. It was a relic from Qt 3, from before we had QAdoptedThread.
Pick-to: 6.8
Fixes: QTBUG-133500
Change-Id: I48d84d76f2b72483ed92fffdd54c6ad17e3d67d3
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit fd857d400a098598072ff08b0a54f4ba2589357b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The CI is flakey, likely due to missing timer events. Instead of
skipping the first event, start the timer only when the new state has
been set.
Task-number: QTBUG-30133
Pick-to: 6.8
Change-Id: Ia58e4b091d8791d1b77642ded67312bc3927d0b7
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit c093b57c8696079fc3408796e0e17c62a990bce2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Make sure to specify the creator organization when calling reuse to
generate the source SBOM.
This replaces
'Creator: Organization: Anonymous'
with
'Creator: Organization: TheQtCompany (https://qt.io)'
Pick-to: 6.8
Fixes: QTBUG-133796
Change-Id: I3532d9f35ca3eacd9c20bee7db88f35c76db9672
Reviewed-by: Lucie Gerard <lucie.gerard@qt.io>
(cherry picked from commit 52a64aca2099a1efc5a8819c9e60a57aefde4370)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This enables generation of pkg-config files that work with Qt's
libdir-installed macOS frameworks. QtFinishPkgConfigFile.cmake
wasn't modified as POSTFIX has no impact on framework name.
Change-Id: I2da8f43608e778aa286ad625b70c5be20b447193
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 7a31e402f24ec29c571f825e06bd569477501dfc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The variation selectors only make sense in the context of the
previous glyph and should never be shaped by themselves, therefore
we should not pick a different font engine for these even if
the cmap does not support it. They are sometimes needed to
properly resolve the emojis, but the OpenType rules in the font
may not be written with them in mind.
If the cmap lookup fails for these, then Harfbuzz will map them
to a zero-width space, thus ignoring them when resolving the
OpenType rules.
We treat these the same as other control characters and just
ignore them when doing font merging.
Note: This was handled through an ad hoc mechanism prior to
the introduction of the emoji segmenter in 6.9.When the emoji
segmenter is disabled, we still use this mechanism, which
depends on us not ignoring the character in that case.
Fixes: QTBUG-133480
Change-Id: I8fa4e8d5e1aabad0946b8fd3fff044e2b2af5d0e
Reviewed-by: Lars Knoll <lars@knoll.priv.no>
(cherry picked from commit cf674f38450f623d94e5695a221a186c0e551e27)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Both enable_if and is_null_pointer belong to type_traits, include it.
Amends 631a0cc45cbe70940746cd944d325d7d3bab8c15.
Pick-to: 6.8
Fixes: QTBUG-133808
Change-Id: I9626ba80b2d9799d1bfed8ca9c9090691b8d8715
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 72cde6f7dd9102d0c3730a75a6c85af69b8a0e3c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Write every byte only once.
Amends 83c2c5055405f09043c35b93cd5ba9b9969f3174 (as well as the start
of the public history).
Pick-to: 6.8
Task-number: QTBUG-106185
Change-Id: I883b2f00c754806882131a09dc3cbc5613420151
Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit 2753924fcbeb29fa5b34782bd6ad6ed4fe4b51f1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
There is no need to screw up the palette of buttons in polish() - the
colors are not honored at all.
Pick-to: 6.8
Task-number: QTBUG-132433
Change-Id: I4df1f046690d1aa9b07fc538441d6ea50d0216ce
Reviewed-by: Wladimir Leuschner <wladimir.leuschner@qt.io>
(cherry picked from commit 6a46395614bf89a8b69fd2b7edb9503bd8f16ceb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
StablePosition was in some cases recording a wrong position, as it was
taking the framePosition and considering it to be the widget's
position. That erroneous position was then used to place the window,
resulting in a correct position but a wrong framePosition.
Wait and check for the window.geometry() and the
window.frameGeometry() to be different. If not the frame
has not been updated, or there is no frame when there
should be one. The test will most likely fail because
of this.
Fix flakiness on Opensuse 15
Pick-to: 6.8 6.5
Change-Id: I8e05ee7769de4efc2ac55ec7afbe366f76e325db
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 21ef8bed6d738551c1a322e78366d3c347a0e09e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Detailed docs were omitted before (and QTextMarkdownImporter::Feature is
not public) because
- "GitHub dialect" is a moving target (although we may have supported
all known features when it was introduced). We should reserve the
right to add to the feature set accordingly: so the numeric flags
can be expected to change.
- the writer mostly ignores the feature flags and writes back to
GitHub dialect; only the front matter can be omitted that way
- recognizing non-URL links seems fuzzy; md4c does it, so we allow that
feature, but if it goes wrong it would be an md4c bug
- hex flags look strange: in fact they come from
https://github.com/mity/md4c/blob/master/src/md4c.h#L306
If we assume that they might change, it would be better not to
document the numeric values in detail. But so far, md4c has never
removed any, only added a few (and we don't yet support all the
new ones).
Change-Id: I6552da1226bf7ad6242432c1d5d3df9ec8f61d6f
Reviewed-by: David Boddie <david.boddie@qt.io>
Reviewed-by: Tommi M. Tauriainen <tommi.m.tauriainen@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
(cherry picked from commit 280025fc7e97ad943ed2938f6434cadf94bd635f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Create a function `_qt_internal_set_source_file_generated` that sets the
source file property `GENERATED` along with Qt relevant properties:
- `SKIP_LINTING` if CMake>=3.27 and `QT_FEATURE_lint_generated_code`
Task-number: QTBUG-125077
Change-Id: I0ef5f7901f502366aaf2d020554c72e4845101b6
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit f654519c7bd142d5cc9f81e0c826dfd31956791d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Will be used by WebEngine configure checks to check if the
dependencies are met and show an according error message if not.
Pick-to: 6.8
Task-number: QTBUG-122899
Change-Id: I56d46fe5cf12051903d1aec893336be5ae8983a2
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 414b73075c537481280179ea78748dd2a6b45f9e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
When converting a json SPDX document to a tag/value SPDX document, we
need to make sure that the python dependencies are looked up.
After they are looked up, either error out or silently return
depending on whether the operation is required or not.
By default when _qt_internal_sbom_generate_tag_value_spdx_document is
called it is required to succeed and thus requires the python
dependencies to be present. A caller can opt out using the OPTIONAL
argument.
Pick-to: 6.8
Task-number: QTBUG-122899
Change-Id: Iccb68f900f4892a816360843dd87f9e469104bf7
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 8b6b17ae87abcdb2120255b490ce6fe03b0e2e08)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Improve wording when python or some dependency is missing, deduplicate
the strings and make sure to mention what is actually missing.
Pick-to: 6.8
Task-number: QTBUG-122899
Change-Id: I26af38f0330a5462c6001cae03c46284e742fbda
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit ad82afb05417e2b07a55a4520105b1f01a802487)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Upstream CMake has a nasty bug where AUTOGEN dependencies are
discarded if a library is added as a dependency more than once (or
rather the number of times it is added is not equal to the number of
configured build configs).
This can result in racy build failures, where a <module>_autogen
target is supposed to depend on some <other_module>_sync_headers
target, but doesn't, and thus moc generates empty metatypes files
because it can't find a synced header.
To avoid the AUTOGEN dependencies from being discarded, manually
add all dependencies passed to qt_internal_extend_target to the
AUTOGEN_TARGET_DEPENDS property.
The issue is fixed in CMake 4.0, so the workaround is gated on the
cmake version used. Add a flag called
QT_NO_AUTOGEN_DISCARDED_DEPENDENCIES_WORKAROUND to disable the
workaround, in case the fix gets reverted upstream.
Pick-to: 6.8 6.5
Fixes: QTBUG-133725
Change-Id: I857d7e774fc9f9f5203a58311daea5e7177e0d67
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit fcb20586316aff2ccc39e2ae840b79f8b0e904a7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
To ensure that when we find the interpreter, but not some python
dependency, we actually show the error about the dependency.
Pick-to: 6.8
Task-number: QTBUG-122899
Change-Id: Ib4f42e04f071f800d0f5bbe3700a1208e1017a19
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 46ee11a426292bc1538b5138501136b2dadc7173)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
New upstream version.
Importing note: 10.45 is missing a licence file for the sljit
dependency. This is tracked upstream at
https://github.com/PCRE2Project/pcre2/issues/686
so it may get fixed in 10.46 (in which case the import script /
qt_attribution.json may need to be amended).
[ChangeLog][Third-Party Code] PCRE2 was updated to version 10.45.
Pick-to: 6.8 6.5
Change-Id: Ifa0430782bed8ffb1c26f44ca6eb06cd26aaa1f9
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 3cb58b053c26603ba1d541b3c9c51ec25212ee80)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Don't call qEnvironmentVariableIsSet(), since it locks the environment
mutex. Since qgetenv() and qEnvironmentVariable() both report whether
the value was set (returning non-isNull()), we can avoid the extra
mutex lock (and envvar lookup) by just calling those and then checking
for isNull().
In qEnvironmentVariableOptionalReal(), in addition, use qgetenv()
instead of qEnvironmentVariable(). While on Windows, that may convert
encoding, QString::toDouble() first converts to Latin-1, and only then
converts to double, so we avoid one encoding conversion, even on
Windows; on Unix we avoid two.
Amends 4d1f13f3549a73f5ca4e64dac9137e83138080fa.
Pick-to: 6.8 6.5
Change-Id: I6803e2277b324c2568726765245681bcbf517362
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit 8669bc97ff6811bae304a8bb2a0e3af2bb78cfe0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit moves the third-party-libraries.html topic to the qmake
documentation. The topic is renamed and links to it are corrected.
See also: 623150
Task-number: QTBUG-132504
Change-Id: I711400d887b7e4894021b0433eb1cd61dfdd5349
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 1e7e0b0cacaae4fb0bb2b730dd6cdb34d7e93afe)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QMenuPrivate::mousePopupPos is a QPoint which gets set to
QGuiApplicationPrivate::lastCursorPosition, and only read from
QMenuPrivate::hasMouseMoved to determine if the mouse has moved enough.
When the last mouse position is not known, lastCursorPosition.toPoint()
returns {INT_MAX,INT_MAX} (see c5792dcfd631abb4f9e2b92cd6e88d7e5c373406
for the reasoning). This is extremely prone to overflows. In fact, one
was happening into QMenuPrivate::hasMouseMoved:
(mousePopupPos - globalPos).manhattanLength()
On the first mouse move the subtraction yields an enormous result which
overflows manhattanLength.
The solution is simple, make mousePopupPos so that these calculations
happen in fp coordinates. The length itself is only used as a threshold
against QApplication::startDragDistance, so its representation doesn't
actually matter.
Pick-to: 6.8
Change-Id: I9c8e30a637de120d086d6f7171725702c205da78
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: David Faure <david.faure@kdab.com>
(cherry picked from commit 7736823500fe8d97bc6d12ffb88001d34d1980bb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This was missed in 3e1a223318dbda50a010ba851841a9e51c80c42b
Task-number: QTBUG-127953
Pick-to: 6.8
Change-Id: I2ff6cafe852ec2696aea37e2e79e3c8b95c0e8ca
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit b8b6382b02457963fa5d0e67e069dc92e6d6c9d9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Similar to commit 12d4bf1ab52748cb84894f50d437064b439e0b7d, which was
for QLocale. Like it, QResource can be used very late in the execution,
like for example the logging system. For example (simplified):
#9 0x00007ffff759d497 in resourceMutex () at /io/qresource.cpp:188
#10 0x00007ffff759d615 in QResourcePrivate::load (this=0x41c940, file=...) at /io/qresource.cpp:333
#11 0x00007ffff759dc19 in QResourcePrivate::ensureInitialized (this=0x41c940) at /io/qresource.cpp:386
#14 0x00007ffff75011a9 in QLibrarySettings::load() at /global/qlibraryinfo.cpp:80
#22 0x00007ffff7501756 in havePaths () at /global/qlibraryinfo.cpp:149
#23 0x00007ffff75028e3 in QLibraryInfoPrivate::paths (p=QLibraryInfo::DataPath, usageMode=QLibraryInfoPrivate::RegularUsage) at /global/qlibraryinfo.cpp:613
#26 0x00007ffff758e4f0 in QLoggingRegistry::initializeRules () at /io/qloggingregistry.cpp:309
#34 0x00007ffff758f007 in QLoggingRegistry::instance () at io/qloggingregistry.cpp:424
#35 0x00007ffff758c50b in QLoggingCategory::init () at io/qloggingcategory.cpp:188
#43 0x00007ffff758c6bb in QLoggingCategory::defaultCategory () at io/qloggingcategory.cpp:317
#44 0x00007ffff750ff8e in qt_message_print (msgType=QtWarningMsg, context=..., message=...) at global/qlogging.cpp:2036
#45 0x00007ffff7509515 in qt_message(msgType=QtWarningMsg, context=..., msg=...) at global/qlogging.cpp:360
#46 0x00007ffff750a712 in QMessageLogger::warning (this=0x7fffffffd8b0, msg=...) at global/qlogging.cpp:600
#47 0x00007ffff790e083 in QThreadStorageData::finish (p=0x41b588) at thread/qthreadstorage.cpp:160
#50 0x00007ffff78ed423 in QThreadPrivate::finish (this=0x41b5e0) at thread/qthread_unix.cpp:404
#51 0x00007ffff78ec8ed in destroy_current_thread_data (p=0x41b520) at thread/qthread_unix.cpp:154
#52 0x00007ffff78ec9ec in Cleanup::~Cleanup () at thread/qthread_unix.cpp:204
Task-number: QTBUG-133206
Task-number: QTBUG-133500
Pick-to: 6.8
Change-Id: I7b653afb1b41ef3c1c9afffdaa93e6558740016b
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit ba18ae3869fd6703fbaad548d2421a82e7e675cc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Neater and more debuggable. This code was added in Qt 5.4, before we
could use C++11.
Pick-to: 6.8 6.5 6.2 5.15
Change-Id: Icd8acccb4a9ae1f500e7fffdc4d4fc7c310cbb89
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit b888bc09ce33a91800cb2119a52097897f3d62d1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This meant a string containing the octal form of INT_MIN (-020000000000)
would be just too long and getenv_s() would fail. This was never caught
because code that was meant to test different bases simply forgot to use
the base. Amends commit bb56586e32677ee9be23bffa4f3cc9a913ef192f.
I've renamed the rows to be the text being parsed, so it matches the
previous rows and it makes clear what was being parsed just by reading
the test's output. That also revealed a duplicate row to be removed.
[ChangeLog][QtCore][QtEnvironment] Fixed a bug that caused
qEnvironmentVariableIntValue() to fail to parse octal values from
-020000000000 to -010000000000 with MSVC. Other compilers were not
affected.
Pick-to: 6.8 6.5
Change-Id: I9095d86cccd9e8001e85fffd6fbbcd6a9a1678c3
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 83f2d1130aa49228a8a87547660791708735dd4b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This is what QDir::isRelativePath() does, for better or worse. We've
used QDir::isRelativePath() before and we shouldn't change the behavior.
Amends commit c74cba1117355a6312b1f0cc815efa4cdea4bbfa
Pick-to: 6.8
Change-Id: I03e3e921977af2b9c6ff2593535d846d6ce28fe2
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit dd2dc8c70d0227ff235a8c7feaca7d7c4ead9c63)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
That's not a valid type for the Standard's string, because the Standard
doesn't allow for std::char_traits<signed char> either.
Pick-to: 6.8
Fixes: QTBUG-133689
Change-Id: Icd0d4928fa4cdc9d806bfffd4053f0eb1073e6b4
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 0cc41083c30c1474a862a34b59a4f755d4c51640)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Nothing else calls it.
Drive-by initialize the two pointers via NSDMI.
Pick-to: 6.8
Change-Id: I8c51cf5126aeb8bd6254fffdd21a37526329bbf3
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit c7ec043e4643d4b18731fdf2efc14976a81e1809)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
[ChangeLog][QtGui][QDesktopServices] Fixed a bug that caused
QDesktopServices::openUrl() to discard a query when opening a local file
URL that contained a query but no fragment.
Pick-to: 6.8
Fixes: QTBUG-133663
Change-Id: Ie8fa190036417f590540fffdcf03e53f3c99b38f
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit aad0ab897f61bcb6ac9ba908afd1ee33e05fe4db)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
It's an internal class containing the common content between
QStringConverter and QTextCodec (Qt5CoreCompat) so the latter didn't get
the new API from the former.
This allows us to remove the QStringConverter::Flags qdoc hack too.
Change-Id: Iacf32fb88e3c3d0ea369fffd153356cec308e3dd
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit c2fa41a081e4c9fe308dcd47283537eedf05c24a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Otherwise we would traverse beyond bounds.
We calculate the delta in sizes between the haystack and the needle and
if this delta is smaller than the starting position
(the `from` argument) then we start from there.
The default value for `from` is size(). With the needle being longer
than the haystack, the delta is negative and we set our starting
position to be the delta, i.e. we start before the start of the
haystack.
[ChangeLog][QtCore][QByteArray/QByteArrayView] Fixed a bug in
lastIndexOf() that could lead to out-of-bounds access when the needle
is longer than the haystack.
Pick-to: 6.8 6.5 6.2 5.15
Change-Id: Id5cd772f00b0c3c50fbf61b4e888bba5587391ee
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit d25e5e2cb78a2e2f2a1791fed250421ce9eefc46)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Specifically on Windows we use COM, which requires being
de-initialized in the same thread as it was initialized.
Given that QNetworkInfo is a GLOBAL_STATIC with a qAddPostCondition
(iirc APPLICATION_STATIC was not yet implemented at the time) to
delete the backend when qApp is destructed, we need to cope with
destruction happening on the main thread.
If the backend is loaded on a secondary thread, the thread may
have shut down, or we may not otherwise be able to rely on
emitting Queued emissions to perform the destruction.
Conversely we also can't trivially move the construction to the
application thread (eg. using BlockingQueued emission during first load)
because we may cause a deadlock.
This leaves us with just documenting where the first load should happen.
Fixes: QTBUG-133644
Pick-to: 6.8 6.5
Change-Id: I7f52e884151c6c24acc34f1112faabc897d9b0f9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 6ad2918de4a300d11472edcafe62f07ae2f63cd8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QAnyStringView::fromArray() was not documented, leading to a broken
auto-link that referred to it.
Pick-to: 6.8
Change-Id: Ibf3704da8b3f16e56589bd649ce1e63a7cbd3739
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit f9334be98e4deb9e9a4a30f5f22e92b571670938)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
It appears that there are no longer relevant begin() and end() functions
to link to. constBegin() and constEnd() are the relevant alternatives.
Pick-to: 6.8
Change-Id: If6fc421ee08364de9a879fb704a7989046b9b43a
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
(cherry picked from commit c8e59d682cc2c6a5cbe124575bb54316af55bed1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Building Qt with e.g. a version 1.2.x Vulkan SDK and then running
on an implementation providing 1.3 or 1.4, one will likely get an
assert in debug builds upon initializing the memory allocator.
Work it around by restricting the apiVersion passed in based on the
preprocessor macros.
Pick-to: 6.8
Change-Id: Ia689ffc29d5675b84b6683e289d0725d7e47220b
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
(cherry picked from commit b6d4c1368d38242a8c677efc3144c10cfe363179)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The documentation claims that this is where the namespace and the macro
definitions live, and it's convention to have a Qt<Namespace> header for
Qt namespaces.
Pick-to: 6.8
Change-Id: Ia49001d61f0967df84344779909860cf65c3623c
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 6c61d7b0f804ae5c048af95abef4d41ecc8862df)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The applicationWillResignActive documentation describes that the app
should "use this method to pause ongoing tasks, disable timers, and
throttle down OpenGL ES frame rates". Similarly, the more modern
sceneWillResignActive describes that the app should "use this method
to quiet your interface and prepare it to stop interacting with the
user. Specifically, pause ongoing tasks, disable timers, and decrease
frame rates or stop updating your interface altogether."
In practice the application enters the inactive (as opposed to the
backgrounded) state when the user brings up the app switcher, or
enters split-view mode, as described by the "Adopting Multitasking
Enhancements on iPad" documentation.
We do propagate the inactive state as Qt::ApplicationInactive, but
it was up to the application itself to react to the state.
To adhere to the documented behavior, we now skip update request
delivery if the app is not active. Once it becomes active again
we re-try the update request delivery.
Relying on the exposed state of window was not an option, as the
window is still technically exposed, even if the app itself is
inactive.
This hopefully fixes a GPU crash observed (only) on A10 iPads
(iPad 7) with iOS 18, when the user entered split-view mode,
possibly due to changes in the system Metal-based OpenGL driver:
void IOGPUScheduler::signalHardwareError(eRestartRequest, int32_t)
void IOGPUScheduler::hardware_error_interrupt(IOInterruptEventSource *, int)
void IOGPUCommandQueue::retireCommandBuffer(IOGPUEventFence *)
Deny submissions/ignore app[openglwindow] with 2 GPURestarts in 31 submissions.
Execution of the command buffer was aborted due to an error during execution
Caused GPU Timeout Error (00000002:kIOGPUCommandBufferCallbackErrorTimeout)
GLDRendererMetal command buffer completion error
Error Domain=MTLCommandBufferErrorDomain Code=2
Execution of the command buffer was aborted due to an error during execution
Ignored (for causing prior/excessive GPU errors)
Terminating due to blacklisting by kernel driver
The back-trace always pointed to the display-link callback,
so the assumption is that the crash was triggered by the app
rendering when it shouldn't, during the split-view transition.
Fixes: QTBUG-132314
Pick-to: 6.8 6.5 5.15
Change-Id: Idf1f692daa9d437ee69f9436706777b220fbfbf4
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit c812190a921660c748be3324c3a34245b24354e9)
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
This is more efficient, because it maps to a single assembler
instruction on most ISAs, and also avoids a Coverity warning about the
loop not terminating and thus 1 << i overflowing, if type == {}.
The clone class, QSizePolicy, is not affected, since it already uses
qCountTrailingZeroBits().
Amends 6c322a917ad57d57f0ee76825eab3e2e008c5bd4.
Coverity-Id: 474336
Pick-to: 6.8 6.5
Change-Id: Idf62d045d8ac3f0cb15196dd8664ac37d92a9cc2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit d71379d447e87843c5a5d91857c4ff253ad4b847)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
std::slist doesn't seem to even exist on Google, while std::forward_list
exists in the standard since C++11.
Pick-to: 6.8
Change-Id: I9869c716fb631bc743e656a3b8bbb8ca35c9a1ed
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 9e5dae9b8c3d43cfd86719e429f35b032d14c66c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
That becomes an error. So only allow them in GCC-compatible compilers.
Fixes: QTBUG-133376
Change-Id: Idd04be795dd9fd2b43affffd08cd7b8a444bbc43
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 5da95322bd0ed7bfb94028582a82689124646dbd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
A few values have meaningful defaults, for the rest only warn about
implemented metric.
Pick-to: 6.8
Change-Id: I80c6c8dba6c8d2715daac0463a411bc5117f0bc0
Reviewed-by: David Faure <david.faure@kdab.com>
(cherry picked from commit da1fbf6053c07df76a4d2518103bdfc40d59cfa8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This is hot code, run early in the application's life, usually as a
result of the first qDebug() because QLoggingRegistry wants to find
qtlogging.ini. So let's not use QFileInfo, which allocates memory, just
to do string manipulation. These are always filesystem paths.
See commit d59e640c868f3db2d661970f3d34a22013d49053 for a similar change
in findConfiguration().
Pick-to: 6.8
Change-Id: I012daf4a3aa2ebc2c5abfffd2ef7ceac1df2626d
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit c74cba1117355a6312b1f0cc815efa4cdea4bbfa)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit adds a new parameter (--pre-test-adb-command) to
AndroidTestRunner. The new parameter allows to pass an extra adb command
which will be called by AndroidTestRunner after installation and before
running the test.
To set the mentioned argument the new parameter for qt_internal_add_test
was proposed: ANDROID_TESTRUNNER_PRE_TEST_ADB_COMMANDS.
The new parameter is needed especially for multimedia screen capture
tests. ScreenCapture feature needs an acceptation of Security Popup. It
can be automatically accepted with additional adb command.
Fixes: QTBUG-132249
Pick-to: 6.8
Change-Id: Ib70cd05d60d4594961ca68b554c7aae11cf42240
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit b4c82eba03388aa4f9e5b56f633e0e679a3b0123)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Commit 353ce5344fbde5a6cecbdd2c131e1cf0f4b7f383 made QMenu::exec()
return immediately (without showing the menu), which meant it never
emitted aboutToHide() and QToolButton didn't reset mouseButtonDown.
Therefore, on the next click on the toolbutton (maybe by then the
menu has actions), it won't even try to show it (because mouseButtonDown
is still true).
Pick-to: 6.8
Task-number: QTBUG-129108
Change-Id: I3f84b9a35eb444fc33d8516c4be130293c04017d
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit f0508b7ff3d2393521f49dcb1a9e880bf7665a87)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Previously we had complicated logic trying to differentiate between Qt
targets, system libraries, vendored libraries, custom sbom targets,
whether they are in external documents or not, when generating SBOM
dependencies for a target.
We also lacked the ability to handle regular non-Qt non-system
libraries. This was discovered while creating the SBOM for Qt Creator,
where the code treated all Creator helper libraries as system
libraries rather than just regular dependencies.
Simplify the code by unifying most of the code branches, removing
nested ifs, and removing special handling of some targets when
checking whether they are in external documents.
Now system libraries are marked at qt_find_package time by setting the
_qt_internal_sbom_is_system_library property on the target, rather
than trying to infer it base on the target name and other markers.
Now the logic goes as follows:
- check if system library based on the presence of the
_qt_internal_sbom_is_system_library property
- check if it's a vendored lib based on walking its libs and checking
if the _qt_module_is_3rdparty_library property is set
- mark system libraries as consumed
- if not a system library, handle it as a regular dependency, taking
into account if it's external or not
Also add some debug messages to help keep track of system libraries.
And remove some of the unnecessary code in
in _qt_internal_sbom_is_external_target_dependency and
_qt_internal_sbom_add_external_target_dependency.
Pick-to: 6.8
Task-number: QTBUG-122899
Change-Id: Ic43fe53446b74badee2cde6d18146e952587c292
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 66261ac0f1f2807916c80b2050536d52b8fe6d3a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Introduce a helper function to silence this lengthy warning, and use
it consistently in all places where the warning was triggered.
Amends 502a7706b94380d4957a7e594fc7c4c4db8ae81b which introduced the
warning.
Pick-to: 6.8 6.5
Change-Id: Ifa5c7e0182a12885af4db42ef5d68b1f27a0c6bc
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit a30289ee0be41e8311aef6d8737885b354a9f047)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The SBOM functions so far had a lot of Qt-specific logic inside them.
Decouple this logic into separate Qt-specific functions or explicitly
guard the code with Qt-specific handling options, to prepare for a
cleaner SBOM public API.
The generic functions then call the Qt-specific ones if various
internal options are set.
This approach is used, rather than directly passing values to the
generic functions because:
- we have cases where we need to recursively pass the values all the
way down to all recursively created attribution targets
- some of the logic needs to know about values before and after qt
processing, and this could be achieved with something like lambdas
but it's not worth the complexity
Pick-to: 6.8
Task-number: QTBUG-122899
Change-Id: I4399c41f4d976f20b16a0bb0c674d4f07ee1ccd4
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit f1ac316191c010b1389f6f3549c9f0b4424b9936)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This amends commit 353ce5344fbde5a6cecbdd2c131e1cf0f4b7f383 so that
the behavior doesn't depend on the widget style.
If QStyle::PM_MenuPanelWidth returns 2, then size will be (2x2),
which is hardly a valid menu to show - don't show that either.
Pick-to: 6.8
Task-number: QTBUG-129108
Change-Id: I2daa05932ea00971880747daeffdfa20a8be3f22
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 9dfd8410b07b0c484443ad6355004ace5f9b2b8b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
On some very rare cases the continuation could be executed twice in a
multithreaded scenario. Consider the following example:
auto f = QtConcurrent::run(someFunction);
f.then(someOtherFunction);
Assuming that QtConcurrent::run() is executed on Thread B, and the
continuation is attached in Thread A, the following call stack is
possible:
1. Thread B: someFunction() is finished
2. Thread B: QFutureInterface::reportFinished() is called
3. Thread B: QFutureInterfaceBase::reportFinished() is called and
finished.
4. Thread A: then() is called. It checks that the future is already
finished, so the attached continuation is executed
immediately.
5. Thread B: QFutureInterfaceBase::runContinuation() is executed.
At this point it sees that a continuation exists, and
executes it again.
Step 5 will lead to a crash, because we'll try to access a moved-from
QPromise.
To fix the issue, introduce a flag that is explicitly used to test if
the continuation was already executed or not.
The pre-existing code already uses a concept of a continuation state,
but it cannot be easily extended without convering it from an enum
to flags, because the canceled continuation should still be called
in order to actually execute the onCanceled() handler.
Wrapping QFIBP::ContinuationState into QFlags would increase its size
from 1 to 4 bytes, and manually treating the enum as flags will result
in a more complicated code. So, I simply picked the approach of adding
an explicit flag for this case.
Writing a unit-test is not really possible, but I verified that the
reproducer from the linked Jira ticket does not crash anymore.
Amends dfaca09e85a49d2983bb89893bfbe1ba4c19eab4 that introduced the
continuations, so picking to all active Qt 6 branches.
Fixes: QTBUG-118032
Pick-to: 6.8 6.5
Change-Id: I3e07722495e38367e8e4be2eded34140e22b0053
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 04b5d2b94f96c73a13973f6a57cefbf07d2e850b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
For build time sboms to be found in a no-prefix qt build of a repo,
specifically when finding external sbom documents, the build time
sboms have to be in the same location.
Previously they were in each repo's build dir.
Align the location to be in the qtbase build dir, just like for super
builds.
Also check for QT_BUILDING_QT because we don't want to apply the logic
for QT_WILL_INSTALL not being set in user projects.
Pick-to: 6.8
Task-number: QTBUG-122899
Change-Id: I04a066fc0efc91a4f2ee938c190b8632c8c946aa
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 3a5c62d4af9cb07fba065de8a2d1b97531b6fd30)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
It can happen that qt repo version bumps are direct pushed, and not
merged in DAG-dependency order. This can cause a mismatch between the
qttools package version and any of its dependencies, which would block
integrations. To avoid this, we disable the warning about incompatible
package versions when building the doc tools. The version check in
that case doesn't make sense, so it's safe to do.
Amends f7f02c791bcbee44597f1fe24570ebdf352ec648
Pick-to: 6.8
Task-number: QTBUG-128730
Change-Id: I6180ecb09c6a3dee415ae73c11549ee0f709f240
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Toni Saario <toni.saario@qt.io>
(cherry picked from commit a8f55f4729918700b9597843c98f9f2505ff0d23)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
tst_QGestureRecognizer::swipeGesture() is flaky as sometimes the
gesture event is being sent before the widget's position has
been updated.
The gesture starts in the window frame.
Set flag Qt::FramelessWindowFrame to prevent this from
happening.
Fix flakiness on Opensuse 15
Pick-to: 6.8
Change-Id: I794b022b5a51146ddfa7d6029509c6fa43b9aad6
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 6dc0e593939cbeaeb45392d8daf7fcd90e8cb0f8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QStringViews should be passed by value, not cref, so sane ABIs pass it
in registers instead of forcing the variable to the stack.
As a drive-by, s/QVector/QList/ in the return type.
Amends 51e2a64ed9360c8e889726c3fbaf649a4d260e0d.
Pick-to: 6.8 6.5
Change-Id: I6b51dfda87643f6c7ec219ac4a8970537bb6b2ed
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 8113a50d71cb9ea320e69c2b10452972e3310f4d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QT_CHAINLOAD_TOOLCHAIN_FILE might not be set, but
__qt_chainload_toolchain_file falls back to the value initially set
when building qtbase in per-module build scenario. Use the correct
variable(__qt_chainload_toolchain_file) when specifying
VCPKG_CHAINLOAD_TOOLCHAIN_FILE.
Pick-to: 6.8
Change-Id: I331c305a17172a1cc67a6ed8b43b2baa380abc0b
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit c65d6319f9379a724ddb4c0757245fe51c93fac5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
All iterations through QDomNodeListPrivate were going through the
forEachNode function with its own internal logic. The newly introduced
iterator works with the similar logic but is written a bit more compact.
Thus it makes sense to replace the forEachNode logic with internal
functions of the iterator.
Change-Id: I22b7ae7a49e2bfaf84bede2fe0b45530a32f8d55
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit b1c32afb914a8dda0b1b38bf9d85c1c316b27cf1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QAnyStringView is designed to replace overload sets containing QString
and QChar, among others, so it needs to accept types that merely
implicitly convert to QString and QChar. It achieves this by
maintaining a hidden container to hold the converted QString or QChar
for the duration of the full-expression, much like the compiler would
do if the function took QString/QChar.
This patch adds a check for the single-char ctors to determine whether
they convert or not, by comparing QASV::data() to the address of the
QASV's argument. While it would be interesting to have the same test
for QString, that is outside the scope of this patch.
Task-number: QTBUG-126054
Pick-to: 6.8 6.5 6.2
Change-Id: I30ac2d1199da5a03fe6fee4c9d5ea2a209a003d6
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit f31c37a1312fc4e21a58906e2b883099629fb9e1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
They added some new scripts.
There were a few changes to the line break algorithm,
most notably there is more rules that require more context than before.
While not major, there was some shuffling and additions to our
implementation to match the new rules.
IDNA test data now disallows the trailing dot/empty root label,
technically to be toggled off by an option that controls a few things,
but we don't have options. For test-data they changed the format a
little - "" is used to mean empty string, while a blank segment is
null/no string, update the parser to read this.
[ChangeLog][Third-Party Code] Updated the Unicode Character Database to
UCD revision 34/Unicode 16.
Fixes: QTBUG-132902
Task-number: QTBUG-132851
Pick-to: 6.8 6.5
Change-Id: I4569703659f6fd0f20943110a03301c1cf8cc1ed
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit 85899ff181984a1310cd1ad10cdb0824f1ca5118)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The titlebarAppearsTransparent property of NSWindow depends on whether
the window has a NSWindowStyleMaskTexturedBackground, so we need to
re-apply the window flags after updating the style mask to ensure we
pick up the updated value for titlebarAppearsTransparent.
Amends a1e6fed44964a3eb14045bf819d232d6cbad9f59.
Fixes: QTBUG-133525
Change-Id: Ifff594f54569ac43ad27917e5f4b2f8a3bae5901
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit bddc0198297828ba29e5cf4b39e07412a506a551)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
tst_QGestureRecognizer::panGesture() is flaky as sometimes the gesture
event is being sent before the frame and position has had time to
update. The event then starts in the frame and is not received by the
widget.
Set FramelessWindowHint flag to the widget, to remove the need of
updating its frame position and position.
Fix flakiness on Opensuse 15
Pick-to: 6.8 6.5
Change-Id: Id88510a91e3ed0d5ff92fdc31422503744448b3e
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit fc0e788d029beac251fda40650154fc6865e1649)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This fixes some read-past-end issues in assertions that verify the
next row of a table after the last for a specific locale belong to a
later locale. Since those assertions happen without sight of the table
of which the locale's range is a part, they can't tell when the
range's end is in fact the table's end - so they shouldn't have been
reading from a row there. Fix by putting a row there, that belongs to
a nominal locale with index out of range.
Change-Id: Ib9d227ca4f86c372c13f963a08a8d637eae63ed0
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit b37c580169890d5ccacb5746eb4b99dd711efda4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
It no longer inherits QHash, so drop the references to this.
And remove an extra 'and'.
Pick-to: 6.8
Change-Id: I5c19f7793571fe04f93e0ede37d280d215d95dfc
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit dc8055c9149c0ceb42b4313fb7af0a5b78fe1c16)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
ReadOnly was used in places where ReadWrite was the correct value.
Pick-to: 6.8
Change-Id: I26a2f0de55665ac015fe269e8e5f0d23a2f00e5f
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 4dcff4ed6d24e6aa061e145bb9de9ff93351a2b1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
After the commit 28df9a49776a88cb1a8e69348ae19a59b16a5b7e, a regression
occurred in the positioning of cursorHandle and EditPopup.
Previously, these positions were calculated using QtEditText
coordinates, which worked correctly because the QtEditText size matched
the QtWindow size. However, after the mentioned commit, the QtEditText
size no longer reflects the window size. In this case, we need to use
the parent View for calculations.
This adjustment was already made for the single cursorHandle.
This commit also updates the positioning of selection handles and the EditPopup.
Fixes: QTBUG-132589
Pick-to: 6.8
Change-Id: I861292e363452d487284e3f603fe03a21a334aa4
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 5bd26fda7a3f0a509a64847b58b916830ebc2d0c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The new (6.9) iterator for QDomNodeList was implemented as random access
iterator. The underlying structure of QDomNodeList is similar to a
linked list and therefore it is better suited for bidirectional
iterator.
This patch changes the iterator to a bidirectional iterator. Further the
tests are expanded because the new implementation uses more custom code.
Fixes: QTBUG-132527
Change-Id: I796f445e0b883abc2aea613f1fed6f17c4d93dcd
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 8609982791928a30a6d836b25810143a064f8c6f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Having the input field length too wide causes the view to scroll
to contain it. Since it is not visible, setting it to 1px width and
height should work.
Further, input field contents where set on the showInputPanel
call. At this point in time we do not necessarily have an updated
focus object. Hence the input contents is now set on the
setFocusObject call.
Ignore input on showInputPanel/hideInputPanel. This reflects
the current design where showInputPanel do not act unless
inputMethodAccepted(), and hideInputPanel do not act if
m_focusObject.
Still hideInputPanel used to set m_usingTextInput to false,
this behavior is not kept.
Fixes: QTBUG-132057
Pick-to: 6.8
Change-Id: I2d7088def8060df267c5da9e045824decd913faa
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
(cherry picked from commit 7dd94d74e4497647ff62c85460643487baf372bc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
On 150% DPI scaling, the Radio/Checkbox indicators were clipped. This
patch adds an extra margin to the left to avoid this clipping.
Fixes: QTBUG-133117
Pick-to: 6.8
Change-Id: I2e0186cbdad12481922de5ddf00f50daeb94bb37
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
(cherry picked from commit 3d45d22b536cd5fa074f6de4d02b1fd049e6b220)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
It's not just with tesselation we're using these buffers, but also for
multiview, which meant we'd continuously grow the pool until we run
out resources when multiview was enabled. Interesting observation
from this is that newBufferWithLength would 'hang' instead of
returning erroneously unable to acquire a new buffer.
Change-Id: Ie30ca44bc7b4b8f29c517fe6c88fafbe46be3d17
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
(cherry picked from commit 3c81c8907633fbc154ec4ae3a89e8d86c9ca0832)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
It was using int for two flag columns; we can pass the relevant flag
types now, and we get better type-checking by doing so. Expand the
integral numeric column from int to qlonglong, since that's the type
we actually end up with by the time we're asking QLocale to do our
formatting for us. Add test-cases for things we've lately noticed
aren't right, notably including the min-qlonglong test (which passes
because compilers handle the UB straightforwardly), that needed the
integral numeric column's expansion. Sign-handling for negative values
in hex fails; a later commit shall fix and remove the QEXPECT_FAIL().
Pick-to: 6.8 6.5 5.15
Task-number: QTBUG-133269
Change-Id: I39c5339b144b40a30886d8253fa464828ed87629
Reviewed-by: Mate Barany <mate.barany@qt.io>
(cherry picked from commit 5a230596c8c1f63e662ce17e094e2ae187066d6d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
tst_QGestureRecognizer::panGesture() is flaky as sometimes
the gesture event is being sent outside of the parent. It
is being sent in the window frame instead of in the widget.
Fix position of the parent and verify that it is correct.
Fix flakiness on Opensuse 15
Pick-to: 6.8
Change-Id: I00eacb80a7e2e658345d3bc56cdef0c0024d1a1d
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 3766b9cb3cb49fdef626526181b6a7fe26870e29)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The format of the Xcode preferences has changed, so we need to account
for the new format when looking up the default development team.
Pick-to: 6.8 6.5
Change-Id: Ib34c2e5245c13db4d81218a5a2460417e4fc6347
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 469e4237cf32d27609661132727555490086750b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The format of the Xcode preferences has changed, so we need to account
for the new format when looking up the default development team.
The account identifier (previously an email address) was not used by
any consumers of the provisioningTeams() function, so it was left out.
Pick-to: 6.8 6.5
Change-Id: I81a400000615594336e14c95db86ffa71a5c5ff9
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 380a9fdc872e14e537f3e148c7a1e72be5face2d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
As well as the _qt_internal_apple_development_team_id_computed
property.
It's used for macOS as well, so use `apple` infix instead of `ios`.
Pick-to: 6.8 6.5
Change-Id: I7932166d094a14ac32cce95e6c9fcbfa44bb97b4
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit d688c73e083cecc9b9478f09b202b66b92c87e4d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This is a first step for adding QT_NO_INTEGRAL_STRINGS in the next
commit.
Mark setUtf16(const ushort *) as obsolete.
Use the weak overload workaround, so that the call isn't ambiguous if
it's called on a nullptr.
[ChangeLog][QtCore][QString] Added setUtf16(const char16_t *) and
setUnicode(const char16_t *) overloads.
Task-number: QTBUG-125871
Change-Id: I25d12c19876466c235c0d9928aae6fd332836bf5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit be3bf632e1cf80b16475f8353e4753b38317626b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Insert line breaks in the content the \tab macro expands to. This
produces nicer-looking html and also fixes an issue related to
the post-processing done to the generated files.
Fixes: QTWEBSITE-1202
Pick-to: 6.8
Change-Id: If4e7f7242f8687ef84ad715744653c4167cf907f
Reviewed-by: Andreas Eliasson <andreas.eliasson@qt.io>
(cherry picked from commit 88e4e952d73db9bc442593a96c88ca22ba7ab673)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
When UUID definitions are placed within Qt namespace MinGW build fails because specializations of struct __mingw_uuidof_s are now defined in a different namespace.
Fixes: QTBUG-133516
Pick-to: 6.8 6.5
Change-Id: I49270aa2a892d407675dab7b90d3929d120c5224
Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io>
(cherry picked from commit 84b7cef13913139b2ed7e506ace0fa6b97269829)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
In preparation of changing the random access iterator to a
bidirectional iterator, the tests are extended to ensure complete
test coverage.
Task-number: QTBUG-132527
Change-Id: I8caf93417282631f7982cb12a82b39c00d67c913
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit e4bcd9f1cb0e787c9353589ea48dca6823592d41)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Amends 73405890b8911dd1a58120665ce63a38281c6ce4. The patch here
does the same for D3D12 as that previous one did for the Vulkan
backend.
Others, like D3D11, are not effected because the loop logic there
does not branch.
Pick-to: 6.8
Fixes: QTBUG-133405
Change-Id: I88ac7c841dc0c28fc3f6b37c3402315b52de0a66
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
(cherry picked from commit 68e48ac60a9681887999e31f6dff622eb81bdb7d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
We were accidentally closing it along with all the other file
descriptors if the CloseFileDescriptors flag was active. That meant we
were unable to report start problems back to the parent process.
So instead of closing everything immediately, we simply mark everything
as FD_CLOEXEC so they'll be closed by execve()'s success. Because we're
using CLOSE_RANGE_CLOEXEC now to detect the system call, we don't need
the configure-time test.
[ChangeLog][QtCore][QProcess] Fixed a bug that caused QProcess not to
report start failures if the UnixProcessFlag::CloseFileDescriptors flag
was active.
Pick-to: 6.8
Change-Id: I4d81d763281354e886d9fffd56ef6ab8b6115715
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
(cherry picked from commit 3d007ff2e9caf328f92d65f71a94fd869552b1b6)
bf805455d40b4445f61321439d529cd85cb6bc65 deprecated the QString()
operator in Qt5. Later dccf28b7c344822b7459635099ebe3abdf5fd107 and
2eee9e6fcf9b70681c5d9202d1509d176e48fc31 attempted to remove it
entirely, but a reference to it still remained.
This change also removes the detailed documentation for toString() in
the same paragraph, which previously stated that it generates strings
for use in menus. However, this is not always the case due to
toString(QKeySequence::PortableText). The differences between the two
serialization methods are already well-documented in the toString()
documentation.
Change-Id: I42dbb353bc56354f37b8fc22170f8e588eb97176
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit f06dd091696fed5b47a1bb071a8d5c28abb5c8a2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
When rendering hinted text on Windows with DirectWrite, the goal was
to keep the rendering and metrics as close to GDI as possible,
minimizing the impact of changing the default font backend.
Therefore, the DWRITE_RENDERING_MODE_GDI_CLASSIC was always preferred
when hinting was on.
However, DWRITE_RENDERING_MODE_GDI_CLASSIC only applies antialiasing
in the horizontal direction, but GDI applies vertical antialiasing
as well. The result is that text will look more aliased with
DirectWrite than it did with GDI, which arguably looks ugly
especially at large sizes and can be perceived as a regression.
Microsoft documentation recommends using symmetric antialiasing
when the pixel size exceeds 16, so this patch enables
DWRITE_RENDERING_MODE_NATURAL_SYMMETRIC for fonts larger than
16px regardless of whether hinting is on.
It's worth noting that for fonts with heavy hinting, such as
Times New Roman, the rendering using
DWRITE_RENDERING_MODE_NATURAL_SYMMETRIC is different from
GDI, although more similar to Freetype. However, the impact
of not having vertical antialiasing is worse and as native apps
are moving towards using DirectWrite, the GDI rendering is not
going to be the definition of a "native" look anymore.
A second thing to note in this patch is that we always pass in false
for the useGdiNatural argument in GetGdiCompatibleGlyphMetrics().
According to the documentation, we should be passing in true for text
rendered with CLEARTYPE_NATURAL_QUALITY. However, doing this causes
wider kerning in certain cases. Since the tighter kerning matches
the layouts we get in native apps, as well as when using Freetype,
I've chosen to pass false for now, to be consistent.
This change also adds a manual test which can be used to switch
between DirectWrite, GDI and Freetype rendering on Windows, so
that it's easy to compare.
[ChangeLog][Windows] Improved hinted text rendering at font sizes
larger than 16px.
Pick-to: 6.8
Fixes: QTBUG-131946
Change-Id: Iebbe5c7affe7df6266ade6b161c31bde3d2caa84
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit 407a98d94fb05780f30e77463fb2bd535041a044)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
memcpy() takes void*, not char*, so the cast from QChar* to char* is
not necessary (and potentially harmful).
Amends the start of the public history.
Pick-to: 6.8 6.5
Change-Id: I7b7178290bd30d93ed9e64b6b84294d0f7576c80
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 7206f6a39d298ed9c94bccf7bdc57498fa73ac36)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The test is flaky every now and then on the CI, so increase the timeout from
5s to 20s (a previous TRY_VERIFY precheck reported just shy of 10s waiting
time, doubling should be™ sufficient).
Amends the start of the public history.
Pick-to: 6.8 6.5 6.2 5.15
Change-Id: I8e64bf8ac1576c0ac71790a03936635016b3b2b7
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 40e65f029341a01e16dc88871eb7b24979aea9bf)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This allows Qt Quick items to react to the QContextMenuEvent, rather
than immediately showing a native edit menu.
Task-number: QTBUG-35598
Change-Id: Id8f492b549431a42aa26f2d72b418301d2cab3dd
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit e426737d73bdda1b936e52179b08108250907e03)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This is from one of the 90s books on C++ Coding Style:
Destructors of (public) base classes should be either public and
virtual or else protected and non-virtual.
The dtors of the various QFlags helper classes were public and
non-virtual, allowing slicing and use outside of QFlags.
Fix both following the rule and making the dtors protected.
Previously, this would have been enough, but Clang started to warn
about undeclared copy- and move-SMFs in the presence of a user-declared
dtor, so need to declare all five.
Found in API-review.
Change-Id: I70d1163f7bb42d981bf550418d2775a784bd416e
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit f080f161237e3310fca0955742218276069e4868)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
... because it is not really related to IO.
We were choosing between serialization and text, and ended up with
text, because that's where the standard itself puts format [0].
[0]: https://eel.is/c++draft/format.functions
Amends ffac33964d51971a1c1f61308b6f0a60a4133296.
Found in Qt 6.9 API review.
Change-Id: I827322175da81bc027a9e136098b7e84677f43f7
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 584ac8185255da9b15360bf0ca50677cba46ac9f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
... and add more specific #errors.
There are two distinct error cases here:
- First, someone could add more Q_STL_ macros to qstdlibdetection.h,
so like a switch with -Wswitch, list them all here and #error out if
there's a Q_STL_ we haven't yet seen. The audience here is Qt
developers, via the CI.
- Second, one of the "non-major" libraries (ie. not libc++, libstdc++
or MS-STL) add support for C++20, specifically the std::ordering
types as announced by __cpp_lib_three_way_comparison, in which case
we need to retroactively add the correct unordered value here. The
audience here is both Qt developers, via CI, but also Qt users.
So separate the two error conditions.
Also, for platforms where we don't know the numeric value of
std::partial_ordering::unordered, use Qt's legacy value, for
potentially faster conversions to/from QPartialOrdering. There's no
point in guessing which value _might_ be used by a future STL, and
swapping STLs is _always_ BiC, so we don't need to guess which STL
will follow the Dinkumware ones on QNX and VxWorks.
Amends 0231f33ad121a85368bb3f43273973b9632735dc.
Change-Id: I1d06a18ca5bb26aceb7c76a0f035ecd8d4673547
Reviewed-by: Michał Łoś <michal.los@siili.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 1a74f77f57fff52e0166dd895a8c6d9e09b388a4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Fixes clicking UI elements with a mouse on Android.
8d8cbe87e21f05b7d611ed4be47299977288b267 introduced changes to support
mouse buttons other than Qt::LeftButton, but the release always looked
like no buttons changed, nor were they tracked (m_buttons is always
Qt::NoButton). Qt was not notified of mouse up, so nothing was clickable.
Now all mouse events go through sendMouseButtonEvents, and the last seen
button state is tracked for every event. If a mouse up with no buttons
occurs, the last seen set of buttons is used instead, so Qt correctly
handles the event. Also adds the mouse button state information to
mouse move events from Android, so the workaround for delivering
Qt::LeftButton when a window is tracking a move while a button is
pressed has been removed.
Tested on a Samsung A1 with a Bluetooth mouse.
Fixes: QTBUG-132700
Fixes: QTBUG-130297
Pick-to: 6.8
Change-Id: I241282c2915d7e6cf99db7f0bc1ad2d541349077
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit d908e043984dcfed3aa80e30cd1cafacd13b644d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Like QGuiApplication does as well. Also add a note that screen and
window DPR can be different.
Pick-to: 6.8
Change-Id: I1a24cf7f11e945187da9dce4421039350e811997
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 97049278443860d3dd1b1efd20d1f7dabaf72a35)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The various base classes that abstract away template-independent parts
of QVLA have protected destructors to prevent slicing. Re-add the
special 5 (using the macro) and a defaulted default constructor.
Pick-to: 6.8 6.5
Change-Id: I60f036eafc808862a1abee72fd53023dd99b4cc3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit c10072895d1061e258d23f3cc2a9050de5236a46)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Application developers using Qt from their distribution, or from the
official installer, get a release-mode Qt build, where QT_DEBUG wasn't
defined. That's no reason to hit the issue that a breakpoint in
code that gets hit when opening a popup menu should lead to a complete
desktop freeze due to the mouse/keyboard grab.
Change-Id: Idf0df03ce5afb792261b62cabb06fab17b5e2952
Reviewed-by: Liang Qi <liang.qi@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
(cherry picked from commit a176f87a6451412a632866fda1fd79290b9d7520)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
If a class honors the RO0 we usually just leave a comment in the class'
body, and don't explicitly redeclare any of the RO5 special member
functions.
In some cases we may need to redeclare (some of) them. The main use-case
so far is to declare a protected destructor for a base class that is
not polymorphic, in order to prevent slicing; the compiler-provided
destructor is always public.
We can easily declare and default such a protected destructor, but that
comes with the problem that now we're violating the RO5 (as far as C++
is concerned, declaring a SMF counts towards the RO5, even if it's
immediately defaulted).
Specifically: by declaring the destructor, the class loses the
compiler-generated move operations, and the copy operations are
generated but deprecated. Clang >= 18 warns about this.
In such a scenario we *must* redeclare all five SMFs... and default them
all. This is boilerplate, therefore I'm adding a macro to streamline it.
Apply the new macro to a couple of cases were manual refactoring has
already been done.
Pick-to: 6.8 6.5
Change-Id: I5dc0ff9770621fbec0b1057c164d0623f901e3e9
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit fcb57391f73d36914e10ba964dbd9b01fe6f3af2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
- There is no load() in Q*Atomic (unlike std::atomic), so link to
loadAcquire()/loadRelaxed(), depending on context.
- Also remove the template argument, <T>, which prevents qdoc linking.
Amends b62c3a85452aecf4f6c863645db34857b05d5ebf and
329e09a3c303fad1ab001de74924288aae1e7a9d.
Pick-to: 6.8 6.5 6.2 5.15
Change-Id: I8c58674ffc7e779fee982555edcd45ed40d4c17d
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 9854482835071993968a524878b601c1d9327f1e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The selection of which set to iterate over and which one to remove
from based on their relative size violates the function's
documentation, which clearly states that items are removed from *this,
and not from `other`, so the result must never contain any elements
from `other`.
Amends 4f2c96eaa8bfa4d8a6dfb92096e4e4030d0cdea7. Instead of reverting
to the gruesome old code with the forced detach-just-to-remove copies,
distinguish four cases:
- if the two sets are shallow copies of each other, then their
intersection is *this
- otherwise, if either set is empty, clear() *this. This is required
for one of the tests that 29017f1395b1bc52e60760fa58c92f6fa4ee4f60
added to succeed.
- otherwise, if *this is detached, perform the operation in-place,
using removeIf()
- otherwise, create a new set and move-assign to *this to avoid
detaching just to remove something again. In this case, we can
continue to iterate over the smaller set, but we need to keep
picking elements from LHS into the result.
[ChangeLog][QtCore][QSet] Fixed a regression (introduced for Qt 5.2)
in intersect() that caused equivalent elements of `*this` to be
overwritten by elements of `other` if `other.size()` was larger than
`this->size()`.
Not picking to 5.15, as users will have likely adjusted their code to
the buggy behavior, and because removeIf() isn't available there.
Pick-to: 6.8 6.5
Fixes: QTBUG-132536
Task-number: QTBUG-106179
Change-Id: Idfa17c3b3589c4eacec27259fc01df6aeaa6c45f
Reviewed-by: Øystein Heskestad <oystein.heskestad@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 162015e9c6f469951d9212ef655cff16dcace071)
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
This reverts commit 92acc94fa98d19929d28feb5d543acf8c50c2290.
The change broke QSet ordering guarantees: The documentation clearly
states that each item from `other` that isn't already in `*this` is
inserted ("STL insertion behavior"). Swapping *this and other breaks
this.
Independent of STL vs. Qt insertion behavior, making the picking of
elements from containers "random" in the sense that the size of the
container is now important, and not merely LHS vs. RHS, is a bad idea.
[ChangeLog][QtCore][QSet] Fixed a regression in unite() that caused
equivalent elements of `*this` to be overwritten by elements of
`other` if `other.size()` was larger than `this->size()`.
Pick-to: 6.8
Fixes: QTBUG-132500
Change-Id: Ia636b62325139d618b5467a643ff710716324296
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit 2d1b3028673493cb144060cbec49b1b95f4188d2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
In Qt versions 5.0..6.7, at least, this used to be the implemented
behavior for unite(). For intersect(), it was implemented up to and
excl. 5.2. Even the documentation states as much:
intersect(): Removes all items from _this set_ that are not
contained in the other set.
unite(): Each item in the other set that isn't already in this set
is inserted into this set.
Add checks that the functions behave as documented (hint: they no
longer do, since 6.8 (unite()) and 5.2 (intersect()), resp.), this
being the only correct way to implement these functions (items in
sets may be equivalent, but not identical; it is important that the
set operations work in a manner consistent with insert(), to meet
user's expectation of how these functions work (unite() just
inserts() the rhs, intersect() removes if !rhs.contains). Note that
QSet, unlike other Qt associative containers, actually has STL-style
insertion behavior (insert() doesn't overwrite).
subtract() is the only one that's still true to its docs. A test for
this function will be added in a follow-up commit - eventually.
In anticipation of adding rvalue-other overloads of at least
unite(), add a test with that, too.
Pick-to: 6.8 6.5 6.2 5.15
Task-number: QTBUG-132500
Task-number: QTBUG-132536
Change-Id: Id309ab5192e6d1c9bbeef496cbd7116d306eaae8
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit 0d4fd5c545b47966c56ed0b9eb9b5c0a8f75c02a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The original patch that added this feature was disabling the core dumps
unconditionally. I guess the check was simply forgotten.
Amends 9df6e8ad3b3a7a57af87e6a3fef2ef793610cb3d.
Found in Qt 6.9 API review.
Change-Id: If3f9cb35d11a0262241a465626a25f6d7d2bbdb4
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 9860f6522919d154dd4f95ff6f6ae58d3e4c435e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
It usage of libc++ was never detected if the compiler was explicitly set
to a specific clang binary and clang wrapper.
Change-Id: I5fd3c84223cafedf06b34afe91d975e71c199e24
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 982fe396e5908a6f1089ba577ed6220d90eaaa95)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Fixing warnings/errors about QFile::open() return value not being
checked, and print the name of the file and the error message that
occurred.
Task-number: QTBUG-132902
Change-Id: I099b300b5fd4563334fa547ffa365ec3f68e08cf
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit e99d5c6268862e5773056a008c273e18bf5b4ef7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
We look it up with a binary search, so it needs to be sorted.
Pick-to: 6.8 6.5
Change-Id: I0aa25e6ff9722372c0a09f2dce9f9c839fedf00e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 382a7d006b52faa08b84e56d97cc6c216925a43e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
On MSVC the values stored end up as negative.
Task-number: QTBUG-132902
Pick-to: 6.8 6.5
Change-Id: I963c57c34479041911c1364a1100d04998bdfaed
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 62685375a2d71fa34015faac76f03e709e4217c7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Use QPainter::setPen(QColor) and QPainter::setBrush(QColor) overload
instead creating a temporary QPen/QBrush to gain advantaged of the newly
introduced QPen and QBrush assignment functions from
ab53500cfa11b988e7e4234583fa6eb5027b4c08
Change-Id: I3b8c4f7d669a08558cf6abcc77c23a4fdda99c02
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 82a5e8bdb788179d1323e76b725d57efaab0b217)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
On Windows, using a URL of "file:///c:/" as a base to be resolved with
"../" should not result in the Windows drive being removed.
[ChangeLog][QtCore][QUrl] Fixed a bug (regression from 6.7) where
resolving a base URL of an absolute file path containing a Windows drive
could result in said drive being removed (e.g., resolving "file:///c:/"
with "../" would result in "file:///").
Fixes: QTBUG-133402
Pick-to: 6.8
Change-Id: I58286b9c5e5d02363f0efffdb06f983b560340df
Reviewed-by: David Faure <david.faure@kdab.com>
(cherry picked from commit 340c9d88ab353e201f117d64609fa5f7d2fa2b21)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
We set it when manipulating full URLs. If you're creating them from
parts, you may end up with one without a host. We will still fix that up
in QUrl::toString() ("manipulates full URL").
This allows the path normalization code to avoid accidentally creating a
URL with no host/authority and with a path that starts with double
slash.
[ChangeLog][QtCore][QUrl] Fixed a bug (regression from 6.7) where
QUrl::resolved() could create invalid URLs when the relative URI being
resolved contained a path with double slashes (e.g., combining
"scheme:a" with "..//b.txt")
Pick-to: 6.8
Fixes: QTBUG-133403
Change-Id: I3fe9d5fbd2efcaa66d66fffdc010e5a84066b641
Reviewed-by: David Faure <david.faure@kdab.com>
(cherry picked from commit 7d05f5ed7d3472028e28a09eeda175bb1b1eeb00)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Definitely a compiler bug because it passes for everything we threw at
the compiler in the CI but fails for a user. At least the workaround is
simple.
Fixes: QTBUG-133032
Pick-to: 6.8
Change-Id: Ie84590c466cf1d6f01bbfffd3ca1d6c262d77200
Reviewed-by: Irfan Omair <irfan.omair@gmail.com>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 0a5b37b706ee72c7d9042efcde244aa93a5ce9a5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
To prevent colored glyphs (like emoji) from being cut off at the edges,
we can simply apply the solution from bbba71748438dc05d344bb9727f10b7f55a5d229
to colored glyphs as well (i.e. to glyphs with QFontEngine::Format_ARGB format).
Fixes: QTBUG-133297
Pick-to: 6.8
Change-Id: I5578e2d12f956d0635b662b3ecf714aa63474945
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
(cherry picked from commit 7cc0ea0b5a1dc1d9e1a9a8cc8639958e42adba3a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Added the link to the qtcore-toc.
Task-number: QTBUG-130085
Change-Id: I765e01aeda0bce694157bf15ff5a036f239168f5
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 43cb7f93a4da2d57513acb3c4cbdd56c1eaf188f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
I've been meaning to add this since at least 2012 (cf. commit message
of 9180d9aa8bfb9e9f66fad13f194398a98698eb77), this is as good a time
as any.
Detection taken from qcompare.h, except for
- libstdc++: using version macro instead of date one
- Dinkumware, which is taken from the above-mentioned commit (adjusted
for the LIBCPP->CPPLIB typo),
- STLport/SGI, which are taken from stlport's _stlport_version.h,
- RogueWave, which is taken from Apache stdcxx's rw/_config.h, a fork
of RogueWave, contributed to Apache by RogueWave themselves.
It looks like not all STLs provide a version macro, and those that do
vary a lot in granularity, so for the time being, just define these
macros to nothing and not to some form of version.
[ChangeLog][QtCore] Added Q_STL_ macros for stdlib detection (libc++,
libstdc++, MSSTL, Dinkumware, STLport, SGI, RogueWave). If your STL is
lacking, please file a bug report. Note that these macros are not
considered public API just yet.
Picking to all active branches, since not picking is more risky (code
that assumed these macros existed in older branches could silently
change behavior if they don't).
Fixes: QTBUG-132908
Fixes: QTBUG-132909
Pick-to: 6.8 6.5 6.2 5.15
Change-Id: I8f956d131292483b7727f11f69b460b12a06b583
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit b6f825a857d0d2266ea89879f26703f86ddf669a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The replacement is new in 6.9, so the deprecation should be done in a
later Qt release.
Amends 90fe9874d22f0c4b809a3e493766ef852c72cc39.
Found in Qt 6.9 API review.
Change-Id: If68685f98928015163cd4aa0e65fed2c6578e429
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit b0364bc2633f322630028a13fe1143e222015cd1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Amends commit 19b7f854a274812d9c95fc7aaf134a12530c105f, which removed
the __PIE__ check because of the GCC version check that was alongside.
GCC and Clang define both __PIE__ and __PIC__ for -fPIE, so checking for
__PIC__'s presence isn't enough.
Drive-by amend the no-PIC #error message to also suggest
-DFEATURE_no_direct_extern_access=ON, which is more modern and produces
better code for executables too. Because of that, I've also changed the
reduce_relocations option to the CMake one, as there is no configure-
style equivalent for the modern option.
Pick-to: 6.8 6.5
Fixes: QTBUG-133101
Change-Id: I957b264eaee360fd964afffd60617964b26fe934
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 014e77801fa4b99cdb03330ccce1e212ac13a0af)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
When "address" is a QBAV, it points to line(QBAV) which points to
lineArray(QBA), so its data will be overwitten after every read:
while(file.readLineInto(&lineArray))
This amends f0aa391ef89a393221d77d5ad3c1616a4727f11a .
Fixes: QTBUG-133445
Change-Id: Id23e726327529c44e205c4c0720af0dad42c175b
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Liang Qi <liang.qi@qt.io>
(cherry picked from commit 07eeb45d881bb0240e472167217912b08be44371)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The NSFontPanel emits changeFont even when not the active window, and
applications are expected to update their views accordingly.
As the changeFont action message is sent through the responder chain we
were only picking up the changes when the font panel was active, thanks
to the NSWindow delegate we were installing on the panel.
But when the active window is one of our other windows, we were failing
to process the changeFont message in our QNSView.
We now handle the message by forwarding it to the font dialog delegate,
so that we enter the same code path as before, and emit the right
signals for QFontDialog and friends.
Pick-to: 6.8
Change-Id: I97427c73fe46f129ca11afa6b2c222bf0f0fb0af
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit 3d42f31243ce52e517e09843b93f40b79925652f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QSqlQuery has been made movable in Qt 6.2
(14f9f00fdb2dc428610c08e3d9d03e38e9602166). The pre-existing copy
operations have been deprecated, but not removed, in order to preserve
SC/BC.
This left us with two issues:
1) Whether or not to keep the deprecated copies in Qt 7. The answer is
no: the copy operations are impossible to implement in a way consistent
with value semantics (the state of the DB driver can't be copied in
general). Therefore, mark the related APIs as to-be-removed, and not
just deprecated.
2) While we no longer copy QSqlQuery from Qt code directly, QMetaType
still detects the presence of the copy constructor and extracts it,
triggering the deprecation warning.
Rather than unconditionally suppressing the warning (which will hide any
similar issue we might have in the future), add a local workaround that
raises a runtime warning if QSqlQuery is copied through QMetaType, while
not raising the deprecation warning when building Qt itself.
[ChangeLog][QtSql][QSqlQuery] Copying a QSqlQuery object via QMetaType
now raises a runtime warning. Note that copy operations for QSqlQuery
objects have already been deprecated since Qt 6.2, and are planned to be
removed in Qt 7.
Fixes: QTBUG-132752
Task-number: QTBUG-91766
Change-Id: I48714ad53ec706a5e4e055c45a1c05f372382940
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit f744cef06cf3a56591782f487c545b55b2a673fb)
Following qtbase/1c8884fc277c5916a420a3c14de68547a391f9fc's making
syncqt error out when an installable header contains #pragma once, we
can now flip the coin and use #pragma once as a static assertion that
the given header is not going to be installed, making it easier to
understand which headers are "public", which ones are "private" and
which ones are "neither, since never installed".
Do this for the XCB platform support files.
In qxcbglintegration.h, the header guard was actually broken (had only
#ifndef and #endif, was missing the actual #define).
As a drive-by, normalize vertical whitespace.
Pick-to: 6.8 6.5
Change-Id: Iede0605c38cda7606edfc7155bd8bfc95990c5bc
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 91f9ba2993a2652bcb349ce639aff67b5bfc8938)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Go straight for QResource, because this is run very early in Qt's
initialization, usually as a result of some debug message, via
QLoggingRegistry::initializeRules(). This bypasses the need to create
QResourceFileEnginePrivate, QResourceFileEngine, QFileInfoPrivate, and
QFileInfo, all of which would end up in this .isValid() call.
Additionally, I'm making it query in the C locale, which will also avoid
initializing the system & default QLocales. If a resource exists in any
language, the C locale query will find it.
Pick-to: 6.8
Task-number: QTBUG-133206
Change-Id: I434b498903d793c12d35fffd3e297bfdbdc1b6fe
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit d59e640c868f3db2d661970f3d34a22013d49053)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Use QPainter::setPen(QColor) overload instead creating a temporary QPen
to gain advantaged of the newly introduced QPen operator=(QColor)
function from ab53500cfa11b988e7e4234583fa6eb5027b4c08
Change-Id: Ib29a932a183b629f2c5f3ce32f4e00bd7ab24a03
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 678564291d8faa7689b4a65376b2c60118fc9936)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Reportedly, some unofficial DirectWrite ports are missing the
default values to the arguments for IDWritePaintReader's
MoveToFirstChild() and MoveToNextSibling(), so we make this
explicit to work around the problem.
Fixes: QTBUG-133336
Change-Id: Ia9a01e371e7424508db0d5ad3c75037caaf16854
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit cbce69ebd643bb4841de20f34c5b23bddbcde0c6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Otherwise running the deployment script fails on macOS with something
like
CMake Error at
.qt/deploy_qml_app_texteditorexample_32987d3e6e.cmake:1 (include):
include called with invalid argument:
2/build/.qt/QtDeploySupport.cmake
due to the following generated content:
include(build/texteditor space 2/build/.qt/QtDeploySupport.cmake)
Pick-to: 6.8
Task-number: QTBUG-126827
Change-Id: I8f9923db8dc670a6efbd6f75c48da5dfd1af687d
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 65f08c09713b6d167638c4e19ebafcac045fc1c5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The feature names are normalized using `qt_feature_normalize_name`, but
a user might read `qt_feature` usage and not realize that they should
normalize the name in the `FEATURE_*` variable.
This change emits an error if it detects such invalid names.
Fixes: QTBUG-132464
Pick-to: 6.8
Change-Id: I33c7ab9f589c92e11e16d376660e8b6152339d12
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit b71647d06970b2cc3b63b93c020eca8caf0a519f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The patch provides two documentation snippets: for an arbitrary arg
and for \c {*this}. That is because qdoc does not support passing
a command (e.g. \c) as a part of the snippet's parameter.
Amends e95fb04202b3f786037c10942fd4e912644fd7d2.
Found in Qt 6.9 API review.
Change-Id: I4eed234d18e39f2fc0c30a647a423f3240e31d40
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 8511149d886e5aef2a065efffc336c7b25e6540e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This is both more accurate and also more stable: The suffix-list
update usually takes several days to go through all branches; using
the commit date avoids using newer fetch dates in older branches.
Pick-to: 6.8 6.5 6.2 5.15
Change-Id: Ifefd7158e4104c7bbdfe6a2d8a505d8acf7275b4
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit cbea57f80b43a969d2e15d53b759abb9924d52c1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
When two actions in one menu have the same hotkey and the first action
is not enabled, the action search was selecting the first, disabled
action despite the fact that it could not be selected later on.
Pick-to: 6.8
Fixes: QTBUG-56952
Change-Id: I894ee09d9ccc7154ca506ef907924cd150ac6ed2
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 13636f848da6932f9864bf9335d19b439b8387cd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QT_ANDROID_SYSTEM_LIBS_PREFIX and QT_ANDROID_NO_DEPLOY_QT_LIBS were
added in Qt 6.4, but they were missing \cmakepropertysince 6.4.
Pick-to: 6.8
Change-Id: Ife0f68e79d331f4923d1015431f5af65d80dca36
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 51474d795a4c801933f9444b73d536fb1c407e72)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Those Android CMake properties have been carrying the documentation tag
of \preliminarycmakeproperty by mistake.
Pick-to: 6.8
Change-Id: I739fee2f078300427557a29b25e1898d57cf04d7
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 2abc4594791823f1e56d692df38ede69f83e45cf)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
It's semi-private API (ie. undocumented) and for most platforms¹, the
change is a no-op, which is why the approach here is a bit different
than your usual REMOVED_SINCE:
Normally, when only the return value changes, we mark the new overload
as QT6_*_NEW_OVERLOAD to allow the two function to coexist and the old
function to call the new one.
But the extra argument backing QT6_*_NEW_OVERLOAD would change the
mangling of the function even on platforms that don't mangle the
return type (the majority), and we'd have to decorate all calls that
could possibly be seen by QtCore's removed_api.cpp TU with
QT6_CALL_NEW_OVERLOAD. The main user of the API is moc-generated code,
though, and so I didn't want to have to change moc's output, even
though, currently, nothing in removed_api.cpp includes moc-generated
code. But it may, at some point in time.
This means I needed to grasp the nettle and duplicate the (granted,
trivial) implementation. Even a private helper function would mean
(maintenance and runtime) overhead for "normal"¹ platforms, so I opted
not to go there, either.
¹ those that (rightfully) don't mangle the return type, ie. all except
... MSVC.
As a benefit, we catch the mistake of modifying the dynamic
QMetaObject under the object's radar already now.
[ChangeLog][Potentially Source-Incompatible Changes][QtCore][QObjectData] This
(undocumented) class' dynamicMetaObject() function now returns a const
QMetaObject* (was: non-const). The backwards-compatible fix is to
receive the result in a const QMetaObject* variable (or to use auto),
and applying a manual const_cast, if a non-const object pointer was
actually required. Modifying the meta object that was returned by this
function was never supported and may lead to problems elsewhere.
Amends 0b044e8b055f9c1d93b278ed69aba76f7c886cb1.
Change-Id: I4ebc43018a2a87433ab7a97554196842b97cf1ba
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 2c212e15f8b9dc2578d93ac69a0f5826ea9de18f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The pmr::monotonic_buffer_resource ("pmr::mbr") strategy can only
allocate buffers; deallocation is a no-op. I chose it for
QDuplicateTracker because the tool was only used one-off: build it,
then destroy it. There were no other operations.
That changed when 090c7e3262dce93df83c73a4a822761e5d9b4650 added
clear().
Calling pmr::unordered_set::clear() will deallocate the nodes (but not
the bucket array), but due to pmr::mbr, nothing is actually
deallocated, so memory that was freed by the container isn't actually
reused by it, later. IOW: repeated grow-clear-grow-clear cycles would
forever grow the monotonic_muffer_resource, using more and more memory
and thus appear to be leaking it.
This isn't exactly optimal behavior, so try to shed the pmr::mbr's
extra memory with a call to mbr::release().
Unfortunately, C++17 originally failed to nail down the semantics of
pmr::mbr::release(), prompting LWG 3120 in response to observed
implementation divergence. In particular, MSSTL, at the time of LWG
3120 filing, didn't appear to allow to allocate() after release(). In
our tests, it does allow it, it just never falls back to the original
(stack) buffer, and, looking at the implementation, it doesn't look
like it can do so anytime soon (it doesn't remember the buffer, and
everything is inline, so they would seem to need a BC break to fix it.
We tried to work-around the problem by hard-resetting 'res' by going
through a destroy-recreate cycle. pmr::mbr is neither copy- nor
move-constructible, so that blunt instrument is, unfortunately,
necessary (std::optional would be an alternative, but has overhead
that affects all platforms). This crashed, though, so just call
release() and handle MSSTL's failure to reuse the initial buffer as a
QoI issue.
For all platforms, before release(), we also need to make sure that
`set` no longer holds any references into it, and, since clear()
doesn't shed capacity, we need to use the C++11 version of the
swap-trick (swap is actually UB here, because the allocators differ):
move-assign a default-constructed set.
Amends 090c7e3262dce93df83c73a4a822761e5d9b4650.
Fixes: QTBUG-132945
Pick-to: 6.8 6.5 6.2
Change-Id: I4796806e427602255439dcb1518aa9b661c7933e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 9f4325e67354ce6c4c98e7a206f17729b378dc04)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QSet::remove() calls QHash::remove(), which unconditionally detaches,
so fixing the detach there, by pulling the isUnused() check to before
detach(), fixes it for both.
For removeIf(), the old code used begin()/end() for iteration,
detaching unconditionally, even if nothing was removed in the end.
In this case, fix by using cbegin()/cend(). That delays the detach()
until the first erase(), where it belongs. The end() iterator of QHash
(and therefore QSet) are stateless sentinels in all but name, so we can
continue to cache end(). Add a code comment to that effect.
Amends 62dad9be9e172597c56a970202299563aa04918e (for removeIf()) and
5b7c3e31b538376f2b4733bd868b5875b504cdb3 (for remove()).
[ChangeLog][QtCore][QSet] remove() and removeIf() no longer
unconditionally detach, but only if something is actually being
removed.
[ChangeLog][QtCore][QHash] remove() no longer unconditionally
detaches, but only if something is actually being removed.
Pick-to: 6.8 6.5
Task-number: QTBUG-106179
Fixes: QTBUG-132831
Change-Id: I807577eafa1be478b0a2da45cf8c44936d5e48ed
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 3a284dc19d1c77692f2faddedc674cc293d51a00)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Sometimes test causes kernel crash. Test is skipped until
gnome-shell 46.1 or newer is backported to Ubuntu 24.04 LTS.
See also https://bugs.launchpad.net/ubuntu/+source/gnome-shell/+bug/2095396
Task-number: QTBUG-132070
Pick-to: 6.8
Change-Id: Ia1c7f1737e225189b86cb2b2d2ff68a7cc1e838c
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 1c0406ee17d5747f8e5b107db81949055aaa7f9e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
While LWG 3870 changed the const/static_cast'ing for C++23, this is
q17, so use the C++17/20 semantics of casting away const- and
volatile-ness.
Found in API-review.
Amends 364ac13a79a8fff0447a62e9af5588db397c0bfd.
Change-Id: Ie11589cbc96b8c3c36deaa6101a897f527d92a46
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit c05982fda39bbfa9fa3641c7e5938f204a8b1bf5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
These functions expose implementation details of their respective
class, so, seeing as the classes are pimpl'ed and their op==s are
out-of-line, too, these functions ought to be out-of-line, too.
De-inline them, by calling a private out-of-line helper function. This
way, they can remain unexported and "real" hidden friends (= with an
inline definition).
As drive-by:
- in QBrush/QColor: check the properties in the order of cheapness
(style(), color(), transform()), and don't copy QTransform just to
check isIdentity() (access the member directly).
- in QPen/QColor: avoid the QBrush copy (access the member
directly). This also retroactively endorses the noexcept on this
function.
- in QPen/PenStyle: amend the comment that says it's allocating with a
`// ### optimize`
Amends f0186862e16128343705abd0de5994e8ca05a909.
Found in API-review.
Change-Id: Ibfd43b1f2200ef030d6739dad1bf026cc190606b
Reviewed-by: Tatiana Borisova <tatiana.borisova@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit d769ca41fc11e1af81e4cdf7cacb3884f98b108c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Amends commit 0756cc1eae5fd8981983319fef1d084762a67b8d.
The generic instantiation of this function had a std::nullptr_t *
parameter, but callers had special code to pass a nullptr there because
we never needed a value of a nullptr (it's always a null pointer). For
example, in compare_ptr_helper():
auto lhsFormatter = Internal::pointerToString<QObject>;
auto rhsFormatter = Internal::genericToString<std::nullptr_t>;
return compare_helper(t1 == nullptr, "Compared QObject pointers are not the same",
const_cast<const QObject *>(t1), nullptr,
lhsFormatter, rhsFormatter, actual, expected, file, line);
But in debug mode, some compilers did emit a load from this memory
location, causing a crash. So we just specialize this function to avoid
such.
We had a test for this... except it was never reached because the
earlier QCOMPARE() had already failed. For the test, this amends
commit ae021882330abc5f6fbaadca290e6e5670c89028.
Fixes: QTBUG-133330
Pick-to: 6.8
Change-Id: I2cd3bb475788431c6a0dfffd28e730e8b613e033
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit e19b633c468123526660b40ae110f46090682c76)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Setting permissions manually require the user to point to the manually
managed AndroidManifest.xml file.
Pick-to: 6.8
Change-Id: Iae289ad32a12f869a5a0ec0261bc3e771d94a15d
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 40e18c7c7e3afd8dacf22879ec1bc442ecbd9877)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Cloning the git sources will:
- allow embedding the git sha1 into the SBOM generated by the build
system
- ease development process in CI VMs when investigating issues.
This will slightly slow down the CI build phase by a minute or two.
Pick-to: 6.8
Task-number: QTBUG-122899
Task-number: QTQAINFRA-6520
Change-Id: If554ed0fedca26ff77d04752288ee8497bc4b9ce
Reviewed-by: Toni Saario <toni.saario@qt.io>
(cherry picked from commit 5717a4fd4a3fd2ba530a7eb4812ce2a5c34515cb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
On back-porting commit 7f9ee43de783105d8de0a0b614751eec639131f8 to
6.8, I worked out how to move the maximal version of each locale ID to
the front, while keeping it after a shorter ID that can't be derived
from it. Forward-port a refactored (and more systematic) version of
those changes now to dev (and thus 6.9) so that we get reasonable
compatibility between versions (albeit with 6.8 still lacking
truncated forms, since its QTranslator takes care of those).
This, however, brought to light a problem in the subsequent addition
and insertion of truncations. Since non-equivalent truncations of the
maximal version may (and often do) use the same script, they match
equivalents that are now later than the maximal one, which caused all
truncations to be appended, where some should be inserted just after
the equivalents. Furthermore, had the truncations of the maximal one
been inserted, they'd have appeared just after it, before some of its
equivalents, where it should be after. Reworked the handling of
truncations to take account of the fact that entries come in blocks of
equivalent forms; any truncations inserted instead of appended should
be inserted after this block, not between its members.
Adapt tests to match. As a "drive-by", shuffle some Punjabi tests so
that the comment that applies to two of them is followed by those two.
Task-number: QTBUG-131894
Change-Id: I67ea21cf279e8a3b2e8413c27ac0fa5dfabdaca7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit b6122866962880251fa8a82856d1fb9db43900d6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The ctor refuses to be called with a nullptr painter, but a moved-from
QPainterStateGuard object _will_ have a nullptr painter. An assert
gives a slightly nicer error message than "nullptr deref".
Extract Method verifyPainter() to not litter the executable with
string literals for every one of the these functions (some compilers
don't use the leeway extended to them by the standard to fold duplicate
string literals).
Found in API-review.
Amends ec3a5f4994a2bafc65fa8e01fb0861219580f622.
Change-Id: I562e6a0ff5a4c8ce86418b998ed78c501441b61a
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
(cherry picked from commit 5c20f9aa5c31d30a2dccfc617e93c6d6ac0fc96c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
There are no Q_ENUM/Q_FLAG/Q_INVOKABLEs defined in it, so drop
Q_NAMESPACE. We can always add it back in when something is added to
it that does require a meta object.
Found in API-review.
Amends 5ac4f04325a56d47812f528fe31ceb0d4932f664.
Change-Id: I8b197f2cd835d1fe4893f2e9608dcaf0ffd14cd9
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 530b2e1fc7d289c12507696137996a02bdbeb439)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
It can't, pfew. Was wondering for a moment, but of course, even the
QSet::iterator is really a const_iterator.
Pick-to: 6.8 6.5 6.2
Change-Id: I85caa64c1caca6d77569aa2ceb868a4aa0e5578d
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Magdalena Stojek <magdalena.stojek@qt.io>
Reviewed-by: Lena Biliaieva <lena.biliaieva@qt.io>
(cherry picked from commit a4fd95c51a4347482d6d0a815657d0b5bdaf06db)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
In QtCreator, the file lit up like a Christmas tree from all the
undefined types :)
Amends the start of the public history.
Pick-to: 6.8 6.5 6.2 5.15
Change-Id: I558ad493a4848e6a28bd37a38f2432c5605e0f43
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 768ab2051765f3825903c449a2f0e2c07e665152)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
If an executable has a .bat or .cmd extension, and is executed without
a prepended 'call' command within a batch script, the parent batch
script execution will not continue once the child process has
finished.
Prepending call to the command ensures that the parent batch script
continues execution.
This changes ensures that configuration succeeds for the use case when
cmake is actually a batch script called cmake.bat or cmake.cmd.
We already use 'call' in qt-configure-module, so do it also in
configure.
Pick-to: 6.8
Change-Id: Ia42cb71787e88c850f1cbd1fcef5b6decbdeaabf
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 062a7dc4248904bed51dc87466ec29b407945950)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
So it doesn't confuse me or anyone else again
Change-Id: I8ad5d4cb1b00e0edaffa90ed67e30246211e1a97
Reviewed-by: Liang Qi <liang.qi@qt.io>
(cherry picked from commit 7fcfc3790512b6d467732119330ea886de2a72fb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
If `value` is INT_MAX and `lastPaintedValue` is -1 (the default), the
subtraction will overflow. Extend the arguments to 64 bits. The result
is only used for a double comparison anyhow.
Change-Id: Id4a5396c61da81932ac626b3102e583a74264df4
Pick-to: 6.8
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit 8e843ddba8de6b9dbe9851856fd4524af5d3c584)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The check for SH_Menu_AllowActiveAndDisabled is done in eight places.
Simplify it by added a helper function which checks if an action should
be considered (i.e. is not a separator, is enabled or
SH_Menu_AllowActiveAndDisabled is enabled).
Pick-to: 6.8
Task-number: QTBUG-56952
Change-Id: I65c6dc67b804dd4c5cf463767a525ec6f785bf1a
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit e0a44cd32ed3884fd665c112a9dfc2bc45a6597d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
While the code checks for the possibility that leftMillis-rightMillis
may overflow, it fails to take into account that the result may be
minimal ("INT64_MIN", so to speak) and passes it to qAbs, triggering UB
in there. Since it's just a range check and we don't need the result to
be signed, use qUnsignedAbs.
Change-Id: I7f1a4bbc521fdc164ca20fedf0e995359a67ea4d
Pick-to: 6.8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit 45e90b73c75b2c7997a0f8d750f9927f64e05a0e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The typical usage of a QDuplicateTracker should be to pass the
guesstimate for the number of entries as a constructor argument, or,
failing that, default-construct the object. In those cases, everything
is peachy:
QDuplicateTracker<int> seen(n);
QDuplicateTracker<int> seen;
But for users that subscribe to a AAA view and use
auto seen = QDuplicateTracker<int>{};
or that emplace() a QDuplicateTracker in e.g. std::optional, we need
to make sure that value-initializing QDuplicateTracker doesn't
value-initialize the internal buffer (which can be several KiB in
size).
So don't = default the default ctor, but implement it as empty.
Amends f21a6d409ea0504c64cd72861fc16b6f3e080086.
Pick-to: 6.8 6.5 6.2 5.15
Change-Id: I930f40d2bb85b74d2216378d8b8ca854a53a49e4
Reviewed-by: Dennis Oberst <dennis.oberst@qt.io>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 15154fa4c5d216b1c943a3b37be24f5fb2e4fa73)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This isn't strictly necessary, as it doesn't affect anything we use
the header for, but it brings us back in sync so future updates don't
involve as many changes to review. Document why we amend the upstream
SPDX identifier (to a non-deprecated equivalent).
[ChangeLog][Third-Party Code][QtTest] The perf_event_p.h from Linux is
updated to match Linux kernel 6.13.
Pick-to: 6.8
Task-number: QTBUG-132871
Change-Id: I101734b743f6689ca64054008455b98e4f6b827c
Reviewed-by: Lucie Gerard <lucie.gerard@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 019d2e5974326cac1803bb860f280c1b8fd104c3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
In the git version of CLDR v46.1, Acre's metazone inherits a generic
long name. However, root provides no metazone data for it to inherit.
So we ended up with an empty entry for Acre in the QlocaleXML file.
Harmless, but easy to avoid, so avoid it.
Pick-to: 6.8
Task-number: QTBUG-132851
Change-Id: I392d0922bebff731632e729a4931caa02dc3a404
Reviewed-by: Mate Barany <mate.barany@qt.io>
(cherry picked from commit b60be8c14d9f39358d00ef06a8ea5562fba17d98)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
There already exists a method to do this, but seems at some point
calling it has been dropped. Add a call to update the native
reference whenever the reference in Java gets updated.
Task-number: QTBUG-130614
Change-Id: If9654b504c88340feff2432973f8f9f2eaffa272
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit acd331cd15785dda444b1a34f343a42c6b3c89fe)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
isActive() may return true if a (transient) parent window
is active (has focus).
Compare against QGuiApplication::focusWindow() instead.
Fixes: QTBUG-129233
Pick-to: 6.8
Change-Id: I834a5814a5db161bdea2ba3524d1010e0c0e3e6e
Reviewed-by: Even Oscar Andersen <even.oscar.andersen@qt.io>
Reviewed-by: Piotr Wierciński <piotr.wiercinski@qt.io>
Reviewed-by: Lorn Potter <lorn.potter@qt.io>
(cherry picked from commit 31762e2e704673057a292ac59977b501919f2450)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QTextStream's operator<<(number) uses qAbs to extract the "absolute
value" of number, and passes that and the number's sign to an internal
formatting function. However qAbs is unsuitable for the task, because it
will fail if `number` is minimal, as it returns the same type of
its input.
Since we can afford to change the type of the result, call the private
qUnsignedAbs() function instead.
Change-Id: Ib813a199503f2d07c78bb76862ab2e15d68d0ec2
Pick-to: 6.8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 8f762b546fe6b2254029c4804a32d9ae6bbf4495)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This fix ensures that each call to QTest::qRun() runs all tests the
requested number of repetitions.
This fixes an issue where QTEST_QUICKCONTROLS_MAIN would only test the
first style, and skip remaining styles. The cause was that the repeat
counter was not reset between QTest::qRun() calls. Subsequent calls to
QTest::qRun() would therefore not run any tests.
Amends: 80a14c86b2739492d7f7fbdb1cbde1da85d1341d
Fixes: QTBUG-133207
Pick-to: 6.8 6.7
Change-Id: Idb164fd01ac0b8e04e5dd74c3625f2c343f742c5
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
(cherry picked from commit 07318c81a700b4d4a46c81ae2e4f17c6b1e501c0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
... instead a QString as it gets converted to an utf-8 string anyway to
avoid this conversion.
Task-number: QTBUG-132303
Change-Id: I3fcf721f9fd0d1dd181af262663fddd532262ee3
Reviewed-by: Thierry Bastian <thierryb@filewave.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 892a020cc3ad7e3d5cdcb38d26091343e78695da)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
There's little we can do, but a lot of content ends up in QLocale very
late in the execution. Let's at least not crash.
Task-number: QTBUG-133206
Pick-to: 6.8
Change-Id: I77d41141cb115147f9befffdd5e69dac19c96044
Reviewed-by: Albert Astals Cid <aacid@kde.org>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit e32f28034ad2383393645777bcd96eab3f696076)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Checking qAbs preconditions reveals that several places into Qt are
calling it with minimal values, causing UB. Those places do not actually
need that the absolute value is of the same type as the parameter.
Therefore, introduce qUnsignedAbs, which is like qAbs() but whose return
type is always unsigned, and therefore can accept everything.
This function is private; I don't want to encourage users to rely on our
extension.
Aggressively cherry picking because this will be needed in subsequent
bugfixes.
Change-Id: I2047768a5fd35f12bf898ca8c2008813434edd8d
Pick-to: 6.8 6.5 6.2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 83c812e1322a2b004bc604be3e6f61fb83246eb0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
We'll need it higher up in the file, but we don't want to/can't move
code around, so make -127 a symbolic constant.
Amends 39c7bf4631b401c681c24bb5a732a0359c8a6d7c, which, however,
merely moved the code around.
Pick-to: 6.8
Change-Id: Id6f2d51e5678b3bad7ae658cc3e38fd3909861d7
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 57aabff91eed41fb7ba0cf67df4fe7767c6e0e43)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
While the application's a11y object doesn't have a parent
within Qt's a11y hierarchy, the AT-SPI registry/desktop is the
parent of all application objects.
Therefore, report that one instead of using a null path.
With that in place, querying the application parent
via Accerciser's IPython console now gives the expected
result:
In [16]: acc.role
Out[16]: <enum ATSPI_ROLE_APPLICATION of type Atspi.Role>
In [17]: acc.parent
Out[17]: <Atspi.Accessible object at 0x7fbebc3fc1c0 (AtspiAccessible at 0x139d6410)>
In [18]: acc.parent.role
Out[18]: <enum ATSPI_ROLE_DESKTOP_FRAME of type Atspi.Role>
While at it, also add a "m_" prefix for the
AtspiAdaptor::accessibilityRegistry member.
Fixes: QTBUG-132935
Change-Id: I0e174f73c837b233fe4d5788d1c375b404000025
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
(cherry picked from commit befce757faa0b0abd2c1f4ec408c1a0932794b0c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Modifying the process environment can cause crashes in application code
that accesses the environment via non-qt functions on worker threads.
When launching a process, we can avoid modifying the environment of the
caller by using QProcess with setEnvironment. The codepaths without
QProcess support is still prone to these issues and could potentially be
improved via execve
Task-number: QTBUG-129222
Pick-to: 6.8
Change-Id: I4e2d93abaa0e392b341041faaae0ffd11e225bcb
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 673400679dca23840174c9882cea5b796b52b2f7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QTest::createTouchDevice() passes ownership of the device to the caller,
so make sure to delete it.
Change-Id: I100d3de9eab8ec9f88ed3e0850ada9d988bd962e
Pick-to: 6.8
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 28d0e658e297b5de52fb0cccaede08179c7f4b8c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QRect::width() and height() may overflow: they're only safe to call
when right-left+1 (or bottom-top+1) is representable by an `int`.
Therefore, avoiding calling them from QDebug, which is supposed to
"always work" (otherwise, it's not of great debugging help...).
QRectF does not have this issue as it stores the width directly.
Change-Id: I438dbacae42c17730afb92f05d16e3eebb161255
Pick-to: 6.8 6.5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 0f336500a0add3e3a8bb31c5cc605e5e13e23833)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
added a details about code paths that cannot happen and added constexpr
Fixes: QTBUG-132303
Change-Id: I98340c5a1f275c00aafb3294cf8e5e8368126b76
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
(cherry picked from commit e574cda7fc3f6be5a81489d8d9cdb859625d4e88)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The legacy infrastructure does not map very well to the modern one:
it turns out that, somewhat counterintuitively, targeting a
QRhiSwapChain for a QWindow may still mean rendering into a texture,
when using OpenGL on certain platforms.
For example, the Wayland platform plugin implements client-side
decorations by binding an FBO upon making a context current on a
surface for a (decorated) window, and it also makes
defaultFramebufferObject() on the context return the FBO id.
The expectation is that this is why errors such as
GL_INVALID_OPERATION are encountered in glDrawBuffers on Linux.
The QRhi GL backend's assumption that the QRhiRenderTarget being
a QRhiResource::SwapChainRenderTarget implies that the target
really is the color buffer(s) of a window surface is not in practice
sufficient on these platforms.
The bound FBO was already correct always (whatever defaultFbo reports),
but the code path hit was the wrong one. And there is different code
for MRT support (textures only) and stereo rendering (window surface
only).
Make sure defaultFbo() is queried before taking the decision which path
to hit.
Pick-to: 6.8
Fixes: QTBUG-122819
Fixes: QTBUG-132780
Change-Id: Iaaab57b031f430178ee4611a4f7a02c854010441
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
(cherry picked from commit 3869106cc5914fb4a8eda30ae1bd5f68dcee2fda)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
imageFence seems to have no purpose. And some of the
comments seem to be out of date / misleading.
More importantly, do the command buffer completion wait
before the acquireNextImage. Otherwise frame.imageSem
may have wait operations pending if the queueSubmit
did not get to wait on it yet. The expectation is that
this potential issue is what triggers the recent
validation layer releases' enhanced synchronization
checkers.
Pick-to: 6.8
Fixes: QTBUG-132808
Change-Id: Ib8e3884ccea343f5a839aa2ee17cd358fafeac69
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
(cherry picked from commit 24d62ffd720b5bec5d07b07b8d2c9dda7635f3c0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Because we called this before opening the target file, we did not check
that the destination file engine is the QFSFileEngine, and therefore we
may have passed a path that referred to a Qt resource path. We still do
that on Windows, but Qt resource paths start with a ':' character and
that is not allowed on Windows, so the Win32 CopyFile() function fails.
Moreover, this function *can* clone directory trees, which we don't want
to happen because it doesn't happen on other OSes. Instead, fall back to
the fcopyfile() call in cloneFile(). It will still do cloning where
permitted.
This was added in commit db0064b767474a89bc72ea4374f477682983c5f4,
before the fcopyfile() in 974b3adf8a099ca95fc2eabfc434038ce73f62c8,
though both were for Qt 5.10.
[ChangeLog][QtCore][QFile] Fixed a bug on Apple systems that would cause
copy() to copy a directory if the QFile pointed to a directory and the
destination was in the same volume. Now copy()'s behavior is the same as
in other OSes: directories are never copied.
[ChangeLog][QtCore][QFile] Fixed a bug on Apple systems that allowed
copy() to create a file with the name that referred to a Qt resource
path, if one tried to copy to that path. Qt resource paths can't be
modified using QFile.
Change-Id: I996368f4c656ff10ff5efffd5b47c6ddde34fd10
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 45886e6a81016c5c9212fffb5c0a83fd2431223e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Use the cross-platform renderer code in Freetype as well as
DirectWrite to share as much code as possible.
Change-Id: I643dced6b913138890b39eafc3984cca5ced0aae
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit d58ad990e227fecf5526df1a89736afc0c9268fa)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This traverses the paint node graph and renders
the emoji through a generic renderer. This renderer
is largely based on the renderer in the FreeType
backend and will be used there as well in a follow-up
patch.
Fixes: QTBUG-113458
Change-Id: I44d17b0be8d85e38589edeb68793bf4ee4491eca
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 9f22a51987614ce51b3c12ced420bc4ca5b1ec61)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Specify that since 6.8 tab focus can transfer in and out of the
embedded window if using a Qt Quick based window.
Pick-to: 6.8
Change-Id: I21d04457ee79497431f889e261f1cb6bd9fd39ee
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 059210b17e50fd7c45af4ca0631ddcf8dd7c67f8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QLocale is very often accessed during global static destructors, so
let's try and survive if the default has already been destroyed. In that
case, we shall fall back to the C locale.
I've placed the call to systemData(), which updates the system locale,
before the initialization of defaultLocalePrivate, as the initialization
of the latter depends on the former.
Task-number: QTBUG-133206
Pick-to: 6.8
Change-Id: I48e29b45f9be4514336cfffdf5affa5631a956a3
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Albert Astals Cid <aacid@kde.org>
(cherry picked from commit e0a1f491567f2495443babc5aa36a038260f96c6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This does some refactoring on the color font support in
the DirectWrite backend and introduces support for loading
embedded PNGs from the font.
This gives us support for CBDT and SBIX fonts, which are both
based on embedding image files.
[ChangeLog][Windows] Added support for color font formats with
embedded pixmaps in DirectWrite backend.
Task-number: QTBUG-113458
Change-Id: I695901b62600c37619c80aa915f60de13a4fca3f
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 1b85143d217042876209794bf8d0361b7ce8834f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Active window should always be in front of the stack so bring it to the
front of the stack if it's not.
Pick-to: 6.8
Fixes: QTBUG-112758
Change-Id: Iff123d1e95f728f51b786106d83a429c111aa6a8
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit e6e210c2406e8d4cfe67543871af5fe14a2bda82)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This includes:
- turning VERIFY_SOURCE_SBOM ON
- adding exception to the licenseRule.json files
- correcting the licensing given via REUSE.toml files
- renaming license files not located in LICENSES folder.
They need to be named LICENSE. to be ignored by reuse and
excluded from the source SBOM. The name are updated in the
corresponding qt_attribution.json
A lot of files are skipped during the license test,
but all are present in the source SBOM.
This is why correction are needed before turning the
source SBOM check on.
[ChangeLog][Third-Party Code] Renaming the license files with prefix
LICENSE. to have them ignored by reuse tool.
Task-number: QTBUG-131434
Change-Id: Iab517215bb10a17357d2d2436bba8d3af76e5cd1
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 7cb90e15631a9e6f12469a7ca8c070781c4aafc2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The license check is only called if VERIFY_SOURCE_SBOM is set to ON
in the module_config.yaml. This way, a module can turn on the check
only when ready.
The license check is done via a perl script. Since no perl is
available for Windows on ARM64, VERIFY_SOURCE_SBOM is set to OFF
in this case.
Task-number: QTBUG-131434
Change-Id: I183b7726928bbc925940330d39779a4ac2307254
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 153002f7d2904988efdd8abc68adff0f9927943b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
deallocatePreparedStmt() knows by itself when to call the psql cleanup
routines or not. No need to have this logic outside this function.
Task-number: QTBUG-132303
Change-Id: Ib1a5ba7b53c156f6a6b93f23a3ec8c851d7398fc
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Thierry Bastian <thierryb@filewave.com>
(cherry picked from commit 9094ad18b0d909f7490dec3451ec7ef9c312f42a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Requiring users to do find_package(Qt6FooPrivate) to use private modules
turned out to be a too invasive change for Qt 6.9. We turn off this
behavior and restrict it to the dev branch.
[ChangeLog][CMake] The requirement to do find_package(Qt6FooPrivate) in
user projects was postponed to a later Qt version.
Task-number: QTBUG-87776
Change-Id: Ifbf676288587ae5fabe100bf3bd93b220ddbc5ac
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
A project might want to find_package all available (installed) Qt CMake
packages that contain qt modules.
A use case might be a qml app that needs to link to all of Qt, and
support showing qml files that can load any Qt qml module.
Add a new Qt6 COMPONENT called ALL_QT_MODULES.
It can be used like this:
find_package(Qt6 COMPONENTS ALL_QT_MODULES).
The implementation will find all installed Qt modules by globbing over
all json files installed in $qt/modules dir, and treat the file names
as package names.
It will then tell Qt6 to find_package each of those packages.
Pick-to: 6.8
Change-Id: I89242307438576a0cbb3cdca80a9cb72818b6035
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit c7027880aa746a01362ac12491910479d7fc67e3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Just like we do with qt plugins, collect all found qml plugin targets
into two new directory scoped variables:
- QT_ALL_QML_PLUGINS_FOUND_VIA_FIND_PACKAGE
- QT_ALL_QML_PLUGINS_VERSIONED_FOUND_VIA_FIND_PACKAGE
The plugin target names are derived from the Config.cmake file names,
based on the existing assumption that qt_internal_add_plugin always
uses the target name when generating the Config.cmake file.
Pick-to: 6.8
Change-Id: I78c76488e133fb3c0374cbc149425726077f6c31
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit bf83fffd13c176391d353080cd76bc68ae7ea184)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The code is moved into a macro without any modifications aside from
removing the escaping of variable evaluation and escaping of quotes.
It's kept as a macro similar to __qt_internal_include_plugin_packages,
because there might be calls to find_package() that set variables in
the current scope.
The reason for moving is easier maintenance (no more escaping).
Pick-to: 6.8
Change-Id: Ie6ddc26fe4ff8db0134f3542c2886f8b5d68dc51
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 47006aca44c16c78f00940574170640f19e9fb43)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Introduce two new directory-scoped variables containing versioned
(prefixed with Qt6::) target names of qt modules and qt plugins found
as a result of finding Qt packages:
- QT_ALL_MODULES_VERSIONED_FOUND_VIA_FIND_PACKAGE
- QT_ALL_PLUGINS_VERSIONED_FOUND_VIA_FIND_PACKAGE
To be consistent in the naming of the variables going forward,
deprecate the old QT_ALL_PLUGINS_FOUND_BY_FIND_PACKAGE variable
in favor of a new QT_ALL_PLUGINS_FOUND_VIA_FIND_PACKAGE.
The difference is 'BY' vs 'VIA'.
The non-versioned variables are modified not to contain duplicates:
- QT_ALL_MODULES_FOUND_VIA_FIND_PACKAGE
- QT_ALL_PLUGINS_FOUND_VIA_FIND_PACKAGE
Also remove duplicates from the variable that collects all found qt
plugin types:
- QT_ALL_PLUGIN_TYPES_FOUND_VIA_FIND_PACKAGE
A follow-up change will collect qml plugin targets.
This information can be useful to find out what Qt targets are
available in a project, for example to know what plugin targets or
types can be linked into another target, or which libraries can be
deployed.
Pick-to: 6.8
Change-Id: I4f158872f4a8f6ef6008f081270604f75b77ad9d
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit f7b8ff71778bde94741402216269c2de2dda32c1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QAbstractItemModelTester performs non-destructive tests on test models.
It helps with catching the most common errors in the test model.
Task-number: QTBUG-132880
Change-Id: I719f4223d84e66c1d94cbd0380bfdb77b07da7b6
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit b751a12f7af533049ff46c6a63bd12eb6082415a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Previously we were using raw zero-based integer values
for roles in QtAbstractItemModel tests.
Roles starting from 0x0 to 0xFF are reserved for pre-defined roles
defined in Qt::ItemDataRole enum.
This change will change the base role value to Qt::UserRole.
It will later help us to use QAbstractItemModelTester as this
tester class expects certain types from pre-defined role values.
Task-number: QTBUG-132880
Change-Id: Ie19739cd7bf49829fe58f5ad53078942d47a433b
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 967d9b8cf200163b25a3c1a3b3d79a107f9073b2)
When closing a popup window on macOS, and the NSView needs display,
for example due to the frame geometry having changed, the system will
ask our NSView to display one last frame, via NSOrderOutAnimationProxyWindow
initWithSnapshotOfWindow.
If this happens during the close() that the QWidget destructor does,
we no longer have a QWidget subclass to handle the corresponding paint
event, so we'll end up flushing an empty frame, using that for the
animation transition instead of the last valid frame of the widget.
Worse, if the top level is using RHI to flush, the texture list
might be stale, as there is currently no plumbing for a widget to
tell QWidgetRepaintManager about it deleting a texture that was
previously picked up and placed in the QPlatformTextureList. When
this happens we end up crashing on dereferencing the stale texture.
To mitigate these issues we now skip the expose event if the widget
is already in ~QWidget. This potentially means the close animation
will use a stale frame, but we can live with that.
Pick-to: 6.8 6.5
Change-Id: Iabe1d97019923ee3a1a86039630095d00c966156
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 9509434ecb4a11409d8c2bea9c010b40f8f7894d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
As part of 3d99f90b50ab22ef5ab4433c57f9ee584a0a7cae we added logic
to look up the toolbar for a QMainWindowLayoutSeparatorHelper. In
the case of QDockWidgetGroupWindow the logic was broken, as it was
casting the layout's parentWidget(), the group window, to a QMainWindow,
instead of using the group window's parent.
However for QDockWidgetGroupWindow we shouldn't look for a toolbar
at all, as QDockWidgetGroupWindow can't have a toolbar. Using the
parent main window's toolbar is wrong, as mouse events for that
window will not affect mouse events for the group window, so the
bug in 3d99f90b50ab22ef5ab4433c57f9ee584a0a7cae is not triggered.
Fixes: QTBUG-132952
Pick-to: 6.8 6.5
Change-Id: Ic7845254e05bc358a39f79ec7622029d90173b45
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 81ed068a510421e6204193ec37448a628324543d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
To be used in network-related tests where we potentially are
using private/public keys and (on macOS) end-up with keychain
access blocking a test with dialogs requesting a permission
to access the keychain.
Task-number: QTBUG-132645
Pick-to: 6.8
Change-Id: Ide74633bf88b0453d5d8f8de56282c8cf8207380
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 13109ba350686cd8ce8e298db5d76d0e7c209bd1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Makes it easier to debug diffs of SBOMs, due to lower amount of
content in generated files.
Pick-to: 6.8
Task-number: QTBUG-122899
Change-Id: I5a1e8a9868cda199de4a7344b86a12f68fec31bf
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 3c516ffa8739a6d8729780138f07a6bea7cfea8c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The code relies on -Wswitch, but lacked the Q_UNREACHABLE_RETURN() at
the end that compiler and code readers need to understand that we don't
accept values other than those enumerated, even though an enum variable
could hold other values, too.
Since the function is constexpr, can't use that macro directly, but
need to copy the usual GCC 8 magic incantation.
Amends 171ff57be1b8fd1c1b33cffbffa389790f239b5c.
Pick-to: 6.8
Change-Id: I6c9dd0e4178211f57da61aa6df70f8036370f158
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 420ca3463ee8adf2d986af5802d8da4bb24ce14d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Add them to the PackageComment field of the SBOM.
Can be useful to map back the SPDX Package to the CMake target or
package.
Pick-to: 6.8
Task-number: QTBUG-122899
Change-Id: Icbbb90132038c489b55c4ee7a038aea593ce1ff6
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 0be13fb6994feade6777a17cc405d9b2f32f2aa3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Replaces content like timestamps, version strings and checksums with
constant values to make the SBOM generation deterministic.
This is useful for reproducible builds, to allow cleaner inter-diffs
while developing new SBOM features.
Can be enabled by configuring with
-DQT_SBOM_FAKE_DETERMINISTIC_BUILD=ON
Pick-to: 6.8
Task-number: QTBUG-122899
Change-Id: Id0003bdd23fe57abd70213a2a108885861693242
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit d2dea0bc08036925cb93c226af19aeb896926309)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Reduce the groove size of QSlider when using Windows11Style, so that the
minimum selectable value does appear so.
Fixes: QTBUG-133128
Pick-to: 6.8
Change-Id: I3e5a5378e2eace3920c06db8cb1198122c0937b5
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
(cherry picked from commit dee731ae981eb4f41f4b00be80f75c7a0a5c0e11)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
We never ended up calling _qt_internal_finalize_sbom for generic Qt
repo executables, and we never passed an SBOM type, so this code never
worked.
Remove it to avoid confusion.
It might be re-added in the future.
This doesn't affect the SBOM generation for Qt tools and apps.
Pick-to: 6.8
Task-number: QTBUG-122899
Change-Id: Iffde964efe2a6b70e6e0b64ec0803af5e84172fb
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit f2472c2e6a5b93dfbda166582620c30ea8855edb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
XML requires escaping for certain characters, and we need to consider
this when writing out qrc files (which use XML).
This commit introduces a helper function,
_qt_internal_escape_xml_characters, to take care of the escaping.
It uses regular expressions to process the input strings. We take care
to start with '&', as '&' needs to be escaped, too.
We minimize the amount of escaping we're doing (the exact rules
differing between attributes and text), to avoid unnecessary work that
needs to be done when configuring a project. This is achieved by a
SUBSET option which can be passed to _qt_internal_escape_xml_characters.
Pick-to: 6.8
Task-number: QTBUG-131916
Change-Id: Ic1bd0eedee0343c3d70b6954842e21b3c550b092
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit e4fbbdea05540723d4c4429d673d25efa3201d7a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Add a few internal functions to allow
- getting the sbom project supplier
- project supplier url
- project namespace
- computing a project namespace
- computing a project file name
- getting a sanitized spdx id given a hint
Pick-to: 6.8
Task-number: QTBUG-122899
Change-Id: I0dc3df274eaf6882a6af021aabee75501b5083f8
Reviewed-by: Moss Heim <moss.heim@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit dbf44b61c11d63a4e3242a62c3be34ebf1f3f012)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
If the tests are built and run as standalone or non-prefix build and a
find hint was used, e.g. `Qt6_ROOT`, then this type hint should be
forwarded to the `ctest --build-and-test` otherwise the internal
package would fail when it tries to `find_package`.
Change-Id: If71852dd5124b8deeddd28ba835f1943d96ba2b8
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 599ad25a65ddf3b3fb7dcdc7c446da070800e507)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
[ChangeLog][CMake] CMake packages of public Qt modules don't provide the
targets of their private counterparts anymore. User projects must now
call find_package(Qt6 COMPONENTS FooPrivate) to make use of the
Qt6::FooPrivate target. User projects that rely on the old behavior can
set the CMake variable QT_FIND_PRIVATE_MODULES to ON.
For user projects, the warning message we know from QMake is displayed.
The warning can be disabled by setting the CMake variable
QT_NO_PRIVATE_MODULE_WARNING to ON.
Within Qt itself, find_package(Qt6Foo) will still
find_package(Qt6FooPrivate).
For static Qt builds, we need to wrap usage of private Qt modules in
$<BUILD_INTERFACE> or $<BUILD_LOCAL_INTERFACE> (if CMake's version is >=
3.26). Static builds with CMake < 3.26 will always load the private
modules if the Qt6FooConfig.cmake from Qt's build tree is loaded. This
is the case in non-prefix builds and (in the future) when building
examples as external project.
This amends commit fbbf4ace0188b9718b6d7808021c0b887fd52d9f.
Task-number: QTBUG-87776
Change-Id: I78e95248f2b3fa73c3005c61df2fe4f71ad8eeb8
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit ad7b94e163ac5c3959a7e38d7f48536be288a187)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
When drawing an itemview item, the rounded corners (for current and
hovered item) were not properly drawn - the rounded corners of the
windows11 style were sometimes also visible where they should not be.
Fix it by using a clip rect and move the rounded corners out of the clip
rect on the appropriate places.
Task-nubmer: QTBUG-131585
Change-Id: I4eccc1e65768306a5511cda6e18db8f56fe1eff6
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit ed18ad9543ae4b30307bb178d1ee8b309062b9e3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Otherwise when no other context is made current until thread exit, the
QGuiGLThreadContext destructor will try to call doneCurrent() on an
already deleted context.
Pick-to: 6.8
Change-Id: If55dd69a72b8ab4012780a449f6a02729dd0ed43
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
(cherry picked from commit cd1686e55f706048286cbc962bbe02032c2396cd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
It expects one mask per wait semaphore, where only one was given,
leading to an out-of-bound read.
Amends 202dd3cb39ab4408c44a8588b8d6fb9a1cc3a184.
Fixes: QTBUG-132356
Change-Id: I6f7d33eb4568d1577e09411f7be751c8dc520429
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
(cherry picked from commit ff68e05bc3f8c98ccfc26b03ec68b183af9172f1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Adds functionality to communicate with a desktop manager. This feature
is only enabled if "desktop" is added to the QT_QPA_PLATFORM environment
variable (e.g., "QT_QPA_PLATFORM=qnx:no-fullscreen:desktop").
Pick-to: 6.8
Change-Id: If98e0dda43692abce47f2d8f5f340bd7276ec901
Reviewed-by: James McDonnell <jmcdonnell@blackberry.com>
(cherry picked from commit 70b1db9c0e0a53ec7e47ba296a534d38559c702f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Incremental updates don't always work
due to a misinterpretation of the rectangles passed in by the upper
layers.
Pick-to: 6.8
Change-Id: Id30c97f80904209726b3aaf37c52b2e14ee2f187
Reviewed-by: James McDonnell <jmcdonnell@blackberry.com>
(cherry picked from commit d0e64a36d2806ae2892cb34cb44ef63b2d56abd1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This reverts commits 729c0960b84183bcf9576f974cb5e3b3c3fdc6ef and
348b680ae56e92f061424a10c4baa726cf7f15d2. Friendship is not required.
The removal of the forward-declaration in qflags.h implied adding it
where it had been required but not present.
Change-Id: Ie17963f95bb5fa98fd75fffd7e6e5289b58f1960
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit c7a069870ae80f47b32479dc1f8f7161a3238201)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Test was failing on Android because of three issues:
1. Mouse selection does not work well with Android, especially when
predictive text is enabled. After changes in
de5ae6917c819ff23f7d9c5742b50b15e0824877 commit, mouse selection on
Android needs ImhNoPredictiveText to be set for correct handling.
2. Test sends mouse press events on center position of the QLineEdit.
On some devices, the text would sometimes end before this center
position. To avoid this situation the width is set directly.
3. Android expects the mouse click to be released before the next
click. If it doesn't, the next selection won't work properly
This commit fixes all those issues and unblacklists
testQuickSelectionWithMouse test
Fixes: QTBUG-87417
Fixes: QTQAINFRA-6896
Pick-to: 6.8
Change-Id: Id19850446954196a077047e250ea24a91ae7255e
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 1b02900ffe02980cb3e69c60ca415fd694cd773a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This helps with better debugging where in most cases the tests are run
without --verbose, but if there's a build error, it won't be clear what
went wrong, and only re-running with --verbose would give such details,
which is just annoying to deal with.
Change-Id: Icb8bcb8e5ba297d48b9e166c93523f25a21937b2
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
(cherry picked from commit 48dbc72c4467d120353dba46fdbc2f8ddc145629)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Print logcats only if it's explicitly requested with the respective
argument or if there was a crash, i.e. where we can't get the test's
exit code. Otherweise, in case of normal failure, we don't really need
to pollute the output.
Change-Id: Ic4e6db5d9fd6786bd28204a3ec87f63a7ec9764a
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
(cherry picked from commit 256fd95a712384c6d5b8b1841ab9c749fca89970)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
There's no need to have the QIODevice layer buffer the data and thus
allocate memory. In the case of QFile::copy(), it also improves the
error message output.
Previously:
"Cannot create /tmp/tmp/f for output: No space left on device"
Now:
"Failure to write block: No space left on device"
Change-Id: I537a2a79ead9d1d9ac2efffdd650702a4424bac6
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit 8a720c162d500369810674930884e36cf2494d88)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
In case there is no valid QStyleOption::styleObject, default the
PE_IndicatorRadioButton to the selected and unselected appearances.
Fixes: QTBUG-132906
Pick-to: 6.8
Change-Id: I5e9c13cb3384321e025e5af08ee3dab81feb07fe
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
(cherry picked from commit b717945812b16f957421bc2a2b1c4220f8148e64)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
In many situations, it is desireable that QTemporaryFile::rename()
overwrites an existing file, such as when emulating QSaveFile because
one would like more control over the temp file (such as passing it to
a different process). The public API of QTemporaryFile did not allow
it, making the typical Unix mktemp + mv algorithm to avoid symlink
attacks unimplementable with public Qt API.
QSaveFile is not a 100% replacement, because it always follows
symlinks and places the temporary file beside the physical target
file, keeping the symlink intact, instead of placing the tmp file
beside the symlink and clobbering it, if the target happens to be one.
Extract Method QTemporaryFilePrivate::rename() and add a bool
overwrite parameter that causes the existing
QTemporaryFileEngine::renameOverwrite() to be called in lieu of
QTemporaryFileEngine::rename(). The non-atomic path via
QFile::rename() is not affected.
This makes the functionality available as private API, in case we need
it in older branches.
Task-number: QTBUG-132646
Pick-to: 6.8 6.5 5.15
Change-Id: I0d5ca96c0a1a557854582e1a565a3db0d8af2a95
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit a01b14f1de59d378088a949bb21f3536832634c8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QNX 8 moved the inotify API implementation to a separate library,
libfsnotify. Added qt_config_compile_test to verify inotify in libfsnotify
Pick-to: 6.8
Change-Id: I5906d8fd0f146dc9db8d9ae2d8c0053bff21b840
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 2dfbfd5f9a800f40afd2a4e48a208a9f781fb0ae)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This adds an SHOW_INTERNAL option to qt_internal_add_docs that
passes the --showinternal option to qdoc.
The option can also be set for all calls by setting either the CMake
variable QT_QDOC_SHOW_INTERNAL or the environment variable.
Pick-to: 6.8
Fixes: QTBUG-118176
Change-Id: If72c4072e10bc5f12b0431a5f8abea6ee1e2bd69
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 0b7ff3d0a7be7b8df6184cde5ca33bb681790131)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Calls to qt_internal_add_docs now accept the following options:
- QDOC_EXTRA_ARGS: Extra arguments to pass to qdoc
- QDOC_PREPARE_EXTRA_ARGS: Extra arguments to pass to qdoc prepare
phase
- QDOC_GENERATE_EXTRA_ARGS: Extra arguments to pass to qdoc generate
phase
In addition, the following cmake and environment variables can be set
to pass extra arguments to qdoc for all targets:
- QT_QDOC_EXTRA_ARGS
- QT_QDOC_PREPARE_EXTRA_ARGS
- QT_QDOC_GENERATE_EXTRA_ARGS
The cmake variables can also be set at directory-scope, before the
call to qt_internal_add_docs.
Pick-to: 6.8
Task-number: QTBUG-118176
Change-Id: I0e28f3b863d5ca4efd0256432130af1c9c965f9d
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 948b2f601dd9c7f526497680c5c4928d2793c238)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Change the option handling code to be similar to our other internal
functions.
Break too long lines.
Add a doc comment.
Add a message(DEBUG) for the case when qt_internal_add_docs is still
called with one argument.
Rename doc_project variable to qdoc_conf_path.
Pick-to: 6.8
Task-number: QTBUG-118176
Change-Id: I73167f1e72e2abcdb90722ecd6ee00f7636b8a5d
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 2fd16b2acb726e597479bb30f42363075e3de56b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Since 2023, pgBouncer supports prepared statements but only when
prepared/executed/removed at the protocol level.
So to support this, You need to call the appropriate functions
from libpq.
it does not change the behavior otherwise. You can note that to free
statements, libpq only has the function in v17.
Prior versions of postgresql will still use DEALLOCATE.
Fixes: QTBUG-132303
Change-Id: I2456820bbea318e1715ae46617bf4d137815ca54
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
(cherry picked from commit ca09bc8d7a96b95d40bec9638f63467a24dfc0c2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
`INSTALL_PUBLICBINDIR` is only exported if it was defined by the user
when building QtBase. The conditional check aligns with the one used in
`qt_internal_generate_user_facing_tools_info`
Fixes: QTBUG-107016
Pick-to: 6.8
Change-Id: Id5c38555e1d22cb3c16d85261cb052c695b4de03
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit a9964422360c637c7a46f85628a580448bb13bc1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
...that tried to load Qt6Foo instead of Qt6FooPrivate. This might now
load the wrong package, since we've split CMake packages of public and
private Qt modules.
Enough time has passed, and we can assume that all
Qt6*Dependencies.cmake files have the _qt_package_name property set by
now.
Task-number: QTBUG-87776
Change-Id: Icf18872dd49b1e3a82b7327027f7d6e48b656b70
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit ed7bc398d8f8f033a79e1adddf7874e9fdd961af)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This is a compatibility function for `cmake_path(RELATIVE_PATH)`.
For CMake<3.20 it uses `file(RELATIVE_PATH)` instead
Pick-to: 6.8
Change-Id: Ibf9ca221c1753bd99dcc1820bffaea28f9bfe5af
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 334acc2eb3ec0cba702780036c94abdac306864e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The mentioned version is from 2015.
Change-Id: I330bd8ec08ab815a85d3e4e5afc44f314ade2ef6
Reviewed-by: Kristoffer Skau <kristoffer.skau@qt.io>
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
(cherry picked from commit 20b07bfa305153b8d828e133bb7dda838c2166c6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Problem is, this has potential issues down the line. For example,
if one pops up a QQuickWindow afterwards, also with Vulkan, and
wants to do things like enabling the debug layer (QSG_RHI_DEBUG_LAYER
and similar), that will not work since the instance is already up.
In absence of better solutions, drop a warning as well and keep this
undocumented for now.
On the plus side, this allows applications to implement things like
enumerating adapters with Vulkan and then launching a QQuickWindow
with the selected adapter. With other APIs (D3D) this is a breeze,
but is impossible here due to the very unfortunate concept of Vulkan
instances, and handles such as a VkPhysicalDevice being tied to the
instance.
An application has no way of knowing what VkInstance Qt Quick will
create/use, unless the developer does the extra boilerplate to
provide their own, which is an overkill in this case. So offer some
way to make this work, even if there are some pitfalls.
Change-Id: I1fc11f90cd1bf3fdac945ed5a7221f596368d30e
Reviewed-by: Kristoffer Skau <kristoffer.skau@qt.io>
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
(cherry picked from commit 3c338def89a4e03e3b47e624d83d83785c52037b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Include each of an entry's truncations right after the entry if its
script (or, where absent, the one implied via likely subtag rules)
matches and there is no later entry that it should appear after. This
is a compromise between prefering strictly equivalent matches to
potentially incompatible ones and prefering candidates derived from
earlier entries in the original list. Defer to QLocaleSelector (see
QTBUG-112765) the addition of options to give the caller control over
how to make that compromise.
On picking to 6.9 (by hand, since initial pick failed for want of a
precursor I've now picked) I've decided to pick to 6.8, which shall
surely get conflicts, since we want to fix the same issue there.
Pick-to: 6.8
Fixes: QTBUG-131894
Change-Id: I8750f4f40530c94638853388f47fcae1008db8d5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit cbf49f735e3cca85922a85d6548666816686db78)
We were including, for each entry we got from CLDR or the system,
minimal and maximal additions from CLDR's likely-subtag rules, plus
versions with script omitted and possibly also territory added, when
likely-equivalent to the original. Include also the converse, with
territory omitted and possibly also script added when
likely-equivalent, so as to control order when these entries also show
up by truncation of others.
On picking to 6.9 (by hand, since initial pick failed for want of a
precursor I've now picked) I've decided to pick to 6.8, which shall
probably get conflicts, since we want to fix the same issue there.
Pick-to: 6.8
Task-number: QTBUG-131894
Change-Id: I363bfe31867be43807fe3b4942dafa186b8d2e94
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 7f9ee43de783105d8de0a0b614751eec639131f8)
Skip duplicates as a separate step, to save some complications. Other
than that, achieve the same results by post-processing the list,
instead of trying to integrate the finding of fallbacks into the main
iteration. This makes the code easier to think about and cope with
further complications as we come to them.
Change-Id: If06eae5fd1e91e88b52b3d32ccaba8cbb8e3c8af
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 2c39365aad957aea7ca9c9c861665391edf7ef23)
We can test whether the candidate is already in the list by exploiting
the comparison of QLatin1StringView with QString (and related
QStringList::compare() overload), so we don't need to convert the
QByteArray to QString unless we're actually going to add it.
(This does lead to the prior name being converted twice, but the
second of these is about to go away.)
Picked by hand since some later changes turn out to need it.
Change-Id: I8e47cbb4c9e44ad8ef13d04e930a4619845418ef
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit f8128f280999e21ba291c899ce669d77803b976c)
The unconstrained implementation was removed, so qdoc was not able to
find a proper function. Provide a fake definition that matches what
qdoc expects. In this case the users shouldn't really care about the
constraints that the actual implementation has.
Amends 0c707c6ebece18677deaccccdfec5d48c587106f.
Found in Qt 6.9 API review.
Change-Id: I6207b491fa94cc62d217af7dc7687923dc6971a4
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit b1509550436400ec9be608b5c760501d9b86912a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
So that it allows overloading.
Also move the type T declaration into the function scope, as it
could never be used as a constraint anyway, and we do not want
users to pass custom type there.
Amends 0c707c6ebece18677deaccccdfec5d48c587106f.
Found in 6.9 API review.
Change-Id: I086d65bdef7be2f9e0e67e96cc8a9ac76eaa5b0f
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit f1d2d47f609cfb3c4cf9b2a86072613b3c9e0642)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Also add a comment to publicsuffix-list's entry that the update is
done by a script that should be updated whenever this file's contents
change.
Amends 36dca3c04f759449f74008a3e79021a179b0f35e.
Pick-to: 6.8 6.5
Change-Id: I1a0e51568e6d4300197c09f759ad3d82277a74d1
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit b9f74f9a0b97588fc07d75fa6a427f5c8d6a2c6c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QAbstractFileIconEngine stores the generated pixmap in a QPixmapCache
with the size as key. This is wrong as the size is multiplied by the
current devicePixelRatio so this has to be done also for the key.
Pick-to: 6.8
Change-Id: I6d8ceedc950d23abf9c4d79d92e86848b9508c9b
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 83ff179f85559af880d28d7832d44f95c5ce9616)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
We changed the default in 6.8. It was documented in the changelog but
not in docs. Amends 09ea47f8113bdce437253b19a91f739aeef7a333
Pick-to: 6.8
Fixes: QTBUG-132173
Change-Id: I1b6bf69931ba12025cf95e80c12a5073a94af598
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
(cherry picked from commit 622133ace2533617f294b8d875b5eb749a78571b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
So the array itself is also const.
Amends a94731c2ad85f9dd40050a780f67c911bf12668e.
Change-Id: Ic4d78d3d059dd47f776ffffdd0971b1aa35a69e9
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 8500e730406cf592d9eeffadab3c4f7e6a51da96)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The previous attempt to escape invalid characters for username/password
did not work for e.g. '}' or '{'. The msdn documentation is somewhat
inconsitent here but after testing it looks like putting the
username/password inside '{' and '}' no matter if needed or not is the
easiest way. We have to escape '}' by doubling it though.
No need to escape the DSN - testing on windows revealed that ';' is not
allowed in there and '\'' and '"' at the start of the DSN is perfectly
fine without any escaping.
Pick-to: 6.8
Fixes: QTBUG-122642
Change-Id: I04d007d343dd65eb0dbc0252518843eb43cd9ab8
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 38277a88f1dd69de6e031bc8313c8d5beadf6bd0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
There is no need to set a minimum width for QAbstractSpinBox in
QWindows11Style::polish() as this might override the user preferences.
Also the minimum size handling is now properly done within
sizeFromContents().
Pick-to: 6.8
Change-Id: Ibc1fd7a6f862fc85e3739025b9de581aa235d74c
Reviewed-by: Wladimir Leuschner <wladimir.leuschner@qt.io>
(cherry picked from commit 2ec4c28470de115c16944653a5d4f6209452d56c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Add two new enum values:
IsDecoratedRootColumn: notifies the style that the current cell also
contains place for the tree column branch indicator so it can e.g.
properly draw rounded edges in a cell or complete row.
IsDecorationForRootColumn: the item contains the information to draw
the tree column branch indicator.
Task-number: QTBUG-131585
Change-Id: Iee2823fe3a227630f926d0448095a10fad2b0ba7
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit c917d16f4b9982425b51dfc4947792e36defde35)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Nothing has changed in the headers we use, aside from the version
number, since v3.23.0, so we may as well declare ourselves up to
date.
[ChangeLog][Third-Party Code][QtTest] Valgrind headers are up to date
with Valgrind v3.24.0.
Pick-to: 6.8
Task-number: QTBUG-132871
Change-Id: Ib2ad8d73e662535a014d241b46cc50214b45f50b
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit 549bab4150b4652bb8b6577c737e49ae03f6348f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
If the objcopy call parameter is in quotations marks it fails the call
and prevents separate debug info builds for QNX.
Fixes: QTBUG-132801
Pick-to: 6.8
Change-Id: Ifadf57f80eb5c354aedeb8985bc7a0c9b79dc62e
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 9261b68395df75dbb01539c547832d9cc35521d9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This avoids the need to run qt-cmake-standalone-test and then import
the test, as described in QTCREATORBUG-25389.
Pick-to: 6.8
Change-Id: I010d6613debb2e34ef3809d2da78ca33ade4d602
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 742a0ed72f5264b0198d87df6c4e0657eaf48172)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
When even some values I haven't seen may need to be left for later,
but values I have seen are definitely to be discarded, I need to know
if I've already processed them before doing the fiddly check for
whether to defer; but if I decide to defer, I haven't yet processed
and need the later check, to which I've deferred, to see the value as
still new, even though I did once ask about it before. So I need a way
to query without adding to the set.
Pick-to: 6.8 6.5
Change-Id: I712f1c400147210c149aeec6de1d15d2e095d6a9
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 09b77a8d07276e0b5e5fec596f957f8fc4a78869)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Pruning the part of a locale name after the first '_' should now be
redundant, as QLocale::uiLanguages() now includes the resulting
truncations. It may do so later in the sequence than the pruning used
here, where the pruned version either might be a bad choice (due to
being in a script incompatible with what we started on, e.g. pruning
pa_PK to pa, which uses a different script) or would also arise from
some later, more specific, entry (as when uiLanguages() is expanded
from {en_NL, en_150}, where checking en immediately after en_NL would
bypass the more specific en_150 when present).
Change-Id: I4c7c199ca16a8e4803843547c5a689cea11af1f2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 9574e8cbef06b3b55d1f651b09d134aef7150aba)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
We intentionally include <version> in the most low-level Qt
header, so that all other headers could just assume that it
is always available.
In this case it is already available from qtconfiginclude.h,
which is included from qtconfigmacros.h.
Amends 20b6ebea84997ecd70d37640f68232c60cc7231f.
Found in Qt 6.9 API review.
Change-Id: I430c7392b5237ec582708e3ae1170eabc7c3a402
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 9a3199fec2673e591811a4775ec8a00073c9f433)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Url passed from the QFileDialogArgs will never be invalid, it will
always be the value that user passed into or the lastVisited or the
working directory. And because of this, the fixes code of QTBUG-70798
will never be invoked, and the `lastVisited` will never be initialize if
nativedialog is in use.
I wrote an init function to initialize the `lastVisited` global
variable, to make sure the value will be loaded correctly
Fixes: QTBUG-70798
Pick-to: 6.8
Change-Id: Id05f63db7b4738e6317721741111882a565437e3
Reviewed-by: Xu Shitong <xushitong@uniontech.com>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit 34f1b6b6d1dd7c37f2d71c0032ddc0c83360c11c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The implementation follows XDG Desktop Portal mostly, and is for
desktop, not generic unix.
Task-number: QTBUG-130884
Change-Id: I88456abb37b8b23cfec00ee8eac8ffee9a65ed9f
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 3e29267df0e2f332290caad69e5bd5cfd61cf3da)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Including bsdfb/directfb/eglfs/integrity/linuxfb/vkkhrdisplay.
QGenericUnixServices is mainly for desktop usages which uses dbus
and xdg things.
Task-number: QTBUG-130884
Change-Id: I003ec780aa039610cb5c36cd67cabbf173d8f642
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit f8d0e4798c0d2985dbe5f8515a8281c9109ef6c4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
In order to optimize the footprint of QPA plugins, we avoid to
create QPlatformServices object in QPlatformIntegration constructor.
It benefits embedded platforms and others.
Task-number: QTBUG-130884
Pick-to: 6.8 6.5
Change-Id: I5c0d2616ace9fbc0e077eece32d8836b40fc83dd
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit ff51ea5418d131248b07e327513b41dad1231f37)
Reviewed-by: Liang Qi <liang.qi@qt.io>
We have weaned ourselves off of qExchange(), which, however, has C++23
semantics (is constexpr and noexcept), while we only require C++17 atm.
At the same time, we have more and more uses of a constexpr exchange(),
iow: the C++20 extension.
We have the qNN namespaces for this, so let's use it: Add
q20::exchange(), with C++20 semantics (constexpr, not noexcept), and
use it to port the only remaining qExchange() user (since ported to
2×std::move() to make the header compatible with QT_NO_QEXCHANGE),
QScopedValueRollback.
No user requires the C++23 noexcept on the function (compilers will
figure it out, because the std::exchange is fully inline), and we
can't provide a q23::exchange() even if we needed to, because the
author of P2401 forgot to ask to update the value of
__cpp_lib_exchange_function...
Fixes: QTBUG-133038
Pick-to: 6.8
Change-Id: I003df445001d1c5ab02402119c5e5106aa156263
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit b5ed7fb203335cef7b7b4f70f4130b07166cecf2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Amends commit ff9da1db0b0963f967f45ab430ec40a3051b70b4.
QDeadlineTimer's Forever constructor is constexpr inline, while the one
taking an integer is neither. In an LTO build, the compiler might have
realized that it's constant, but let's be sure.
Pick-to: 6.8
Change-Id: I2c07caec660e05efe695fffd6ac8ec3120258a96
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit ef73a5f175f8d51a0bacbdd30cacbd3b6d151d36)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This says better what it is and I'll use the trait for the unlock
operation.
Change-Id: I46752ca2ee71297d77e5fffdddaa193b6c86dbbc
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 85ebb9d52a413f205046f864a2823e3f0819ed9e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Right now, the DLLMain in qaxserverdll.cpp calls GetModuleFileName() on
the hInstance for the DLL and passes the path to QCoreApplication to
override the path. This adds a way for it to simply pass the hInstance
handle, which will automatically cause qAppFileName() &
QCoreApplication::applicationFilePath() return the DLL's path, which in
turn influences the default QCoreApplication::libraryPaths().
Change-Id: I3cc172288c54c3938566fffdfb62985000ce2e9c
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit 507024317fec0c1deeb62c8c2ba5a43af7d65f21)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The messages said "This test crashes on Android" bu tit appears the
problem is not a crash, but that the executable can't be executed. The
file appears to be present and yet execve() is producing ENOENT (No such
file or directory). That probably means it's the interpreter stored in
the ELF header's dynamic section that is not found.
Fixing that is SEP[1].
[1] https://en.wikipedia.org/wiki/Somebody_else%27s_problem
Change-Id: I3025825c5e00f47a5a40fffd53c47131db3676dc
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 40ad963e1a22dbf3eea96f6a17bf6cbb28294649)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Created a list and added Android to the existing mention of iOS.
Fixes: QTBUG-132742
Pick-to: 6.8
Change-Id: I6e906980d28b54daf18c019eb9299a9d67daef3d
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit afa34d5f3773dec4fb2a7d524100a6f7a307e3e6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The serialization code did stream out a function pointer as an integer,
and then tried to set it back -- effectively, it has *never* worked
since the beginning of public history, unless
serialization/deserialization were done within the same process.
While we cannot support streaming custom easing functions, we can
recover the non-custom functions from the type, which was also streamed
out; setType will take care of that, and we'll just ignore the
subsequent field in the stream.
If one tries to stream out a QEasingCurve with a custom curve, what do
we do? I've decided to just print a warning and stream _something_ out,
so I can keep some degree of behavioral compatibility and aggressively
cherrypick this patch.
AFAIK, there's no support for such a scenario in QDataStream: all
out-stream operators have a wide contract, and there's no Status flag
that meaningfully represents this case (and I doubt anyone checks QDS'
status while writing into it).
Change-Id: Ifa80cf3a9003cab074ddf112022c09b364497007
Fixes: QTBUG-132575
Pick-to: 6.8 6.5 6.2 5.15
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 78a46bf16b7061bfd77b7b3bcf392c28ee788bfc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
If qtbase is configured with -debug-and-release -force-debug-info,
which maps to '-GNinja Multi-Config'
'-DCMAKE_CONFIGURATION_TYPES=RelWIthDebInfo;Debug'
and then qtopcua is configured with -GNinja -DCMAKE_BUILD_TYPE=Release
building the 'all' target would not build executables or tools.
That's because the targets have their EXCLUDE_FROM_ALL property set to
exclude any non-first multi-config, and Release doesn't match
RelWithDebInfo.
Such a scenario can happen for our multi-config windows builds, when
someone tries to build a repo not with qt-configure-module but rather
with cmake directly. They would then not specify the same build types
or generator, which can happen when opening in an IDE like Qt Creator.
Make sure to also check if the current generator is a multi-config
one, in addition to whether QT_FEATURE_debug_and_release is ON, before
adding the genex to the EXCLUDE_FROM_ALL property.
This allows building and installing executables and tools in such a
scenario, because in a single config build, the genex would not be
added, even if QT_FEATURE_debug_and_release is ON.
Pick-to: 6.8
Fixes: QTBUG-132609
Task-number: QTBUG-132338
Change-Id: Iaee1a0afb19df97ee1263dbaf27c8e29fc127831
Reviewed-by: Jannis Völker <jannis.voelker@basyskom.com>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit baddc0a1958c8ea9cb946465c93ecdd62bde9d3d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
- Use auto * when initializing with new
- Initialize variables
- Fix static invocations
- Use per-class includes
- Minor cleanups
Pick-to: 6.8
Change-Id: I137bc7dfad63bc55a1b1bbc3f42d758bbfdb86ba
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
(cherry picked from commit f388ca8841ad25cf79e5fdf8fa3e9d2f4de48ebc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
If you drag-and-drop a OpenGLWidget in Designer, the main window gets
re-created when the OpenGLWidget is instantiated. So in general (in
rare cases), at the end of QWidgetWindow::handleMouseEvent() we might
have a different window, and therefore can't reliably call
QWindowPrivate::maybeSynthesizeContextMenuEvent() without checking for
a valid pointer.
Amends 84a5f50c7766c99f62b22bb4388137e0aa8dd13d
Fixes: QTBUG-132912
Change-Id: I7b220b4daceab988aadabf9427ef6b2d5624e00d
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
(cherry picked from commit 1accd2421686b387daa115b3a46974fce0fdb118)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The documentation for QPaintDevice::PdmDevicePixelRatioF_EncodedA
refers to encodeMetricF() which was nowhere to be found in the
documentation because it was marked as internal.
Pick-to: 6.8
Change-Id: I37707bc641d359f367f77c958043b6dfa33d4dcb
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 3ff989acaf84405a472605140e4035b993380bce)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
According to the discussion in QTBUG-132398, the script stopped
working in newer Xcode versions, and also didn't cover new
Objective-C language features.
Remove the script to avoid confusion.
Pick-to: 6.8
Fixes: QTBUG-132398
Change-Id: I37b96ac6a77af1fcc4221591cb1f6320fa9a024b
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 6404714183b3fcf93ac27482c5a3193a4f93767d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
qt_register_target_dependencies does the same thing as
qt_record_extra_qt_package_dependency but in more convenient way.
Update the qt_register_target_dependencies signature and adjust naming,
it now accepts PUBLIC and PRIVATE multi-value arguments and called
qt_internal_register_target_dependencies.
Use it and deprecate qt_record_extra_qt_package_dependency.
Pick-to: 6.8 6.5
Change-Id: I0594cf699ec1e3af7210dd7450fa3f81c1f565ae
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 8272b747d3b91e15fda2b76326221a26fb2245d2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
To avoid the following error:
The custom command generating
.rcc/qrc_editabletreemodel.cpp
is attached to multiple targets:
editabletreemodel
editabletreemodel_tester
but none of these is a common dependency of the other(s). This is
not allowed by the Xcode "new build system".
Pick-to: 6.8
Fixes: QTBUG-131631
Change-Id: I1c5d0702596a4f8f723d9080bc5304d6ad06853b
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 9f593791988da197dbe956669b8a4647dc50124a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The generic copy-and-remove fallback will first open the original file
with a different case, truncate it, and then remove the original file.
Leaving us with no file at all.
Task-number: QTBUG-132785
Pick-to: 6.8 6.5
Change-Id: Ia5a41d26c1d6d6bdc231c71acf15bd2ea496c715
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 2defca418788ab167fa1ce70e518c9250cb0909f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
When we're trying to resolve a font for color emojis, we will
prefer any color font over the selected font (since a normal
font may have monochrome glyphs for emoji characters and that's
not what we are after).
If there are no color fonts on the system at all, we need to do
a final match where we ignore whether the font is in color or
not and just return it anyway.
In this final pass we would find the first best match among the
fallbacks (typically the first one), but never actually check
the font that was requested in the first place. This was a
mistake. Unless it does not exist, we should just return the
requested font family.
Task-number: QTBUG-132377
Change-Id: Ie53a6bd665ebdaaca92bf0c33fabf5195e1aa5fe
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
(cherry picked from commit b154af082c8679fa09f325735025d98df9a8dcff)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Construct the arguments list explicilty to QStringList to avoid calling
QProcess::splitCommand() and potentially splitting a path with spaces
that shouldn't, this also saves from having to deal with shell quotes.
Fixes: QTBUG-132891
Pick-to: 6.8
Change-Id: I48f6c219830269c507f146b654bcfa025f0e3203
Reviewed-by: Olli Vuolteenaho <olli.vuolteenaho@qt.io>
Reviewed-by: Petri Virkkunen <petri.virkkunen@qt.io>
Reviewed-by: Soheil Armin <soheil.armin@qt.io>
(cherry picked from commit a8d8fb83ccfed09dd35dbab22caceaff963a3415)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
There were two mistakes in the code that intended to detect
if a specific font was a color font in the FontConfig database.
1. The "int n" parameter in FcPatternGet*() is not an array size,
but an index, so it should be 0 and not 1.
2. We need to add FC_COLOR to the list of properties in our pattern
when populating the database, otherwise we will just fail to match
it and none of the system fonts will be listed as color.
Fixes: QTBUG-132377
Change-Id: Ib3c112e8a354abacd05679c62283a1f1abfb40ee
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
(cherry picked from commit 2e1db6541777ee076195ff9e793e4e83afd81539)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QT_MOC_CPP is not the same as Q_MOC_RUN, which moc's preprocessor still
sets. It appears Qt 3's qmake set it when ALLMOC_HEADER was set... a
feature that doesn't appear in Qt 4 (but exists with cmake_automoc).
MOC_SKIP_{BEGIN,END} appears in Qt 3's moc, but not in Qt 4's. But they
weren't in qthreadstorage.h at the time, so I guess they were added in
the 4.0 development cycle when QThreadStorage changed, but before moc
was rewritten (which deleted the Qt historic repository's oldest file,
moc.l).
Change-Id: Ibfff778c9f4d17af006dfffd8545fb24b495ecdd
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit bec49144f809ef8c5c61099ce46241c16b20b180)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QHeaderView has no resizeMode property, only a ResizeMode enum type that
is then used in the sectionResizeMode API.
Fix that reference, reflow the paragraph, and apply some light editing.
Amends 9e3a96189d9db8a458e65cd5078509afe7a160db
Change-Id: I240c3f64fd45c96f4d3ba95c2086a638468e137f
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
(cherry picked from commit 988a3cd95da4b5875c7116141f2b22acf3e20502)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Added the missing function declarations to the #if Q_QDOC part of the
header. Also fixed a typo in the std::unordered_map docs.
Amends 850d4895be565931d18c92e5e2f9a33b7f26de6d,
0c96528e8d43ad4309bdca14b179a5045984655a,
a9fe57fefaac0cb047e4c02e0b8c8f8327e0a58c,
and a8c9a5617c72ad2e55bf497df6ff2c2e141cbdef.
Found in Qt 6.9 API review.
Change-Id: I792023b506e2afdbdca4bca3197887e50c98a788
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 256b56f581a66acde829a2f47b3d0f6ed464fb44)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
And remove NOLINT(clang-diagnostic-self-move), silencing the warning for
Clang seems to work for clang-tidy too (tested locally).
Amends 03bd9491491881529ad28cd6d672edfdda9a0065.
Pick-to: 6.8
Change-Id: Ibdf982a728f2c6150f2911173dc3c9246f3662b8
Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 6f0f39673f5ae9debd9ab59be60c32f00f40c41a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
With LTO, I'm seeing GCC conclude that it's best to inline the
lockInternal() and unlockInternal() methods into the public ones and
then emit out-of-line copies for those. That's actually sub-optimal, so
force GCC not to do it.
Pick-to: 6.8
Change-Id: I88c29098757ea6e70c00fffde56989ec05b136bd
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit cc4abefb1db3bdfee0d57ea528d55073a4498b4d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
There's no need for it to be a global, if the data isn't either. I have
a vague recollection of the data also being globals back in the
day... (they used to be plain QStringList pointers).
Change-Id: Ie5f1a71d0b20a0195822fffd992101c94824a07f
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
(cherry picked from commit a314e4b98513d4b5cd89d05e74f93c2b16ebc168)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Those aren't GUI tests. I suppose they've been in tst_QApplication since
Qt 2 or 3, when there was no QCore/GuiApplication yet, and were never
moved.
Change-Id: I30b3c1a309ba2c720210fffd045ebd0bcfa803fe
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 9fe44e4779cf421de7f33f867be8e55d291c16ea)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
moc (and thus the bootstrap library) has needed JSON output since Qt
5.15 (commit da284ef10e0ef80776b9fc9b7bb0e6dc8d71ba63 "Add support for
machine-readable JSON output to the MOC").
Change-Id: I4b8cf51c092eb35cc383fffd48d120f0cb2c56b0
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Johannes Grunenberg <nerixdev@outlook.de>
(cherry picked from commit 029bb47e12d63e186663714c3776d3654285496b)
The idea of b2ed29b8d9b33dcece83000aee28073dd27f1cd9 was to have the
contents of <version> (if it exists) available in all Qt headers.
Since we broke up qglobal.h into smaller pieces, qcompilerdetection.h
is no longer necessarily included by any given Qt header, which
thwards the original idea.
Try with qtconfiginclude.h, which exists since
61935786c30b0209811fa32f7a02f138da8570b2 (Qt 6.6).
For Qt 6.5, we'll need to add it separately to qtversionchecks.h and
qtconfigmacros.h, whence qtconfiginclude.h was extracted, as well as
keeping it in qcompilerdetection.h, which includes qtconfiginclude.h
only since 22029a76c37d8d670479d523684a84f7966ed434.
Amends the breaking of qglobal.h into smaller headers, without being
attributable to any one of the individual commits that made up the
change, or else amends b2ed29b8d9b33dcece83000aee28073dd27f1cd9.
Pick-to: 6.8 6.5
Task-number: QTBUG-108228
Change-Id: I909196bd767e8d9e016069f1a59994d40e646e59
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 4771dc308785ed132198b2c9a3200b7eb26d683e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
GCC 8.x does not treat __builtin_unreachable() as constexpr and
disallows using the Q_UNREACHABLE_RETURN macro. Guard the statements
with the respective checks.
Amends b0b34c56a99130bfc9c82cb006653ce6b8f0516e
Pick-to: 6.8
Task-number: QTBUG-125285
Fixes: QTBUG-132804
Change-Id: I88cdbe3bae1a336edc255e3e93e8d948bde253da
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit a57d5b1fd60b6b6848ef8ad9db237941229d7a23)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
As we produce crash reporting via Swift on macOS 15 now.
Pick-to: 6.8
Change-Id: Iab4777b29bcaa66eff9d2f1de63072f5744d56df
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit dbfc3c9c381aa1cc0ab3cf5b758b38fb4499cb39)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
A QML module can have URI that include dot character.
In this change, we refactor the code generator to create
the same hierarchies as a Java package structure. Each
QML module URI will be appended to the base application
package name to form a package that represents the QML
module as a Java package. Then the generated code of each
QML component will be placed in a single file.
This change, also refactor how to generated code should
be written in the file, by buffering the generated code
to a QByteArray first, and then flushing it into the
target file. We also create a marker file inside the
directories of each module, so that we can entirely
remove the directory and all its files before generating
new code during the next build.
Fixes: QTBUG-125891
Fixes: QTBUG-125970
Fixes: QTBUG-125971
Pick-to: 6.8
Change-Id: Iebce6495d9d29af32c3f1f97274c252444d2864e
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 68785b3e59c8a8f4a383051123b87af3d930ff18)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Recursively find all qml modules, built by this project.
Later, the qmldir of these modules will be used to
generated to code.
The command line argument -i of qmldom tool had
to be replaced with -I. The -i was incorrect as it
expects the qmldir file while -I accepts a QML directory
to be included.
Fixes: QTBUG-125892
Fixes: QTBUG-125970
Pick-to: 6.8
Change-Id: I4099e488d3d7f4b79566e6ea19eca95f57f7c2fd
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 7ed88eb565d40b195aa868e67777872ef07a5ea2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
We want to test if QT_BUILDING_QT is defined, so use the right
construct.
Pick-to: 6.8
Task-number: QTBUG-132900
Change-Id: Iac26f70021a337a2c476618979b4b8eb180ffd3b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit fc4aff1249ffbb7a1b34df8a3b06c17aacb22308)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Use ifdef, not if, otherwise we trigger -Wundef if the feature
is unsupported.
Pick-to: 6.8
Task-number: QTBUG-132900
Change-Id: I8a779da59bf2c7add14ace6405faf19b7ca48c28
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit f04dfa8666662ddefa52a0bd1c8a60be361e4c00)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Call QCoreApplication::forwardEvent() rather than sendEvent() to ensure
the QContextMenuEvent is spontaneous if the mouse event is.
Fixes: QTBUG-132873
Change-Id: I6198c2105210d2841f43ef81a9be0f917272846f
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 97605760aec7bfe48a8642ba8677204efd9c46a5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Emit a warning if the string we get is too large for Java, and cast
the size to jsize before calling JNI.
For consistency, replace the Q_ASSERT in QJniArray's size check to use
the same logic.
Addresses header review comment; code was not handling this case before
it got moved into the inline helper either.
Change-Id: I00d68509be8b5f7304dda2e824fa0ced0f8f8d48
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 9d35561f6f6be125369e6020ce95a73b4aa6b51f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Older devices may have lower screen resolution. In this case, the
hardcoded width may not work as expected. For example, all text may
not fit in QLineEdit.
This was the reason why the tst_qlineedit::textMargin test failed on
some Android devices (especially x86 emulator with Android API 29).
When the left and right margins were set to 20, all tested text did
not fit in QLineEdit. When we clicked at the beginning of QLineEdit,
we clicked on the second character of the text. The cursor was moved
to position 1, which caused the test to fail.
This commit updates textMargin test to make sure that tested text will
fit in to the QLineEdit.
Task-number: QTBUG-87417
Fixes: QTQAINFRA-6897
Pick-to: 6.8
Change-Id: I35352ac1e6f975e72d5c9638f8520f8ddd1d56ae
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
(cherry picked from commit 0a017308cca154b6f906c6e143fb33fe109316bc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Using the left/right keyboard key will deselect the text but also
move the cursor. In this case, to be consistent with the test, the
cursor must return to the previous position. This allows to
unblacklist tests:
- undo_keypressevents
- leftKeyOnSelectedText
Task-number: QTBUG-87417
Fixes: QTQAINFRA-6890
Fixes: QTQAINFRA-6895
Pick-to: 6.8
Change-Id: I8a6d7cca332fe365ca820a67c23d9cd3fc36fc43
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 43f2fdc25cfd356292636ea1f8160cf62bab4018)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The font matching process consists of multiple passes, so to help
us keep them apart, this adds some informative output to explain
where we are in the process.
Change-Id: I54f0712cc8600d2b1e1bf4b8688e2ae198e0453b
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
(cherry picked from commit d2c8c12183a7f085643ee2d1fa7cd1677256b148)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This amends 16850709306589a2433c0038605d365a6b6bedad. The patch
aimed to pass false for the color font parameter, but got it in
the wrong position, so it passed false for the pixel size instead.
The registerFont() function is a real mess, and it should be cleaned
up, but this at least fixes the immediate bug.
Task-number: QTBUG-132821
Change-Id: Id54989960aa5f86d3c79423d004530bb6a4fa475
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
(cherry picked from commit 0107e05e50761dd29a3d968baa9f502ade41e064)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
For populating the freetype font database on Windows, we're using
GDI, which does not support color fonts. Therefore we were
registering all system fonts as monochrome, which was okay, because
our Freetype backend did not actually support the color font format
used on Windows.
Since 29a1c57183958b3951db4e7ba9504918a3caa761 we now support COLR
fonts, so they should be added with the correct properties.
Since GDI does not provide this information, we create a temporary
freetype face from the font file when resolving the family during
matching.
Fixes: QTBUG-132255
Change-Id: Ib62632de7fe8d9dc533abe4ae2368090a382cca7
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 81e596c24fc106439ce4135478a2d18d23fdbaac)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The return type of the QtAbstractItemModel.sibling() method is
a QtModelIndex Java type.
The JNI call from QAndroidItemModelProxy::sibling() is using
<jobject> as return type of QJniObject::callMethod(). This will
result in a non-matching JVM function signature.
This change replaces jobject with JQtModelIndex as the QtJniType.
Pick-to: 6.8
Fixes: QTBUG-132841
Change-Id: If157858f1ed49e25c8fbdfb9bb5c1fc2b7052826
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 190c85b706ee80bc92d6419676dca0dbfa60587b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
All modern compilers implement divisions and modulus via multiplications
and shift, so the codegen is practically the same (three multiplications
in total). But the new code allows more than 136 years of uptime (49710
days).
Drive-by fix indentation in nearby line.
Change-Id: Iea806bd7dfac1f852c66fffd41c2ac6660e7cc65
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit 61924c622acc5afd1e01dd65702e09a063928c5f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
There's nothing wrong with those two, but we don't need the middle men
to the monotonic clock. This also reduces the sizeof QMessagePattern by
one quint64 (QElapsedTimer is 16 bytes in Qt 6).
Change-Id: I0eb171f03ee8f3a7148bfffd5534a7f3daba3a01
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit 9dc294143d8fab498268f88c176b1af16de9b2ee)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This way they aren't in the middle of a block of booleans.
Change-Id: Iba067f6f23db7c059cddfffdc27231dd09b6898e
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 4daed2877251b861ce9f7ee5a09dc035518e1d9e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Amends commit e04f109456bbcb184963b8ed71944b958b35c201.
This function does not free the pointers stored in literals, so add a
couple of assertions to indicate that it's only safe to call from the
constructor. And that being the case, we can update the tokens
unique_ptr in two steps, which makes the compiler not attempt to call
delete[] on the previous pointer.
Change-Id: Ibe76a7df795e9c6d6191fffdf45e3b3ef6f0f344
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit b86bcf5c25d0072300a8b0a4b5cfe942cabf53ad)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
So it packs better with the booleans around it.
Change-Id: I330164b99fcbbf9e9629fffd52bcbb38bec4ac0e
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit ede95ef7e916ffb946878477938c304a5dc206d3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
When quitting Qt, only quit the hosting Activity or Service if it's
primarily a Qt app, i.e. Qt is in the driver's seat. When using QtQuick
for Android, i.e. Qt is just a View, we do not want to forcefully quit
Activities, that is up to the app code.
Task-number: QTBUG-123711
Pick-to: 6.8
Change-Id: Ib98700be8693c3d30a296998b863b0f224c9bf69
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 3bcf55daa597888fcf0997e7ce2edd1d4c730a2a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Call startQtApplication() in QtView even if the Qt libs
have already been loaded, to make sure the app gets started
also when the Activity is recreated. Check whether Qt app
is already running inside the method itself to avoid hanging up
because of trying to start it twice.
Task-number: QTBUG-123711
Pick-to: 6.8
Change-Id: I3b009e4c2f40af9f258ce32b7e181c3faa21c194
Reviewed-by: Petri Virkkunen <petri.virkkunen@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit be33f2d3233fb787d5251ba7d0876962efe49075)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
When we quit Qt in an Android app, we also quit the Java thread created
to act as the Qt main thread. This works well for normal Qt for Android
apps, where the lifetime of the Qt part and the whole Android app is
essentially the same. However, in QtQuick for Android Qt can be just
a part of the entire app, and the lifecycles are not directly tied.
Hence, we might want to quit Qt when the part of the app that has it
is not active, and restart it when the Qt part of the app comes
active again, and for this we need to create a new QtThread.
Set the QtThread variable to null when it has been terminated,
and if it's required again, create a new instance.
Task-number: QTBUG-130610
Pick-to: 6.8
Change-Id: I430e195fd319a20c9627ed98d6f30858cebc49c4
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 7c7b63f3e85436125baf2211bc5e10556736241b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Currently, we create references to Java classes and objects
in JNI_OnLoad. However, that is done only once, when the
Android QPA plugin is loaded, and in case we would like to stop
Qt entirely and then start it again, we want
to reinitialize all these things. Move these initializations to
a separate method, and call it before starting the Qt runtime and
app.
Remove the synchronization block guarder by m_mainActivityMutex
in QtNative.startApplication(), as it calls startQtAndroidPlugin()
which now will call activity() if the JNI needs to be
reinitialized, leading to a deadlock as that method is guarded
with the same object.
Task-number: QTBUG-130610
Pick-to: 6.8
Change-Id: I826dfb9b032a6c615f2408d484d1f4f0ea528d02
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Petri Virkkunen <petri.virkkunen@qt.io>
(cherry picked from commit 9f8e49360c33d5fb8e39322f3abe9544d38baae6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Q6Hash::remove() returns a bool, not an integer, like Q5Hash::remove() did.
Pick-to: 6.8 6.5
Change-Id: Ia2907c7a2a4177f9b5ad05ca1ef3b9a5baa8137a
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 441a96ba16794dc8621219be705800480654e9e8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
which follows the behavior in QWidgetPrivate::setGeometry_sys().
Pick-to: 6.8
Fixes: QTBUG-129698
Change-Id: Ia85e9470111eea9e3392cdf38c3da2db232ef065
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit def4f827da98d3027c86a8dae27811729767d36a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This removes the need for #if in the initialization list and the ugly
whitespace-before-punctuation syntax.
Change-Id: Id33ec83e574360f65c9bfffd22b8cb450156477b
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit f68df05a77afd58d60a80b16bd062d0e9e6d42a3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The logging category macro already puts the logging category into the
QtPrivate namespace. There is no need to wrap it into another QtPrivate
namespace.
Fixes: QTBUG-132111
Change-Id: I99a7aa16662e3515c5f96d6736d47c1d0e45034c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 4f05eac0a88959ff0faa4d6b194d9dd8eeb3f4b6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QWindows11Style inherits the stylehint policy for
SH_Menu_AllowActiveAndDisabled from QWindowsVistaStyle, although the
inactive selection is not visible. This patch makes disabled menu items
non-selectable.
Pick-to: 6.8
Change-Id: Ib59988cfad444f9f8203628d4b3e1f72d6775b46
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 3f42d2baacf3d227a001e49d74ea97f7ab551ae1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
COLRv1 fonts are not automatically rendered by Freetype, but
is currently gaining traction and the default emoji font on
Android 15 is in this format.
What we get from Freetype is a scene graph that we can render
ourselves. This patch implements a recursive renderer for the
graph.
One current limitations is that conical gradients are not fully
compliant with the spec. I have so far not been able to find
any fonts where conical gradients are used, so this is left
as a semi-supported feature for now. It's certainly not
needed for the Android emoji font.
Pick-to: 6.8
Fixes: QTBUG-130909
Fixes: QTBUG-131116
Change-Id: I2484743602ad16f01318ecd6de2b245b38a8f566
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 9e5887a5d4f2344aa5f62325be9d63ff3d8f18db)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Fix drawing the link overlay icon - we must not set the device pixel
ratio here as we don't know the exact value.
Also fix some styling issues introduced with the previous commit.
This amends fd7bc16e9fbdc63bd22ba90d0c20b36ccffd2bae.
Pick-to: 6.8
Task-number: QTBUG-131843
Change-Id: I382527d17e8187bfae7cf40f352e6f87965671a1
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit f4b64f9c12a6351008a08bfeb4540481edf9f1d0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The function is used in semi-public API and should in
QtPublicAndroidHelpers.cmake.
Amends de40931eba2cf09a8c97c9a75c6d23c77748f44c
Change-Id: I3946ecb091584ac5406b3eb4d2024210398f26a3
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit b0dc47aa447beaf4ab4bad39edeae06275c48f74)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
As a drive-by replace QList::append and operator<< with emplace_back,
to avoid repeating value_type.
Task-number: QTBUG-115841
Pick-to: 6.8
Change-Id: I6fb790f959b41b0feb49e3a0f0b6b3631e24a232
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 71d114588d9312e89195a32357ec402fc22b062e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QDoc markup following the \tabcontent macro should start a new
paragraph. As HTML-specific macros are injected directly into
the output, QDoc's doc parser is not aware that the macro should
start a new paragraph.
Turn the macros into generic, non-format-specific macros,
expanding to \div and \enddiv commands that wrap the tab
content.
Pick-to: 6.8 6.5
Change-Id: Ie8313af391b1a38ef74592acac3198fef5b7b310
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
(cherry picked from commit 5c0b08a20dd14f7fd8632495aa911fe427f58f7f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Set __qt_${target}_find_package_args once per the
_qt_internal_find_tool_dependencies call. It doesn't make sense to call
set it in loop, since variable doesn't depend on loop parameters.
Pick-to: 6.8 6.5
Change-Id: Ia1024625b870364a1db8e07f61bf7ea6ab4e9f84
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 80932ed80b5ec809b42be63c8f719290da56f288)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Some classes have circular dependencies:
* RuntimeIteration depends on RuntimeTask
* RuntimeContainer depends on RuntimeIteration
* RuntimeTask depends on RuntimeContainer
* TaskTreePrivate depends on RuntimeTask
* RuntimeContainer depends on TaskTreePrivate
Although there are a few std::unique_ptr deployed, the code at the
moment does not fully solve the problem: the classes have an inline
destructor, and the dependency has only been forward declared, resulting
in a build error.
Make some destructors out-of-line, and define them (as defaulted) late
enough so that all the graph of classes has been seen, in order to fix
the build.
Pick-to: 6.8
Change-Id: If150b92154061e915ebac920806717d2288c0638
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
(cherry picked from commit 71e53405a309684e4adcb8669a5f3d04319ad767)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
- `PARSE_ARGV` should have been 1.
- `module_includes` target needs to be unique
See gerrit comment of previous change, and
https://gitlab.kitware.com/cmake/cmake/-/issues/26580
Amends: 8f2f4ad4688df4963982c489c80b84e115cda29d
Pick-to: 6.8
Task-number: QTBUG-98640
Change-Id: I82b85813f282ba1d5b4c938e59558e32647d4d86
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 9f805b5bf7dc61a032a7ec79fd514c932103f1de)
Similar `*_check` targets are created in `qt_internal_add_test`.
This change extends that implementation to auto cmake tests.
Note: These generated targets do not have additional dependencies, on
the build targets, unlike those generated by `qt_internal_add_test`.
You would need to (re-)run the build first separately and then run the
`*_check` target.
Fixes: QTBUG-98640
Pick-to: 6.8
Change-Id: I387f09570b6a4a345756133870c2eb9ef1cf3cf8
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 8f2f4ad4688df4963982c489c80b84e115cda29d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Use the correct variable name when restoring the environment.
Amends e388c1caeb1ccdb88b9a9801be9cd6328d8a7987
Task-number: QTBUG-128420
Pick-to: 6.8 6.5
Change-Id: I03ee3481a4638969edd75ce6ad233e8a94d5c563
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit ccbec262c220cbe990a68611e39dca9662b71777)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
qdebug.h includes many Qt and STL headers, so if you include a Qt header
you get all those transitive includes, which may affect build time.
- Where appropriate use the printf-like syntax of qDebug() and co.,
these don't need the QDebug streaming operators
- qfloat16 is used in an inline member function, so include it
explicitly
[ChangeLog][Potentially Source Incompatible Changes] Various Qt public
headers don't include QDebug any more; if you need QDebug's streaming
you'll have to include it in your code.
Task-number: QTBUG-132439
Change-Id: I750587e17a3b38fa226cd3af8eaccc8da580f436
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 185cba6e95a006d2548f20599f84390e5a3ad653)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
COIN is using patched std::optional header for VxWorks, which is based
on 23.09 version of this system, and fixes few compilation and runtime
issues, unfortunately it introduced runtime error as well. This error
causes std::optional to not destroy contained object in destructor,
which is a source of fail in tst_QResourceEngine::cleanupTestCase().
This fail was quieted down using QEXPECT_FAIL for VxWorks, due to exact
reason being unknown at the time.
It was found out that unpatched version of std::optional header in
VxWorks 24.03 fixes most of issues found in 23.09, so there is no need
to use old header. Additionally it cleans contained object in destructor
properly, so this is the one that should be used. In order to use it,
COIN will need to refresh VxWorks images, but this in turn will fail
this test with XFAIL.
Replace QEXPECT_FAIL with QSKIP in tst_QResourceEngine::cleanupTestCase
for VxWorks, update comment accordngly.
Once unpatched optional version from VxWorks 24.03 will be used on COIN,
skip will be removed entirely.
Task-number: QTBUG-130069
Change-Id: Ib446d04b2fabb027dad7af909ac00b7b30e76b53
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit a10acaca0887541207ad5607680d7864d317cf4b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
It's possible that the first ABI from Build.SUPPORTED_ABIS would return
an ABI that's not packaged in the APK, for example if an armeabi-v7a APK
is run under the device supporting arm64-v8a, in that case the returned
path would be that of an arm64-v8a while it's not actually packaged
inside the APK.
Fixes: QTBUG-132155
Change-Id: I0f311accee246fa2d1d0b8aaf424d034b4b2d04c
Reviewed-by: André Klitzing <aklitzing@gmail.com>
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
(cherry picked from commit a5f80b4732d33dd36414a6ffbd49a9efc7c87a0a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QShortcut has a constructor that takes a _parent_ object and a
function to invoke, and it will internally connect its activated()
signal to that function. This connection will not provide a
context object (the parent is not used to this purpose).
Given it's not clear what the context should be if any (the parent?
`this`?), I'm not at ease at just supplying "something" as the context.
Instead, hide the constructor if we're under QT_NO_CONTEXTLESS_CONNECT.
There's another constructor where the caller can supply a context.
Change-Id: I21befcc86eeb07e65eadee1222757ecc5bab1d2c
Pick-to: 6.8
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit ade3bb1c5224a9155a2a2f965fa70740aa9ec8a7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
COLRv0 fonts are both scalable and in color, which was not
previously handled in the Freetype backend because it only
supported color fonts with embedded bitmaps. This patch
simply correctly detects the scalable color fonts and
render them through the same mechanism as other color
fonts.
[ChangeLog][Freetype] Added support for COLRv0 format color
fonts.
Pick-to: 6.8
Task-number: QTBUG-131116
Change-Id: I290e7525c24b4cf2ec872a366e5193f54712a3a4
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 39df9e1858a4115bc19b6a4dee5d687c5ee00d21)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The class declares a protected destructor, which interferes with the
RO5. The only subclass in qtbase is move-only; QTextCodec (in
Core5Compat) is not even movable.
Make QStringConverterBase move-only as well.
Pick-to: 6.8
Change-Id: I20d16df79f7ad8e7e7a8af339954cfa2d1482e96
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit eb533c81b8aa55f89605bb1d091afe4df4db763c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Running Chrome in headless mode helps to circumvent
a lot of issues with GPU driver/Wayland interactions
that we encounter in CI.
Run Chrome in headless mode if corresponding environment
variable is set.
Change-Id: I1cf290f484054766e2b99d99045e7b39d5662210
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Even Oscar Andersen <even.oscar.andersen@qt.io>
(cherry picked from commit 213a2610d821b93429d6519dda11ab0e7b5cae84)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Since the removed API uses QDebug. Requested in code review.
This is needed for a subsequent commit (removing qdebug.h from public
headers when possible), but I split out to its own commit to ease
backporting.
Pick-to: 6.8
Change-Id: I76980634b9ebbae7cf010d99f5095aa94a825824
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit c0fcb2db242a40cdcc2bbfd00332390b64cab439)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This fixes an issue where comparing pointers to object is only defined
if both pointers point into the same array.
Task-number: QTBUG-132507
Pick-to: 6.8
Change-Id: Ib7ccb30001add38ad25b62c848a01cd53566d8bf
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 5dcdeeebbc08be8845cdb5a0e586b7a864b7f16f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The data for the CLDR update was generated from an incorrect xnr.xml
that has contained an extra < and hence the generated
qtimezonelocale_data_p.h is also incorrect.
Update qtimezonelocale_data_p.h with the correct CLDR v46 data.
Task-number: QTBUG-130877
Change-Id: Ibc87e137b1519be470704ed519c0988333625af5
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit 95abc38ba6e586c8e491593ebe4c4b4ee32a79e7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This looks like another case of a base class with a protected, defaulted
destructor, which interferes with RO5. Explicitly redeclare the other
special member functions in order to suppress the warnings coming from
the deprecated copies.
Pick-to: 6.8
Change-Id: Icf8c8817ef001d0503683d071c4f004db64caa2d
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit f6e99f347d243749af8d9beacd7c68852f0ff636)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
I'm not entirely sure why function_ref_base declares its destructor. I
guess it's declared in order to make it protected, because the class is
non-polymorphic and inherited by function_ref, and one may want to avoid
slicing. On the other hand, function_ref_base is an implementation
detail, living in a `detail` namespace; so that sounds very unlikely.
In any case, the class is clearly meant to be copiable, so add back
(as protected) the missing special members.
Pick-to: 6.8 6.5
Change-Id: Ibf909e1746e65eecf8b8990839a6e4c9eb56ca13
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 74b875641f40b15a4a59a0c55cd79c251b49c05e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Flat buttons were larger than normal buttons - therefore also add
marginsRemove(QMargins(2,2,2,2) for the flat case too.
Pick-to: 6.8
Task-number: QTBUG-132433
Change-Id: Id010d45bf85c5d7d09ff8db8bda44b1be7d85297
Reviewed-by: Wladimir Leuschner <wladimir.leuschner@qt.io>
(cherry picked from commit a930fb758d71ef6bf353e8fd8078de2335c32085)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
As that will steal focus from tst_QApplication, which is needed for
subsequent tests.
Pick-to: 6.8
Change-Id: I5720c4a2bb45f98894616e01da10b9c40a2b6735
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 8de8800670d2881c6dfe957d6a1c5d925417b85c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Dynamic linking on WebAssembly involves preloading .so libraries
during startup of application. Normally, those plugin preload
lists are generating manually by user, which can be tedious.
Add a bash script which demonstrates how to call python
programs to generate preload lists.
Change-Id: I0a9869ad0d26606f8b33af2c38248cec3088dd0d
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 010ed1788402bf98d9b98500fdb1f61c333cebe5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
... instead of Q_NORETURN, as the attribute should be unconditionally
available since C++11.
Amends bad618606d64e943e3fa78e7d1dbc8e1fab55480.
Found in Qt 6.9 API review.
Change-Id: Ia008acf0777867f551c7e1cc3423f29f8ed6fbed
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 8472004a895fa98e68f6f3ff134720904a00c150)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The call to q_assert() isn't constexpr, so can't happen in a constexpr
function. Most compilers shrug this off as they can see the code
actually is unreachable, but apparently debug builds on QNX can't work
that out. Since nothing actually needs the function to be constexpr,
remove that qualifier. In the process, move the offset-case, which is
also unreachable, to the end of the switch, closer to the unreachable
end of the function (since I failed to spot that there were two
unreachable parts at first).
Pick-to: 6.8
Fixes: QTBUG-132698
Change-Id: Ibdde7abd91d284e1c1af53e2b5e142fc234400a8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 2578d72a7cb9b784a00efb04df6a31496d92dcdc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Was missing from this new value type, and is quite useful for this type.
Addresses API review comment.
Change-Id: I07ea7ded7f963b2032c377f024bb88e9d54a4d5c
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit b562c36a9a7be5f62a8e79b93c9728381775f460)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Java methods of QtAbstractItemModel may get called from Qt GUI thread or
Java main thread. Situation is the same with internal proxy methods,
where they may directly or indirectly called from these two thread.
At the same time, a chain of calls may happen from these threads, so
some functions may get called indirectly from a single caller thread.
In this change, we are adding a map of QObject* to QRecursiveMutux
where the QObject is a QAbstractItemModel, either the proxy instance
or a reference to an underlaying QAbstractItemModel when the model
is implemented in C++.
Each call to any function locks the QRecursiveMutux instance associated
with the QAbstractItemModel instance. A connection from
QObject::destroyed to a lamda, helps to remove the map entry when
the model is destroyed.
Pick-to: 6.8
Fixes: QTBUG-127467
Change-Id: I18dcdc207e201b3883526648b4e672e5868ed8ab
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit bf76387507dde71063ebe484bce1e7d1b8e09bc2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The qthreadstorage.h header contains two implementations controlled by
the QT_CONFIG(thread) definition.
Commit 8553ffd8d147ecf6a713d12a360027b477dd59c8 changed the positions
of the namespace macros in the header, but didn't consider the fact
that we now include std and Qt headers inside QT_NAMESPACE in the
!QT_CONFIG(thread) case.
Fix it by moving all the includes to the top, and wrapping them in
the needed QT_CONFIG() checks. As a drive-by, drop the unused
type_traits include.
Found in Qt 6.9 API review, but picking down to 6.5, as that's what
the original commit did.
Note that 6.5 cherry-pick will require to replace <memory> with
QtCore/qscopedpointer.h because
6da1f72311b844b2232da3067ad6e1e24614e67c was never picked to that
branch.
Pick-to: 6.8 6.5
Change-Id: Ic9c5fe82df38a3bd64829c016de8dcbd9f060315
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 4a6ef7fc6881c7b5ab0b9f6d51a2738ce86cca93)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This is a non-polymorphic class, so explicitly export only the
out-of-line methods.
Amends cc128d802c6d9c87a1e00a8a88d5e6590a7195f4.
Found in Qt 6.9 API review.
Change-Id: I30af1121bce1ba9c57cb326cffb1375ac3b22195
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
(cherry picked from commit 5f7149e3590e3c2e829f5a843feebe357c42ca67)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Increase the size of QComboBoxSize and align the subline for editable
QComboBoxes with the begin end end of the rounded corners.
Task-number: QTBUG-132261
Pick-to: 6.8
Change-Id: I235ec1ceb94a5e87f373b007ac31d0d8a83cf600
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
(cherry picked from commit 23c16c611cfeee55ce38e928989b346c697270b0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Decrease the bottom line frame thickness for QToolButton by using
fractional coordinates.
Task-number: QTBUG-132261
Pick-to: 6.8
Change-Id: I77a3acdd20c694dce38d809db9c3051949a98fa3
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
(cherry picked from commit 3e9baca7d2197bfc10d20de6f326e2749a8f781e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
In preparation of adding QT_NO_SCOPED_POINTER, which would be rather
pointless for users if public headers continued to mention the type.
Pick-to: 6.8
Task-number: QTBUG-132213
Change-Id: Ib5a40a1b8defe1cfe858218bb25c422f900dfe6b
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit c5a4e3f790eb4157e33eac2402110f71a76a5418)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
When converting an implicitly-shared Qt container to QSpan, the QSpan
ctor would call .data(), which detaches said Qt container (if it's not
const). This is what must happen for mutable spans (QSpan<int>), but
is not necessary for non-mutable spans (QSpan<const int>).
Fix by copying the potential const from QSpan::element_type to the
Range object in the resp. QSpan ctor. This makes a QSpan over a const
element_type mark the range const before passing it to adl_data() (=
member-data()). For a non-const element_type, nothing changes.
[ChangeLog][QtCore][QSpan] No longer detaches implicitly-shared Qt
containers converted to QSpan<const T, N>. Note that std::span<const
T, N> will, however, detach such containers, so we recommend to use
std::as_const() with implcitly-shared Qt containers, as always.
Fixes: QTBUG-132133
Change-Id: I9fdae20994d2c900bc5b45b44db3901d10f8838a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 287234704b57e171c786ba8df0b93c49edb903c5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QException has an out-of-line destructor in order to pin its vtable.
But like any std::exception subclass it's meant to be (and effectively
is) copy-constructible and copy-assignable (cf. [exception]/2).
Add the missing copy operations, and the default constructor.
One may argue that this class should use some other approach since it
also has a polymorphic clone() -- for instance disable assignments and
make copy constructions protected -- but that ship has sailed.
This prevents a Clang warning about the deprecated copies in the
presence of a user-declared destructor.
Change-Id: I4d8613ade265ea85a5a7e97255b75b7fcf3e5a27
Pick-to: 6.8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 793309693aac24e7f88fc225408d92def638996e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
So that the pthread_key is destroyed much later than now, at QtCore
unload time instead of a bit earlier in exit(). That's important so it
runs later than the Q_DESTRUCTOR_FUNCTION for QLibraryStore
(qlibrary.cpp), which is what unloads plugins, whose unload-time
destructors may be attempting to quit() & wait() for their worker
threads.
I had to keep the destruction of the exiting thread's adopted thread
where it was: a function-local static's destructor. As noted in the
comment added by 1da7558bfd7626bcc40a214a90ae5027f32f6c7f, we need
QThreadData::cleanup() to run before the libraries start to unload
because we need to delete the event dispatcher.
Init priority 10 will place it after the QHash random seed and qsimd
initialization, on ELF systems and on Windows. On other systems (incl.
Apple ones), the order probably depends on the order of the files in the
CMakeLists.txt. I thought that would mean the destructor for thread/
would run before plugin/ but that apparently is not the case. But that's
fragile.
Amends 1da7558bfd7626bcc40a214a90ae5027f32f6c7f, which amended other
things...
Fixes: QTBUG-132697
Task-number: QTBUG-102984
Task-number: QTBUG-132381
Pick-to: 6.8
Change-Id: Id7263d6ffe7a5949cd84e35d942ad0e02df1b455
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 2f69a05bd0cd7ce63890f709ff3ed7a4f78acd70)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit adds one unusual creation and three more unusual exits:
* creation of the Q*Application in a thread (QTBUG-130895)
* exits using ::exit() instead of returning from main():
* from the main thread's event loop
* from an auxiliary thread
* from inside an auxiliary thread's event loop
All of these exercise the moment the QAdoptedThread & QThreadData for
the main thread is destroyed, which are, respectively:
* thread exit time, running thread-specific destructors
* inside exit(), running atexit()-like callbacks (qthread_*.cpp)
* [tst_static_q*application] inside exit(), running static destructors
(added in commit 1da7558bfd7626bcc40a214a90ae5027f32f6c7f)
Unlike the tst_static_q*application tests, the calls to ::exit() cannot
be a regular QtTest because that would cause the log output to be
incomplete. The threaded Q*Application could be a test of its own, but
since I needed to add the helper anyway, I chose to add the test there.
For the majority of the tests, the failure mode is going to be a crash
on exit.
Task-number: QTBUG-12673
Task-number: QTBUG-132429
Pick-to: 6.8
Change-Id: I1062ef500356bd97dd0cfffda4aeeda9afa138e8
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit bfbd1a281dd00c47df315c06e895bf5d53cd8764)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
There is no need to search for high-res svg icons - a svg scalable by
design. Also the QSvgIconEngine does not support it.
Pick-to: 6.8
Change-Id: Ib76c887900ce77268e9c0253cb697b8de9e7f10e
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit c64774eef72411029f7c2fb611328f25b83ff8ca)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
If COIN_CTEST_IGNORE_EXIT_CODE is in effect and ctest aborts for some
reason (for example due to the workitem being cancelled) the ctest exit
code will be ignored, as expected, but we will not have a LastTest.log
to copy, which will fail the workitem unexpectedly.
We now match the ignoreExitCode of the LastTest.log copy with the ctest
run.
Change-Id: I9df0f863a42dd4cf25cee1694e85cb32058a4e5b
Reviewed-by: Toni Saario <toni.saario@qt.io>
(cherry picked from commit 0e2067334d58787464a3554730042dba37413c6d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The docs said only the first placeholder would be considered; in fact,
it considers only the last.
Fix the docs and add a test (also for QTemporaryDir).
Amends b4bb4449aea7592afdb9b9134bb90c40fe29735a.
While 6.6 and earlier are unaffected by the incorrect documentation,
pick this to all active branches in order to verify the behavior is
the same everywhere.
Pick-to: 6.8 6.5 6.2 5.15
Fixes: QTBUG-132597
Change-Id: Ia7a37f714f834191b07420d31ca9024702b537cc
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit e7abbc7bf3ab06359b2847b1e1a46c38d8bc6581)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Initially the git vars were assigned to the parent scope of the
_qt_internal_sbom_begin_project function, with the intent to set them
in the global scope. But the function was later wrapped in other
functions, so the variables stopped being accessible.
Instead of playing with recursive PARENT_SCOPEs, save the variables in
global properties like we do for other info, and use a new
_qt_internal_sbom_get_git_version_vars() function to query the vars in
the code that needs them.
This fixes generated purls to contain the git version and hashes.
Also add a new internal API wrapper macro called
qt_internal_sbom_get_git_version_vars to allow calling it
in other repos.
Pick-to: 6.8
Task-number: QTBUG-122899
Change-Id: I061b34f418c1ecc1c66c8c01ef758d2f40611ede
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 41a92bf6f1486259ef25db775520cba647e1cc15)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The SBOM implementation got somewhat large. Split the code into
several new QtPublicSbomFooHelpers.cmake files, to make it more
manageable.
No code or behavior was changed.
Pick-to: 6.8
Task-number: QTBUG-122899
Change-Id: Ia0ca1792eec21d12c4bb4cabe63279e1f5c07e3d
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 27d2b54b5d2bc5a69edc2de703b2ca34cb2637dc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
When calling insertRows(), the model of the child items was not
correctly updated. insertRow() is behaving correctly.
Pick-to: 6.8
Fixes: QTBUG-131372
Change-Id: I8b6aef7ab97887c6eb46eb21b992d76e4d59b3a0
Reviewed-by: David Faure <david.faure@kdab.com>
(cherry picked from commit 5bab8448feb2661f871e71d71a95afaffcb1656a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
It's kinda is important to verify that commit() worked; all the
follow-up tests assume it, so wrap the calls in QVERIFY().
Amends 7e5e7eeaa1418d959906cdf9d717c984c9fc7a7e.
Pick-to: 6.8 6.5 5.15
Change-Id: I01185d65a5ec06ed122e59c43d9cdcc3a7157259
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 97fe38ff0d1e60f92c0bfa6fb3571a0433e60352)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
To ensure we don't overwrite it in this quite long function.
Amends 7e5e7eeaa1418d959906cdf9d717c984c9fc7a7e.
Pick-to: 6.8 6.5 5.15
Change-Id: Ie5f81b50d2d66ba9e064810f8cbc1a7af298cc2b
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 67a906b5564a1ccf03e547aa78fc6fd910d9cd15)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
There was a typo in the link_libraries variable name, where an upper
case 'L' was used instead of a lower case 'l'.
Pick-to: 6.8
Task-number: QTBUG-122899
Change-Id: I206a161107cf7510856ad8740dada88e12341e94
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 2affe46b2543f7d2de1939e049a0d783b5a7dcfb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
They result in lldb hanging, which was previously only a case when SIP
was enabled, but can now be reproduced on macOS 15 even with SIP disabled.
https://github.com/llvm/llvm-project/issues/53254
Pick-to: 6.8
Change-Id: Ifa09f8cf22522b5a1028db1f250ebe9e1543cf9d
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit 50d5914f28b535790f8eca6210adad24fe76940b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Swift 5.9 includes built in crash reporting, printing stack traces,
libraries, and registers to stdout/err.
https://www.swift.org/blog/swift-5.9-backtraces/
As (Core)Foundation is written in Swift nowadays, we get this feature
for free even in our "C++" apps, as we always link to CoreFoundation.
To enable the feature the binary needs the com.apple.security.get-task-allow
entitlement, so we add it for all our tests automatically.
The final piece is to run the tests with SWIFT_BACKTRACE=enable=yes,
but we'll do this in our CI provisioning, as setting it from within
testlib doesn't seem to work.
Pick-to: 6.8
Change-Id: I31090efee06460f45522093e17f900e76590b282
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 9bebdc97f161cc58461530fa0171e0defc6cc1ee)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Should be 6.9. The entries in removed_api.cpp are already added to the
correct place, just the macro in the public header used wrong version.
Amends d41b87e06742b491c4e36aeae32e03f85b078d69.
Change-Id: I88749dbeb070206c42feb4ffc504f260f8857823
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit da799c20d763b5534152dca52fef12fda875acc2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
That prevented qdoc from generating the docs for the fromPrimaries()
function.
Amends bde2292247bf4849852355c0dcc71f97c9daace9.
Found in Qt 6.9 API review.
Change-Id: I2f5c57a4dc4a437798907c64fb657c9fda61e0df
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit e2756158dcf87fea757475d711ac9cda20f42152)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Don't try to update the left and right boundaries when no valid idxRect
was found.
Also fix the early exit check - we can exit when the idxRect is
completely below *or* completely above the current viewport.
This amends 2f9c72028d2481f587f378a256654d0a362e3d44.
Pick-to: 6.8
Fixes: QTBUG-132670
Task-number: QTBUG-124173
Change-Id: I51f9e12c66268318e597facfbe4df74367d1089a
Reviewed-by: David Faure <david.faure@kdab.com>
(cherry picked from commit 9d4b5fa017199627a42477a842a4e1ef349bb1ae)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
For all CPE and PURL fields where it makes sense, to avoid
duplication.
Pick-to: 6.8
Task-number: QTBUG-132181
Change-Id: Icd1c5267e4e9b582eea28150ebd1b2cca3852229
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 82dc92cb1b94de12761f23ad6ec27feb2aca43cd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Replace instances of $<VERSION> in CPE and PURL strings read from
qt_attribution.json files with the version of the package being
processed.
This avoids duplicating the version in qt_attribution.json files in 3
different fields Version, CPE, and PURL.
Pick-to: 6.8
Task-number: QTBUG-132181
Change-Id: I91af17c82dbb936739f4811bf86043e00ee49a78
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit bc3bbb51b7b48d3c4a44a432441938863582242c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Add a new qt_internal_sbom_generate_tag_value_spdx_document function
that takes an input SPDX JSON file and generates a tag/value SPDX
file. This is needed by WebEngine to convert the Chromium JSON file to
a tag/value SPDX file so we can reference it as an external document.
To ensure the external document is found, we now always add the
current sbom build directories as install prefixes. This was
previously done only for top-level builds.
To ensure the converted external document is referenced only after it
is converted, it needs to be converted before any targets mention
packages from within it.
A sample usage might be:
qt_internal_sbom_generate_tag_value_spdx_document(
OPERATION_ID qt5compat
INPUT_JSON_FILE_PATH "${external_sbom_file_path}"
OUT_VAR_OUTPUT_FILE_NAME external_output_file_name
OUT_VAR_OUTPUT_ABSOLUTE_FILE_PATH external_output_file_path
)
Pick-to: 6.8
Task-number: QTBUG-122899
Task-number: QTBUG-129901
Task-number: QTBUG-131377
Change-Id: I5d5397f788c8c7960b6fc233c2868244e5816e0b
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit b8f5e5f554c0c8b340b532b998fed5ef2a87eefd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
We shouldn't be using the direct project name in spdx relationships,
but rather the sanitized name which is prefixed with
'SPDXRef-Package-', to ensure sbom validation succeeds.
Also we should default PROJECT_FOR_SPDX_ID to
"Package-${arg_PROJECT}" if it's not set.
Pick-to: 6.8
Task-number: QTBUG-122899
Task-number: QTBUG-129901
Task-number: QTBUG-131377
Change-Id: I354babcf4fea5f6efd9b32422dd8d3835ef50f15
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit f086e72b7e6332412a7c87bc435398a0e3dee305)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This change modifies the existing implementation of the
external references API to have better named options and better
behavior.
It also adds comments and exposes an internal API wrapper around the
existing implementation.
It's meant to be used by qtwebengine to reference the
Chromium-generated SBOM.
As a drive-by, it removes the previously unused RENAME option.
A sample usage could be:
qt_internal_sbom_get_external_document_ref_spdx_id(
"qt5compat" document_ref_spdx_id)
qt_internal_sbom_add_external_reference(
EXTERNAL_DOCUMENT_FILE_PATH "/path/to/qt5compat-6.8.1.spdx.json"
EXTERNAL_DOCUMENT_SPDX_ID "${document_ref_spdx_id}"
)
Pick-to: 6.8
Task-number: QTBUG-122899
Task-number: QTBUG-129901
Task-number: QTBUG-131377
Change-Id: I13d0fe4d803449bec42f8b454c8131e4d727669a
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Moss Heim <moss.heim@qt.io>
(cherry picked from commit 9a3998692c10964a919942147d8d8035e878b167)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Allow including custom cmake files at predefined steps of the sbom
generation using the new internal
qt_internal_sbom_add_cmake_include_step API.
This covers pre-existing steps like BEGIN, END, POST_GENERATION, and
VERIFY, as well as two new steps, BEFORE_CHECKSUM and AFTER_CHECKSUM.
A sample usage of the new API could be:
set(step_path "${CMAKE_CURRENT_BINARY_DIR}/run_some_cmake.cmake")
file(WRITE "${step_path}"
"
# This is a CMake script to run some CMake code.
message(STATUS \"Running some CMake code...\")
message(STATUS \"Done running some CMake code.\")
"
)
foreach(step IN ITEMS BEGIN END BEFORE_CHECKSUM
AFTER_CHECKSUM POST_GENERATION VERIFY)
qt_internal_sbom_add_cmake_include_step(
STEP "${step}"
INCLUDE_PATH "${step_path}"
)
endforeach()
Pick-to: 6.8
Task-number: QTBUG-122899
Task-number: QTBUG-129901
Task-number: QTBUG-131377
Change-Id: I6f9512bf3a3bc3ebeb7d21426e5a3833280e42a5
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 8c754dcbb139ba83f033b3b3fc1d9edb8a909811)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This change introduces a new SBOM API to add info about various kinds
of files to a target SBOM package. The new function name is called
qt_internal_sbom_add_files().
The motivating case is including SBOM information for qt translation
files, resources (e.g. webengine data files) and any other kind of
custom files.
A sample call might look like:
qt_internal_sbom_add_files(Translations
FILES "${qm_files}"
SOURCE_FILES_ONE_PER_INPUT_FILE "${ts_files}"
FILE_TYPE "QT_TRANSLATION"
INSTALL_PATH "${INSTALL_TRANSLATIONSDIR}"
)
While the motivating case is Qt-specific, the function implementation
is being somewhat future proofed for the not-yet created public SBOM
API.
The new API supports adding files to any target that is backed by an
SBOM package, so all targets created by qt_internal_add_module()
and friends, as well as ones created by qt_internal_add_sbom().
It can be called multiple times for the same target, with a different
set of files, to e.g. assign a different license, or file type per
file set. Note that the file set doesn't have anything to do with
CMake's concept of file sets.
The function is also multi-config aware, and allows specifying
different install paths per config, as well as generator expressions
in file names. But the multi-config support is a bit wonky, and might
need some rethinking in the future.
Note that the custom files must be installed and available in the
specified qt install path, because the file contents will be
checksummed at install time and embedded into the sbom document.
Calling the new API does not do installation itself.
Implementation wise, the function call flow is
- project calls qt_internal_sbom_add_files() one or more times
- at finalization time, the _qt_internal_sbom_add_target finalizer is
called for a target, which then calls
_qt_internal_sbom_handle_target_custom_files()
- the latter calls _qt_internal_sbom_handle_target_custom_file_set()
for each file set that was added to the target
- the latter calls _qt_internal_sbom_handle_multi_config_custom_file()
for each input file in the file set, which ultimately calls
_qt_internal_sbom_add_custom_file()
Pick-to: 6.8
Task-number: QTBUG-122899
Task-number: QTBUG-128320
Change-Id: Iafde26ebd68f4168b49e55fbc8ad1c251e98d4b0
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit b085fe6ad9eee69791bc3c15bfeb7cc41245519a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Previously Python and other sbom tooling was looked up at SBOM
project end time.
This was fine for the use cases we had so far, but it prevents
introducing new API that wants call the spdx tools before the end of
the project. Such API will be introduced in a follow up change.
Move the python interpreter, python dependency lookup and other sbom
tooling setup to happen at project begin time.
Pick-to: 6.8
Task-number: QTBUG-122899
Task-number: QTBUG-129901
Task-number: QTBUG-131377
Change-Id: Ic8884e378c0ffd9720ede26b0c61f4122f3bb9d9
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 2fa815341c68148ff00c6d16be017f80e4032ef1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Tool dependencies that are added using the
qt_record_extra_package_dependency function now are considered as
the third party dependencies. This allows using two different
approaches when looking for the dependencies of Qt tools.
All dependencies that are Qt tools now go to the path invented in
035fbd068b5a3fbc18b7868ecac9a6a6a2f6602c and use the
_qt_internal_find_tool_dependencies function which is designed to
look for Qt packages and uses CONFIG signature of find_package.
To look for the non-Qt modules we should use more generic find_package
signature and _qt_internal_find_third_party_dependencies fits perfecly
for these purpose.
Note that it's known issue that the
_qt_internal_find_third_party_dependencies command also may find
"target" tools when crosscompiling, but this commmit doesn't reinvent
it. We already have various places which make the scoped "host"
dependencies lookups to ensure that "host" tools look for the "host"
dependencies in build systems like yocto.
Ammends 035fbd068b5a3fbc18b7868ecac9a6a6a2f6602c
Task-number: QTBUG-132340
Fixes: QTBUG-132622
Fixes: QTBUG-132616
Pick-to: 6.8 6.5
Change-Id: I9effba3d405ceec720a8a2a332250619cd56f598
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit f881e06dd44c377772dd3b99793ab7552c7cd64e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
It seems that findChildren does not return every window if called
at an inconvenient time.
This causes not all windows to be returned, and later the
QWasmCompositor will not detect a valid window to compose,
and therefor goes to disabled.
Fixes: QTBUG-132414
Change-Id: I6c872071751d5a2fbdeea36fb8f4c7e9677fd7d0
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
(cherry picked from commit 5c5844cedb938c38ea595957b172c48a67c502fc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This amends commit fbbf4ace0188b9718b6d7808021c0b887fd52d9f.
Remove the EXTRA_PACKAGE_DEPENDENCIES argument that was added in
mentioned commit, and use the qt_register_target_dependencies function
instead to add the package dependency Qt6FooPrivate -> Qt6Foo.
Task-number: QTBUG-87776
Change-Id: I08a48954576dc3c0b6fde809f90d2022201d7eb0
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 2d38af3125d18255007f7451f31e26e9c16af45a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Some icon glyphs might not be square, and actualSize needs to return a
size that fits into, and maintains the aspect ratio of, the requested
size.
Compute the bounding rect of the text/glyph that would be rendered, and
scale it to fit into the requested size.
Use that to return a pixmap of the correct size.
As a drive-by, fix the cache-testing by comparing the
deviceIndependentSize of the stored pixmap with the size we want.
Change-Id: Ic6fd0f0e260b3e3946d032941d9b677463d5c145
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit be9682d372e0021ff112817dc146f5768ac6f28c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QString::data on a non-const string will needlessly try to detach.
Avoid that by accessing the raw data pointer.
Addresses header review comment.
Change-Id: I89b4d3451cda517e5c5ca08173510b3529ce73aa
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit bf2491acc74528004af8d5f4caf50e88fcb86f89)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
...of private modules in public modules. This isn't necessary anymore
since the Qt6FooPrivateDependencies.cmake files contain these 3rdparty
dependencies proper.
This reverts commit dae078e521c3932c66436cbdbfaf5294a1842901.
This amends commit fbbf4ace0188b9718b6d7808021c0b887fd52d9f.
Task-number: QTBUG-87776
Change-Id: I2c425d49fe7beb790abf9a94f089d43fde8b047e
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit e7816586b612050adf0cd872b81d04b606ec2b54)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
As per the standard at [1], the second parameter has to be int, while
difference_type is jint (which is also int, so no difference in
practice, esp for the already released QJniArrayIterator).
https://eel.is/c++draft/over.oper#over.inc-1.sentence-3
Addresses API review comment.
Change-Id: Idea11f83048b9b65548ec1ac8abc2586c6e61a27
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 291c5ec433131d43921e77f3b6565e89cc0b3420)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Each 3rd party license attribution is identified by a
unique Id key, which should be all lower case and without
spaces. See QUIP-7 for more info. about the
qt_attribution.json file format:
https://contribute.qt-project.org/quips/7.
Pick-to: 6.8
Change-Id: Iaa233a0e6180945e014b9a407bbd61df591f1dea
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
(cherry picked from commit 1926df8d57c2b6c600a5486b1939d96b21f7f812)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
When using qmake to build a user project on macOS, the Qt headers are
included with the -I option, rather than the -isystem option. This
means that the compiler will not silence warnings that are generated
while parsing Qt headers.
If the user project compiles their code with the
-Wzero-as-null-pointer-constant compiler option, this leads to
warnings like:
/QtCore.framework/Headers/qcompare.h:226:78:
warning: zero as null pointer constant
[-Wzero-as-null-pointer-constant]
friend constexpr bool is_eq (partial_ordering o) noexcept
{ return o == 0; }
^
nullptr
Fixing qmake to use -isystem instead of -I is not trivial.
We already silence these warnings for gcc in the header file.
Do it for clang as well.
Amends bdd41f491c0f85ae0897a1c7372c5ecda62a5aab
Pick-to: 6.8
Fixes: QTBUG-132581
Change-Id: I7883248b7be548580a03333e76620ac10f57733a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 0711eb60716b53dc86cacb2fc19b72aa4ffee3d0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Android 15 (at least) seems to have changed how float arguments are
passed to native functions, breaking our (conceptually correct) code for
processing the va_arg list into a list of static argument types of the
function implementation.
To fix this, we have to move away from using a va_arg function, and
register a function with statically typed arguments instead.
Use a template function that we instantiate with variadic arguments
deduced from the actual function, using a factory-helper that generates
a JNINativeMethod struct with that template instantiation as the
function pointer. Move all of that into a struct where we can also
declare the signature string as compile-time constant without cluttering
the namespace with static objects.
We can now remove the helpers that took care of type promotion in va_arg
functions, and of the tuple-construction from a va_list.
As a drive-by, don't cast function pointers to void *; it's strictly
speaking undefined behavior in C and should have generated a compiler
warning, if not a hard error [1]. We must initialize the
JNINativeMethod::fnPtr member with the address of the function pointer
instead.
[1] https://port70.net/~nsz/c/c11/n1570.html#6.3.2.3p8
Also, declare the native method as the JNICALL calling convention. That
is only defined on Windows, so makes no difference in practice, but it's
the correct thing to do anyway.
Fixes: QTBUG-132410
Pick-to: 6.8
Change-Id: I190b95fcbcd07cf99c6765fa426c3c351f91994a
Reviewed-by: Volker Krause <vkrause@kde.org>
(cherry picked from commit e91a17873ee4ae58d369b8eb70029cf895b31d03)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Cleanup CE_ItemViewItem branch in drawControl():
- use local rect instead rect, vopt->rect or option->rect for
consistency
- move out viewItemPosition comparisons into local booleans
- fix coding style
- merge two QPainter::drawLine() calls into one
Pick-to: 6.8
Task-number: QTBUG-131585
Change-Id: I7cd2f96a2a733a55d5e7fb5956c59bd043317cb2
Reviewed-by: Wladimir Leuschner <wladimir.leuschner@qt.io>
(cherry picked from commit 44edab7c84be101025dc6f9a74f87944ea3a22e9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
There is no reason why the QBitmap(int w,int h) constructor is not
deprecated, and the one taking a QSize is. Since there's no deprecation
marker in the source code, I'm assuming this is just a documentation
issue.
Amends 111115bf8862b7cd1197c2ef8a4b475c882776d4.
Change-Id: I700de1821ab23ce85e793734c7048d1b2031ce9d
Pick-to: 6.8 6.5
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 7f7605c22f0e1847612e9e283eead75a1ace409e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Demonstrates the problem described in the bug report on Android
15/x86_64. QEXPECT_FAIL the relevant test cases until the next
commit fixes the problem.
Task-number: QTBUG-132410
Pick-to: 6.8
Change-Id: I065fd29282ef42ed75a2ed8177ded183c92aa6e3
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 749367da8c3309c98b3285836c2bd8abcd7274b1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
When making an object array, we use a LocalFrame to get access to the
conversion routine, but manage the frame of local references manually in
chunks of 100 objects. If any of the conversion routines uses the
LocalFrame's implicit frame management, then we push and pop frames out
of order.
Disable the frame's implicit frame management, and only use our chunk
management.
Amends 37638c84efaf2810ad49da0b987f19287d8c4ad6.
Pick-to: 6.8
Change-Id: I93be77ffc8750bb90fd7daed8c273169b03a29e4
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit fe6222b7561faa52f12a961d7c5417e364cf0236)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This is not the same as the 'directory' test below, which tests that we
can't open() a QSaveFile on something that already is a directory. For
this one, the target file did not exist when we open()ed, but has become
a directory since then.
Change-Id: I92d13f103693d375e742fffdd74053dd1b86d81f
Reviewed-by: David Faure <david.faure@kdab.com>
(cherry picked from commit f4ff7c40588a4515504e22266d15816ca8616cba)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
So we don't have to parse it on first use if it isn't set. This should
be a small performance gain for everyone who uses the default, which is
usually the majority of people.
Change-Id: I10c471715457dcfa3a1dfffd2768ce605e4f7e30
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit e04f109456bbcb184963b8ed71944b958b35c201)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This somewhat duplicates some other tests, namely the QHttp2Connection
one, but tst_http2 is our only coverage of the HTTP/2 code prior to 6.8.
This change adds a test where the server sets the
SETTINGS_HEADER_TABLE_SIZE to 0, effectively disabling the dynamic
table. We, in an earlier patch, makes the HPack table error out if
a new header entry is about to be added if the table has not been
resized below a changed 'max'. So, we take advantage of that here and
set the new 'max' capacity without resizing the table, or updating
dynamic capacity causing it to fail if the client doesn't send the
expected Dynamic Table Size Update.
Task-number: QTBUG-132277
Pick-to: 6.8 6.5
Change-Id: I1ca8ca7828d5b83606e7adbcfc13c154fa1e3cab
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit f7c3acd27ff48b24f99086be206acbe7e00e3208)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This removes boilerplate and the extra complication of std::addressof.
Task-number: QTBUG-132507
Pick-to: 6.8
Change-Id: I07091ec0ac526975cf55361a9811fad77eb152c2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 30ae70a110ee2460744e4fb78bae29b75effbf72)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Instead of passing the safe area margins to all windows
or top windows, we can instead call the listener for
setOnApplyWindowInsetsListener() on specific QtWindow
and have it pass the windowId with the callback to C++.
What was missing before was that the listner was not reset
after removing the window and also, we don't need to
necessarily require a window matching the id to be found,
so that if no window is found we can assume that the callback
is not valid.
Task-number: QTBUG-131519
Change-Id: Idd411e407ac8f5992aa6684ece70329198de1bc2
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit d7860d445d462dae853358c8b956fa6b1b6a2fc7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QUniqueHandle is intended for handle types or opaque pointers that are
no-throw constructible, copyable, and assignable, and has nothrow
comparison and relation operators. This patch ensures that this holds
true, and makes most of the QUniqueHandle noexcept specifiers valid.
This will make it easier to implement the comparison and relation
operators in terms of the Qt comparison framework.
Task-number: QTBUG-132507
Pick-to: 6.8
Change-Id: Id9fc3fac72a2337541e49c3b4613b8fd082796af
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 49f1877bbbb8f96d81144861558bdcc81e758a58)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
We need to, following the RFC, send a Dynamic Table Size Update using
HPack once we have acknowledged the setting as long as the new size is
smaller, or if we decide to use the new, larger size.
It's further complicated by the fact that we need to send this update on
the next 'field block' (anything with headers in it), and we may have
multiple SETTING frames come in, and we need to then acknowledge the
_smallest_ one as well as the _final_ one. This is so the decoder on the
peer's side can know that we have set the smallest size, and trimmed our
tables thusly, before going to the larger size.
This could, for example, be used to clear the table.
Task-number: QTBUG-132277
Pick-to: 6.8
Change-Id: I2b886e125f2c197bc3d42aa0b2bbd308ed2a687c
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit 57f44d6d882e09f1560f86816fac6ca8d06264fc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
In the update from 6.7.2 to 6.7.3, commit `ea0f00d5d` changed how linker
flags like `ws2_32` are treated when generating pri/prl files.
Specifically, before the commit a flag like `ws2_32` was left
untouched. The above commit changed it such that such flags are
converted to `-lws2_32` (seemingly in order to better support FFmpeg,
according to the commit message). However, this change also affects
absolute paths if the file has no extension. That is, after the above
mentioned commit, an absolute path linker flag to, say, a dylib on macOS
without a suffix will result in prepending the `-l` flag. This will
result in errors during link time.
An example where this caused problems can be found in the nixpkgs PR
draft #367206 (https://github.com/NixOS/nixpkgs/pull/367206).
This adds a small check to ensure that `-l` is not prepended if the
linker flag is an absolute path without a suffix.
Change-Id: I2c7ce3aac6624e1a27c59af233e3da2c1ae7ba60
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 714ae22b84553271a2809c393dd1a5a90089cc19)
On some platforms the capabilities of a device can change at runtime,
and we don't want to model this as a "new device" appearing in place
of the old one.
We already made the capabilities property non-CONSTANT, but let's add
a NOTIFY as well for completeness.
I considered making the capabilities member protected, but
QXcbConnection's xi2 handling relies on modifying the caps
as part of creating the device.
Fixes: QTBUG-132281
Change-Id: Ic345475b179f4562cdd39ecf51c7d6738ad47a74
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
(cherry picked from commit d74079873bbbff8701ec9b254647624775ced27a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
A lambda creates a struct with a function-call operator. So use of
'this' in a lambda body is always a bit ambiguous (the outer object?
Or the lambda itself? even though C++ defines it unabiguously to the
former).
Use a named capture variable instead of 'this' to make it obvious what
is being deleted.
Amends 699162c6fa6121cc496338f1d8d6e1b4287f7760.
Change-Id: I48d82d788d495bac43c6adb114dfdd95a8dd0d1f
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 21811161c9109c28da70b7bb9b28df33fa9b7766)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Because it can be.
Helps readers understand that the type of a continuation doesn't
change once constructed.
Amends 699162c6fa6121cc496338f1d8d6e1b4287f7760.
Change-Id: I43848204cfd8584e6e55d7fbca1b22d30b391e50
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 9dadca4d4e6058299f9d50ae28fd734717d7fdc5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The progressbar content calculation assumes that
subElementRect(SE_ProgressBarContents) returns a rect at 0/0 which is
not the case for progressbars in rtl mode. Fix it by moving the topLeft
edge to 0/0 and translating the painter accordingly
Pick-to: 6.8
Task-number: QTBUG-132459
Change-Id: I614589c9094b0da3c02867b45570d4dfdca61a18
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit 314a5b972646a4f2ef9c1f49ddfd335f546336ab)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Mouse tracking is needed for windows 11 style since it is using
QStyle::State_MouseOver to draw the cells.
Pick-to: 6.8
Fixes: QTBUG-129242
Change-Id: Ib79ac5a8c14ac8c70365e87120f80b4e4ee4c5b9
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit 85333b3d8cb89bf58c6c6c0db7c3db5c95b4cbfc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
When Java calls a native function that expects a QString with a null
String object, then we get a nullptr jstring. We must not try to convert
that to a QString.
Add the necessary checks at the call-site of the toQString helper, and
an assert to the helper itself. Add test case.
Change-Id: If5c55c702bdb3f89ac45fdf3912af2ac295f5e5c
Reviewed-by: Volker Krause <vkrause@kde.org>
(cherry picked from commit db6a9834d2b109e81cc73ef3c64d0c420237e9dc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Amends 65093a84c2b94b1543fd4593bc45d491951d28d4, which changed how we
destroyed the main thread's QThreadData. This merges the call to
destroy_current_thread_data() for both types of Unix systems: those with
broken thread_local destructors and those with working ones. It turns
out that the function got called too early for us in those working
systems (see updated comment).
The clean up of the QThreadData is split into two different mechanisms:
* for any auxiliary thread, when it exits, PThread will call back to
destroy_current_thread_data()
* for the thread that called ::exit(), PThread won't, but ::exit() will
invoke set_thread_data()::TlsKey's destructor
This is different from the situation that existed prior to commit
65093a84c2b94b1543fd4593bc45d491951d28d4: first, there's no code in
qcoreapplication.cpp for this (all in qthread_unix.cpp). Second one may
call ::exit() from any thread, whether that is the thread that called
main(), the thread Qt thinks is theMainThread, or any other.
This commit moves the tst_QCoreApplication check for no extant objects
to a new test. I've chosen to add a new test instead of running a helper
binary via QProcess because we do have a couple of !QT_CONFIG(process)
platforms in the CI, and this is too important.
Credit to OSS-Fuzz for finding this, though it is not itself a fuzzying
problem (all tests of a given structure were crashing on exit).
Fixes: QTBUG-132381
Task-number: QTBUG-130895
Task-number: QTBUG-129927
Task-number: QTBUG-129846
Task-number: QTBUG-130341
Task-number: QTBUG-117996
Pick-to: 6.8
Change-Id: Ie294dce7263b4189f89ffffd9155ec71d31b89d9
Reviewed-by: Robert Löhning <robert.loehning@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 1da7558bfd7626bcc40a214a90ae5027f32f6c7f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This reverts commit c3a2b9f35a9a12ff3c6f5f0d11844de161b47c2a.
Unfortunately, some of the log messages happen WAY too late at process
exit time, when QtCore is unloading. In particular, the worst offender
is the one in QThreadPrivate::finish(), which is called after the last
QObject in the thread that called ::exit() was getting destroyed. This
implies we have Static (De)Initialization Order Fiascos happening (the
logging recurses into qlocale.cpp and the defaultLocalePrivate global
static has already been destroyed).
I need to revert this commit in order to fix QThreadData destruction.
The functionality is welcome back in QtCore once the fixes are in, so
long as whoever does it fixes the issues we're seeing in the CI (and I
can't reproduce on my development machine). I've created QTBUG-132429 to
track the reversal and see if the functionality can be brought back in.
Task-number: QTBUG-120124
Task-number: QTBUG-132429
Pick-to: 6.8
Change-Id: Iecf8f14529c7a2bb2185fffdfd328066098826b1
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 357351b7ab8ab2eee865d2449ffcca9c9f502fd3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
New languages added with v46
- Kara-Kalpak
- Swampy Cree
Several new Chinese-language locales have been added, including one
using Latin script, which invalidated some prior QLocale tests, which
have been adjusted to fit.
Some obsolete time-zone identifiers are now treated as deprecated
aliases. These have lost their AnyTerritory association, implying
changes to QTimeZone tests.
Many redundant likely sub-tag rules for unspecified language have been
dropped, in favor of simpler rules.
[ChangeLog][Third-Party Code] Updated CLDR data, used by QLocale, to
v46.
Task-number: QTBUG-130877
Pick-to: 6.8
Change-Id: I92cf210422c7759dd829a7ca2f845d20e263d25b
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit e316276b76b9c3768ca4e19a04d03308ef21fe12)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Expose some new API to make it easier to test too.
Will be used in follow-up patches for a http2 bugfix.
The setMaxDynamicTableSize() method no longer sets capacity or evicts
entries. This can then be used to set the new maximum size which we will
accept later when we receive a Dynamic Table Size Update.
This flow makes sense with both encoder and decoder. The decoder would
usually be set by us when we send our SETTINGS frame, and then the
Dynamic Table Size Update would be sent by the peer.
For the encoder we would set the maximum size when we receive the
SETTINGS frame, and then we must defer the actual resizing until we
can send the Dynamic Table Size Update ourselves, usually along with the
next HEADERS frame.
Pick-to: 6.8 6.5
Task-number: QTBUG-132277
Change-Id: I959f5006eb09427d130735efe136da8c04453fa2
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit be477819ac17850632bca6ce59ee2c8ef11191cd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
To avoid illegal access, the change ensures that the QAccessibleInterface
is non-null and valid before accessing its QAccessibleActionInterface.
The check for the validity was also added to existing code which
previously only checked for the QAccessibleInterface not being null.
Fixes: QTBUG-132059
Pick-to: 6.8
Change-Id: I69fc4f9bb052ded8f188032d324666d0c00b9c3c
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Reviewed-by: Lars Schmertmann <lars.schmertmann@governikus.de>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 279c891ddf0ad10dd86c8fc836ce385df57593c4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Even with SHGSI_LINKOVERLAY flag set, loaded Icon with
SHDefExtractIcon doesn't have any overlay, so we draw
it manually.
Pick-to: 6.8
Fixes: QTBUG-131843
Change-Id: Iae4c2da12104a361b9a8cf05c78adcdb698f1f82
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
(cherry picked from commit fd7bc16e9fbdc63bd22ba90d0c20b36ccffd2bae)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QIOSTextResponder add actions to its own NSUndoManager. But
we need to remove those actions again when the responder is
deallocated, otherwise it can lead to a crash in UIKit when
swiping between apps.
Fixes: QTBUG-123843
Pick-to: 6.8 6.5 6.2
Change-Id: I404751bc50692a960e568ff2eb0f1754da0cec31
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 42f29da7a5b6c6969c169e9a868696a968ca930d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
In windows Backtab key event always comes as "Shift+Backtab".
So in order for Backtab key to be recognized as a shortcut sequence,
we also consider Backtab without shift modifier a possibility.
Fixes: QTBUG-94890
Change-Id: I20a7b404b57d8df5bea23765257a178f2e098ed0
Pick-to: 6.8
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit 4d9f99c4ea70cdae58c80e1bfdbabefe3abb455f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Handle traits should be simple, and not require exceptions. Note that
we should not make calls to fclose() or close() noexcept, because these
are POSIX cancellation points.
Pick-to: 6.8
Change-Id: I8bbf573b1346eafd52c6080dbb024f8b3bc89359
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit a80d1bf2716b1ba404799d6a09003b145b73b079)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The message displayed to the user says they need "at least Visual Studio
2019", but in reality the minimum is now 2022.
Amends 9a409295c7cfe74b4fb6b1892f4ff86d4f3c23f3
Pick-to: 6.8
Change-Id: Idaedd72d114b994fddd2ba7574fb7a45ca0a3e85
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 652250295c7f9812b49c522ab2fbe518ac9690e4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
When installing a top-level build using the DESTDIR env var mechanism,
the SBOM generation process could not find the qtbase sbom document,
while generating the qtshadertools document.
Make sure to prepend the DESTDIR env var to the install-time install
prefix, when looking for external SBOM documents.
Pick-to: 6.8
Fixes: QTBUG-132188
Change-Id: I1cdb75842fc552b43d982f05444b5ddc1fe58595
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit f2ce68d8f31f4c90471183d66075bd6fd5955d6a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Commit 6ebe3d0f0806069f906522dfe9b81baa3f3478de introduced extra
SFINAE checks on the template conditions.
However, it broke the case of using callables with deduced return
type, because SFINAE does not work for such conditions and treated
as a hard error instead.
Fix by explicitly providing all template parameters, so that compiler
could figure a better overload on its own.
Only QtConcurrent::blockingMapped() seems to be affected, but add
unit-tests to check all other methods as well.
Fixes: QTBUG-130766
Pick-to: 6.8 6.5
Change-Id: I1ddbe712d8ce04ac96ba13841cb569d728cfb943
Reviewed-by: Tatiana Borisova <tatiana.borisova@qt.io>
(cherry picked from commit f73765682e7c8f1e0e78b7464deec57c7f2669ba)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Calling reset() with the owned handle should maintain ownership and not
leak resources. Move assignment should also handle self-assignment
without leaks. The new tests verifies that this holds true.
Task-number: QTBUG-132507
Pick-to: 6.8
Change-Id: Icdfa4d67b06b71a74e810593e57449b51982c98c
Reviewed-by: Tim Blechmann <tim.blechmann@qt.io>
(cherry picked from commit 03bd9491491881529ad28cd6d672edfdda9a0065)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
qopengl.h pulls in headers from the OpenGL framework on macos when
opengl is enabled. We should therefore also link the OpenGL framework.
fixes linker error in libqcocoa:
Undefined symbols for architecture x86_64:
"_glGetIntegerv", referenced from:
QCocoaGLContext::updateSurfaceFormat() in
libqcocoa.a(qcocoaglcontext.mm.o)
"_glGetString", referenced from:
QCocoaGLContext::updateSurfaceFormat() in
libqcocoa.a(qcocoaglcontext.mm.o)
Change-Id: I02d2c80e2652da0cf16eaca7ab161cf711599dc2
Pick-to: 6.8 6.5
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 6f41c1652f73e1d79d6a4a91d009671a1e285b15)
Handle traits should be simple, and not require exceptions. This patch
will allow us to improve the noexcept correctness of QUniqueHandle.
Pick-to: 6.8
Change-Id: I84d92818a2fcea5b98e09c0b7dc08b251751396c
Reviewed-by: Tim Blechmann <tim.blechmann@qt.io>
(cherry picked from commit 3c57c7357422bdfda60f56901a7590b258915b6b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This makes it more clear which 'factor' the function is about.
The function internally calls a pre-existing 'factor()' function,
but since that is a static method of QHighDpiScaling, there the
meaning of 'factor' is more clear from the call context:
QHighDpiScaling::factor(window).
Resulted from API review.
Amends: 5ac4f04325a56d47812f528fe31ceb0d4932f664
Task-number: QTBUG-132090
Change-Id: I869bc05116d334b53b23a46aa2bb788432f250de
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit f9376703c92e957c7334a2ff42a801237f53c8bf)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This can be tested by enabling "Don't keep activities" in the developer
options. With this option Android will immediately destroy the activity
when it is moved to the background. In this case registerBackends will
be called the first time before the BackendRegister was created. Because
m_backendsRegistered was set to true even if it failed, the final call has
no effect. So we need to ensure to set m_backendsRegistered only if a
BackendRegister is available.
Fixes: QTBUG-132085
Pick-to: 6.8
Change-Id: I2ea1c0e0737c982594ceb06cbaf540399c45e3f4
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 9903242ecab82c1ed72dcaf90e90a171c942a84a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This does not change the behavior of release() but gives more
compact code.
Task-number: QTBUG-132507
Pick-to: 6.8
Change-Id: I5b34c80409ca0e9e9a5e9aee9ef7bc80017610af
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit ec0c62385e0df00f42bc9fb5e117cb8b994cfc96)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Starting with Qt 6.8+ we should error out if the minimum sdk / Xcode
version requirements are not met.
An opt out is added for cmake build tests, otherwise all the tests
that use private cmake api will fail to configure when run on older
Xcode or SDK versions in the CI.
We do this by checking for a new QT_INTERNAL_IS_CMAKE_BUILD_TEST
variable.
We do the check inside
_qt_internal_check_apple_sdk_and_xcode_versions
instead of passing
a QT_FORCE_WARN_APPLE_SDK_AND_XCODE_CHECK variable to the test
configuration, because not all cmake build tests use private api, so
this way the list of projects that get the opt out is more
constrained.
Pick-to: 6.8
Task-number: QTBUG-119490
Change-Id: I1284616c91341848a9cf6406fbf35750707d1227
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit a13bfec63df2cf206e354ab56fc017a1f0eb8f6d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Having a defaulted argument to QUniqueHandle::reset() gives a convenient
way of releasing ownership without assigning a new handle, and makes
the QUniqueHandle API more similar to std::unique_ptr.
Task-number: QTBUG-132507
Pick-to: 6.8
Change-Id: I842d4545d7cc2da8fe2df08280d0d816ed4be7fd
Reviewed-by: Tim Blechmann <tim.blechmann@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 248ac4128fe86150532ff7146d0459abb5260946)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Set the <package>_FOUND variable to TRUE by default, so the follow
logic that need to change the flag only need to take care about
setting it to FALSE if something exceptional occurred.
Amends 8d0283ad2cae3d8fbd4b1b7ee5c6454f7fcc079c
Pick-to: 6.8 6.5
Change-Id: Idd4407ea77e81703b5fa8cc5efa8c52b53d401ae
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 13608241793f6671500868c9ce96468f604f651e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The existing lookup mechanism doesn't consider Qt path when looking for
the Qt Tool package dependencies. In good scenario this leads to the
missing Qt Tool package, in worst case scenario the Tool package could
be found by alternative search path and attempt using the invalid
tools.
Use the lookup functionality we have for Qt modules when looking for
dependencies of the Qt tools. This will look the tools in Qt search
paths first and only then attempt looking elsewhere, considering the
QT_HOST_PATH.
Pick-to: 6.8 6.5
Fixes: QTBUG-132340
Change-Id: I570c03037f2a92922d2546a4f5fde1bc17a7f812
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 035fbd068b5a3fbc18b7868ecac9a6a6a2f6602c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
cmd.exe has a huge problem when running the batch scripts locating
by paths contaning spaces and more the one set of quotes in arguments.
This can be worked around by using the 'call' command as the test
command runner.
Fixes: QTBUG-132258
Pick-to: 6.8 6.5
Change-Id: I9b6fb0f8bccf44456e4cb9b79f3c6bd3f9fe4678
Reviewed-by: Even Oscar Andersen <even.oscar.andersen@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 10a3859809fc0b6e1edd6cbb93e409f0513a9bbe)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
It's more efficient (doesn't need to allocate the QSignalSpies on the
heap) and makes the header fit for the upcoming QT_NO_SCOPED_POINTER.
VxWorks seems to have a problem with its std::optional implementation,
though:
QWARN : tst_QAbstractAnimation::stateBinding() Trying to construct an instance of an invalid type, type id: -2125884168
QWARN : tst_QAbstractAnimation::stateBinding() Trying to construct an instance of an invalid type, type id: -2125884172
QWARN : tst_QAbstractAnimation::stateBinding() Trying to construct an instance of an invalid type, type id: -2125884024
Received signal 11 (SIGSEGV), code 2, for address 0x0000000d
So write a small optional-like wrapper around std::unique_ptr for that
platform.
Amends 930e59b798d9e3d08e17440980d33a08fb411cbe.
Pick-to: 6.8 6.5
Task-number: QTBUG-132213
Change-Id: Icf85678d616bc96c7d74b982d0b919ea3f13265a
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit 7bd47fb70881e7240c027cd2844866c99f8f096d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
A typical usage for mapping a 4-point polygon to a rectangle might be
QTransform transform;
bool ok = QTransform::quadToQuad(polygon, polygon->boundingRect(),
transform);
It works because the QPolygonF(QRectF) ctor is implicitly called on
the second argument; but that ctor turns it into a 5-point polygon.
So it should be legal for QTransform functions to work with 5-point
closed paths.
Fixes: QTBUG-21329
Change-Id: Iae249012e14b8a3e8d3b0dfa35da8f9759359832
Pick-to: 6.8 6.5 5.15
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
(cherry picked from commit 48b1af941c50ab28cc92f9ea65a8a74a32eaf2bc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
We updated the minimum CMake version used in CI for Qt 6.9+ to 3.22.
Enforce the minimum CMake version in CI to avoid regressions.
This reverts commit 5803af38aab09b7e47230a494e14654031d024e7.
Task-number: QTBUG-131169
Change-Id: Ifc91644dd26e465be44bfa7cfe6f99e295a174a9
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit dcd057a31b54de637a5ca8bb8a5d46e753d3066a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
When requesting a readback every frame, the readback activeFrameSlot
alternates between 0 and 1. Suppose we are in currentFrame 1, and
process a list of readbacks of slots [1, 0]. First, we skip the readback
of slot 0 since it does not match the currentFrame 1. The list thus
remains [1, 0]. Then, we process the readback of slot 1, and call
activeTextureReadbacks.removeLast(). This removes the readback of slot
0, while in reality we processed the readback of slot 1. The
activeTextureReadbacks is now [1], containing a readback for which we
called vmaDestroyBuffer(), leading to a crash ("double-free" attempt) in
Vulkan on the next function call.
To fix this, remove the readback that is actually processed (index i)
instead of the last one. Since we iterate backwards, indices remain
valid.
Pick-to: 6.8
Change-Id: Idd4296de45167edd0a9da345dcc1c3b6ac71a6d6
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
(cherry picked from commit 73405890b8911dd1a58120665ce63a38281c6ce4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This only affects the !QT_CONFIG(thread) case and requires the rewrite
of the old-style static cleanup() deleter protocol into the modern
operator()() one.
As a drive-by, mark the deleter noexcept, like destructors are
supposed to be.
Pick-to: 6.8
Task-number: QTBUG-132213
Change-Id: I8839865880647d76b77eb9a3f2858067db86234e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 6da1f72311b844b2232da3067ad6e1e24614e67c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QT_NO_CAST_FROM_ASCII is a policy setting, not a strictness
setting. The other components of QT_ENABLE_STRICT_MODE_UP_TO all deal
with clearly undesirable APIs, which QString(const char*) cannot be
said to be.
Keeping it in QT_ENABLE_STRICT_MODE_UP_TO would seriously impede the
use of strict mode in Qt itself (cf. QTBUG-132327).
Amends 3a6c8e02b6d1b0574da52b0087092d0c74aa92c1.
[ChangeLog][QtCore][QT_ENABLE_STRICT_MODE_UP_TO] No longer includes
QT_NO_CAST_FROM_ASCII. If you wish to continue using
QT_NO_CAST_FROM_ASCII, you need to define it in addition to
QT_ENABLE_STRICT_MODE_UP_TO. The reason for this change is that, while
everything else in strict mode should eventually become the default,
we're not proposing to remove the ability to construct a QString from
a const char*. QT_NO_CAST_FROM_BYTEARRAY and QT_NO_CAST_TO_ASCII
remain enabled in strict mode, though.
Task-number: QTBUG-132327
Pick-to: 6.8
Change-Id: I36b850833b1de79a47de975ca28d3591a0a0e089
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit f9163ae7a8167daded0798654d99a2e3a5aaa2b5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Both whenAll() and whenAny() have two overloads:
* an overload taking two input iterators, e.g.
whenAll(IntpuIt begin, InputIt end)
* an overload taking an arbitrary number of future objects, e.g.
whenAll(Futures &&... futures)
The public APIs are properly constrained, but internally they call
QtPrivate::when*Impl() template functions, that have the same two
overloads, but do not have any constraints.
As a result, passing exactly two QFuture<T>{} objects was leading to
the compiler picking the Impl overload that takes a pair of iterators.
Fix it by applying a subset of constraints from the public API to
the private implementation as well.
Amends 102f7d31c469a546f52c930a047bd294fb198186 which was introduced
for Qt 6.3, so picking down to Qt 6.5.
Fixes: QTBUG-131959
Pick-to: 6.8 6.5
Change-Id: Ide29ac9a494d07870e92957c40c1f614e56825f8
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 8aef5b0d8fd57684abe39c88af8c14d8882ef07b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The enum already exists in QJsonDocument, so there is no reason to
introduce a new one in QJsonValue.
Instead, use the fact that we only need to forward-declare QJsonValue
in QJsonDocument's header, include the latter into qjsonvalue.h, and
use a type alias.
For Qt 7, pre-program moving of the enum into QJsonValue and using
an alias in QJsonDocument.
Amends ac73079dee5f0260528a5c217a82cb0beafb0a56.
Found in Qt 6.9 API review.
[ChangeLog][QtCore][Potentially Source-Incompatible Changes] The
QJsonDocument header no longer includes QJsonValue.
The backward-compatible fix is to include all needed headers
explicitly and to not rely on the transitive includes.
Change-Id: I7c5219a239149e4a87d4780c4277d111983ad0f4
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 3cb87d891bb040f73fb68b6c5e7e82518f603c59)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
...and vcpkg usage was requested.
The user got no further feedback why vcpkg wasn't used despite passing
the -vcpkg configure argument.
Pick-to: 6.8
Change-Id: Ib43c2045f093c3887a63406e37f37bdd681341cd
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit fecae6ab1b1aa36f43b5cd87b229de4df37e44ab)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
When a layout is used to arrange the children of a non-top-level
custom widget, the layout's contentsMargins need to be manually set to
zero to avoid extra empty space around the widgets, misaligning it
w.r.t. its siblings.
Add the necessary call.
Amends 2690822428deec4f0c08f4d118d69a7c6036369e, which, however,
inherited the missing margin adjustment from older code.
Pick-to: 6.8
Change-Id: Icd1945a4f2b1635f031e50758ec2f1ec9313ae27
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 15524d1623a1400e4de15e57408e37020d394986)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Examples should show idiomatic use of Qt and C++, so mark the custom
widget constructors in this example as explicit and their destructors
are override.
Amends 2690822428deec4f0c08f4d118d69a7c6036369e, which, however,
inherited the missing explicit from older code.
Pick-to: 6.8
Change-Id: I5b5b49f69330c6f139345bed7264c85a36c36e9b
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit e0e9a5627376e04aba1b2ca2591554851d7de240)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The old code used manual memory mangement (raw new/delete) to
(de)allocate the Ui struct. This is so 80s.
Use an owning smart pointer to manage the memory. Ordinarily, this
would have been QScopedPointer, but seeing as that doesn't have a
create() method to hide the raw new, use std::unique_ptr and
std::make_unique() instead.
Amends 2690822428deec4f0c08f4d118d69a7c6036369e.
Pick-to: 6.8
Change-Id: Icabb9154eb38630855e14094b958af0214516f6b
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 0da2c2c4ef2219967db87021eece2a60b6e207af)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The old code used a grid layout inside the QGroupBox, but the design
with labels in the first and edit-widgets in the second column lends
itself to a QFormLayout, which adapts the alignment of the widgets to
the platform style, so use that.
Amends 2690822428deec4f0c08f4d118d69a7c6036369e, which, however,
inherited all of the above from even older code.
Pick-to: 6.8
Change-Id: I528f0ce9d8cb7a997fbfabcdca887c059f571b38
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 9c099ef942216d01261c26b60e3727a2a467f12a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
- The old code used two QPushButtons in a QHBoxLayout to provide
Ok/Cancel buttons. This hard-codes the positions and text (and
icons) of these buttons, instead of adapting to the platform style.
The new code simply uses QDialogButtonBox, which is designed for
this purpose.
- Also, the old code connected the Ok button's clicked() signal to a
custom slot that then called QDialog::accept(). This means that the
code in the custom slot is not executed when the dialog is accepted
by other means (e.g. return press in one of the line edits
("auto-default"), though I'm not sure here).
The new code uses the idiomatic Qt way of overriding
QDialog::accept() instead, and connects the button-box's accepted()
signal to it. This is done in the .ui file, so it already works in
Designer preview.
- Finally, the old code made a manual connection from the Cancel
button to QDialog::reject().
The new code uses the Qt idiom of connecting in the .ui file
directly, using QDialogButtonBox::rejected() as the signal.
Amends 2690822428deec4f0c08f4d118d69a7c6036369e, which, however,
inherited all of the above from even older code.
Pick-to: 6.8
Change-Id: I83afd6156a0811e0c0f99f2480625ea6b69ff78b
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 3419c299369ac1da94ba5710aaf5f5f65c38c33c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The old code connected to the wrong signal and therefore had to write
a custom slot to perform the disabling of the group-box.
The new code simply connects the QCheckBox::toggled(bool) signal to
the directly-compatible QWidget::setDisabled(bool) slot, removing the
need for a custom slot.
Also move the connection into the .ui file, so it works already when
checking the form in QtDesigner.
Amends 2690822428deec4f0c08f4d118d69a7c6036369e, which, however, only
inherited the issues from older code.
Pick-to: 6.8
Change-Id: Ia834f92de270bb7b18981273188f6e5b6cd457a2
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 53826d1cde26f825d1983476c6697f72130e351f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Because we don't need one. I guess I was just lazy.
Amends b12fd1fa9d0b64e3cb66fa68c85392dbde8e175b ("Long live
qEnvironmentVariable()").
Pick-to: 6.8
Change-Id: I5b9141c5a32f9d784e0bfffdc3e4d742790aebdd
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit ce95c26034cc5b3ae8094c1521221e5b2f13ecfa)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
As pointed out by Thiago the QT_DECLARE_METATYPE calls are redundant, so
remove them.
Task-number: QTBUG-132101
Pick-to: 6.8
Change-Id: I73800e70d3f270fb87941d4e053aa7ac5ed1841c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 3bb4c4949fed9ccf8653151c78d5130b8db00716)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
We can use hashLengthInternal() to check if the buffer is big enough.
This matches what the QCH::hash() method does, it also has an assert
that `result.size() == ba.size()`, so we can assume this works with
OpenSSL's EVP_MD_get_size() in EVP::finalizeUnchecked().
Amends c70c81b371993ca865d523bb5f37eac4eb8a972b.
Pick-to: 6.8
Change-Id: I64935f3d590ab243b361a0b764f011c388820e32
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit b83e825fab16f83f86149ead78efb6ec3d2fa16d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Wrap them in QVERIFY(), as usual.
Found by QFile::open()-turned-nodiscard-come-6.10.
Amends e673e5a257569eaa816c6acd31dd754efd9f8c75 and
25c96d547b4563cbfedcec6093d68116148d8599.
Pick-to: 6.8
Change-Id: Id39e5d9e500b524af8443cb57916a12f98bd7c23
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit cf6ae9a90106a3557a8df1e0d2567b02a4ef6ded)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The tests peek into QEventLoopPrivate, which means that a UBSan build
needs access to QEventLoopPrivate's type_info, for which we need to
export the class.
Amends 3af20bd8eb8c75017c5d6d138d7c42914ee5bee3, which fixed the weak
vtable that, presumably, made this test work before.
Pick-to: 6.8
Change-Id: I4104ba95093fa240c5ef7d9d5bf287c1652333f0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 8bf54385319df958ea88f9998e7690d4c35e354d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This patch series is in preparation of enabling QT_NO_SCOPED_POINTER
when building QtCore, a prerequisite for enabling this opt-out in leaf
modules.
This first part of the patch series ports objects whose use cannot
"leak" into other modules, e.g. because they are in .cpp files or are
private members and is thus SC (and, as demonstrated by various static
assertions we put into the source code over the years, BC).
The second patch will deal with objects in protected and public APIs,
and thus might be QUIP-6 SiC Type A.
Task-number: QTBUG-132213
Change-Id: If4967f6e563a4e7d74550fad4c6d354fad1beef5
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit 63f1c6fcbab5f36809ffc96ac5ff6cb9e01e70bb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The local appDir variable was only used to hold the return value of
another function call. But hardly any compiler will be able to look
through the QString atomic ref-counting to turn the non-Darwin code
paths into the tail-calls that they ought to be.
Remove the variable and return the result immediately. This removes
the move-assignment and dtor calls in the two changed lines and lets
RVO kick in, turning these calls into tail-calls on non-Darwin
platforms.
Amends 4ac872639ed0dd3ae6627e05bdda821f7d128500.
Pick-to: 6.8 6.5
Change-Id: Ieeefbd52fc983ab7aebcff6419965b206f374935
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit e57113feac183abd1f5bfcfb633a33e1387b2d3e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Add crash handling to avoid waiting until 10min timeout on each crash.
Force restart on each crash by killing emulator.
Make health check more robust to allow it to work even when emulator is
down. This is done via wait in separate process which cannot be done
with normal timeout command, as input to pipe that is not being read
by emulator will block forever.
Change-Id: I86c3c86f936cc96d57b38983da48d1d73162399d
Reviewed-by: Simo Fält <simo.falt@qt.io>
(cherry picked from commit 918cbe7601b07fa6db7973ff9a4f76208dae8f22)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The backend-provided DRM device might not be the right one,
so allow kms config to override it.
Pick-to: 6.8
Task-number: QTBUG-131887
Change-Id: Ied744ae7015eae64f4556f1528e0dbe8ae69d206
Reviewed-by: Pasi Petäjäjärvi <pasi.petajajarvi@qt.io>
(cherry picked from commit c3bbbb22b8bc920e4937cf640fd1d2df3b0f9205)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
With those tests split, tst_QCryptographicHash takes about 4ms.
When FEATURE_openssl_hash is enabled those tests take about 15s on
their own, but when openssl_hash is disabled they take about 2 minutes.
That makes running the tests locally a bit of a hassle when hacking
code ... test ... hack ... test.
This is with a debug build, GCC, `-O0 -g` flags.
Change-Id: I8b8f5d1954feb1f9eb8115e27635610a41b42f47
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit fff217824b532da7306af1ac755581e76e098a27)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QCommandLinkButton was using QIcon::pixmap() without specifying the
current device pixel ratio. Switch to QIcon::paint() to not have to
fiddle around with the dpr at all here.
As a drive-by remove a useless QPainter::save/restore call.
Pick-to: 6.8
Change-Id: I7e2492a09b28cb8a4f4cc60454733e0054fe1e9b
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 785fb89e0aafc25a435d28ff05bf0dc05385b372)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This could cause conflicts with other users of these algorithms, notably
libb2 itself. Though if you're using libb2, you shouldn't be using the
un-optimized copy inside QtCore...
I've updated the SHA1 of the last commit in the repository, but there
were no changes to our sources.
[ChangeLog][Third-Party Code] Fixed a bug that caused the BLAKE2 symbols
to be visible from QtCore in a static build. If you need to use the
BLAKE2 hashing algorithm in your own code, either use QCryptographicHash
or import libb2 into your build environment. Using libb2 remains the
recommended solution for all systems, especially those for which it has
optimized (vectorized) implementations.
Fixes: QTBUG-132347
Pick-to: 6.8
Change-Id: I48003b58cef0d8bcc720fffdd89b0f151fd102e3
Reviewed-by: Linus Jahn <lnj@kaidan.im>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit b884fbf10237547e809745f528978942faf0e5f6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
It's safer and clearer.
Also standardize on unique_ptr instead of QScopedPointer, because the
latter is not supposed to be movable, so the assignment in
QLibrarySettings::load() would not compile.
As a drive-by, scope a variable tighter (in an if condition).
Task-number: QTBUG-132213
Pick-to: 6.8
Change-Id: Iecdd910af4d06dbd03d2daf3ccf99dd4822f04ac
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit aa1f2064801b39a26a718703817e197a3e31447e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The previous patch to not modify the CT_SpinBox by QStyleSheet when
nothing was added for QStylesheet also removed the additional margins &
paddings handling for the size calculation. This patch re-adds this.
This amends 96adebed606cdbc73c73778917d777dc04c6e93e.
Pick-to: 6.8
Task-number: QTBUG-130642
Fixes: QTBUG-132431
Change-Id: Iff1f0febeca90d3154e61fd80e4b359bc7766b84
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit b2cc8824ec2cdeb6e053a2ff92d7d5b71f8d0ee5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Different styles provide different icons for SP_CommandLink so reload
the icon on every style change.
Pick-to: 6.8
Change-Id: I2d8bd706d4c1bca89b91c90f1bb90a796b38e0d3
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit d4c518b210ad56cb51c17e6e1b4a81b0deb7253c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
And definitely not by non-const reference.
Discovered during upcoming fixes for native function registration.
Task-number: QTBUG-132410
Pick-to: 6.8
Change-Id: I0ce8519f5a1f9f3caffefc53e6d93b52509bc439
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 1b84970b90c36771bf266f8612dba9585341795a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This is more robust and lessens the impedance mismatch as seen by the
old code using std::unique_ptr<char[]>(expr).get().
The new code isn't impedance-mismatch-free, either
(UP{qstrdup(qba.data())}), but short of writing a small string class
whose internal buffer can be release()ed to comply with the archaic
QTest::toString() new[]'ed const char* return value, there's not much
we can do about it atm.
Also separate the internal from the "public" stuff in
QCborValueFormatter by adding private: and public: sections.
Pick-to: 6.8
Change-Id: I09a2ad1a75bb9eab3d01f2b5b60afc2d762da384
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit d9264ee65d6f24e1008b08494b1472a54ac01940)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
It was used by the QT_TERMINATE_ON_EXCEPTION macro, introduced in 2012,
to support pre-C++11 noexcept semantics. That macro was removed for Qt
6.8 in commit 9b2ae564a59656d9cf49b141e70f5958b4fb79a4. This commit
amends that removing the definition of qTerminate() immediately in Qt
6.9 (it was an \internal function).
Change-Id: I9682121c04fafb3676b0fffd9f5ac999e7603c84
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit b8f84fd1e2af38ece89d60619bf93e7af34433ab)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QSaveFile records past write errors in writeData(), but often the
QFileDevice::writeData() calls it places will succeed because the data
is only being buffered. Instead, the failures are noticed only by
flush(), whose actions do not affect QSaveFilePrivate::writeError.
[ChangeLog][QtCore][QSaveFile] Fixed a bug that caused commit() to
return true and overwrite its intended target file even though it failed
to flush buffered data to the storage, which could cause data loss. This
issue can be worked around by calling flush() first and only calling
commit() if that returns success.
[ChangeLog][QtCore][QSaveFile] Fixed a bug that caused commit() to
return true even after a cancelWriting() call had been placed, if
writing directly to the target file (that is, only with
setDirectWriteFallback() set to true). Note that the state of the file
does not change under those conditions, only the value returned by the
function.
Drive-by clarify a comment from 6bf1674f1e51fd8b08783035cda7493ecd63b44
(Qt 4.6 "Don't drop errors from flush on QFile::close") which had me
chasing the wrong lead.
Fixes: QTBUG-132332
Pick-to: 6.8 6.5 5.15
Change-Id: I427df6fd02132d02be91fffd175579c35b9c06cc
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
(cherry picked from commit 92373d353cf090faa03cbc8aca505d1784b10b54)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Commit e176dd78fd2f253eb2625585b2bd90b5713e5984 replaced a `new
char[n]` with a std::make_unique<char[]>(n), probably on this author's
insistence.
But the two are not equivalent: make_unique() value-initializes, even
arrays, even of built-in type, which means that each buffer resize
writes each byte twice: first nulling out the whole buffer as part of
value-initialization, then in the memcpy() and any following read()s.
For buffers of several MiB, or even GiB in size, this is very costly.
Fix by adding and using a backport of C++20
make_unique_for_overwrite(), which performs the equivalent of the old
code (ie. default-, not value-initialization).
Also add q20::is_(un)bounded_array, which are needed for the
implementation of q20::make_unique_for_overwrite().
Amends e176dd78fd2f253eb2625585b2bd90b5713e5984.
Pick-to: 6.8 6.5
Change-Id: I8865c7369e522ec475df122e3d00d6aba3b24561
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 1a9f8cc0df33195df959cee2e355dde4cbacd754)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
It does.
While std::span, does, too, and so users should be using
std::as_const(), it's quite simple to avoid for QSpan, so we'll fix it
in QSpan. This patch adds the reproducer.
Task-number: QTBUG-132133
Pick-to: 6.8
Change-Id: I2e416fb7344830cd5e0d945cce61491cd6f4a7a5
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 05b9a4b2deefd586356e1f36d84372b06e74cfe3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Since `QT_QPA_PLATFORM_PLUGIN_PATH` or `-platformpluginpath`
specifies the path to platform plugins, `extraSearchPath`
should be loaded first.
Pick-to: 6.8
Change-Id: I2e62fbf2021250ca864c669a7bbd7d56acd67d1e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 457580936ddebc73e8a24fc8af0d342084b3a0b5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
GCC 9 doesn't accept [[unlikely]] between the (condition) and the
compound-statement of an if, in both C++17 and C++20 modes:
qdecompresshelper.cpp: In member function ‘qsizetype QDecompressHelper::readZLib(char*, qsizetype)’:
qcompilerdetection.h:1048:31: error: attributes at the beginning of statement are ignored [-Werror=attributes]
1048 | # define Q_UNLIKELY_BRANCH [[unlikely]]
| ^~~~~~~~~~~~
qdecompresshelper.cpp:597:54: note: in expansion of macro ‘Q_UNLIKELY_BRANCH’
597 | if (ret == Z_DATA_ERROR && !triedRawDeflate) Q_UNLIKELY_BRANCH {
| ^~~~~~~~~~~~~~~~~
See also https://stackoverflow.com/questions/51797959/how-to-use-c20s-likely-unlikely-attribute-in-if-else-statement
Put it into the compound-statement instead, then GCC 9 accepts it. The
two are equivalent, because [[likely]] marks a path, and there is no
selection statement between the two positions.
Amends 5ae84d0afbd3690a2c003d06d920566a5d56dc8c.
Change-Id: Iac1970219c98a1c26e450dfe6bad6583e4d32c29
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 7a7804d4b454021d68d1d5138d134ef62abfcdb3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
We don't like surprises in qNN, so use the real is_scoped_enum_v from
std instead of adding the _v version outselves, even in C++20.
Amends 03a7be37806a32e9a8ac963b309812d6b8f125f6 and
63a8f657c2236829f16016602d9c0098b089d35e.
Change-Id: I7f9149678b95f7a59643152abf5a627e226cc058
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 40501ffbb441ce48733b3733b7ab781c7db8cca8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Replace the internal PainterStateGuard class with the now public
QPainterStateGuard.
Change-Id: I9c072ce6e45ddfe2d0a8aba789311193788dee5a
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 204df603ef43be921e0eecae4d4af0ae6026787f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Replace the internal QPainterStateSaver class with the now public
QPainterStateGuard.
Change-Id: I56285cb469cec43071320e87ac378674fd99c06b
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 7690b6260eac12958c97d642421e27680ca57496)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Reduce the size of the subline for QLineEdit to fit the begin and end of
the rounded frame corner.
Task-number: QTBUG-132261
Pick-to: 6.8
Change-Id: I879f30c2bdc6601fef4738aeec71d7ab7bcee22c
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
(cherry picked from commit 5e656b9ea3c192f389b7e4f7aa2ae6b010cec306)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The content rects for QSpinBoxes were smaller than QLineEdits rects for
UI elements that should have the same size. This patch increases the
content rect for QSpinBoxes.
Task-number: QTBUG-132261
Pick-to: 6.8
Change-Id: I59e752b719399c5845ab3ef81c6e271deda16273
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
(cherry picked from commit a53e095882551caf3684a1f6a205b6c7d76a8913)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The plugin lookup mechanism doesn't handle the situation, when the
plugin is available but it's private dependency(static plugin case)
is missing. In this case we currently silently bypass the dependency
lookup and create targets. So users see the confusing message about
missing linked target, like:
Qt6QSQLiteDriverPluginTargets.cmake:61 (set_target_properties):
The link interface of target "Qt6::QSQLiteDriverPlugin" contains:
SQLite::SQLite3
but the target was not found. Possible reasons include:
* There is a typo in the target name.
* A find_package call is missing for an IMPORTED target.
* An ALIAS target is missing.
This indeed should be handled properly and we should omit creating
targets especially if users don't really use the plugin directly.
Also if dependencies are not satisfied it looks logically to set
the <plugin>_FOUND to false as this will be yet another indicator
for user that the plugin is not found.
Task-number: QTBUG-132244
Pick-to: 6.8 6.5
Change-Id: I8685163df0dee3a728c724901f69780569ffcad5
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 8d0283ad2cae3d8fbd4b1b7ee5c6454f7fcc079c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
When calculating the maximum width of a text layout, we
would add the text width of each substring *after* we had
added the negative right bearing of the last character to it.
But the bearing of the last character in a wrapped substring
does not actually add to the maximum width unless it is the
last character of the *whole* string.
Prior to 250117086ff15bba79df8f0e15ee66192edc9ea9 this was
not noticed, because the last glyph in the substring would
typically be a space and the space does not have any
bearings (when doing wrapping on individual characters it
could still happen). After the change, the previous glyph
for which we get the right bearing will be the last
non-whitespace glyph. If this happened to have a negative
right bearing, we would add this to the max width and
end up with a larger max width than we should.
This caused a test failure in tst_qquicktext.
This test prefers the text width without the bearing (i.e.
the *advance* of the substring) unless the line is manually
wrapped or it is the last line of the layout.
Pick-to: 6.8
Change-Id: Iba1a5ad48d575683672400f0572dfa683a0f2d9c
Reviewed-by: Lars Knoll <lars@knoll.priv.no>
(cherry picked from commit c08a92307d6d9fa9d9d9a1f301e3f2a65374e99a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
When requesting symbol icons the OS automatically chooses a rendering
mode per icon. Most icons use the monochrome rendering mode by default,
but some of them use the hierarchical.
We don't want to override this choice by always using hierarchical,
as that doesn't match the look of most icons in the system and may
be surprising to the user.
We still want to support tinted icons, based on the QPalette. For
iOS this is easy via [UIImage withTintColor:] but for macOS we
have to do an extra render pass. Unfortunately we can't use
configurationWithPaletteColors with a single color, as for the
hierarchical icons this will produce a different looking icon
than if we tint the entire icon.
[ChangeLog][macOS/iOS] The Apple icon engine, used for theme
icons on macOS and iOS, will now use the default rendering
mode for icons, typically monochrome, instead of always
using hierarchical icons.
Pick-to: 6.8
Change-Id: I9e66d848222e8ed0f7f20897454f27446bf0fd81
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 9f392c09a1d30e48494b4df0e2f5f531c7e4ec4b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Is needed when sending more SETTINGS frames during the test later
Task-number: QTBUG-132277
Pick-to: 6.8
Change-Id: I24b2a5d1b2e7aecd8687db5b24f37233df3b91dd
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit 6e7a15f5c50a94216bcf35241ec008e6c419ba18)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Increases to around 16MB with the format change.
Required by some tests.
Change-Id: Ia41436b4269220f84271b614ea6f2b96ca605c32
Reviewed-by: Simo Fält <simo.falt@qt.io>
(cherry picked from commit 75d87caef70ff79b4db04834d28daa1905f0d5a0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The deprecations aren't urgent, and allowing more time for users to
adapt is appropriate. In addition, also suppress the deprecation
warnings when compiling the related autotest.
Resulted from API-review.
Amends: 577946c1f05aaaa2a3f9682001aeb4144386b26b
Task-number: QTBUG-132090
Change-Id: Ia0c07ab510a9a9c8722892fcd94f58f6ec287059
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 0aa07ce77237dacc58de5939d5a239fb8997da7a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The y position for the MDI subwindow icon was not calculated correctly
so the icon was not painted vertically centered.
Pick-to: 6.8
Task-number: QTBUG-130673
Change-Id: I5f9023820a4e4b4288017869ac4088fe2669ce50
Reviewed-by: Wladimir Leuschner <wladimir.leuschner@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 6e29a94b547fbafa69e97ac02aeb33edad63f2ae)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
... instead of QScopedArrayPointer.
Less Qt code (which we're supposed to test with this library) and more
consistent with the tuple implementation.
Also makes the header clean w.r.t. upcoming QT_NO_SCOPED_POINTER.
Pick-to: 6.8
Task-number: QTBUG-132213
Change-Id: I3705b8db89e909e3f1e37ad6a31aaba6f9af899a
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit f405925829ca37af47ecbb291bdb8a95a606e024)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The adjustment for the textrect was wrong - the bottomRight point must
be moved by -1/-1, not 1/1.
Pick-to: 6.8
Task-number: QTBUG-130673
Change-Id: I6c099fdd9a03188e7a5c7852b1912ed9b2801f7a
Reviewed-by: Wladimir Leuschner <wladimir.leuschner@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 2c85e5d22215f24bd46d07a1183393e52702493f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Fix the style and use PainterStateGuard instead own save/restore
functionality because PainterStateGuard is already available and used in
those functions.
Pick-to: 6.8
Task-number: QTBUG-132187
Change-Id: Ie454b6cffe03444d88f13d15adb19a7e7783a493
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 1fb86f1f84bb56dab60bc15604c09a14157d6f10)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The lcQtGuiTest category is only used in qtestsupport_gui.cpp, so
declare it there as a static logging category.
Addresses header-review comment, amends
5ac4f04325a56d47812f528fe31ceb0d4932f664.
Task-number: QTBUG-132090
Change-Id: I5b2a93822a698f55c52c1be87ebf8a689f49e2a3
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
(cherry picked from commit b957dfc6e06deed64e20e8eee5d2164250b28b95)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
So they be SFINAE-ruled out when either the key or (for associative
containers) value types don't provide their debug-streaming operators
either.
Amends 850d4895be565931d18c92e5e2f9a33b7f26de6d,
0c96528e8d43ad4309bdca14b179a5045984655a,
a9fe57fefaac0cb047e4c02e0b8c8f8327e0a58c.
Fixes: QTBUG-132104
Task-number: QTBUG-130290
Change-Id: I1d6703b1fdf6cfd03799fffd33191d8028ecc123
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 8f958a6e2dcff5bb9b01442a19f5605f357c6e7e)
This function re-executes the query used by QSqlQueryModel and refreshes
the data from the database. The query must not use bound values as these
values are not preserved.
[ChangeLog][QtSql][QSqlQueryModel] Added refresh() to refresh the model
data from the database.
Task-number: QTBUG-123603
Change-Id: I3f1d779e07b88565abe825c31cfc4d7d1b2312c4
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 1bd883dbc15c4016f78d421afac2ac9f31ec4874)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
A QSqlDriver instance is directly bound to a QSqlDatabase object. But
there was no way to get the QSqlDatabase out of a QSqlQuery/QSqlDriver.
Fix it by storing the connection name also in the driver during
creation and add a getter for it.
[ChangeLog][QtSql][QSqlDriver] Added connectionName() which returns the
connection name of the associated QSqlDatabase instance.
Task-number: QTBUG-123603
Change-Id: If78b85413cf6ca965ff6bf9f3600cb54169b5569
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 5b07e3de3fe5335d9338c65ca40cfe656a389167)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
When we're calculating the width of the layout, we include the
right bearing of the last character in the text line if it is
negative (i.e. it exceeds the advance width). We do this by
storing the last glyph that has been verified to fit in the
line, so that we can retrieve its right bearing when we find
a break.
However, when we were wrapping on spaces this previous glyph
would always be a space, and the right bearing would
subsequently be 0. But then the trailing spaces would be
trimmed and the right bearing of the actual last glyph
would not be recorded and never added to the text width.
This caused a failure in tst_qquicktext on Windows with both
DirectWrite and Freetype: This was purely unlucky, because
the metrics of the Tahoma font happened to be such that the
right bearing on the 'k' was enough to cause a line to
overflow. Since we didn't account for it when setting the
width, we ended up with unexpected line breaks, causing the
test to fail.
This did not happen with GDI, since it rounded the right
bearing of the character down to 0 (which was actually
visible in the layout, in that the k was painted a fraction
of a pixel outside the text layout's width).
In addition, QTBUG-130313 was causing us to pick a different
font when resolving the non-existent font requested by the test,
so therefore the bug was not found immediately when moving to
DirectWrite as the default but only when QTBUG-130313 was fixed.
We fix this by
1. When adding a chunk of whitespace, we record the previous
non-whitespace glyph that has been verified to fit.
2. When adding a chunk of non-whitespace, we only record the
previous glyph verified to fit *if* it is not whitespace.
Otherwise we keep whatever we recorded before adding the
spaces.
Pick-to: 6.8
Fixes: QTBUG-132075
Change-Id: I8d9a2f3197068f5f93520d217a6bb89633644e95
Reviewed-by: Lars Knoll <lars@knoll.priv.no>
(cherry picked from commit 250117086ff15bba79df8f0e15ee66192edc9ea9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
A common source of issues is that people do not consider that
fonts can have fractional metrics and use QFontMetrics for UI
purposes, causing bounds and eliding to be inaccurate.
This is not very surprising, since the class name sounds very
much like what you should prefer by default and the docs
didn't even contain links to the QFontMetricsF class.
It might make sense to deprecate the class, since it really
does not serve any useful purpose, but for now we at least
document the issue up-front so that users can easily find
the alternative.
Pick-to: 6.8 6.5
Task-number: QTBUG-132102
Change-Id: I69756c561e5dee448a9d0a7d85af1a9b15ff1ae3
Reviewed-by: Nodir Temirkhodjaev <nodir.temir@gmail.com>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 9a6036dea2cfe0cec555a503445aed93fed3d985)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Refreshing the global theme may be expensive for large scale applications, and even if Windows sent corresponding message,
it may be triggered by many reasons, not just the system theme,
so no matter what we'd better add an extra check.
Change-Id: I70847aa54fb4af37c81855a62330a4bce31ff104
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit 9b924a4907a4a2b27ee52e807fd419caf219f655)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Use structs derived from std::false_type and std::true_type instead
of boolean constants. This allows us to make use of std::conjunction_v
and std::disjunciton_v in the conditions, thus making use of
short-circuit evaluation and saving unnecessary template
instantiations.
Still keep the constexpr bool *_v constant for the cases when we need
a signle check only.
Amends 678e9f614bc5a05d2ff16cf916397998e7cdfca1.
Pick-to: 6.8
Change-Id: If2ab48ef910e97f241f5922d4108a271bc532f3a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 8784ea16a6bc66ac481d5cbf2dd1ece2d57a836b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QCocoaScreen uses removed APIs, which cause the code no fail compilation
with CMAKE_OSX_DEPLOYMENT_TARGET=15.0.
Adding a compile-time check to detect this early.
Task-number: QTBUG-128900
Pick-to: 6.8 6.5
Change-Id: I7eeb60f5769af6b1622efd1e0637e85a038b7930
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit b6f3695a80f5abfbcfb0ebb5b03358b8e7bbbaf9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The new \tm command appends a trademark symbol and links to the
trademark documentation page if `navigation.trademarkspage` variable
is set. As we have such a page in qtdoc repository, set the variable
in the global configuration. This works as all Qt module docs have a
dependency to the `qtdoc` documentation set.
Pick-to: 6.8
Task-number: QTBUG-124393
Change-Id: Iabc6e7e5afe5114eac79947f0feb512458f1c4da
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
(cherry picked from commit 429f565017f7213a91eb0cf43966b2148e0bb651)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
There's no real reason not to be able to move a state guard.
Since a moved-from QPainterStateGuard must not have a restore-
level count, we have to implement the move-constructor explicily.
Add a test case, which verifies that we don't end up with an
un-balanced save/restore count, and that verifies that we would
trigger the Q_ASSERT if we do.
Address comment from header review,
amends 9ecf47a8a8d11227ecf192246d7df7c2c4dc9105.
Task-number: QTBUG-132090
Change-Id: I1db135bf48c0fa0a7bac4fdae7b7263c356b5eb6
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
(cherry picked from commit ec3a5f4994a2bafc65fa8e01fb0861219580f622)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
We were mostly ignoring them because it looks like most people's options
were longer than their positional arguments. The rest must have just
accepted the enforced wrapping.
But if you have very short options like single-letter only ones or none
at all, the positional argument wrapping is unnecessarily short.
[ChangeLog][QtCore][QCommandLineParser] Made it so the positional
argument descriptions are taken into account in the aligning of text for
helpText().
Pick-to: 6.8
Fixes: QTBUG-131716
Change-Id: Ib1eee62c7cf4462f6a26fffdec233ba849ebf158
Reviewed-by: David Faure <david.faure@kdab.com>
(cherry picked from commit 8928b0fbb9ca4caf9b63a32b3d2a73a6da096755)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
It only contains qdoc blocks and wasn't even listed in SOURCES.
Also changed the license to be in line with QUIP-18.
Pick-to: 6.8 6.5
Change-Id: I2c90300ddfd47c3f693dc84cb86f326fa185dd84
Reviewed-by: Lucie Gerard <lucie.gerard@qt.io>
(cherry picked from commit 1cdf813e221b5aa133bc85cb928e329ef1dea896)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
[ChangeLog][CMake] Private Qt modules have been split off into separate
Qt6FooPrivate CMake config packages. A call to find_package(Qt6Foo) will
now implicitly find_package(Qt6FooPrivate). It's not an error if
Qt6FooPrivate isn't available as it may be the case on certain Linux
distros that split their Qt module packages into private and public
parts.
For every public module Qt6Foo that has an associated Qt6FooPrivate
module, create a separate Qt6FooPrivate CMake config package.
Let Qt6FooPrivate find Qt6Foo. This is a required dependency.
Let Qt6Foo find Qt6FooPrivate if it's available. A message of log level
VERBOSE is issued if Qt6FooPrivate is not found.
Implementation notes: In QtModuleConfig.cmake.in, we pull in the private
module. This is not part of the *Dependencies.cmake file, because
1. The Qt6FooPrivate package references the Qt6::Foo target, therefore
it must be available. And Qt6FooDependencies.cmake is loaded before
creating targets.
2. The dependency needs to be optional, and we don't have facilities for
optional dependencies in Qt6FooDependencies yet.
3. We'd have to avoid recursion, because of the Qt6FooPrivate -> Qt6Foo
dependency.
Fixes: QTBUG-87776
Change-Id: I8f23f07da7ca76486f87b759e197174c11e13534
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit fbbf4ace0188b9718b6d7808021c0b887fd52d9f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This auto-computes the string's length without a NUL-byte scan, and
also fixes a GCC 14 unity-build C++23 warning:
In function ‘constexpr qsizetype QtPrivate::lengthHelperPointer(const Char*) [with Char = char]’,
inlined from ‘constexpr qsizetype QtPrivate::lengthHelperPointer(const Char*) [with Char = char]’ at qbytearrayview.h:69:28,
inlined from ‘constexpr QLatin1String::QLatin1String(const char*)’ at qlatin1stringview.h:52:62,
inlined from ‘constexpr QLatin1StringView contextString(QXmlStreamReaderPrivate::XmlContext)’ at qxmlstream.cpp:814:90,
inlined from ‘void QXmlStreamReaderPrivate::checkToken()’ at qxmlstream.cpp:4018:85:
qbytearrayview.h:77:16: warning: ‘strlen’ argument missing terminating nul [-Wstringop-overread]
77 | while (data[i] != Char(0))
| ~~~~^
In file included from unity_0_cxx.cxx:412:
qxmlstream.cpp: In member function ‘void QXmlStreamReaderPrivate::checkToken()’:
qxmlstream.cpp:769:23: note: referenced argument declared here
769 | static constexpr auto QXmlStreamReader_XmlContextString = qOffsetStringArray(
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Amends c4301be7d5f94852e1b17f2c2989d5ca807855d4, which was picked to
5.15, but didn't use QOffsetStringArray there (and unity-builds exist
only since 6.5), so only picking to 6.5.
Pick-to: 6.8 6.5
Change-Id: Ib50369aed6e8248fb88f43c7569c8a435c2b152e
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 44366d07dca047f096d1366c43ba549c97150074)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Since some of the Qt opt-outs are defined project-wide by the
buildsystem these days (e.g. QT_NO_QSNPRINF, ...), a module that
attempts to use QT_ENABLE_STRICT_MODE_UP_TO will hit warnings
regarding re-definition of these macros (definition on the compiler
command line, redefinition by qtconfigmacros.h).
To fix, guard the #define QT_NO_FOO's with #ifndef QT_NO_FOO.
Amends bd7d54249e3f2b6a9dd6b759c892d7c97d26c0aa (which was also picked
to 6.8).
Pick-to: 6.8
Change-Id: I88276c9ed01edde1495105cf5bd1e07b1fd244f4
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 752de4a0aabc305af16251a55edf247e043b1b18)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Since some of the Qt opt-outs are defined project-wide by the
buildsystem these days (e.g. QT_NO_FOREACH, QT_NO_JAVA_STYLE_ITERATOR,
...), a module that attempts to use QT_ENABLE_STRICT_MODE_UP_TO will
hit warnings regarding re-definition of these macros (definition on
the compiler command line, redefinition by qtconfigmacros.h).
To fix, guard the #define QT_NO_FOO's with #ifndef QT_NO_FOO.
Amends 3a6c8e02b6d1b0574da52b0087092d0c74aa92c1.
Pick-to: 6.8
Change-Id: I457457d1e60dbd9362b987157ba089adc67d1d6b
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 0f416cbaaba46ddb039bbf33e1d70dbe80821d57)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
In preparation of adding QT_NO_SCOPED_PONTER, which would be rather
pointless for users if public headers continued to mention the type.
Pick-to: 6.8
Task-number: QTBUG-132213
Change-Id: I6539e83158ab34e4fa4bd22b6d0ac5629a3b6db9
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit b815c6f7fd71086c97fe6e9aa9472154be5fcc57)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Passing an invalid index gives an assertion in debug mode and crashes in
release mode due to an out-of-bounds access. Fix it by appending the
given widget (same as passing a negative index which is documented).
Pick-to: 6.8 6.5 6.2
Fixes: QTBUG-130275
Change-Id: Id0c245e185acc36e5d07cea1d22619bb0e9eee07
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit 0f9062ec71021c256dba7ee8498f036d7aac0821)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The arrows for horizontal scrollbars must be swapped in rtl mode.
Pick-to: 6.8
Change-Id: I517fcea19837a6438edc261e066930218b71ce28
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 02920ef05a980d9bb670e1f8a4b84e0b6cef13c1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Because they would break communication (or loop infinitely) otherwise
since we use the presence of bytes in the returned buffer to know if
there is still something we need to transmit.
Amends 4e60a6b556d91ab797aebb7422666a685a726755
Change-Id: If72c1a142d4567f69d78177250b0218c5ca999fd
Reviewed-by: Even Oscar Andersen <even.oscar.andersen@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit 1efcc0df6adab11e7239f5f12a13766a58e2c1ea)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The example configuration included a space character that caused a
syntax error parsing the .qdocconf.
Replace the hardcoded qhp `QtDoc` project name with a placeholder.
Pick-to: 6.8
Change-Id: Iadf3a50e030f02182016ed9832f4f59d29f82c57
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
(cherry picked from commit 4051ec3356bded10cd7ac66dc1149259bc48d36b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Both widgets and Qt Quick Controls are unable to avoid accepting the
right-click events (press and/or release) in at least some cases.
In the Windows UI pattern of allowing the user to select something by
pressing (and maybe dragging) with the right button and then getting
a QContextMenuEvent afterwards, it's sensible for the code that does
the selection to accept the mouse events, because that code is only
concerned with selection, not the context menu. And in Controls,
Pane is accepting all mouse events just to prevent propagation to
other controls underneath. (That might not be so great, but we don't
have a better way yet.) In legacy Qt Quick, accepting the event results
in an exclusive grab; so in fact, Pane gets the grab, so we can't use
that either, as a way to distinguish "stop propagation" from "this item
is handling it completely, nothing more needs to be done". So it
doesn't make sense for QWindowPrivate::maybeSynthesizeContextMenuEvent
to check the grabber either.
Amends 357c64a99607456133bfabf86d6b67162717cb29 and
84a5f50c7766c99f62b22bb4388137e0aa8dd13d
Task-number: QTBUG-67331
Task-number: QTBUG-93486
Task-number: QTBUG-132066
Fixes: QTBUG-132073
Change-Id: I822cada05cfef27afe6a44faf170585f027061f7
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 70c61b12efe9d1faf24063b63cf5a69414d45cea)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This is a Qt dependency that the user cannot influence.
We did this in cfefce57a4ff446305cd1f839e7c5203bac7a6c5
with "GradleDependency" before. It is a Qt dependency
that the user cannot influence.
Pick-to: 6.8 6.5
Change-Id: I01ef84eab7ab743d5ea9eb15208ef9c567dd2a43
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit ab2a0438ef8b6cc2c73ab0f33d353d00c6599cd9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Clean up the dead code according to TODO statement.
Pick-to: 6.8
Change-Id: I9bdf10067d3a1324d584cebc51cf4555f00f717a
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 64435289027d53c9dace16eaa38087369fee6c4c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QThreadPool's functions already links to the QThread ones, but they didn't
link back.
From the API review.
Change-Id: I02853d8110806f735b748d022a1cfaea5a72d603
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit bbcf47a07d3ec138016d4f997c9b4849598c2f10)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Some http servers like to send RST frames whenever they send their response.
The stream is already closed at that point so it's a little weird, but the
RFC doesn't disallow it, so we'll just ignore the frames.
Fixes: QTBUG-132124
Change-Id: Ic26e249437b739830935e2f3feec572687579b21
Reviewed-by: Øystein Heskestad <oystein.heskestad@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit 2c71fdf043ca94d1c567f169d51245e2702bec19)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Piggy-back on the recently-added, type-erased, std::tuple stream
operator to handle std::optional the same way.
While std::optional doesn't support the Tuple Protocol, and we
therefore can't use putTuple() directly, we can still use
putTupleImplImpl() if we set up its arguments manually.
[ChangeLog][Potentially Source-Incompatible Changes][QDebug] The
std::optional streaming operator is now a member of QDebug, not a free
function. This breaks users that rely on the exact definition of the
operator (e.g. `operator<<(d, opt)`). A backwards-compatible fix is to
call the operator with infix notation (d << opt) only, and to avoid
const QDebug objects.
Change-Id: Ib040d65953ca9d3892aee5bdb597d6d30a9694b1
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 08320bfe2b7387d6f488d405dddf9d3aba6434ec)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This appears to not have worked, ever, so add it as a new feature, for
view API symmetry, not as a bug-fix.
The new constructor is available for all compatible byte types,
because it is more like the (ptr) constructor (which is available for
all compatible byte types) than the known-size-array constructor
(which is only available for char).
This does not affect QB/QBV overload sets, since they could exist
ambiguity-free only if one of them is a Q_WEAK_OVERLOAD.
The GHS compiler doesn't like the CanConvert static_asserts, so
comment them out for it. The functionality itself is tested by
the fromArrayWithUnknownSize test.
[ChangeLog][QtCore][QByteArrayView] Made construction from arrays of
unknown size compile. Such arrays will use the const Byte*
constructor, determining the size of the array at runtime.
Task-number: QTBUG-112746
Change-Id: I201033656f123b09644e5de447cd5d7b038e5154
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 54d47f8390cb85c5b0f0ac050b5aa5a934d798b0)
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
When a compound widget is styled with a font through a property and the
default styling has no font settings, the font was not reset to the
parent font but left it the styled state.
Fix it by not resolving the current font when the style rule has no font
settings - use the parent font directly instead.
Fixes: QTBUG-131685
Pick-to: 6.8
Change-Id: I8e79423cfeff24143cd051b282503c4565125b4d
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 5731fe051e48e7a256ef31ae93cfb89ce8d871cc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
- Draw custom titlebars that are requested by setting the
Qt::ExpandedClientAreaHint with QPainter instead of GdiPlus.
- Draw the application icon, in case it was set, for the custom titlebar
- Add DPI awareness to the custom titlebar
Change-Id: I276e7d8948e5a436f1835d96b59756b7237f63d2
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 438aa1524ee99fd636dc02a7181857ade71bb101)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This reverts commit 4332cb313469de1525afe3cddd792d7bc7e08a14.
The original idea of distinguishing between context (outside/within application)
is not working anymore - it's always outside (except the moment when
a mouse pressed inside the window, which is immediately followed by
'outside application' context). So in fact we never ignore key
modifiers.
Fixes: QTBUG-132091
Pick-to: 6.8
Change-Id: I560a48ccf8f8ee1a55f812be6af18b1dd7e25c78
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 7740ac36d27740ff9204cc2626f58620b7e214cb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Looking at other similar Qt APIs, the type argument usually comes first.
The typical related examples can be QMessageBox() constructor taking
QIcon as a first parameter, and qFormatLogMessage() function, taking
message type as a first parameter.
This patch changes the order of arguments, so that MessageType enum
comes as a first argument.
Amends bad618606d64e943e3fa78e7d1dbc8e1fab55480.
Found in Qt 6.9 API review.
Change-Id: Ibbdef755a8676a2c556fe7f1c95009ad51320b98
Reviewed-by: David Faure <david.faure@kdab.com>
(cherry picked from commit 56114f4d1ed6ec26ff59a596caf09f5b4e0f5d68)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
As a drive-by: move the \since command in the showMessageAndExit() docs
to the right place.
Amends bad618606d64e943e3fa78e7d1dbc8e1fab55480.
Change-Id: I4e6e6d63929029879867624e4007941edfca9cd9
Reviewed-by: David Faure <david.faure@kdab.com>
(cherry picked from commit 6692beace9bb5f461d71935e500e1c6ccfa97fd1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
7499fd0229d63f969bf6ca58d3b764b96395bed2 commit cleans up the localLibs
to not add dependencies to the libs.xml file as they will not be
satisfied.
Mentioned change created a regression with multi-ABI build. It happens
because in qtDependencies[ARCH] container, some libs just have different
atchitecture prefix.
This commit remove architecture prefix when checking libs in
qtDependencies container.
Fixes: QTBUG-131707
Pick-to: 6.8
Change-Id: Iae54779bfa4bd143ec35353604724d8ec4e35ef2
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit e59308c5119caac5d4f1024c7d8147e9887cb246)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
And also add a trailing comma to the last element of the enum to
minimize future diffs.
Amends bad618606d64e943e3fa78e7d1dbc8e1fab55480.
Found in Qt 6.9 API review.
Change-Id: I1a30c344967005c9abc73e59980e56626e09cd7c
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 14cc2591ac06dbcee01c2b110e014db2993d7a1e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The underlying QObjCWeakPointer used to track the view requires
a bit of bookkeeping, so avoid updating its value unless the
view actually changes.
Pick-to: 6.8
Change-Id: I6a1aeaf0e6e0eb221d55de00c8f30259832e58fa
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 2e80e74f37980f62bb915983e61d6734fb416bcd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
If the existing m_object is the same as the incoming object the
call to objc_setAssociatedObject in trackObjectLifetime will
release the existing WeakPointerLifetimeTracker after assigning
a new one, which means we'd clear the QObjCWeakPointer's object.
We now reset the state up front.
Fixes: QTBUG-132256
Pick-to: 6.8
Change-Id: If2c08840d465ae6d190c87a4720a537fe9caa8dc
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit 92012333d112dbdf2926117ec3bb123bd30ed9fc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
... to sync it with the rest of the api.
This amends ff339819925ab550c48b53d9baaba43e5adebfaa.
Task-number: QTBUG-124173
Change-Id: I0ed4681bf7d3717f84a7e888affb0c8cae877c35
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 15a1ae90f5b6da3ffd50acda63ddd33ca14227f4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The file contains two implementations of the class template, one for
QT_CONFIG(thread) and one for without. Both are in the QT_NAMESPACE,
but each provided their own QT_{BEGIN,END}_NAMESPACE macro pair.
This is unneeded and may throw off scripts which use the macros as
insertion positions (like includemocs, which, however, operates on
.cpp files, not headers).
To fix, move the namespace macro pair to be around the #if
QT_CONFIG(thread) block.
Pick-to: 6.8 6.5
Change-Id: I56c1f9a4ef7df0fba54c72d8a213fa92573b826c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 8553ffd8d147ecf6a713d12a360027b477dd59c8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The title bar calculation is terribly wrong and was
missed during review.
Change-Id: I0c7a860e747465e6a5e4d8aa5415a9701cf170fd
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit f6af3a581642170f0f4fe0d0563851715e045391)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
When QStringRef was moved out of QtCore, it was also incorrectly
removed from the if_compatible_container constraint, causing
QStringView{sr} to still match the general container QStringView ctor
overload, which doesn't preserve null'ness if data() doesn't return
null. By refusing to provide a constructor from QStringRef, we force
the compiler to use QStringRef's implicit conversion operators
instead.
This transitively affects QAnyStringView in the same way.
The tests can, naturally, only be in qt5compat, so define a macro to
communicate to tst_QStringRef whether it compiles against a fixed
QtCore or not.
Fixes: QTBUG-122797
Fixes: QTBUG-122798
Pick-to: 6.8 6.5
Change-Id: I64b75a8e421d2b6185615e3288ce3ad7fd8f15f9
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit a0e65398483729259cf58781949133c6055fdc7c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Move the query into the model, and use a local scope to make sure that
we don't use the moved-from query later.
Change-Id: I9d216e770733af8b0771280276dba0775209a802
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
Reviewed-by: Dheerendra Purohit <dheerendra@pthinks.com>
(cherry picked from commit af760da54190d96b315ea8edeec00c86871af0d8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This reverts 59bbfb17db563d7e62b9f3158dab3cc6e7e68acd and
c853054910552f5fef04797222dde0d29a0c340d, as that approach
was causing issues for QCommonStyle::iconFromWindowsTheme,
for example in situations where the system has a 1x and 2.5x
screen, and the user requests a 16x16 pixmap or icon via
QStyle::standardPixmap or QStyle::standardIcon. In that
situation our smallest pixmap is 40x40, and we need to
downscale, causing blurred results on a 1x screen.
Change-Id: Ifa6e15d37d15954df689253c32eaa779885c567b
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit d884abaf8bdc1be74ee52306948c0be1986d738d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The color of the subline in editable widgets was black in light and dark
mode. Fix it to use white in dark mode to make it visible. Move it out
into own helper function since it's used in at least three places.
Pick-to: 6.8
Task-nubmer: QTBUG-131585
Fixes: QTBUG-131586
Change-Id: Icca2b142a1ce0c3d7f722baa6d3635bae5950e1c
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 66d42b62b6f01205cf1db72e56ecb5166554e373)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
These two members were added during Qt4 times but never documented.
Pick-to: 6.8 6.5
Change-Id: Ife4abfc6d8883f4c26ce5b95d5c0cfd3adcbd6bf
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Wladimir Leuschner <wladimir.leuschner@qt.io>
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
(cherry picked from commit a90d9f4823bd6baf4cb660a942c2b1695441dbbd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
On monitors where the subpixel arrangement is blue, green, red,
our DirectWrite rendering would give the wrong subppixel
antialiasing, causing color fringes on text.
Like we do with Freetype, we determine subpixel arrangement of the
primary screen and use this as the default.
Pick-to: 6.8
Change-Id: I9ce7025449106a2376bd0ed02ce07b59c79438bd
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
(cherry picked from commit d5cef74d8d71458500f979c0d31a7241b3fef9db)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This amends cb2633468413d8c2a9e28d4c4a10b25e90dd3116.
The patch excluded the ad hoc parsing of variation selector
except when Qt was built without the emoji segmenter. The
reasoning being that the emoji parsing handles this correctly
now.
However, when setting the QT_DISABLE_EMOJI_SEGMENTER variable
in the environment, this is supposed to work as a fail safe
which gives you the original behavior, in case there are
regressions. Therefore, the variation selector handling needs
to be run also when this environment variable is set.
Change-Id: I2669d29016a552775461aad13e50459baecdc26f
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit aaf7437db3a520ab14220a46cf9427cb9a8d915c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
In b8612eaa2a17e12e31ee28141cff1fb43e54c00e, we added a fail safe
where failure to find the font name through DirectWrite would
try loading it through GDI instead and if that was successful we
would register the family with the database after all.
However, the code assumed that CreateFontIndirect() would return
NULL if the font did not exist. It does not do this, but instead
selecting the HFONT on the HDC will give us a suitable alternative
instead. The result would be that any missing font family would
be registered with the font database through this mechanism, even
if it really didn't exist.
This code was added in an early version of the patch, however,
and it should not actually be needed anymore, since we in later
versions of the same patch also added logic to populate the
GDI-compatible family names
(DWRITE_INFORMATIONAL_STRING_WIN32_FAMILY_NAMES etc.). This should
take care of backwards compatibility with the GDI names for fonts.
Since the code has been reported to cause problems on some systems,
it's safest to just remove this hack.
Pick-to: 6.8
Task-number: QTBUG-130313
Change-Id: I7eca893d17796d9cac07391b7b947d28dd7cd920
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 355f54f7d5dd300c73bf203f12e24305d0e227c1)
Remove quotes from the namespace values if they're set
directly to build.gradle.
Fixes: QTBUG-132150
Pick-to: 6.8
Change-Id: I7f5e132c2600bf5079850c99dc500b1dff7e6a96
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 60f78212379ba2b4a7a9bfadc5088a60309e923c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Modified QPlainTestLogger::printBenchmarkResultsHeader() to
concatenate and display both global and local data tags, in
the benchmark result header, in the format `global:local`.
If only one tag is available, it is printed alone.
Pick-to: 6.8 6.5
Fixes: QTBUG-127522
Change-Id: Ic9f3c712ef3f6858aad2546b80d8867ce860b644
Reviewed-by: Matthias Rauter <matthias.rauter@qt.io>
(cherry picked from commit 95f02adf756d1ae485f39a060c6f23a5af3f64ee)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Add Qt::KeypadModifier (and the combination with Qt::AltModifier) to the
modifiers that may be set in a key event in order to trigger a menu
action via its accelerator.
Otherwise, an action that has a number set as the accelerator (e.g.
using text "&1 Exit"), cannot be triggered by typing the corresponding
number on the keypad.
Fixes: QTBUG-73390
Pick-to: 6.8
Change-Id: I0fa63b0c5f23823c61e159fcc72f7245215f8aae
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit ca4334bc966c7e5f9997f98b83afe37eb8b1d3ba)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QStyle::styleHint() take the QWidget as optional third parameter. Add
this to calls to styleHint() where appropriate.
Fixes: QTBUG-2501
Pick-to: 6.8
Change-Id: Id4e4158cc889236064f2f618495608736607d457
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit aa341ecca816e3503a834ffde0ec6cb817139427)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
External tools might rely on the output of "moc --version" to identify
moc, and, depending on how robust their parsing is, could break if the
reported name does not equal "moc".
Explicitly set the application name to moc, so that even if the moc
binary gets renamed and invoked via a symlink, it will still correctly
identify itself.
This might help with both binaries from the Qt Company's installer, as
well as with distros which rename moc to moc6.
Pick-to: 6.8 6.5
Task-number: QLS-1605
Change-Id: Id85e2ffa17d445213da0b37e7bd038d7b68e2c2a
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
(cherry picked from commit 47be32b761ea6e1f2c1bfa9dd9eb38846ce2fd45)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Document that QSpan exists because we cannot use std::span, and
explicitly point to the differences between QSpan and std::span.
Task-number: QTBUG-128837
Pick-to: 6.8
Change-Id: I54f406e3306ee1da136107323887f0c87f94ff9b
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit 083ebfa1a5cb16b0b62ae5b5855a602b2f9ba818)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
In the copying/transcription of the generic converter to the generic
in-place converter, a test for Format_RGB32 destination format was
mistakenly replaced with test of source format. The result was that a
suboptimal pixel store function was selected, and the resulting image
data could end up with non-0xff in the unused alpha field.
Task-number: QTBUG-132051
Pick-to: 6.8
Change-Id: If3ebf5fdd7ab6e377c8ad479ea38ce665f922b7c
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 0ace5ba0357b1614b47cb38a16f4afb2fe8e62db)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
If there's no way to resolve an actual date with the data parsed, then
the date-text given is invalid, so don't try to fix it up.
Pick-to: 6.8 6.5
Fixes: QTBUG-132115
Change-Id: Ic6821bd01394d4dba1be1d25806c372800f8176b
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit 72519aeb237a4085aeb6290b0b4088c690fad106)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
There are two QHashPrivate::Data constructors (and two overloads of
::detached()). Initially the Data ctor that takes a new size always
assumed a resize was happening, and any place where there _may_ be a
resize we would usually detach then rehash.
In an effort to avoid the detach+rehash and instead call detach(d, size)
without the performance overhead of rehashing the call to
reallocationHelper() in this overload of the ctor was changed to verify
that a rehash was actually needed. This had the unfortunate side-effect
of making the compiler no longer inline the reallocationHelper()
function, and it no longer expanded the if-expression with the constant
so it was doing a tight copy-loop with a potential branch in the middle.
In this patch we revert that and make the bool a template argument to
highlight that it should be a constant for better performance (but also
leaving a comment.) Also mark it Q_ALWAYS_INLINE, it has two uses and
they both take advantage of the inlining + expanding the expression.
In theory this might have had an impact on QHash::reserve() calls,
though this code is only relevant when reserve() would cause growth so
the performance regression would hopefully be small compared to all the
other work that would also be needed.
Reverts 45c137d797a85c694897e8b1c5099abacc16e2f5
Pick-to: 6.8
Change-Id: I0d2076a9ded8ca816c54d6ce42d472a23bcbc9fd
Reviewed-by: Lars Knoll <lars@knoll.priv.no>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 6c8b6acc894e47a37c4fb443316d9c40d35a144c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Instead of using just the detached() overload taking a new size, call
the two un-sized one when not resizing. The unsized overload is faster
because it is inlining the reallocationHelper() function and expanding
a branch by way of a constant.
And drop the call to rehash in the !isDetached case, if we enter this
branch we willfully 'attach' the detach guard to keep the key and values
alive.
Follow-up change will fix the sized detach() to use a constant again.
Amends d9ad2251d9fff85a18ce5afc62bcb1230cd2820d
Change-Id: Ia1640766b898610d12b5df20d83cefe5ca2d4c36
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit ac2b0b958e97c41b38c42c0789d91de724d567ce)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Like QStringView's, these classes' documentation promised
is_constructible<View,Char[]>, but failed to deliver, because neither
the (const Pointer&) nor the (const Container &) compile for arrays of
unkonwn bounds, and the (const Char*) one is just a QDoc fake.
Apply the same fix as for QStringView: Add a ctor specifically for
arrays of unknown bound, delegating to the (ptr) overload.
The GHS compiler doesn't like the CanConvert static_asserts, so
comment them out for it. The functionality itself is tested by
the from*ArrayWithUnknownSize tests.
[ChangeLog][QtCore][QUtf8StringView/QAnyStringView] Made construction
from arrays of unknown size compile. Such arrays will use the const
Char* constructor, determining the size of the array at runtime.
Pick-to: 6.8 6.5
Fixes: QTBUG-112746
Change-Id: I7acdcae3c5bdf80a0bed673e621d53ef34a92a1e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 734bd05d0a6d37d6488cf8d1b2b9f79b9329d966)
Less duplication, matches what we do for q_no_char8_t namespaces, too.
Amends 94addad4dd1c89df9c6820d34b9a90424456c492.
Pick-to: 6.8 6.5
Change-Id: I5d98babcb66d1196d3aed31c33289a1b11212a3d
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 2d2ee569421338dbc07a479a7df2531bd37f0ebe)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
... instead of fwd-declaring a bunch of stuff manually.
Also move the fake QDoc decalaration of a "class QUtf8StringView"
over.
Pick-to: 6.8 6.5
Change-Id: I80bc3240d69f69602c127fc0e8fe694dd46765f1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 8404c21152ed3e28f8e00d683a494a8e1e25a69a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Use a static logging category where possible, and check the return value
of QFile::open.
Change-Id: Ieda9f7874d1b88d9bfeb593243eb867d0c274e9f
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit e0ef713a2c6a74fe574481e98f0a582819418ed0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
qstringfwd.h is supposed to be a lean header, dragging in all of
qglobal.h perverts the purpose.
This also helps with certain circular-dependency issues that
appeared when attempting to use this header in other low-level
headers.
Amends abe3b4c9b947de5e55085b37840e0d1d6f3aae42.
[ChangeLog][Potentially Source-Incompatible Changes][QtCore] The
qstringfwd.h header no longer includes qglobal.h. A
backwards-compatible fix is to include qglobal.h yourself instead of
relying on the transitive include.
Pick-to: 6.8 6.5
Change-Id: I1726fccfd13b3a058abaf800c1bbf02c320143a4
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit 5def8ff180c67f288bdc6e3c05b96940aeae37c0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Explain the behavior of open() in detail, including the edge
cases (reopening a file). Fix links to QIODeviceBase::OpenMode
flags. Use explicit links to make linking more robust. Use
the same parameter name 'mode' as in the base class.
Pick-to: 6.8
Task-number: QTBUG-131484
Change-Id: I5d01b3bb48a7a439b93c144e6d38482607de8d33
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit adaf1fb107ceb7003313ceb67605f986b74763b1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Fix links to OpenMode flags. While at it, make links explicit so
that future changes breaking implicit linking will cause errors.
Pick-to: 6.8
Task-number: QTBUG-131484
Change-Id: I20b80014eadcbcba6ebebab1ff4db4c345dd434a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 4e85a4f401118f2f7330b673e45b4a0399825ef3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Explain the method, instead of just linking to the base method.
Call the argument 'mode' instead of 'flags', like it is done in
the base class.
Force the mentioned QIODeviceBase flags to be links. Use fully
qualified name for the first flag mentioned, but use the short form
for the rest to improve readability.
Pick-to: 6.8
Task-number: QTBUG-131484
Change-Id: I8e9668ffc095ec261e2be54a2dcf16a32e4cb441
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 334460407b7cde1cdab5cfe5abe00175893749c3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Force the mentioned QIODeviceBase flags to be links. Use fully
qualified name for the first flag mentioned, but use the short form for
the rest to improve readability.
Mark true and false to be written in code style.
Task-number: QTBUG-131484
Pick-to: 6.8
Change-Id: Iebb0f9c6df382327bc5980e9e06c11deb6658291
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 647bee67150dedbd2a9fd2ddcd265d535e8fd8cf)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
qsocketnotifier.cpp is using a #define to activate a second overload
of QSocketNotifier's activated() signal.
In unity-builds, this overload becomes visible to other TUs and breaks
new-style connect()s¹. In PCH builds, the define comes too late (the
qsocketnotifier.h header was already included by the pch header,
without the define).
Fix by adding qsocketnotifier.cpp to NO_PCH_SOURCES (thereby to
NO_UNITY_BUILD_SOURCES, too).
¹ and the signal's use of QPrivateSignal makes disambiguation by
qOverload(), or assignment to a function pointer, impossible.
Amends 487dd80bce9c6006f349ccb09222e1c308200f0a(!).
Pick-to: 6.8 6.5 5.15
Change-Id: I40ca3b90f7ecc3116ae78dc952583efa299bcedb
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
(cherry picked from commit a38cebfe23674bb459eed6bbbcac965ebf2b6075)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The QtDeclarative code causing QTBUG-131906 hits UB, because it tries
to store -666 in an enum {A, B}, which has a valid range of [0,1],
therefore its underlying_type is uint, yet, as per [conv.prom]/3¹,
integer-promotes to _int_ instead, so in Qt 6.8 would cause the
arg(int) overload to be called, outputting -666, while in Qt 6.9, it's
treated (correctly) as an unsigned value, outputting -666's two's
complement, a positive value.
Add a version of the scenario that does not cause UB.
¹ Thanks to Ahmad Samir for digging up the pertinent legalese.
Task-number: QTBUG-131906
Pick-to: 6.8 6.5
Change-Id: Iba1a04de523a0b4cd1c87deea40c643cf16df14f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit e64fd05fecae291c9d7358d2e47d7170995af256)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
They are now the same, but the name UTF-32 is preferred over UCS-4.
The original ISO-10646 UCS-4 encoding was allowed to use all 31-bit code
units, from 0 to 0x7FFFFFFF[1] including those above 0x10FFFF, which
correspond to UTF-8's five- and six-byte sequences. Unicode doesn't
allow that and restricts the UTF to the range possible in UTF-16.
Renaming the functions is left as an exercise for the reader.
[1] https://en.wikipedia.org/wiki/UTF-32#History
Pick-to: 6.8
Change-Id: I2f29db62b974cb689585fffd9a6434ae252a7651
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit 973d0c4c5160200c188f81da5df064510315f22d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
... when the user passes size = -1. std::char_traits<char32_t>::length()
doesn't appear to be an any better implementation than our simple loop,
but maybe some compiler will optimize it.
wcslen() is usually optimized in the C libraries, even for Unix
platforms that hardly ever use it (it's used as a fallback in qustrlen()
for non-x86 Windows systems).
Pick-to: 6.8
Change-Id: Ia143270869a3a7cf5754fffdc17e500fc454397b
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit b98cf4fc4afaf55145c34ba06d61fec38fadc25d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The original idea (8b5aa7b6c40d70a7ec15b3ea485f28a142fb247c) of the
separation of array and pointer ctors was to determine string literal
sizes at compile-time in C++11's limited constexpr semantics.
But when the scanning for NUL characters was added to the array ctor
in 107ff4c1d6b5da2cb11c65b2bd9106817f7fdb02, the distinction between
the two ctors became meaningless, because we were able to assume
post-C++11 constexpr to make the Char(0) scan a compile-time action.
Finally, 9e1dc1e8a9fda1a7576cc6377c8a36decff631eb removed the array
ctor in favor of the generic Container ctor. I didn't check whether
the old code handled arrays of unknown size, as in
extern const char16_t str[];
QStringView sv = str;
~~~
const char16_t str[] = "str";
but std::size() (and therefore if_compatible_container) surely bails
on such arrays, and if_compatible_pointer also SFINAEs out. As a
consequence, such arrays cannot be used to construct QStringViews atm.
Fix by adding a new constructor for arrays of unknown size, delegating
to the existing pointer overload.
The GHS compiler doesn't like the CanConvert static_asserts, so
comment them out for it. The functionality itself is tested by
the from*ArrayWithUnknownSize tests.
[ChangeLog][QtCore][QStringView] Made construction from arrays of
unknown size compile. Such arrays will use the const Char*
constructor, determining the size of the array at runtime.
Pick-to: 6.8 6.5
Task-number: QTBUG-112746
Change-Id: Ifdb217350d93d38f081c99f14661975491d32076
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 56faffd92bf0ac459a921ec043a6f3b3dba51acc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Other view tests test Char[N] and const Char[N] separately. Do the
same here.
For many Char types, the array CanConvert test was missing
completely. Add them.
Pick-to: 6.8 6.5
Change-Id: I1d0b6de394d548554a547f190e74cb8cead6ecd4
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 0bbbbfc78beb2393ceea0de0fa85942f71d0a2ed)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Adding it here since this test case already has all the infrastructure
for the overload test.
Pick-to: 6.8 6.5
Change-Id: I2d7fff9d2d82fed3db2446690a354f939c9a37fc
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 140dac92f2a8ee1f54843f69be4026900a049ee7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This is supposed to work, so check it.
Pick-to: 6.8
Change-Id: I201033656f123b09644e5de447cd5d7b038e5155
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 8a3ffe7044249bcfb5185bd87a9713685d48de7b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Use QTextLayout to layout and shape the text, which will respect
ligatures. Many icon fonts might not name their icons, but have a
replacement ligature for the actual icon name replacing the text with
the respective glyph.
So if for the name of the icon we get a single glyph run with a single
glyph in it, use that to render the icon.
Change-Id: If0e5c528c3ac4cccdbb7df5fb7fd32ca232f2a66
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
(cherry picked from commit d10e9174fecb91b5c366d57aeb19e6410522a807)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The icon engine needs to be able to rely on glyph indices belonging to
the correct font, and we generally don't want the overhead of iterating
through potential fallbacks if a named glyph or unicode code point
wasn't found in the font.
Assert in the QFontIconEngine constructor that the font we get has the
NoFontMerging strategy bit set.
Amends 2af58490b3d33aab8d08610939fe2b7cab4c469c.
Change-Id: Ib38324aebbeda956c8dd053969d6cf08f7ef3c35
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
(cherry picked from commit 9d47233d2cbbae1aa32240688fcc7a8c08c585d3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
- prev pointer never can be null here, so the check can be deleted.
Ammends 948599e7b71f59fd9c9c0f7f3d1987ec93a23490
Pick-to: 6.8
Change-Id: Ie194f5f0432f6da5f6471328193112c970f623b6
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit d991572a45b2bbdcd43e59586f88487837a2927c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
These functions iterate through the parent hierarchy until the widget
given as argument is found. If never found, the code would assert (in
debug mode) or just silently crash (in release mode).
No need to bring down the entire application just because some widget
coordinate calculation is off. Instead, just emit a qWarning and
return cleanly.
Task-number: QTBUG-132072
Pick-to: 6.8
Change-Id: I4d13f46037cdcf855f76e040f941a8a7050ab12b
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit 73221d263823d50e525858d613ce93769698454a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
For dynamic linking only the main module should
link with libraries like "FETCH".
When side modules are linking to libraries as well,
it leads to linking errors.
Change-Id: I83e37add867f1ce2cbcab4801f49266a288a9ceb
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
(cherry picked from commit b7419557b1b0cc1a87aa91131329b65aee44ec34)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Many subclasses of QAccessibleInterface implement window(), but
some don't, and the documentation states that the backend (us)
will traverse ancestors until it finds one with a window.
We were not doing that for iOS, which caused a crash for
QAccessibleTabButton, which doesn't have a window.
In case we ever hit the code path where we can't find a
window we also skip adding the nil element to the array
in createAccessibleElement, as that causes an exception.
Amends 7a512d1267442e646bb7942291197b2b03f4d1cd
Pick-to: 6.8 6.5
Change-Id: I9b758423956e845a01b014022f4d3ab6306be94e
Reviewed-by: Doris Verria <doris.verria@qt.io>
(cherry picked from commit 6689921b9da3780676a416324eafcac98ab211a3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
In many places this was already done; but there was some old code
remaining where mousePressEvent() simply returned without ignoring the
unhandled event.
Task-number: QTBUG-93486
Task-number: QTBUG-132066
Change-Id: I4a876980b7ef88ee478fa8cfd9f68b5be5b217a2
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit a1175255150d27d50f9690d5f8685b31269d9fa1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QSpan docs use \target commands together with the section headers, to
simplify linking to certain parts of the docs. This approach has its
own drawbacks, though, because the \target link is rendered as-is.
This patch improves usage of the \target commands, making the links
look better.
It does the following changes:
* Moves the \target commands before the related \section2 commands, so
that the section header is visible when following the \target's link.
* Replaces the \target links with the actual section names in the \sa
and other places of the docs where the links do not have the custom
text, because otherwise the target names are actually visible in the
docs instead of the section headers.
Amends 03e78e5d624d9752d76c7448d58c9d9d15a4dc18,
70dc8d3103fade380caec96f7531432cd8e8adb6, and
ef5ac956c755daa9ea84dabfa1314d104e5c62e4.
Pick-to: 6.8
Change-Id: I045824683f342079e33e89e3ee6f8e2e27a0acf5
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 10c844f0533daf657a1cbbbb96651e20e5d603ec)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
It can (unlike the other views).
Pick-to: 6.8 6.5 5.15
Task-number: QTBUG-112746
Change-Id: Id976429611c53f1c707de1d989c454507b8f4773
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 01f0305dc6f751d3eb4d1681a2f8f9f3165b547c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
It would be more consistent if we could rely on the accepted state of
the original QMouseEvent to decide whether to follow up with a
QContextMenuEvent; but not all Qt widgets call ignore() on unhandled
mouse events, both in Qt and in external libraries and applications
(including some from KDE). So we should at least wait until Qt 7 to
make this a requirement. It seems sensible to move the check into
QWindow::event() rather than trying to distinguish the window type in
maybeSynthesizeContextMenuEvent(). We merely output a categorized log
message to indicate when the legacy behavior is in effect.
Amends 84a5f50c7766c99f62b22bb4388137e0aa8dd13d
[ChangeLog][QtWidgets] If your QWidget subclass depends on receiving
QContextMenuEvent, and also handles mouse events directly, we
recommend that you call ignore() on unhandled mouse events (such as
right-button events). In Qt 7, we plan to stop sending
QContextMenuEvent if the triggering mouse event is accepted.
Fixes: QTBUG-132066
Change-Id: I454813dab4c387112f161fc28a0ee94570013afa
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
(cherry picked from commit 357c64a99607456133bfabf86d6b67162717cb29)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Needed to use a weird combination of \c and \a here, as qdoc on
one hand insists that all parameters be documented, and OTOH doesn't
support \a within \c.
Writing anything else than the equivalent code in \c to appease qdoc
would be childish. Equivalent code is the best-possible documentation,
as it leaves no question unanswered.
Task-number: QTBUG-131672
Change-Id: I512872360b7eb212001723f2ba12d4c6eac0b6b0
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit 0afe31fa51a26d12be21c1b9c6e886abb9775441)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
There is no fromSecondsAfterUtc(), I was thinking of
fromSecondsAheadOfUtc().
Pick-to: 6.8 6.5
Fixes: QTBUG-131913
Change-Id: I6a89a27d678d23043819b93d5e4120d01002da4a
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 2bdce97480ed66f0e8e9528fbc8f4f9c3d8487bf)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
1. Make some global constants constexpr.
2. Make some file-scope global constants static.
3. Use QStringLiteral instead of plain const char*
4. Add "u" to QStringLiteral's content.
Pick-to: 6.8
Change-Id: Icbc105366ba40e970b256fe3da41231a6fb5064b
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
(cherry picked from commit ad06099b93d79a954d133d6822517d4d0a10adbc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The alternate base color in darkmode was wrongly set to the accent color
instead of a lighter color. This patch overrides the alternate base
color for the QWindows11Style.
Fixes: QTBUG-131976
Pick-to: 6.8
Change-Id: Ie8f50b0042ca7bf746224275abc0cd255df7a4ad
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit 79aa4269bcbbedef8206d79318c199df7c8a3c9f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
SPDX-FileCopyrightText="To the extent possible under law, Sy Brand has waived all copyright and related or neighboring rights to the expected library. This work is published from: United Kingdom."
/// Fetch from "vkGetDeviceImageMemoryRequirements" on Vulkan >= 1.3, but you can also fetch it from "vkGetDeviceImageMemoryRequirementsKHR" if you enabled extension VK_KHR_maintenance4.
VMA_ASSERT(IsMappingAllowed()&&"Mapping is not allowed on this allocation! Please use one of the new VMA_ALLOCATION_CREATE_HOST_ACCESS_* flags when creating it.");
VMA_ASSERT(IsMappingAllowed()&&"Mapping is not allowed on this allocation! Please use one of the new VMA_ALLOCATION_CREATE_HOST_ACCESS_* flags when creating it.");
VMA_ASSERT(0&&"VMA_ALLOCATOR_CREATE_BUFFER_DEVICE_ADDRESS_BIT is set but required extension or Vulkan 1.2 is not available in your Vulkan header or its support in VMA has been disabled by a preprocessor macro.");
}
#endif
#if VMA_VULKAN_VERSION < 1004000
VMA_ASSERT(m_VulkanApiVersion<VK_MAKE_VERSION(1,4,0)&&"vulkanApiVersion >= VK_API_VERSION_1_4 but required Vulkan version is disabled by preprocessor macros.");
#endif
#if VMA_VULKAN_VERSION < 1003000
VMA_ASSERT(m_VulkanApiVersion<VK_MAKE_VERSION(1,3,0)&&"vulkanApiVersion >= VK_API_VERSION_1_3 but required Vulkan version is disabled by preprocessor macros.");
if(m_VulkanApiVersion>=VK_MAKE_VERSION(1,3,0))
{
VMA_ASSERT(0&&"vulkanApiVersion >= VK_API_VERSION_1_3 but required Vulkan version is disabled by preprocessor macros.");
}
#endif
#if VMA_VULKAN_VERSION < 1002000
VMA_ASSERT(m_VulkanApiVersion<VK_MAKE_VERSION(1,2,0)&&"vulkanApiVersion >= VK_API_VERSION_1_2 but required Vulkan version is disabled by preprocessor macros.");
if(m_VulkanApiVersion>=VK_MAKE_VERSION(1,2,0))
{
VMA_ASSERT(0&&"vulkanApiVersion >= VK_API_VERSION_1_2 but required Vulkan version is disabled by preprocessor macros.");
}
#endif
#if VMA_VULKAN_VERSION < 1001000
VMA_ASSERT(m_VulkanApiVersion<VK_MAKE_VERSION(1,1,0)&&"vulkanApiVersion >= VK_API_VERSION_1_1 but required Vulkan version is disabled by preprocessor macros.");
if(m_VulkanApiVersion>=VK_MAKE_VERSION(1,1,0))
{
VMA_ASSERT(0&&"vulkanApiVersion >= VK_API_VERSION_1_1 but required Vulkan version is disabled by preprocessor macros.");
VMA_ASSERT(0&&"VMA_ALLOCATOR_CREATE_KHR_MAINTENANCE5_BIT is set but required extension is not available in your Vulkan header or its support in VMA has been disabled by a preprocessor macro.");
}
#endif
#if !(VMA_KHR_MAINTENANCE5)
if(m_UseKhrMaintenance5)
{
VMA_ASSERT(0&&"VMA_ALLOCATOR_CREATE_KHR_MAINTENANCE5_BIT is set but required extension is not available in your Vulkan header or its support in VMA has been disabled by a preprocessor macro.");
}
#endif
#if !(VMA_EXTERNAL_MEMORY_WIN32)
if(m_UseKhrExternalMemoryWin32)
{
VMA_ASSERT(0&&"VMA_ALLOCATOR_CREATE_KHR_EXTERNAL_MEMORY_WIN32_BIT is set but required extension is not available in your Vulkan header or its support in VMA has been disabled by a preprocessor macro.");
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.