Compare commits

..

170 Commits
dev ... 6.10

Author SHA1 Message Date
Topi Reinio
8959c5055a Doc: Adjust styling of QML property signatures in offline docs
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.9 6.8
Fixes: QTBUG-136990
Change-Id: I72adbeaca46cd9dd99c54368257268dc8db6bfdc
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: David Boddie <david.boddie@qt.io>
(cherry picked from commit a9a68a87b9d54c528c6a9784095636ef54ac53be)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-06-15 09:32:42 +00:00
Cristian Le
6375c935a5 Propagate _Qt6CTestMacros in RunCMake
Propagate the `_Qt6CTestMacros` variable so that
`_qt_internal_get_cmake_test_configure_options` can be used
inside the RunCMake tests

Pick-to: 6.9 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>
2025-06-15 09:32:42 +00:00
Matthias Rauter
5f8ca97f51 Make include guard match its filename
Change-Id: I57af3c237bddffc424cab734faa30deacaa9bcdb
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit dd81b421270a390aff6e686677575ed6d017cd9d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-06-15 09:32:41 +00:00
Matthias Rauter
3e0bcaeea2 Incorporate the sub-class-of info when deriving mimetypes
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.9 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>
2025-06-15 09:32:41 +00:00
Matthias Rauter
c9d597f5db Extend tests for QUtf8StringView
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.9 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>
2025-06-15 09:32:41 +00:00
Christian Ehrlicher
6588b46c82 QStyleSheetStyle: replace c arrays with std::array
Replace some c-arrays with std::array<> for easier handling.

Pick-to: 6.9
Change-Id: I34766a2aad603d83187515626982adc976667d48
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit cfd52c5c5fc1f157186328962acd0391bb2c891b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-06-15 06:47:11 +00:00
Axel Spoerl
0e0db3eefd QWindowsScreenManager::removeScreen() - don't leave stale screen behind
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.9 6.8 6.5
Change-Id: Id18a6fb3e72922bcdb62c9e79857b6bb713c0c1b
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Wladimir Leuschner <wladimir.leuschner@qt.io>
(cherry picked from commit 3416d28c8b0fa8e5cd6622fc86fe6fc5aae9222b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-06-14 16:44:01 +00:00
Marc Mutz
4cd2ff8226 [docs] QScopeGuard: fix a grammar mistake in ctor docs
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.9 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>
2025-06-14 13:38:54 +00:00
Marc Mutz
453aaf5759 [docs] QScopeGuard: mention dismiss()ing in \class
The class docs should include a discussion of salient API, not leave
that only to \fn's.

Amends 9229452e574e603aa86fd5adb28da33cf5879db9.

Pick-to: 6.9 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>
2025-06-14 13:38:48 +00:00
Fabian Kosmale
bd4d7145d8 moc: support __has_include
__has_include is part of C++17, but moc did not handle it so far.
This commit fixes moc to correctly support it.

It should be noted that support for __has_include relies on all
necessary include paths being passed to moc.

Pick-to: 6.9 6.8
Fixes: QTBUG-136097
Change-Id: I7284e97dea12d1637b38349d32e090c0102124e7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit f2ef86168843334df712008f1735631ebb8fa963)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-06-14 10:48:45 +00:00
Fabian Kosmale
806e4e619c cmake: Unify the set flags between AUTOMOC and qt_wrap_cpp
For AUTOMOC, we were missing the compiler flavor flag, as well as the
WIN32 define. While the latter has not caused any known issues yet, the
former is rather problematic for implementing __has_include in moc.

Note that this only applies in the case where the AUTOMOC flags are set
by us in a qt_ function like qt_add_excutable. Plain add_executable
won't benefit from it, but we already mention that Qt targets should not
use plain CMake functions.

This change is (indirectly) tested by the commit adding __has_include
support for moc.

Task-number: QTBUG-136097
Pick-to: 6.9 6.8
Change-Id: Ie2beb08a44a3a67e3bc363d9c1ba93b7d6a49133
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 246b43d581a17dd9578553b0569b7fb2f2da8e85)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-06-14 10:48:39 +00:00
Ulf Hermann
ce0e4ca6fe QNetworkAccessBackend: Do not leak wrapped upload byte device
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.9 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>
2025-06-14 09:38:48 +00:00
Marc Mutz
5430116ed3 QCoreApplication: fold two atomic ops into one
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.9 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>
2025-06-14 09:38:48 +00:00
Thiago Macieira
ee95cb90c4 QVarLengthArray: use assign() for the iterator,iterator ctor
Let's avoid std::back_inserter for non-complex types, which generates a
huge amount of unnecessary code. The implementation of assign() is far
more modern.

Change-Id: Ia8b9c90336af2bebd49ffffd0d69ace761c6aa59
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 96dfe0373c80964ae9de7955a06f5c7696961f12)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-06-14 09:32:16 +00:00
Thiago Macieira
8bb365b0c5 tst_ContainerApiSymmetry: add non-deprecated copy assignment to Movable
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.9 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>
2025-06-14 09:32:16 +00:00
Rami Potinkara
a997b85d63 Android: fix QtDisplayManager getDisplaySize function
This patch fixed QtDisplayManager::getDisplaySize
function to use API's that do not require
MANAGE_APP_TOKENS permission.

The function previously failed on 32-bit architectures
with Android 11 aka SDK 30 aka VERSION R due to
createWindowContext requiring MANAGE_APP_TOKENS
permission. The earlier try-catch lead to next error,
because of invalid values.

Amends: 98120622ff1f6f87664f4c42e830000a21391751

Fixes: QTBUG-137027
Pick-to: 6.9 6.8 6.5
Change-Id: Ia9c3a64ea41ad0575a34a96858851a1123cfc915
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 1141a6fa17fa9ae7bdd28f8294ba8543e837dcef)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-06-14 03:37:22 +00:00
Mårten Nordheim
617625ab04 Schannel: Use modern key management APIs
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.9 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>
2025-06-14 02:41:05 +00:00
Ahmad Samir
d50bb03157 QDirListing: properly deprecate ExcludeSpecial
Add "since 6.10" to ExcludeOther's docs.

Found in API review.

Amends c553f39e3d3cd02854850da0dfc639acbae59299.

Change-Id: I3edb32d4d50864ddbdde03aaca750d590a0e0854
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit cee8ea7c13b9e91f4b024ebe19c32416b9719fea)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-06-14 02:41:04 +00:00
Christian Ehrlicher
9eb84657bc QStyleSheetStyle: use range-based for loops
Replace some for loops with range-based ones.

Pick-to: 6.9
Change-Id: Ib11fb4ec5785b8ec4c9c297684f90d7f5031fe58
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit a0c591c1203bd749b550814bd57597c1b297b26e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-06-14 00:35:28 +00:00
Alexey Edelev
92d73eb9d5 Move Android ABI detection to the separate function
Allows reusing the Android ABI detection.

Pick-to: 6.9 6.8
Change-Id: I8e452605b25e522c953f39a525c038a88174094b
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit d91d49ffe223850e96cbb4026b16c2f68366bc02)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-06-13 21:09:37 +00:00
Alexey Edelev
3408df40a7 Introduce _qt_internal_append_cmake_configure_depends
The function append the unique entries to the CMAKE_CONFIGURE_DEPENDS
property. This suppress the ninja recompat issue, which complains
about the duplicated entries in that come from the
CMAKE_CONFIGURE_DEPENDS property. It's likely the CMake issue, but
we may work around it.

Pick-to: 6.9 6.8
Change-Id: I2f10834b0dca3d2aa08fe13fba69849e97fa77d0
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 1f10cd4b456d21044e8171a853e6d0ccec9ad92d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-06-13 21:09:34 +00:00
Christian Ehrlicher
afa36328a5 SQL/DB2: Add and document DB2_ROOT
Sync the cmake arguments to search for DB2 with the rest of the qsql
find modules and provide a DB2_ROOT env or cmake var.
Also allow the old variables as a fallback.

Change-Id: I587e519b5cf3513e9580f64f0fb9b46bf789da5c
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 4832f61212b6536afeb0079918aa8eb7bb51eee4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-06-13 21:09:29 +00:00
Marc Mutz
bbb284cd70 QAccessibleWidget: replace QString default arg with overload
We should not use defaulted arguments of non-trivial type, because
their construction and destruction, even if not passed, is repeated at
every call site, producing O(n) executable code.

By overloading out-of-line, we execute the same code at runtime, but
we have only one copy of the arg construction and destruction, in the
library, O(1) executable code production.

Found in API-review of QAccessibleWidgetV2.

Amends the start of the public history.

Can't pick further than (unreleased) 6.10, because this adds a new
symbol.

Task-number: QTBUG-98117
Change-Id: I705bca764992d9e7a2aa1021e0f94006b6817177
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit ab53b1293122518a512335b94491566305280851)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-06-13 18:00:21 +00:00
Volker Hilsheimer
4a4d11c178 Android/iOS: prefer files icons to come from the Icon theme
There are no icons for computer, trash, desktop, folders, files etc. on
mobile platforms. QAbstractFileIconProvider tests the
QPlatformTheme::PreferFileIconFromTheme hint, and if set, gives
QIcon::fromTheme a try with an icon name mapped to the icon provider's
icon type.

We have at least some mapping of such standard icons in the native icon
engines, and those engines would also be the right place to perform
additional platform specific look-ups of icons (i.e. for specific file
types). So as a first improvement, try to use the icon engine for file
icon provider icons.

Task-number: QTBUG-134239
Change-Id: Ib8c301a19b0d7e23f1d3ebdccde2147709f3ddb3
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 560bf5a07720eaa8cc589f424743db8ed1f1d902)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-06-13 18:00:19 +00:00
Volker Hilsheimer
35fe0a0b6f QGroupBox: document non-standard behavior for enable/disable logic
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.9 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>
2025-06-13 18:00:19 +00:00
Volker Hilsheimer
c750468766 a11y on macOS: return a valid window element
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.9 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>
2025-06-13 18:00:18 +00:00
Axel Spoerl
282ce8fbbc Blacklist tst_qscroller::overshoot() on Windows
Function has become flaky due to additions made in
84e09e060bedd37d8de7cded7e430371e335c029.

Blacklist for now.
Add missing link to QTBUG-134105 in BLACKLIST file.

Task-number: QTBUG-134105
Pick-to: 6.9
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>
2025-06-13 18:00:18 +00:00
Dheerendra Purohit
17eb1432b0 Doc: Fix QtConcurrent::run member function parameter order documentation
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.9 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>
2025-06-13 14:54:21 +00:00
Marc Mutz
65db00df78 QAccessibleWidgetV2: make the dtor protected
QAccessibleWidget (i.e. V1) has a protected dtor, so V2, which merely
extends V1 because we can't add new virtuals (via a new base class)
due to BC constraints, shouldn't differ in this respect.

Amends bb2121551c3d7b1af1553710bc211ba0e39b4212.

Found in API-review.

Change-Id: I0c9a00691a14c600b020ff1a9f433634bb7c8d24
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 5efcbf9fb83f24963f6bf40a8dc76571ab02e984)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-06-13 14:54:21 +00:00
Marc Mutz
59db97fdaf QCoreApplication: relax an atomic load in a Q_ASSERT()
A Q_ASSERT() must not have side-effects, incl. ordering memory. So the
implicit loadAcquire() was too strong. The code must also work with
loadRelaxed(), so use that.

Amends the start of the public history.

Change-Id: Ib94bd0989d1a358b552275dc3963b014e6e4c180
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 90dbb413bf78a86d8785e797df7b1558e72f99b8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-06-13 14:54:21 +00:00
Marc Mutz
da96dfdacc tst_moc: fix Clang -Winline-namespace-reopened-noninline
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.9 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>
2025-06-13 14:54:21 +00:00
Marc Mutz
7e7f7daa2b QAccessibleWidgetV2: de-inline ctors and avoid QString default arg
We should not use defaulted arguments of non-trivial type, because
their construction and destruction, even if not passed, is repeated at
every call site, producing O(n) executable code.

By overloading out-of-line, we execute the same code at runtime, but
a) we have only one copy of the arg construction and destruction, in
the library, O(1) executable code production, and b) being out-of-line
in the library, the compiler can optimize the call to the base class
ctor away, if it wants to, because it sees its implementation.

Found in API-review.

Amends bb2121551c3d7b1af1553710bc211ba0e39b4212.

Task-number: QTBUG-98117
Change-Id: Ib6a3b15cc861893797c0445a91691132b21bbf2c
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 79ab9305c1a46e2205ee9be7af7edb78c4483901)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-06-13 14:54:21 +00:00
Wladimir Leuschner
5f6304b313 WindowsQPA: Make custom titlebar a child window
The current approach for custom titlebar uses an overlay of a
frameless popup window at the position of the titlebar area. This
involves synchronizing the window state, position and size of the
popup window with the original window. Also, the drawing of
rounded edges needs to be done manually with the old approach.
This patch adds the titlebar as a real child to the
original window, so that the window manager takes care of the
synchronization and clipping process.

Fixes: QTBUG-135643
Fixes: QTBUG-133943
Fixes: QTBUG-133946
Pick-to: 6.9
Change-Id: I1770580a1c306074f41a7ff64c1d525c93918480
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit 295933aadce1222511aa33bd1c68c302ca0a0a61)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-06-13 14:54:21 +00:00
Mårten Nordheim
43e249cba8 Http2ProtocolHandler: fix logic error with potential use-after-free
We previously asserted that the reply was not nullptr, except in some
special circumstance. But then we proceeded to dereference it anyway.
This was then recently changed to be an if-check, but that just
highlighted the logic-flaw (and made static analyzers warn about it...)

What we want to assert is that the stream object is valid and
conditionally return early if the reply is nullptr, which it is for
promised streams, since no request has been made yet so no reply is
created.

At the same time, update the logic in the QHttp2Stream to not store or
emit header-related signals for a stream that has been reset.

Pick-to: 6.9
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>
2025-06-13 14:54:21 +00:00
Kai Uwe Broulik
afdb96e70c doc: Fix typo in QCalendarWidget::dateTextFormat
renderd -> rendered

Pick-to: 6.9 6.8 6.5
Change-Id: If4df3cd0dd7a11e30283bf5925dc6364d0d79225
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 3d405bfe6708ae5c6feed8eddcbb4bef2a732b48)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-06-13 14:54:21 +00:00
Jonas Karlsson
78dd82396a Fix standardbutton-apply-16.png
There were some artifacts added (white pixels and bad anti aliasing)
when the icon was changed in e771e5e2d7ae77f46d01f087242e0f777fdc02ac

Pick-to: 6.9 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>
2025-06-13 14:54:20 +00:00
Volker Hilsheimer
ee5570b40e Fix -no-feature-draganddrop builds
Amends 7d0017cda8fde28a1130feaeecf41010b40e3cb3 which added the APIs,
and ef7e5ea616a3f04ff0ba5f6fe34487a332152b01 which only added the guard
for QListWidget.

Address header review comment.

Task-number: QTBUG-137478
Change-Id: I405190190f4d64dd810d7d35e9ef616ab0147b19
Reviewed-by: David Faure <david.faure@kdab.com>
(cherry picked from commit 45202b26ce9d3b4fa68fe49f392941270a0ca41c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-06-13 11:06:14 +00:00
Marc Mutz
12b91f97e3 QMetaObject: deprecate the Qt 6 QVector -> QList porting kludge
The argumentTypesFromString() function is clearly documented not to
perform any normalization, yet in typical Qt 6.0 porting rush, it did,
and this kludge was never removed.

Do it now; it's in the way of porting QArgumentType from QBA to QBAV,
and it's causing correct code to incorrectly fail.

This, however, changes the behavior of QMetaObject::indexOf*(), because
they don't fall back to normalization (indeed, these functions are used
as isNormalized checks, e.g. in connect()). So we can't remove the
kludge just yet, but we can drag it out of the fast path and re-try
with QVector replaced by QList when nothing was found using the
original signature. This way, we only pessimize unported users (and
calls that would have failed for other reasons, by scanning for
"QVector<" in the signature).

Add a qWarning() that we'll remove this behavior going forward.

It does, however, fix the bug that signals and slots that contain
types that match, but are not, "QVector<", fail to be found by the
machinery:

[ChangeLog][QtCore][QMetaObject/QObject] Fixed a bug that caused
signals and slots with argument types matching "QVector<"
(e.g. "MyQVector<int>" or "NotQt::QVector<int>") to not be found in
QObject::connect() or QMetaObject::indexOfMethod().

[ChangeLog][Deprecation Notices][QMetaObject] The
indexOf{Constructor,Slot,Signal,Method}() functions are documented to
require input according to QMetaObject::normalizedSignature(), but
accepted a QList declared as QVector. This was an internal porting aid
and is being deprecated now. Watch out for runtime warnings about this.
QObject::connect() and QMetaObject::invokeMethod() are unaffected, as
they fall back to normalizeSignature() automatically.

No change in tst_bench_qobject connect performance, which is
unsurprising, as the benchmark doesn't use a QVector alias.

Amends 03326a2fec416405b437089874f6439e937bbada.

Task-number: QTBUG-135572
Change-Id: I7fd9293bba5d2b57b4452e55499ffbf360bc6123
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit afdf37ad8f674bba9cdcf64c2f9028e28d6039eb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-06-13 05:49:10 +00:00
Thiago Macieira
8e7ddf261e QFileSystemEngine/Unix: avoid an unnecessary conversion to QString
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.9 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>
2025-06-13 05:49:10 +00:00
Thiago Macieira
5f758f7af6 QFileSystemEngine/Linux: correct a minor problem with lstatx() failures
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.9 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>
2025-06-13 05:49:10 +00:00
Marc Mutz
cf1a20df70 tst_QPointer: fix Clang 19 -Wunused-lambda-capture
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.9 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>
2025-06-13 05:49:09 +00:00
Marc Mutz
da212685ee tst_ContainerApiSymmetry: ensure we're checking defined iterator types
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.9 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>
2025-06-13 05:49:09 +00:00
Marc Mutz
536856f99e tst_ContainerApiSymmetry: rename a variable in assign_impl()
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.9 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>
2025-06-13 05:49:09 +00:00
Thiago Macieira
cdb7967d43 Q*Mutex: unexport for Qt 7
Those weren't caught for the Qt 6.0 release.

Change-Id: I5831d4ad80b7f60d8782fffd6c64ef552f82ad6e
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 4f0156fa4bed1883e20c9f55f9f885e8dd3cb75c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-06-13 02:34:43 +00:00
Thiago Macieira
f5cee4ae8c QRangeModel/Doc: link to QtWidgets only if the feature is set
Amends efe41182fda94c0e4805c24b3305577e5da81880.

The code already tests for QT_NO_WIDGETS before including and using
Widgets APIs, and we will want to extend the corelib_snippets target
with more of the existing snippets code to make sure that they build.

To not break -no-widgets builds, don't link against Qt::Widgets unless
the feature is set.

Fixes: QTBUG-137556
Change-Id: Ic30fd519416068c275c3fffd0e1df10a76ce8fad
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 07d3d3935c4d8398818d40ee0f341d7555d745d6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-06-13 02:34:43 +00:00
Mårten Nordheim
e3fcc5403c QDateTime::currentDateTime: fix time zone offset for repeated hours
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.9 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>
2025-06-12 23:32:10 +00:00
Mårten Nordheim
00ecb3b6f5 Schannel: Use smart-ptr to manage the certiticate context
We already have the alias for it, we just never updated the stored
member to use it.

Pick-to: 6.9 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>
2025-06-12 23:32:01 +00:00
Olivier De Cannière
da9ac3bf1d Widgets: Set viewItemPosition style option for QTableView and QListView
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.9 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>
2025-06-12 15:22:31 +00:00
Morten Sørvig
f0d89ec153 wasm: don't recreate WebGL context on surface change
The native WebGL context is tied to a single canvas,
and can only be used with that canvas. (Qt creates
one canvas per QPlatformWindow).

This means that we need new native contexts in cases
where a QWindow is repeatedly created and destroyed.
It can be tempting to just create a new WebGL context
"behind the scenes" on the makeCurrent() call in this
case, but this does not work since GL resources created
by user code with the original WebGL context in place
are now invalid.

Inform user code that this has happened by signaling
a context loss. This is done by returning false from
makeCurrent(), and then making sure isValid() returns
false as well.

The context becomes invalid whenever the owning platform
window is destroyed; add a call from ~QWasmWindow() which
handles that bookkeeping.

Task-number: QTBUG-120138
Change-Id: I929b9bb51153007c16630b1a991399f01ebffa62
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
(cherry picked from commit c2ec20b226f0613db74a1e9fadffcf423ff1a180)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-06-12 13:37:27 +00:00
David Boddie
355619c2a3 Doc: Remove redundant "see also" link
Pick-to: 6.9
Change-Id: Id48d97a171b55f3dbf8d1fa32e23b82d28e5552d
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
(cherry picked from commit 5b86fca7cf21c79a1ec94dc242290ae23101b67c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-06-12 12:20:58 +00:00
Thiago Macieira
2d2dd3aa2e QBasicMutex: bring back fastTryUnlock for MSVC
MSVC exports inline functions, so we're not allowed to remove them. This
is an unlikely problem, though, since it was only called from other
inline functions: if the compiler was inlining content into user code
(as it should), then it would likely have inlined this one too; if
instead the inliner was disabled, then it wouldn't have inlined the
caller either.

Amends commit 1957597aa6bc6ebd8bd1f903389800897411ac5d. Seen in API
review.

Task-number: QTBUG-137478
Change-Id: Idd01170c3396c5b6fefefffd748f3335fc42fd79
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 25f396218d2eb86607a88b4f76edee7f78948816)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-06-12 12:20:58 +00:00
Marc Mutz
d6fb65adb0 QSharedPointer: fix uninit'ed field 'destroyer'
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.9 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>
2025-06-12 12:05:19 +00:00
Marc Mutz
6b77b43b1a QSocks5SocketEngine: don't depend on zero-initialization of QBasicAtomic
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.9 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>
2025-06-12 12:05:13 +00:00
Marc Mutz
2b0ec367c7 QRegion: fix potential UB in QBasicAtomic initialization
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.9 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>
2025-06-12 12:05:06 +00:00
Jani Korteniemi
ee0cb525cd Fix androiddeployqt copying build directory
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.9 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>
2025-06-12 11:11:00 +00:00
Marc Mutz
53b144f757 QTRY_IMPL: revert an incorrect change to a code comment
The comment in the QTRY_IMPL macro definition pertains to the
following using namespace std::chrono_literals, which has nothing to
do with the default timeout of QTRY_ macros, because that is
determined somewhere else. Further, "5 seconds" is not a valid chrono
literal, as "5s" was.

Partially reverts 55f163382d36ddf908fc2884f2020a1b92340c10.

Found in API-review.

Change-Id: Ic1242436bf87d7067e3c5240eb2687505e24800f
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit 270b2194106224c0dfb2221bcd85676a747b4f13)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-06-12 06:07:38 +00:00
Marc Mutz
64ce22c61e qdebug.h: remove duplicate includes
Added by 51f702d4029148570d255daef80d071d98cf1e16 w/o rationale.

Found in API-review.

Change-Id: Ia0afd3d3aaf7a8bc392333b8359ce5b5496bec7f
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit f1e1a933a610a71d93d888cc911187b80ea02e9c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-06-12 06:07:38 +00:00
Volker Hilsheimer
b5e05f32e6 QRM: silence gcc warning that an array can never be nullptr
If T is a C-array, like it is in some of our tests, then an instance of
that can never be nullptr, which recent gcc versions think warrants a
compile time warning -Waddress.

As a C array is a valid data structure to instantiate a QRangeModel
from, silence that warning by handling the case explicitly.

Change-Id: I63090891988e677cf3ae2d871418b1abd4d1dc71
Reviewed-by: Matthias Rauter <matthias.rauter@qt.io>
(cherry picked from commit 7ac8815a1943ced73a1c34a05ec7db318f6957d1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-06-12 06:07:38 +00:00
Tor Arne Vestbø
603e0710af macOS: Explicitly link the platform plugin to Foundation
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.9 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>
2025-06-12 03:08:08 +00:00
Tor Arne Vestbø
42b0903c34 macOS: Remove linkage to AGL framework
It's no longer available on macOS 26, and we don't use it anymore
anyways.

Pick-to: 6.9 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>
2025-06-12 03:08:05 +00:00
Marc Mutz
7f2f005d4f tst_QMetaObject: don't compare QByteArray/QLatin1StringView
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.9 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>
2025-06-11 20:02:03 +00:00
Mårten Nordheim
1256098113 Schannel: fix verifying intermediate certificates with netscape ext
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.9 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>
2025-06-11 19:23:03 +00:00
Volker Hilsheimer
e9a941053f Test: don't discard result of QFile::open
QVERIFY that the file could be opened, fail the test if it couldn't.

Pick-to: 6.9
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>
2025-06-11 18:10:52 +00:00
Fabian Kosmale
64407cc9ce QSFPM: Support source model undergoing reset during setSourceModel
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.9 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>
2025-06-11 18:01:13 +00:00
David Faure
4d644342ad QIdentityProxyModel: avoid emitting reset in no-op setSourceModel
QSortFilterProxyModel does this exactly, it was missing in
QIdentityProxyModel.

Change-Id: If14bc7a377c1ad9235dd70222e3bfbf88eef11c0
Reviewed-by: Santhosh Kumar <santhosh.kumar.selvaraj@qt.io>
(cherry picked from commit 5e971101f016e6e7d015594c539612e770e2999d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-06-11 13:24:52 +00:00
Samuli Piippo
db28f1912c wayland: fix EGL build without x11
Amend 7c0a96785fee4fea8ef1452166b1dde88957445c and add needed
defines to fix EGL build without x11. Otherwise eglplatform.h
will try to include X11 headers.
See 4cc5428548cb8ab973e4b0281dd123d59bfaf6a0 for more details.

Change-Id: I2c284219e83fecf862520a2f667d561adf4d4357
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 0f6c93c4534bd899444eceaeace34b2dd2a53ef6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-06-11 07:55:19 +00:00
Samuli Piippo
afafe577fa CMake: build QGnomePortalInterface always when DBus is available
Builds with DBus but without XCB/Wayland, failed with:
  qgnometheme.cpp:(.text+0x3ec): undefined reference to `vtable for QGnomePortalInterface'
  /usr/bin/ld: src/gui/CMakeFiles/Gui.dir/platform/unix/qgnometheme.cpp.o: in function `QGnomeThemePrivate::QGnomeThemePrivate()':

Change CMake configuration and build QGnomePortalInterface always with DBus,
except on Apple platforms, where it is not needed.

Change-Id: I3fb6400d87ba08f03c30e33924c8c7d483486c3b
Reviewed-by: MohammadHossein Qanbari <mohammad.qanbari@qt.io>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit ccb854799dbdb084749f7c816221f8d1b17164ea)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-06-11 07:55:07 +00:00
Volker Hilsheimer
33cd01395a Exclude MSVC version 19.44 in tst_qcheckedint and tst_qnumeric
Still causing an internal compiler error with the currently latest VC++
version.

Amends 4e3a1675793995e44f5c84f28bfdc0fd02aa27cc.

Change-Id: Ia4290c9b21eb8163180d725ed200629e36e85f1f
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 1ee43844d471a389d7ad8e6f2e655ac9ed2a7017)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-06-10 20:58:01 +00:00
Christian Ehrlicher
0ebe6718a1 QPA/Windows: Fix QPainter warnings when animations are disabled
Don't draw on a QImage with a size of 0/0.

This amends 5feefd30734cd12753956819fc7c152be07c24cd

Pick-to: 6.9 6.9.1
Fixes: QTBUG-135844
Task-number: QTBUG-127634
Change-Id: Ib57cdccfabe67454984f3229f9d7ad02dd0d9992
Reviewed-by: Błażej Szczygieł <mumei6102@gmail.com>
Reviewed-by: Wladimir Leuschner <wladimir.leuschner@qt.io>
(cherry picked from commit 46c2aa2b617ea136dbd1c9c7606316a10588ef11)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-06-10 18:30:32 +00:00
Edward Welbourne
5fc456bfe2 Make QTest::failOnWarning() fail also on any message type >= warning
Particularly for the no-parameter case, which fails on any warning, it
makes no sense to not also fail on a critical.

Pick-to: 6.9
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>
2025-06-10 18:12:03 +00:00
Tor Arne Vestbø
1c82a674bb Add QOperatingSystemVersion/QSysInfo support for macOS 26 (Tahoe)
Pick-to: 6.9 6.8 6.5
Change-Id: If6e7ee92e7c491c91a17e2730112319a132ca623
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit f67ef4934b948bbd4d15a2d90ad7172798abb691)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-06-10 18:12:03 +00:00
Frédéric Lefebvre
a9f1f7f41f Unblacklist tst_qListView::styleOptionViewItem on Ubuntu Wayland
tst_qListView::styleOptionViewItem is no longer flaky on Ubuntu
Wayland.

Fixes: QTBUG-127920
Change-Id: Ia79292c283bc21bb84b3cc30a7d6c1863c8d0836
Reviewed-by: Liang Qi <liang.qi@qt.io>
(cherry picked from commit 372a8f904a0bddd64ab474bb15fa56d29e2f04e1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-06-10 17:41:15 +00:00
Liang Qi
aecd1b9ed7 Unblacklist tst_qGraphicsItem::itemUsesExtendedStyleOption on Wayland
tst_qGraphicsItem::itemUsesExtendedStyleOption is no longer flaky on
Ubuntu Wayland.

Fixes: QTBUG-115293
Change-Id: Ic971a13c37398bd2eaa9ccb16c10bcf62fdb8d69
Reviewed-by: Liang Qi <liang.qi@qt.io>
(cherry picked from commit 22e193e293d9e8052b709f8ee966ca0562814368)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-06-10 17:41:15 +00:00
Frédéric Lefebvre
5af219f287 Unblacklist tst_qGraphicsItem::cursor on Ubuntu Wayland
tst_qGraphicsItem::cursor is no longer flaky on Ubuntu Wayland.

Fixes: QTBUG-127920
Change-Id: Ie9096f8790bd031b642c5f5c259445859848c2f5
Reviewed-by: Liang Qi <liang.qi@qt.io>
(cherry picked from commit ccd7eda0057167f29e9400ca7c0de1d515a565aa)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-06-10 17:41:15 +00:00
Frédéric Lefebvre
7b22740749 Unblacklist tst_qPrinter::testPrintPreviewDialog on Ubuntu Wayland
tst_qPrinter::testPrintPreviewDialog is no longer flaky on Ubuntu
Wayland.

Fixes: QTBUG-127920
Change-Id: Iea857db7be3ef6656667b32011009d561b92a749
Reviewed-by: Liang Qi <liang.qi@qt.io>
(cherry picked from commit e3225008cb08e4fbaad47045bade6aec00f67c1a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-06-10 17:41:15 +00:00
Frédéric Lefebvre
4bda2a17b5 Unblacklist tst_qBackingStore::flush on Ubuntu Wayland
tst_qBackingStore::flush is no longer flaky on Ubuntu Wayland

Fixes: QTBUG-127920
Change-Id: I16d91ceb8854f4aee8c569c792e8cb7977cb95ca
Reviewed-by: Liang Qi <liang.qi@qt.io>
(cherry picked from commit cb97b31906456f6c66a23606eb6fbda92dd049d0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-06-10 17:41:15 +00:00
David Boddie
57baa91ec2 doc: Fix links and auto-links
Changed function names to include parentheses so that they can be auto-
linked to getters and setters for bindable properties.

Pick-to: 6.9
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>
2025-06-10 17:41:15 +00:00
Mårten Nordheim
4235f0587b Http2: fix handling incoming frames on locally reset stream
After some of the RST stream handling was updated to more closely
follow the RFC it was accidentally not updating the handleHEADERS
function, and the handleDATA function was handled incorrectly leading
to a potential nullptr dereference.

Amends d17d260948e16549d82f1fdd4dec98d246b0622e.

Pick-to: 6.9
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>
2025-06-10 17:41:15 +00:00
Mårten Nordheim
a0ab39b24b Http2: Explicitly send RST_STREAM on cancelled request
It will do this when it gets deleted, but due to deleteLater just adding
an event to the event queue the events that are ahead in the queue may
use the stream in question. This would lead to a variant of
'stream not found', or specifically in the case of the bugreport, a
'HEADERS on non-existent stream' stream error.

Amends 6b4e11e63ead46dde5c1002c123ca964bb6aa342

Fixes: QTBUG-137427
Pick-to: 6.9
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>
2025-06-10 17:41:15 +00:00
Christian Ehrlicher
b6a3f29c10 SQLite: Update SQLite to v3.50.1
[ChangeLog][Third-Party Code] Updated SQLite to v3.50.1

Pick-to: 6.9 6.9.1 6.8 6.5 5.15
Change-Id: I238e95f3e028731aa871e279f21503d39acdbd2d
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit bac0226ac355be25d5670d9a1b0c410c7a5ec58f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-06-10 14:45:38 +00:00
Christian Ehrlicher
e9c0dcb0f1 SQL/DB2 & ODBC: avoid some code duplication
Avoid some code duplication by using a template parameter for
qMakeError() and qSqlWarning().

Change-Id: I698ab063fce6c7be1cb3debdb9e83978eac10409
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit ccf81822cffd099a7df68684a1738c804573e630)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-06-10 14:45:37 +00:00
Christian Ehrlicher
e1d874a71b SQL/ODBC: misc cleanup
Misc cleanup
 - merge qGetIntData and qGetBigIntData
 - remove unused braces
 - properly initialize values

Change-Id: I0867dbbfa611087cd470b821f1f8d7ed74ed0aae
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 4896448ffd54178c3e9fa2cba0070ce3a936ed05)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-06-10 14:45:36 +00:00
Laszlo Agocs
d7b80c9c9b rhi: metal: Handle MSAA backing textures like other textures
...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.9 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>
2025-06-10 14:22:37 +00:00
Bartlomiej Moskal
af519f5d8a Android-Keyboard: Avoid manual keyboard visibility updates on API 30+
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.9 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>
2025-06-10 13:29:01 +00:00
Bartlomiej Moskal
1e844fbf23 Android-Keyboard: Remove redundant code in isKeyboardHidden()
The m_keyboardIsVisible variable already reflects the current
keyboard visibility state. This commit simplifies the
isKeyboardHidden() method by using it directly, removing
unnecessary logic.

Task-number: QTBUG-98984
Pick-to: 6.9 6.8
Change-Id: I6bba90e6fbfb1191415e7ee812517ca15ac1c937
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit acbcf992ee5b9978f22a76e03384b4d9ea34a76f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-06-10 13:28:55 +00:00
Bartlomiej Moskal
3f72e55bca Android-Keyboard: Improve keyboard visibility tracking
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.9 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>
2025-06-10 13:28:48 +00:00
Bartlomiej Moskal
75e575e18f Android-Keyboard: Use new show() / hide() methods for keyboard control
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.9 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>
2025-06-10 13:28:42 +00:00
David Boddie
3a5cb14dd3 Doc: Fix links in see also documentation
Pick-to: 6.9
Change-Id: Ie2b6964550ea166def27de311c2b948afba5bf04
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 479fb822bf265d45178b7a9bd0bdacb0a02ce88b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-06-10 13:28:41 +00:00
Laszlo Agocs
52a1447842 rhi: d3d: Change a warning to categorized logging
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.9 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>
2025-06-10 11:51:19 +00:00
Marc Mutz
32c17c4598 QContiguousCache: drag the initialization of atomic ref behind ABI boundary
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.9 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>
2025-06-10 07:12:14 +00:00
Marc Mutz
417a5bcbb6 QLogging: fix potential UB in QBasicAtomic initialization
Until C++17 (inclusive), a default-constructed std::atomic object can,
officially, only be initialized with a call to std::atomic_init, for
which QBasicAtomic doesn't have API. It is even unclear whether
zero-initialization of static and thread-local objects will cause the
object to be initialized.

But initialization with = {} is definitely fishy, because that, by
definition, invokes the problematic default constructor. So make the
initialization explict with Q_BASIC_ATOMIC_INITIALIZER(0) instead.

Amends 4a154170773199f5b3376496c7b1a1c4530744e9.

Task-number: QTBUG-137465
Change-Id: I177e05c09e20e0830af7bf1ccb650afc860ab9d5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 231069963d9fa91736a377de4d3e77307374412f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-06-10 07:12:14 +00:00
Marc Mutz
dbd9f64174 [docs] IPC: don't mention undoc'ed QBasicAtomic
Use Q(non-Basic)Atomic instead.

Amends 7a370838177e581c8a9342808ba86e081951a41c.

Task-number: QTBUG-55421
Pick-to: 6.9 6.8
Change-Id: Ia8cc059a94acbee667c19b443ed2e2f487b56806
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 0ba05ca500ecb1269b3ba67761e1329e0934f40c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-06-10 07:12:14 +00:00
Marc Mutz
2d55125018 QEventLoop: fix potential UB in QBasicAtomic initialization
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.9 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>
2025-06-10 07:12:14 +00:00
Marc Mutz
fdc070c3b0 tst_QMetaObject: add a reproducer for overly eager QVector/QList replacement
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.9 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>
2025-06-10 09:12:14 +02:00
Lars Schmertmann
5564f91b6b Android: Unify behavior of Accessible.description with other platforms
On Windows, macOS and iOS both text and description are read out. On
Android the description is only used, when there is no name/text and
the result is used in AccessibilityNodeInfo::setContentDescription
while AccessibilityNodeInfo::setText is ignored. Using the content
description only is right, because Android will prioritize description
over text. So we need to do our own concatenation to use both.
Using ", " as separator looks like the right way, because Android use
it to separate the text from the role too. This was checked by enabling
TalkBack settings -> Advanced settings -> Developer settings -> Display
speech output.

Fixes: QTBUG-128494
Change-Id: Ib25e993ffc8614b9c9ccdc37207f2c3c496ecb1f
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit ce101c2c3c04f5ccd46abf7024662d0bc4e5a3a3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-06-10 04:15:01 +00:00
Assam Boudjelthia
1e3eb1203a Revert "Android: qtbase/src/android/. ./QtAndroidBinder.java security sensitive"
This reverts commit 7796ad3face5246ad62a959b61fdd3a92cea2803.

Reason for revert: the code is not doing critical data parsing.

Pick-to: 6.9 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>
2025-06-09 16:54:57 +00:00
Nic Zonta
e7a9bb77fe make all convenience functions in QFileDialog open modal dialogs
most convenience functions in qfiledialog.cpp (e.g. getSaveFileUrl, getOpenFileUrl) open modal dialogs, with the exception of getOpenFileContent and saveFileContent. This makes every function consistently open modal dialogs

Fixes: QTBUG-137329
Pick-to: 6.9
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>
2025-06-09 09:59:31 +00:00
David Edmundson
4c47bbc805 wayland: In test lock thread when setting env variables
putenv/setenv are not thread safe. The Qt wrappers lock a mutex
but this only works if all users use it.

Fixes: QTBUG-136450
Change-Id: I9a46b5be607c84436864afcf7eb063275e065738
Reviewed-by: Liang Qi <liang.qi@qt.io>
(cherry picked from commit a639807a8f86fc8203baaac5d731676bef79382e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-06-09 09:59:31 +00:00
Kai Köhne
3bd9eeda59 Doc: Fix broken links in Qt Widgets
The iQRhiWidget API got changed in commits acebb97b5880,  acebb97b58807d1d591.

Pick-to: 6.9 6.8
Change-Id: I7791b1a61d94f33ba01cfe22e63ecfdc7b81022b
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 95229bb7d039bb9e16a2ffd126d7ff1e25b37d32)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-06-09 09:59:31 +00:00
Christian Ehrlicher
deda96666d SQL/ODBC: fix escaping the username/password
The escaping for '{' was wrong in the previous commit.

Amends 38277a88f1dd69de6e031bc8313c8d5beadf6bd0

Pick-to: 6.9 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>
2025-06-09 09:59:31 +00:00
Jani Heikkinen
15d3c67c1b Revert "QFileSystemEngine::tempPath: bypass QDir and go straight to QFSEngine"
This reverts commit c617cc95934ae3c0896082d61a88487b34cf96be.

Reason for revert: QTBUG-137416

Change-Id: Ia715924cca8c38f5b988b3f41ee7b5a277c9c5e4
Reviewed-by: Antti Kokko <antti.kokko@qt.io>
2025-06-09 06:03:04 +00:00
Allan Sandfeld Jensen
f417776a36 SSE2 optimize QColorSpace CLUT
Optimize clamping setup for CLUT lookup.

Pick-to: 6.9
Change-Id: I35d65fc00efcb96a54518466e1e1de169571b862
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 51d5b9e2580a4f54594f616cf9859af86626c887)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-06-08 09:04:39 +00:00
Jani Heikkinen
2770bb4927 Revert "QFileSystemEngine::tempPath: simplify handling of fallbacks"
This reverts commit 17f5cdd39ed8a6e9cf25e99003478adfef572485.

Reason for revert: QTBUG-137416

Change-Id: I401befd260440d08a159c67ea0d0617dc88a9065
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2025-06-08 06:16:46 +00:00
Thiago Macieira
a1c1dda418 Wayland tests: use initTestCase() instead of init() to set env
Once is fine. We don't need to set the environment before each test
function.

Change-Id: Id27938950c196d6d3397fffd2fbf1a66fe7504f9
Reviewed-by: Liang Qi <liang.qi@qt.io>
Reviewed-by: David Redondo <qt@david-redondo.de>
(cherry picked from commit 4e57583f33fed081442526dff6473ce00c85e0be)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-06-07 13:32:41 +00:00
Axel Spoerl
fcd76f6d24 QCommandLinkButton: Don't reset icon on change to QStyleSheetStyle
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.9 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>
2025-06-07 09:44:38 +00:00
Marc Mutz
bff88a1391 tst_QMetaObject: refactor indexOfMethod() test
Removes duplication in preparation of adding more tests.

Pick-to: 6.9 6.8 6.5
Task-number: QTBUG-135572
Change-Id: I9ebfc40e24256d2d92af3f593f905d97b273e187
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 687fb924408f2043989b624e658620c59157e15e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-06-06 20:35:28 +00:00
Michael Weghorn
5380da9cc0 a11y atspi: Warn on unimplemented Application iface method
As already happens in the implementation for the
handling of all other AT-SPI interfaces
(called from AtSpiAdaptor::handleMessage), also
warn when an unimplemented/unknown method gets called
for the Application interface: increase log level
to warn and align message with the one used for
the other interfaces, so this can be more easily
identified.

Task-number: QTBUG-137344
Change-Id: I33d3811fd34ca0f9f4b1ab9d809f505c12c6517c
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 99ad6a51a595430c75323c4d5c2ecbc7fbd8d7f0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-06-06 18:18:34 +00:00
Mårten Nordheim
9ff93f75c0 tst_QHttp2Connection: fix typo of tested variable
Accidentally used clientStream instead of clientStream2.
Test still passes though.

Pick-to: 6.9
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>
2025-06-06 18:18:34 +00:00
Marc Mutz
a01e8d0d5c QTestResult: remove unused QTestResultPrivate forward declaration
This class was never pimpled in Qt 5.

Amends the start of the public history.

Pick-to: 6.9 6.8 6.5
Change-Id: I5761bb0e8401dd654a885b5edcf821be9e4c2694
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit ab7c1386d54732e50c0d9603ae5c013f3da81b12)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-06-06 18:18:33 +00:00
Friedemann Kleint
5641329229 QColorDialog: Stop color picking when application is deactivated
Fixes: QTBUG-134143
Change-Id: Ibfeff4f861ac5c63f4bdd85db40b25eee51c4d31
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 38ce4ad2f863fbd312334e239c0362ce3657830c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-06-06 15:19:43 +00:00
Laszlo Agocs
cdb2b134bc Revert "rhi: gl: Maintain Qt 5 compat wrt disk cache behavior"
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.9 6.8
Fixes: QTBUG-133904
Fixes: QTBUG-134245
Fixes: QTBUG-134089
Fixes: QTBUG-135411
Fixes: QTBUG-134496
Fixes: QTBUG-135810
Change-Id: Icbd880898941195fcbc2da544e1599867c6d5f51
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
(cherry picked from commit a589ef5cff160701316b3eebf2139ea9b55b0de5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-06-06 14:52:47 +00:00
Alexandru Croitor
217d7e4fbf CMake: Make QT_CMAKE_EXPORT_NAMESPACE available in the top-level scope
Previously QT_CMAKE_EXPORT_NAMESPACE was set by calling
find_package(QtBuildInternals) at repo dir scope, even in a top-level
build.

Starting with ddcafa0a51c65d86f6b5481f06fce5faeb75920d in
qtdeclarative, we now have a deferred call of
_qt_internal_write_deferred_qmlls_build_ini_file in the
CMAKE_BINARY_DIR scope, which lacks the QT_CMAKE_EXPORT_NAMESPACE
variable.
This caused errors in a top-level standalone tests build:
  Error evaluating generator expression $
    No target "::qtpaths"
    CMakeLists.txt:DEFERRED

To avoid the error we now set QT_CMAKE_EXPORT_NAMESPACE in the
top level scope.

To avoid duplicating the code into the QtBaseTopLevelHelpers,
we extract the qt_internal_top_level_setup_cmake_and_export_namespace
function into a new QtBuildInternalsHelpers.cmake file, which is
included by both QtBaseTopLevelHelpers.cmake and
QtBuildInternalsConfig.cmake.

We also copy and install that file.

This has less side effects than trying to call
find_package(QtBuildInternals) in the top-level scope.

Change-Id: I8e54e21d3f07ee86860cad49d6e43e0fdefbcee3
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 9b9a2398f30b6c35ef6be3ce929c352afb682910)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-06-06 14:28:09 +00:00
Alexandru Croitor
20dfcf4c59 CMake: Make qt-cmake-standalone-tests work from prefix build dir
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.9 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>
2025-06-06 14:28:03 +00:00
Konsta Alajärvi
8447cd262f CRA: Android: Mark QtLoader.java as security critical
Mark QtLoader as critical with "execute-external-code" due to
library loading in:
-loadQtLibraries()
-loadLibraryHelper()
-loadMainLibrary()
-loadLibraries()
QtLoader also parses library paths in:
-parseNativeLibrariesDir()

Fixes: QTBUG-136726
Task-number: QTBUG-135178
Pick-to: 6.9 6.8
Change-Id: I58a11fd44ea8159b8399ac7a27fd50eaab8185a6
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit fd52f868accab86f800d632014300aaa4920663a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-06-06 10:00:36 +00:00
Konsta Alajärvi
3df9be0f96 CRA: Android: Mark qtandroidplatformfiledialoghelper.cpp as security critical
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.9 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>
2025-06-06 10:00:34 +00:00
Santhosh Kumar
999dbe5734 Fix regression in drawing table cell border when border-collapse enabled
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.9 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>
2025-06-06 05:10:27 +00:00
Eskil Abrahamsen Blomfeldt
488e218604 Add an envvar restoring Qt 5 behavior for vertical font metrics
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.9 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>
2025-06-05 16:13:13 +00:00
Tor Arne Vestbø
1d9432cf79 iOS: Always update screen properties on status bar orientation change
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.9 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>
2025-06-05 16:13:13 +00:00
Tor Arne Vestbø
b695743b7e iOS: Report inverted screen orientations via windowScene orientation
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.9 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>
2025-06-05 16:13:13 +00:00
Piotr Wiercinski
40fd01f4a0 fusion: Improve visibility of Checkbox in dark mode
Fixes: QTBUG-136960
Pick-to: 6.9 6.8
Change-Id: I606fd034ba83011624ff9a38a8c973659c241c26
Reviewed-by: Matthias Rauter <matthias.rauter@qt.io>
(cherry picked from commit 5618710d63db673443ba3872463f4663c09fe204)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-06-05 16:13:13 +00:00
Ivan Solovev
2fc3c10d76 QProperty: fix comparison with comparable type
After e115c60b6da0db7013229e678720f36632c2e614, the comparison with
a type which is different from QProperty::value_type, but is comparable
to it, could result in ambiguous operator==() overloads.

Fix it by adding a new overload for operator==(QProperty<T>, U), where
operator==(T, U) exists.

Explicitly delete operator==(QProperty<T>, QProperty<U>) for such
types T and U, because the implicit conversion might be unwanted here.
The user should manually call .value() at least on one property, if
they want the comparison. Note that GCC does not allow to do it,
treating `= delete` as declaration and complaining about a default
template argument in friend template declaration. So, do it only for
Clang and MSVC.

Amends e115c60b6da0db7013229e678720f36632c2e614.

Task-number: QTBUG-134921
Change-Id: Id3ed48738cc462b5b0820fa3b25d80d4d4414548
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2025-06-05 11:42:15 +00:00
Volker Hilsheimer
e40d85403f QTreeView: Delay reset of accessibility when laying out items lazily
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.9 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>
2025-06-05 10:43:07 +00:00
Liang Qi
1dbbad44d7 wayland: use qgenericunixtheme_p.h instead of qgenericunixthemes_p.h
This amends 54651971a260d65c987d03973168f7d274ed8930 .

Change-Id: Iadeff9a59288934233bbf0f10d26510b5626b4f7
Reviewed-by: David Redondo <qt@david-redondo.de>
(cherry picked from commit c72ba39e50fea0c84fc93986aa587becd2e053b9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-06-05 06:10:51 +00:00
Oliver Eftevaag
6874de0e50 Windowsvista style: Fix hover widget attribute when using contrast theme
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.9 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>
2025-06-05 03:12:47 +00:00
Marc Mutz
023e36e0e7 tst_QMetaObject: add more QList/QVector tests
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.9 6.8 6.5
Task-number: QTBUG-135572
Change-Id: Id28bf3c4163099f07213bfbf7d296b4fd76b71a5
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit 5c563a98a5ffe2a72a641bfa9ed30e17ecffd893)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-06-04 22:25:28 +00:00
Marc Mutz
a4db2f7313 QWaylandGLContext: init fields in default ctor
Coverity complains that the =default'ed default ctor leaves
m_decorationsContext and m_api uninitialized, which is true.

To fix, use NSDMI for the former.

For m_api, initialize it in the default constructor's member
initializer list, because the default value is closely related to the
other constructor's choice of value¹, and so should be more proximal
to the other constructor's initialization of m_api (which is
dynamic). Using NSDMI for m_api would also remove tooling's ability to
detect faults in the other constructor.

¹ I had to track into QSurfaceFormat to verify which of the possible
  values is the correct one (= the one that gets mapped from
  DefaultSurfaceFormat by the switch in the other QWaylandGLContext
  ctor).

Amends 7c0a96785fee4fea8ef1452166b1dde88957445c.

Task-number: QTBUG-110758
Coverity-Id: 481857
Change-Id: I837d0a3a63bd6e2948ef1c9757e250bfba7dd957
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit e51675b891d2a4c64dda0094be0c84070833b82a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-06-04 22:25:28 +00:00
Michael Weghorn
33f8d08343 a11y atspi: Set correct child index in children-changed:add event
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.9 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>
2025-06-04 22:25:28 +00:00
Bartlomiej Moskal
ddd53192d3 Android: Avoid restarting InputMethodManager during IME batch edits
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.9 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>
2025-06-04 22:25:28 +00:00
Eirik Aavitsland
fe7a4b7bf8 Doc: Explicitly advise adding svg, if any, before other files to QIcon
Adding in the wrong order yields a QIcon that does not provide the
expected or desired behavior.

Fixes: QTBUG-135652
Pick-to: 6.9 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>
2025-06-04 19:19:43 +00:00
Edward Welbourne
e359fc7ec5 Fix typo in qlocale_tools_p.h unicodeForDigit() comment
Got the name of the numeric tokenizer helper wrong, making the
cross-reference comment misleading.

Pick-to: 6.9 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>
2025-06-04 19:19:41 +00:00
Edward Welbourne
ad55e57c6e Update QJsonValue(qint64) docs to reflect full precision
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.9 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>
2025-06-04 19:19:39 +00:00
Edward Welbourne
0beddaa99f Fix WASM build for the recent qtestcrashhandler changes
Amends commit fddb6fceaa28df2a24f7bdd216792985bf8141d1 - the code in
qtestcrashhandler_unix.cpp is written to compile for WASM, and some
declarations in the _p.h aren't excluded on WASM, so the exclusion of
the .cpp when WASM lacks threads lead to linker errors.

Change-Id: Idb941643302ed5a4c084d0fd2b4dfc07a44122e3
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Piotr Wierciński <piotr.wiercinski@qt.io>
(cherry picked from commit a34195508aeebf0f0982538cdf3852f149f051ab)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-06-04 19:19:36 +00:00
Nils Petter Skålerud
3f42b65818 QScreen, iOS: Make grabWindow() use UIGraphicsImageRenderer
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.9 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>
2025-06-04 19:19:35 +00:00
Marc Mutz
8ff03d14cc Explain what "junk" means in tst_QDataStream::status_QBitArray_data()
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.9 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>
2025-06-04 19:19:32 +00:00
Christian Ehrlicher
fe777849c9 QStyleSheetStyle: avoid creating QString
Don't create a QString when comparing the strings from
knownPseudoElements - a QLatin1StringView is enough.

Pick-to: 6.9
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>
2025-06-04 19:19:31 +00:00
Alexandru Croitor
2ee633a17a CMake: Fix capturing of x86intrin compile test output
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.9 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>
2025-06-04 19:19:29 +00:00
Christian Ehrlicher
728daaf384 SQLite: Update SQLite to v3.50.0
[ChangeLog][Third-Party Code] Updated SQLite to v3.50.0

Pick-to: 6.9 6.8 6.5 5.15
Change-Id: I20eef45bbb93ae3a50cdd7ffecaa53eec18823f7
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit cc6d78325b021c7b03ffb1aa90083261831f58f5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-06-04 19:19:28 +00:00
Alexandru Croitor
88c7f0250a CMake: Improve atmoicfptr error message on failure
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.9 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>
2025-06-04 19:19:26 +00:00
Lars Schmertmann
5ded95d659 Android: Bump androix dependency to 1.16.0
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.9 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>
2025-06-04 19:19:23 +00:00
Toni Saario
a66e8de68c Coin: Sign cross-compiled Windows binaries
Pick-to: 6.9 6.8
Task-number: QTBUG-137228
Change-Id: Idda7bfd97ac74a87987dcd4c31440b0c2f193c14
Reviewed-by: Simo Fält <simo.falt@qt.io>
(cherry picked from commit 3056da6711933d035be14394d6ea9fe72c1aabe9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-06-04 19:19:21 +00:00
Alexandru Croitor
f35f45642c CMake: Improve error reporting for failed linker no undefined flag
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.9 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>
2025-06-04 19:19:20 +00:00
Alexandru Croitor
c39a3edb50 CMake: Improve compile test error reporting in configure summary
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.9 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>
2025-06-04 19:19:18 +00:00
Thiago Macieira
17f5cdd39e QFileSystemEngine::tempPath: simplify handling of fallbacks
If the environment variable is empty, we have a couple of fallbacks, one
for Apple Darwin systems and one for everyone else. A non-absolute path
in the environment or the Apple API makes no sense, but this code
retains this defensive measure for them; for _PATH_TMP from <paths.h>,
we assume it is absolute.

Pick-to: 6.9
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>
2025-06-04 19:19:14 +00:00
Thiago Macieira
c617cc9593 QFileSystemEngine::tempPath: bypass QDir and go straight to QFSEngine
Temporary paths coming from the environment must be real filesystem
things, never a Qt file engine, so we don't need to create QDir with its
QDirPrivate, in order to call QFileSystemEngine.

The replacing of canonicalPath() with QFSE::absoluteName() is fine
because canonicalizing *after* cleanPath() is the wrong thing. For
example, if you had:

  $ ln -s $HOME/tmp /tmp/symlink
  $ TMPDIR=/tmp/symlink/..
then
  cleanPath($TMPDIR) = /tmp
  absolute($TMPDIR) = /tmp    # QFSE::absoluteName calls cleanPath
  canonical($TMPDIR) = $HOME
  canonical(cleanPath($TMPDIR)) = /tmp

The lack of canonicalization now only affects when the final path is a
symlink. Doing so bought us little security if it is a symlink and it
could change, because the result is not cached and could change from
call to call. That changing is probably worse than any attack, because
you could end up with

  QDir::tempPath() != QDir::tempPath()

[ChangeLog][QtCore][QDir] tempPath() may now return a non-canonical
path. This means going up from it (cdUp()) may result in different paths
from string manipulation (adding "/..").

Pick-to: 6.9
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>
2025-06-04 19:19:11 +00:00
Christian Ehrlicher
b01b4b1e40 SQL/MySQL: add option MYSQL_OPT_SSL_VERIFY_SERVER_CERT
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.9 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>
2025-06-04 19:19:07 +00:00
Michael Weghorn
88977389d3 a11y atspi: Create local variable on stack
There is no reason to allocate the OrgA11yAtspiSocketInterface
object only used inside AtSpiAdaptor::registerApplication on
the heap.

Change-Id: I2985acb5bd3e2f89c60de2b4ffa77b2a78cb4eff
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 77f02471ed263d514c6f6edd170b97d2f6e7b44e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-06-04 12:10:11 +00:00
Eskil Abrahamsen Blomfeldt
3915e017e7 Revert "dwrite: Support additional font names for system fonts"
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.9 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>
2025-06-04 12:09:17 +00:00
Tor Arne Vestbø
43d8bf3c28 Document QT_WARN_DEPRECATED_UP_TO
The default value is 0x070000, via qtdeprecationdefinitions.h

Pick-to: 6.9 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>
2025-06-04 12:07:16 +00:00
Li Changze
2fb5bd9669 qdbus: add call GetConnectionCredentials interface
[ChangeLog][QtDBus][QDBusConnectionInterface] Added method serviceCredentials().
See <https://dbus.freedesktop.org/doc/dbus-specification.html>
section: 'Method: org.freedesktop.DBus.GetConnectionCredentials' for more information.

Change-Id: If37687a35278fde8b0afc33eb19f9fa6b8dbe200
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 5ee2737d916af7e444cae88209d9f0bd4d29e7ea)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-06-04 04:58:15 +00:00
Jani Heikkinen
0b69f2f7ab Revert "Android: consider DecorView insets at app startup"
This reverts commit e96a4b84e136d065054600c07bf5fae17f3049ce.

Reason for revert: QTBUG-137306

Pick-to: 6.9
Change-Id: Id5718737f3f426de49ad109d214af1c920e5ae22
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 05f8abc61dd2429d7041a87d5bfc7bffbb105f12)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-06-04 04:19:31 +00:00
Axel Spoerl
641422686d QCocoaMenu: Explicitly remove NSMenu from supermenu on destruction
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.9 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>
2025-06-03 22:06:38 +00:00
Samuli Piippo
3afa63c30c CMake: qtwaylandscanner doesn't need Wayland::Client
Remove dependency to Wayland::Client as it's not needed and
prevents building qtwaylandscanner for Windows where Client
is not supported but scanner is needed for cross-compilations.

Change-Id: Ia38dda58c0800799673ae2d1e29626ce6b399f04
Reviewed-by: Liang Qi <liang.qi@qt.io>
(cherry picked from commit b23da37d71bde4673fab3510596514e4ac451053)
2025-06-03 13:34:55 +00:00
Christian Ehrlicher
eae538fa06 StyleSheetStyle: Don't paint CE_ComboBoxLabel when no stylesheet is set
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.9 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>
2025-06-03 07:25:23 +00:00
David Redondo
ef015fb9b8 Send synthesized button release event immediately
...not only on the next frame.

Change-Id: Iad31a3d80576c5cd8fa3ba7f64a39d7a6a01337a
Reviewed-by: David Edmundson <davidedmundson@kde.org>
(cherry picked from commit 1260aaf9549b180c192fb5c01b466945ec0575d1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-06-03 07:25:23 +00:00
Lars Schmertmann
878a505853 Android: Enable all warnings on javac for user code too
In addtion to 1cf03c974c433b7a5330b56bd9e519287fce6f7f we should also
enable all warnings in the template as a recommendation for users.

Change-Id: If60a3d9f3c1fd97b49ec7513f781bdfe1775d9d4
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 577f9ebfe6e6d7f5453fae7850055ded32b5d09f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-06-03 07:25:23 +00:00
Cristian Le
17c5224184 Add feature deprecation capability
Emit a warning if `FEATURE_*` variable is set. The "feature" is not
registered as a true feature after deprecation.

Pick-to: 6.9 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>
2025-06-03 07:25:23 +00:00
Cristian Le
de505a9c78 Display feature alias information in configure
Pick-to: 6.9 6.8
Change-Id: Ia7d054436ffcca64d6fecd363795e7439694b3f4
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 11fab3d1503634b47731d91ab0f7d6064dd49b42)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-06-03 07:25:22 +00:00
Alexandru Croitor
d12cdac9bd CMake: Fix location of iOS framework prl files
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.9 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>
2025-06-03 07:25:22 +00:00
Alexandru Croitor
98ac864cab CMake: Improve Apple SDK name and path reporting
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.9 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>
2025-06-03 07:25:22 +00:00
Christian Ehrlicher
03d478d5a9 QHeaderView: remove unused include, add missing include
Remove unused include of qtableview.h in the source - this also fixes
the compilation with feature_tableview = OFF.
Move the missing include of qlist.h into the header.

Pick-to: 6.9
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>
2025-06-03 07:25:22 +00:00
Rami Potinkara
856dcf7f7b Android: don't disambiguate the convertToJni call with 'template'
There is no non-template overload of LocalFrame::convertToJni, and
clang 18 complains about an explicit .template without a template
argument list. We call convertToJni without either in other places, so
do so here as well.

Fixes: QTBUG-136967
Change-Id: I2b4bbc8a4e2056bd2a8bff390ea0847f2e18202e
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit ea8f19f50bc6de845fb5ce7675b3b30dbc5c4344)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-06-03 07:25:22 +00:00
Michael Weghorn
a276ce6208 a11y atspi: Support Application iface "AtspiVersion" property
As the AT-SPI XML spec for the Application interface says,
this should currently always be "2.1" [1]:

    <!--
        AtspiVersion: You should return "2.1" here.

        This was intended to be the version of the atspi interfaces
        that the application supports, but atspi will probably move to
        using versioned interface names instead.  Just return "2.1" here.
    -->
    <property name="AtspiVersion" type="s" access="read"/>

This makes the expected value show up in Accerciser with
pending merge request [2] in place instead of triggering a fallback
path in Accerciser handling the null case for Qt applications.

[1] 2d83e3a6df/xml/Application.xml (L19-26)
[2] https://gitlab.gnome.org/GNOME/accerciser/-/merge_requests/95

Pick-to: 6.9
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>
2025-06-03 04:06:59 +00:00
Olli Vuolteenaho
44913432ce Android: Don't reparse same paths in QML to Java codegen
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.9 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>
2025-06-02 14:41:06 +00:00
Cristian Le
895d921619 Introduce INSTALL_QT_SHAREDIR
Normally `INSTALL_DATADIR` is the canonical place for
`share`/`CMAKE_INSTALL_DATADIR`, but this standard is not well
enforced.

In 834d92a, `INSTALL_SHAREDIR` was introduced to better enforce this
standard and allow to install into third-party program's
`CMAKE_INSTALL_DATADIR` (e.g. wayland). This ended up being used as
`INSTALL_SHAREDIR/qt6` instead, but this leaves little room for
configuration and renaming.

This change introduces a namespaced variant that is guaranteed to be
owned by Qt.

Change-Id: I25c0e5b47c402b178120e9e628fdfaf4aaad27ad
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit cebdf1eb1cbab983a2392695a2491bcdd9ca257d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-06-02 14:41:05 +00:00
David Edmundson
91225ad81e QVulkanWindow: Force render on paint event
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.9 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>
2025-06-02 14:41:04 +00:00
Matthias Rauter
924b8dd584 Mark three files in corelib/mimetype as critical
* 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.9 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>
2025-06-02 14:41:03 +00:00
Andreas Eliasson
121f5105fd Doc: Add \note to QTest::qWait() to consider QTRY_*() macros instead
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.9 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>
2025-06-02 14:41:03 +00:00
Tim Blechmann
84a6c4ca6e Cocoa: QNSView - fix memory leak of QContainerLayer
setLayer will increment the reference count, so QContainerLayer is
leaked, as it is not autoreleased.

Change-Id: I43cef8bbf9ccb9b849322edfb1e7ab75f5ae9898
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit e6dfd2e9b084bea53bf39c5fa3d70dbc81777218)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-06-02 13:55:35 +00:00
Tim Blechmann
46c82ac228 Cocoa: QNSView - fix memory leak of QNSViewMenuHelper
QNSViewMenuHelper is leaked, as dealloc did not nil it to decrement the
reference count.

Pick-to: 6.9 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>
2025-06-02 13:55:29 +00:00
Eskil Abrahamsen Blomfeldt
9237cdf98f DirectWrite: Avoid infinite recursion with broken font data
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.9 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>
2025-06-02 09:34:12 +00:00
84 changed files with 351 additions and 1672 deletions

View File

@ -7,7 +7,7 @@ if (NOT DEFINED QT_SUPERBUILD OR DEFINED QT_REPO_MODULE_VERSION)
set(QT_EXTRA_INTERNAL_TARGET_DEFINES "QT_LEAN_HEADERS=1")
endif()
set(QT_REPO_MODULE_VERSION "6.11.0")
set(QT_REPO_MODULE_VERSION "6.10.0")
set(QT_REPO_MODULE_PRERELEASE_VERSION_SEGMENT "alpha1")
set(QT_COPYRIGHT "Copyright (C) The Qt Company Ltd. and other contributors.")

View File

@ -145,7 +145,7 @@ endforeach()
set(XCB_XCB_component_deps)
set(XCB_COMPOSITE_component_deps XCB XFIXES)
set(XCB_DAMAGE_component_deps XCB XFIXES)
set(XCB_IMAGE_component_deps XCB SHM AUX)
set(XCB_IMAGE_component_deps XCB SHM)
set(XCB_RENDERUTIL_component_deps XCB RENDER)
set(XCB_XFIXES_component_deps XCB RENDER SHAPE)
set(XCB_XVMC_component_deps XCB XV)

View File

@ -287,189 +287,3 @@ function(qt_internal_android_dependencies target)
COMPONENT
Devel)
endfunction()
function(qt_internal_set_up_build_host_java_docs)
if("${ANDROID_SDK_ROOT}" STREQUAL "")
message(FATAL_ERROR
"QT_HOST_DOCUMENT_JAVA_SOURCES=ON requires setting ANDROID_SDK_ROOT."
)
endif()
_qt_internal_locate_android_jar()
set(QT_ANDROID_JAR "${QT_ANDROID_JAR}" PARENT_SCOPE)
set(QT_ANDROID_API_USED_FOR_JAVA "${QT_ANDROID_API_USED_FOR_JAVA}" PARENT_SCOPE)
endfunction()
# Collect the Java source files that were recorded by qt_internal_add_jar.
# If we're not building for Android, qt_internal_add_jar is not called, and we simple collect
# all java files under the current directory.
function(qt_internal_collect_jar_sources out_var)
if(NOT ANDROID)
file(GLOB_RECURSE sources LIST_DIRECTORIES FALSE "*.java")
set("${out_var}" "${sources}" PARENT_SCOPE)
return()
endif()
set(no_value_options "")
set(single_value_options DIRECTORY)
set(multi_value_options "")
cmake_parse_arguments(PARSE_ARGV 1 arg
"${no_value_options}" "${single_value_options}" "${multi_value_options}"
)
_qt_internal_validate_all_args_are_parsed(arg)
set(directory_arg "")
if(DEFINED arg_DIRECTORY)
set(directory_arg DIRECTORY ${arg_DIRECTORY})
endif()
get_directory_property(result ${directory_arg} _qt_jar_sources)
get_directory_property(subdirs ${directory_arg} SUBDIRECTORIES)
foreach(subdir IN LISTS subdirs)
qt_internal_collect_jar_sources(subdir_result DIRECTORY ${subdir})
if(NOT "${subdir_result}" STREQUAL "")
list(APPEND result ${subdir_result})
endif()
endforeach()
set("${out_var}" "${result}" PARENT_SCOPE)
endfunction()
function(qt_internal_add_javadoc_target)
set(no_value_options "")
set(single_value_options
MODULE
OUTPUT_DIR
)
set(multi_value_options
SOURCES
)
cmake_parse_arguments(PARSE_ARGV 0 arg
"${no_value_options}" "${single_value_options}" "${multi_value_options}"
)
_qt_internal_validate_all_args_are_parsed(arg)
if(TARGET ${arg_MODULE})
get_target_property(skip ${arg_MODULE} _qt_skip_javadoc)
if(skip)
message(VERBOSE "Skipping generation of Android HTML docs for ${arg_MODULE}.")
return()
endif()
endif()
# Collect source directories from source file paths.
set(source_dirs "")
foreach(source_path IN LISTS arg_SOURCES)
get_filename_component(dir_path "${source_path}" DIRECTORY)
list(APPEND source_dirs "${dir_path}")
endforeach()
list(REMOVE_DUPLICATES source_dirs)
# Retrieve package names from source dirs.
set(package_names "")
foreach(source_dir IN LISTS source_dirs)
string(REGEX MATCH "/(org/qtproject/qt/android(/.*|$))" package_dir "${source_dir}")
if(package_dir STREQUAL "")
message(VERBOSE "Java source dir is not a package directory: ${source_dir}")
continue()
endif()
# Store package_dir without leading slash.
set(package_dir "${CMAKE_MATCH_1}")
# Use dots instead of slashes for the package name.
string(REPLACE "/" "." package_name "${package_dir}")
list(APPEND package_names "${package_name}")
endforeach()
# Strip package paths from the source dirs.
list(TRANSFORM source_dirs REPLACE "/org/qtproject/qt/android.*" "")
list(REMOVE_DUPLICATES source_dirs)
# Use the correct separator for the --source-path argument.
if(NOT CMAKE_HOST_WIN32)
string(REPLACE ";" ":" source_dirs "${source_dirs}")
endif()
# Use a response file to avoid quoting issues with the space-separated package names.
set(javadoc_output_dir "${arg_OUTPUT_DIR}/android")
set(response_file "${CMAKE_CURRENT_BINARY_DIR}/doc/.javadocargs")
string(REPLACE ";" " " package_names_space_separated "${package_names}")
file(CONFIGURE
OUTPUT "${response_file}"
CONTENT "${package_names_space_separated}
--class-path \"${QT_ANDROID_JAR}\"
-d \"${javadoc_output_dir}\"
--source-path \"${source_dirs}\""
)
set(module ${arg_MODULE})
set(javadoc_target android_html_docs_${module})
add_custom_target(${javadoc_target} ${command_args}
COMMAND ${Java_JAVADOC_EXECUTABLE} "@${response_file}"
COMMENT "Generating Java documentation"
VERBATIM
)
add_dependencies(docs_android ${javadoc_target})
if (QT_WILL_INSTALL)
install(DIRECTORY "${arg_OUTPUT_DIR}/"
DESTINATION "${INSTALL_DOCDIR}/${module}"
COMPONENT _install_docs_android_${module}
EXCLUDE_FROM_ALL
)
add_custom_target(install_docs_android_${module}
COMMAND ${CMAKE_COMMAND}
--install "${CMAKE_BINARY_DIR}"
--component _install_docs_android_${module}
COMMENT "Installing Android html docs for ${module}"
)
else()
add_custom_target(install_docs_android_${module})
endif()
add_dependencies(install_docs_android_${module} ${javadoc_target})
add_dependencies(install_docs_android install_docs_android_${module})
endfunction()
function(qt_internal_create_source_jar)
set(no_value_options "")
set(single_value_options MODULE)
set(multi_value_options SOURCES)
cmake_parse_arguments(PARSE_ARGV 0 arg
"${no_value_options}" "${single_value_options}" "${multi_value_options}"
)
_qt_internal_validate_all_args_are_parsed(arg)
set(module ${arg_MODULE})
set(jar_target android_source_jar_${module})
set(jar_name ${CMAKE_INSTALL_NAMESPACE}AndroidSources${module})
add_jar(${jar_target}
SOURCES ${arg_SOURCES}
VERSION ${PROJECT_VERSION}
INCLUDE_JARS "${QT_ANDROID_JAR}"
OUTPUT_NAME ${jar_name}
)
set_target_properties(${jar_target} PROPERTIES EXCLUDE_FROM_ALL ON)
add_dependencies(android_source_jars ${jar_target})
if(QT_WILL_INSTALL)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${jar_name}-${PROJECT_VERSION}.jar"
DESTINATION "${INSTALL_DATADIR}/android/${module}"
COMPONENT _install_android_source_jar_${module}
EXCLUDE_FROM_ALL
)
add_custom_target(install_android_source_jar_${module}
COMMAND ${CMAKE_COMMAND}
--install "${CMAKE_BINARY_DIR}"
--component _install_android_source_jar_${module}
COMMENT "Installing Android source jar for ${module}"
)
else()
add_custom_target(install_android_source_jar_${module})
endif()
add_dependencies(install_android_source_jar_${module} ${jar_target})
add_dependencies(install_android_source_jars install_android_source_jar_${module})
endfunction()

View File

@ -65,11 +65,6 @@ function(qt_auto_detect_wasm)
endfunction()
function(qt_auto_detect_android)
# Don't assume an Android build if we're requesting to build Java documentation on the host.
if(QT_BUILD_HOST_JAVA_DOCS)
return()
endif()
# We assume an Android build if any of the ANDROID_* cache variables are set.
if(DEFINED ANDROID_SDK_ROOT
OR DEFINED ANDROID_NDK_ROOT

View File

@ -449,7 +449,6 @@ macro(qt_internal_setup_build_and_global_variables)
qt_internal_setup_find_host_info_package()
qt_internal_setup_build_docs()
qt_internal_setup_build_java_docs_on_host()
qt_internal_include_qt_platform_android()

View File

@ -403,16 +403,6 @@ macro(qt_internal_setup_build_docs)
option(QT_BUILD_DOCS "Generate Qt documentation targets" ON)
endmacro()
macro(qt_internal_setup_build_java_docs_on_host)
option(QT_BUILD_HOST_JAVA_DOCS "Generate Java documentation targets on host" OFF)
if(QT_BUILD_HOST_JAVA_DOCS)
find_package(Java)
if(Java_FOUND)
include(UseJava)
endif()
endif()
endmacro()
macro(qt_internal_set_use_ccache)
option(QT_USE_CCACHE "Enable the use of ccache")
if(QT_USE_CCACHE)

View File

@ -79,7 +79,6 @@ function(qt_internal_add_docs)
set(opt_args
SHOW_INTERNAL
SKIP_JAVADOC
)
set(single_args "")
set(multi_args
@ -353,9 +352,9 @@ function(qt_internal_add_docs)
if (QT_WILL_INSTALL)
install(DIRECTORY "${qdoc_output_dir}/"
DESTINATION "${INSTALL_DOCDIR}/${doc_target}"
COMPONENT _install_html_docs_${target}
EXCLUDE_FROM_ALL
DESTINATION "${INSTALL_DOCDIR}/${doc_target}"
COMPONENT _install_html_docs_${target}
EXCLUDE_FROM_ALL
)
add_custom_target(install_html_docs_${target}
@ -366,9 +365,9 @@ function(qt_internal_add_docs)
)
install(FILES "${qch_file_path}"
DESTINATION "${INSTALL_DOCDIR}"
COMPONENT _install_qch_docs_${target}
EXCLUDE_FROM_ALL
DESTINATION "${INSTALL_DOCDIR}"
COMPONENT _install_qch_docs_${target}
EXCLUDE_FROM_ALL
)
add_custom_target(install_qch_docs_${target}
@ -404,73 +403,4 @@ function(qt_internal_add_docs)
qt_internal_add_doc_tool_dependency(prepare_docs_${target} qdoc)
qt_internal_add_doc_tool_dependency(qch_docs_${target} qhelpgenerator)
endif()
_qt_internal_forward_function_args(
FORWARD_PREFIX arg
FORWARD_OUT_VAR add_java_documentation_args
FORWARD_OPTIONS
SKIP_JAVADOC
)
qt_internal_add_java_documentation(${target} ${add_java_documentation_args}
OUTPUT_DIR "${qdoc_output_dir}"
)
endfunction()
function(qt_internal_add_java_documentation target)
if(NOT ANDROID AND NOT QT_BUILD_HOST_JAVA_DOCS)
return()
endif()
set(no_value_options
SKIP_JAVADOC
)
set(single_value_options
OUTPUT_DIR
)
set(multi_value_options "")
cmake_parse_arguments(PARSE_ARGV 1 arg
"${no_value_options}" "${single_value_options}" "${multi_value_options}"
)
_qt_internal_validate_all_args_are_parsed(arg)
# Use a default output directory based on the project name.
if(NOT DEFINED arg_OUTPUT_DIR)
if (QT_WILL_INSTALL)
set(arg_OUTPUT_DIR "${CMAKE_BINARY_DIR}/${INSTALL_DOCDIR}")
else()
set(arg_OUTPUT_DIR "${QT_BUILD_INTERNALS_RELOCATABLE_INSTALL_PREFIX}/${INSTALL_DOCDIR}")
endif()
string(APPEND arg_OUTPUT_DIR "/${PROJECT_NAME}")
endif()
qt_internal_collect_jar_sources(sources)
# Bail out if we haven't found relevant sources.
if(sources STREQUAL "")
return()
endif()
if(NOT TARGET docs_android)
add_custom_target(docs_android)
add_custom_target(install_docs_android)
add_dependencies(install_docs_android docs_android)
add_custom_target(android_source_jars)
add_custom_target(install_android_source_jars)
add_dependencies(install_android_source_jars android_source_jars)
endif()
if(NOT ANDROID)
qt_internal_set_up_build_host_java_docs()
endif()
if(NOT arg_SKIP_JAVADOC)
qt_internal_add_javadoc_target(
MODULE ${target}
SOURCES ${sources}
OUTPUT_DIR "${arg_OUTPUT_DIR}"
)
endif()
qt_internal_create_source_jar(SOURCES ${sources} MODULE ${target})
endfunction()

View File

@ -28,7 +28,6 @@ function(qt_internal_add_jar target)
get_filename_component(absolute_path "${path}" ABSOLUTE)
list(APPEND absolute_sources "${absolute_path}")
endforeach()
set_property(DIRECTORY APPEND PROPERTY _qt_jar_sources "${absolute_sources}")
add_jar(${target} SOURCES ${absolute_sources} ${ARGV})

View File

@ -23,7 +23,32 @@ if (NOT IS_DIRECTORY "${ANDROID_SDK_ROOT}")
message(FATAL_ERROR "Could not find ANDROID_SDK_ROOT or path is not a directory: ${ANDROID_SDK_ROOT}")
endif()
_qt_internal_locate_android_jar()
# This variable specifies the API level used for building Java code, it can be the same as Qt for
# Android's maximum supported Android version or higher.
if(NOT QT_ANDROID_API_USED_FOR_JAVA)
set(QT_ANDROID_API_USED_FOR_JAVA "android-35")
endif()
set(jar_location "${ANDROID_SDK_ROOT}/platforms/${QT_ANDROID_API_USED_FOR_JAVA}/android.jar")
if(NOT EXISTS "${jar_location}")
_qt_internal_detect_latest_android_platform(android_platform_latest)
if(android_platform_latest)
message(NOTICE "The default platform SDK ${QT_ANDROID_API_USED_FOR_JAVA} not found, "
"using the latest installed ${android_platform_latest} instead.")
set(QT_ANDROID_API_USED_FOR_JAVA ${android_platform_latest})
endif()
endif()
set(QT_ANDROID_JAR "${ANDROID_SDK_ROOT}/platforms/${QT_ANDROID_API_USED_FOR_JAVA}/android.jar")
if(NOT EXISTS "${QT_ANDROID_JAR}")
message(FATAL_ERROR
"No suitable Android SDK platform found in '${ANDROID_SDK_ROOT}/platforms'."
" The minimum version required for building Java code is ${QT_ANDROID_API_USED_FOR_JAVA}"
)
endif()
message(STATUS "Using Android SDK API ${QT_ANDROID_API_USED_FOR_JAVA} from "
"${ANDROID_SDK_ROOT}/platforms")
# Locate Java
include(UseJava)

View File

@ -45,36 +45,3 @@ function(_qt_internal_sort_android_platforms out_var)
endif()
set("${out_var}" "${platforms}" PARENT_SCOPE)
endfunction()
function(_qt_internal_locate_android_jar)
# This variable specifies the API level used for building Java code, it can be the same as Qt
# for Android's maximum supported Android version or higher.
if(NOT QT_ANDROID_API_USED_FOR_JAVA)
set(QT_ANDROID_API_USED_FOR_JAVA "android-35")
endif()
set(jar_location "${ANDROID_SDK_ROOT}/platforms/${QT_ANDROID_API_USED_FOR_JAVA}/android.jar")
if(NOT EXISTS "${jar_location}")
_qt_internal_detect_latest_android_platform(android_platform_latest)
if(android_platform_latest)
message(NOTICE "The default platform SDK ${QT_ANDROID_API_USED_FOR_JAVA} not found, "
"using the latest installed ${android_platform_latest} instead.")
set(QT_ANDROID_API_USED_FOR_JAVA ${android_platform_latest})
endif()
endif()
set(QT_ANDROID_JAR "${ANDROID_SDK_ROOT}/platforms/${QT_ANDROID_API_USED_FOR_JAVA}/android.jar")
if(NOT EXISTS "${QT_ANDROID_JAR}")
message(FATAL_ERROR
"No suitable Android SDK platform found in '${ANDROID_SDK_ROOT}/platforms'."
" The minimum version required for building Java code is ${QT_ANDROID_API_USED_FOR_JAVA}"
)
endif()
message(STATUS "Using Android SDK API ${QT_ANDROID_API_USED_FOR_JAVA} from "
"${ANDROID_SDK_ROOT}/platforms")
set(QT_ANDROID_JAR "${QT_ANDROID_JAR}" PARENT_SCOPE)
set(QT_ANDROID_API_USED_FOR_JAVA "${QT_ANDROID_API_USED_FOR_JAVA}" PARENT_SCOPE)
endfunction()

View File

@ -11,4 +11,3 @@ if (ANDROID)
add_subdirectory(templates_aar)
endif()
qt_internal_add_java_documentation(Global)

View File

@ -919,12 +919,11 @@ qt_feature("vxpipedrv" PRIVATE
AUTODETECT OFF
CONDITION VXWORKS
)
qt_feature_deprecated("regularexpression" PUBLIC
REMOVE_BY "7.0"
qt_feature("regularexpression" PUBLIC
SECTION "Kernel"
LABEL "QRegularExpression"
PURPOSE "Provides an API to Perl-compatible regular expressions."
VALUE ON
CONDITION QT_FEATURE_system_pcre2 OR QT_FEATURE_pcre2
)
qt_feature_definition("regularexpression" "QT_NO_REGULAREXPRESSION" NEGATE VALUE "1")
qt_feature("backtrace" PRIVATE
@ -1276,8 +1275,3 @@ qt_configure_add_report_entry(
MESSAGE "Basic cpp/winrt support missing. Some features might not be available."
CONDITION WIN32 AND NOT QT_FEATURE_cpp_winrt
)
qt_configure_add_report_entry(
TYPE ERROR
MESSAGE "Qt requires pcre2 or system-pcre2 feature"
CONDITION NOT QT_FEATURE_pcre2 AND NOT QT_FEATURE_system_pcre2
)

View File

@ -19,28 +19,20 @@ QByteArray encodedString = fromUtf16(string);
auto toUtf16 = QStringDecoder(QStringDecoder::Utf8);
QString string;
while (new_data_available() && !toUtf16.hasError()) {
while (new_data_available()) {
QByteArray chunk = get_new_data();
string += toUtf16(chunk);
}
auto result = toUtf16.finalize();
if (result.error != QStringDecoder::FinalizeResult::NoError) {
// Handle error
}
//! [2]
//! [3]
auto fromUtf16 = QStringEncoder(QStringEncoder::Utf8);
QByteArray encoded;
while (new_data_available() && !fromUtf16.hasError()) {
while (new_data_available()) {
QString chunk = get_new_data();
encoded += fromUtf16(chunk);
}
auto result = fromUtf16.finalize();
if (result.error != QStringEncoder::FinalizeResult::NoError) {
// Handle error
}
//! [3]
{

View File

@ -6,16 +6,15 @@
//! [0]
#include <QSharedData>
#include <QSharedDataPointer>
#include <QString>
class EmployeeData : public QSharedData
{
public:
EmployeeData() : id(-1) {}
public:
EmployeeData() : id(-1) { }
EmployeeData(const EmployeeData &other)
: QSharedData(other), id(other.id), name(other.name) {}
~EmployeeData() = default;
: QSharedData(other), id(other.id), name(other.name) { }
~EmployeeData() { }
int id;
QString name;
@ -23,38 +22,34 @@ public:
class Employee
{
public:
//! [1]
public:
//! [1]
Employee() { d = new EmployeeData; }
//! [1] //! [2]
//! [1] //! [2]
Employee(int id, const QString &name) {
d = new EmployeeData;
setId(id);
setName(name);
}
//! [2] //! [7]
Employee(const Employee &other) = default;
Employee &operator=(const Employee &other) = default;
Employee(Employee &&other) = default;
Employee &operator=(Employee &&other) = default;
~Employee() = default;
//! [7]
//! [3]
//! [2] //! [7]
Employee(const Employee &other)
: d (other.d)
{
}
//! [7]
//! [3]
void setId(int id) { d->id = id; }
//! [3] //! [4]
//! [3] //! [4]
void setName(const QString &name) { d->name = name; }
//! [4]
//! [4]
//! [5]
//! [5]
int id() const { return d->id; }
//! [5] //! [6]
//! [5] //! [6]
QString name() const { return d->name; }
//! [6]
//! [6]
private:
private:
QSharedDataPointer<EmployeeData> d;
};
//! [0]

View File

@ -1492,12 +1492,11 @@ backtraceFramesForLogMessage(int frameCount,
else
return std::move(function).toUtf8(); // -> QByteArray
}();
auto cleanup = [](auto *p) { free(p); };
using Ptr = std::unique_ptr<char, decltype(cleanup)>;
auto demangled = Ptr(abi::__cxa_demangle(fn, nullptr, nullptr, nullptr), cleanup);
QScopedPointer<char, QScopedPointerPodDeleter> demangled;
demangled.reset(abi::__cxa_demangle(fn, nullptr, nullptr, nullptr));
if (demangled)
return QString::fromUtf8(qCleanupFuncinfo(demangled.get()));
return QString::fromUtf8(qCleanupFuncinfo(demangled.data()));
else
return QString::fromUtf8(fn); // restore
};
@ -1538,10 +1537,8 @@ backtraceFramesForLogMessage(int frameCount,
static const QRegularExpression rx(QStringLiteral("^(?:[^(]*/)?([^(/]+)\\(([^+]*)(?:[\\+[a-f0-9x]*)?\\) \\[[a-f0-9x]*\\]$"));
auto decodeFrame = [&](void *&addr) -> DecodedFrame {
auto cleanup = [](auto *p) { free(p); };
auto strings =
std::unique_ptr<char *, decltype(cleanup)>(backtrace_symbols(&addr, 1), cleanup);
QString trace = QString::fromUtf8(strings.get()[0]);
QScopedPointer<char*, QScopedPointerPodDeleter> strings(backtrace_symbols(&addr, 1));
QString trace = QString::fromUtf8(strings.data()[0]);
QRegularExpressionMatch m = rx.match(trace);
if (!m.hasMatch())
return {};

View File

@ -900,13 +900,13 @@ bool QFileSystemEngine::fillMetaData(const QFileSystemEntry &entry, QFileSystemM
}
if (what & QFileSystemMetaData::AliasType)
what |= QFileSystemMetaData::LinkType;
#endif // defined(Q_OS_DARWIN)
#endif
#ifdef UF_HIDDEN
if (what & QFileSystemMetaData::HiddenAttribute) {
// OS X >= 10.5: st_flags & UF_HIDDEN
what |= QFileSystemMetaData::PosixStatFlags;
}
#endif
#endif // defined(Q_OS_DARWIN)
// if we're asking for any of the stat(2) flags, then we're getting them all
if (what & QFileSystemMetaData::PosixStatFlags)
@ -929,7 +929,7 @@ bool QFileSystemEngine::fillMetaData(const QFileSystemEntry &entry, QFileSystemM
// entry still exist are EACCES, EFAULT, ENOMEM and EOVERFLOW. If we get
// EACCES or ENOMEM, then we have no choice on how to proceed, so we may
// as well conclude it doesn't exist; EFAULT can't happen and EOVERFLOW
// shouldn't happen because we build in _LARGEFILE64.
// shouldn't happen because we build in _LARGEFIE64.
union {
QT_STATBUF statBuffer;
struct statx statxBuffer;
@ -939,7 +939,7 @@ bool QFileSystemEngine::fillMetaData(const QFileSystemEntry &entry, QFileSystemM
mode_t mode = 0;
statResult = qt_lstatx(nativeFilePath, &statxBuffer);
if (statResult == -ENOSYS) {
// use lstat(2)
// use lstst(2)
statResult = QT_LSTAT(nativeFilePath, &statBuffer);
if (statResult == 0)
mode = statBuffer.st_mode;
@ -954,7 +954,7 @@ bool QFileSystemEngine::fillMetaData(const QFileSystemEntry &entry, QFileSystemM
data.entryFlags |= QFileSystemMetaData::LinkType;
statResult = -1; // force stat(2) below
} else {
// it's a regular file and it exists
// it's a reagular file and it exists
if (statResult)
data.fillFromStatxBuf(statxBuffer);
else
@ -1868,36 +1868,23 @@ QString QFileSystemEngine::rootPath()
return u"/"_s;
}
static constexpr QLatin1StringView nativeTempPath() noexcept
{
// _PATH_TMP usually ends in '/' and we don't want that
QLatin1StringView temp = _PATH_TMP ""_L1;
static_assert(_PATH_TMP[0] == '/', "_PATH_TMP needs to be absolute");
static_assert(_PATH_TMP[1] != '\0', "Are you really sure _PATH_TMP should be the root dir??");
if (temp.endsWith(u'/'))
temp.chop(1);
return temp;
}
QString QFileSystemEngine::tempPath()
{
#ifdef QT_UNIX_TEMP_PATH_OVERRIDE
return QT_UNIX_TEMP_PATH_OVERRIDE ""_L1;
#else
QString temp = qEnvironmentVariable("TMPDIR");
# if defined(Q_OS_DARWIN) && !defined(QT_BOOTSTRAPPED)
if (NSString *nsPath; temp.isEmpty() && (nsPath = NSTemporaryDirectory()))
temp = QString::fromCFString((CFStringRef)nsPath);
# endif
if (temp.isEmpty())
return nativeTempPath();
// the environment variable may also end in '/'
if (temp.size() > 1 && temp.endsWith(u'/'))
temp.chop(1);
QFileSystemEntry e(temp, QFileSystemEntry::FromInternalPath{});
return QFileSystemEngine::absoluteName(e).filePath();
if (temp.isEmpty()) {
if (false) {
#if defined(Q_OS_DARWIN) && !defined(QT_BOOTSTRAPPED)
} else if (NSString *nsPath = NSTemporaryDirectory()) {
temp = QString::fromCFString((CFStringRef)nsPath);
#endif
} else {
temp = _PATH_TMP ""_L1;
}
}
return QDir(QDir::cleanPath(temp)).canonicalPath();
#endif
}

View File

@ -434,10 +434,10 @@ void QEventDispatcherGlib::registerSocketNotifier(QSocketNotifier *notifier)
p->pollfd.events = G_IO_IN | G_IO_HUP | G_IO_ERR;
break;
case QSocketNotifier::Write:
p->pollfd.events = G_IO_OUT | G_IO_HUP | G_IO_ERR;
p->pollfd.events = G_IO_OUT | G_IO_ERR;
break;
case QSocketNotifier::Exception:
p->pollfd.events = G_IO_PRI | G_IO_HUP | G_IO_ERR;
p->pollfd.events = G_IO_PRI | G_IO_ERR;
break;
}
p->socketNotifier = notifier;

View File

@ -832,7 +832,8 @@ static void argumentTypesFromString(const char *str, const char *end,
--level;
++str;
}
types.emplace_back(QByteArrayView{begin, str - begin});
QByteArray argType(begin, str - begin);
types += QArgumentType(std::move(argType));
}
}

View File

@ -45,8 +45,8 @@ public:
QArgumentType(QMetaType metaType)
: _metaType(metaType)
{}
explicit QArgumentType(QByteArrayView name)
: _metaType(QMetaType{qMetaTypeTypeInternal(name)}), _name(name)
QArgumentType(const QByteArray &name)
: _metaType(QMetaType{qMetaTypeTypeInternal(qToByteArrayViewIgnoringNull(name))}), _name(name)
{}
QMetaType metaType() const noexcept
{ return _metaType; }
@ -69,7 +69,7 @@ private:
Q_DECLARE_EQUALITY_COMPARABLE_NON_NOEXCEPT(QArgumentType)
QMetaType _metaType;
QByteArrayView _name;
QByteArray _name;
};
Q_DECLARE_TYPEINFO(QArgumentType, Q_RELOCATABLE_TYPE);

View File

@ -1,6 +1,5 @@
// Copyright (C) 2021 Intel Corporation.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
// Qt-Security score:critical reason:data-parser
#include "qcoffpeparser_p.h"

View File

@ -1,7 +1,6 @@
// Copyright (C) 2017 The Qt Company Ltd.
// Copyright (C) 2021 Intel Corporation.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
// Qt-Security score:critical reason:data-parser
#include "qelfparser_p.h"

View File

@ -1,7 +1,6 @@
// Copyright (C) 2021 The Qt Company Ltd.
// Copyright (C) 2022 Intel Corporation.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
// Qt-Security score:critical reason:data-parser
#include "qfactoryloader_p.h"

View File

@ -1,8 +1,6 @@
// Copyright (C) 2020 The Qt Company Ltd.
// Copyright (C) 2021 Intel Corporation.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
// Qt-Security score:critical reason:execute-external-code
#include "qlibrary.h"
#include "qlibrary_p.h"

View File

@ -1,7 +1,6 @@
// Copyright (C) 2016 The Qt Company Ltd.
// Copyright (C) 2020 Intel Corporation
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
// Qt-Security score:critical reason:execute-external-code
#include "qplatformdefs.h"

View File

@ -1,6 +1,5 @@
// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
// Qt-Security score:critical reason:execute-external-code
#include "qplatformdefs.h"
#include "qlibrary_p.h"

View File

@ -1,6 +1,5 @@
// Copyright (C) 2016 Intel Corporation.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
// Qt-Security score:critical reason:data-parser
#include "qmachparser_p.h"

View File

@ -1,7 +1,6 @@
// Copyright (C) 2016 The Qt Company Ltd.
// Copyright (C) 2018 Intel Corporation.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
// Qt-Security score:critical reason:execute-external-code
#include "qpluginloader.h"

View File

@ -1,7 +1,6 @@
// Copyright (C) 2020 The Qt Company Ltd.
// Copyright (C) 2017 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Marc Mutz <marc.mutz@kdab.com>
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
// Qt-Security score:critical reason:data-parser
#include "quuid.h"
#include "quuid_p.h"

View File

@ -550,7 +550,6 @@ void QDataStream::setByteOrder(ByteOrder bo)
\value Qt_6_8 Same as Qt_6_7
\value Qt_6_9 Same as Qt_6_7
\value Qt_6_10 Same as Qt_6_7
\value Qt_6_11 Same as Qt_6_10
\omitvalue Qt_DefaultCompiledVersion
\sa setVersion(), version()

View File

@ -4,7 +4,6 @@
#ifndef QDATASTREAM_H
#define QDATASTREAM_H
#include <QtCore/qobjectdefs.h>
#include <QtCore/qchar.h>
#include <QtCore/qcontainerfwd.h>
#include <QtCore/qiodevicebase.h>
@ -47,8 +46,6 @@ QDataStream &writeAssociativeMultiContainer(QDataStream &s, const Container &c);
}
class Q_CORE_EXPORT QDataStream : public QIODeviceBase
{
Q_GADGET
public:
enum Version QT7_ONLY(: quint8) {
Qt_1_0 = 1,
@ -94,13 +91,11 @@ public:
Qt_6_8 = Qt_6_7,
Qt_6_9 = Qt_6_7,
Qt_6_10 = 23,
Qt_6_11 = 24,
Qt_DefaultCompiledVersion = Qt_6_11
#if QT_VERSION >= QT_VERSION_CHECK(6, 12, 0)
Qt_DefaultCompiledVersion = Qt_6_10
#if QT_VERSION >= QT_VERSION_CHECK(6, 11, 0)
#error Add the datastream version for this Qt version and update Qt_DefaultCompiledVersion
#endif
};
Q_ENUM(Version)
enum ByteOrder {
BigEndian = QSysInfo::BigEndian,

View File

@ -39,8 +39,9 @@
#include <QtCore/private/wcharhelpers_win_p.h>
#include <QtCore/q20iterator.h>
#include <QtCore/q26numeric.h>
#endif // !QT_BOOTSTRAPPED
#endif // Q_OS_WIN
#endif
#include <array>
#if __has_include(<bit>) && __cplusplus > 201703L
@ -48,9 +49,6 @@
#endif
#include <string>
#include <QtCore/q20utility.h>
#ifndef QT_BOOTSTRAPPED
#include <QtCore/q26numeric.h>
#endif // !QT_BOOTSTRAPPED
QT_BEGIN_NAMESPACE
@ -2519,27 +2517,6 @@ std::optional<QStringConverter::Encoding> QStringConverter::encodingForName(QAny
}
#ifndef QT_BOOTSTRAPPED
namespace QtPrivate {
// Note: Check isValid() on the QStringConverter before calling this with its
// state!
static int partiallyParsedDataCount(QStringConverter::State *state)
{
#if QT_CONFIG(icu)
if (state->flags & QStringConverter::Flag::UsesIcu) {
UConverter *converter = static_cast<UConverter *>(state->d[0]);
if (!converter)
return 0;
UErrorCode err = U_ZERO_ERROR;
auto leftOver = ucnv_fromUCountPending(converter, &err);
// If there is an error, leftOver is -1, so no need for an additional
// check.
return std::max(leftOver, 0);
}
#endif
return q26::saturate_cast<int>(state->remainingChars);
}
} // namespace QtPrivate
/*!
Returns the encoding for the content of \a data if it can be determined.
\a expectedFirstCharacter can be passed as an additional hint to help determine
@ -2707,205 +2684,6 @@ QStringList QStringConverter::availableCodecs()
return result;
}
/*!
\class QStringConverter::FinalizeResultBase
\internal
*/
/*!
\class QStringConverter::FinalizeResultChar
\inmodule QtCore
\since 6.11
\reentrant
\brief Holds the result of calling finalize() on QStringDecoder or
QStringEncoder.
This class is used to relay the result of the finalize() call or the reason
why the call did not succeed.
*/
/*!
\enum QStringConverter::FinalizeResultBase::Error
\value NoError No error.
\value InvalidCharacters The encoder successfully finalized, but encountered
invalid characters either during finalization or some time earlier.
\value NotEnoughSpace finalize() did \e{not} succeed, you must grow the
buffer and call finalize() again.
*/
/*!
\variable QStringConverter::FinalizeResultChar::error
Relays errors discovered during finalization.
*/
/*!
\variable QStringConverter::FinalizeResultChar::next
Points to the character position \e{following} the last-written character.
*/
/*!
\variable QStringConverter::FinalizeResultChar::invalidChars
The number of invalid characters that were previously counted in the state
as well as any that were encountered during the call to finalize().
*/
/*!
\typedef QStringDecoder::FinalizeResult
This is an alias for QStringConverter::FinalizeResultChar<char16_t>.
*/
/*!
\typedef QStringDecoder::FinalizeResultQChar
This is an alias for QStringConverter::FinalizeResultChar<QChar>.
*/
/*!
\fn QStringDecoder::FinalizeResultQChar QStringDecoder::finalize(QChar *out, qsizetype maxlen)
\fn QStringDecoder::FinalizeResult QStringDecoder::finalize(char16_t *out, qsizetype maxlen)
\fn QStringDecoder::FinalizeResult QStringDecoder::finalize()
Signals to the decoder that no further data will arrive.
May also provide data from residual content that was pending decoding.
When there is no residual data to account for, the return's \c error
field will be set to \l {QCharConverter::FinalizeResult::Error::}
{NoError}.
If \a out is supplied and non-null, it must have space in which up to
\a maxlen characters may be written. Up to this many characters of
residual output are written to this space, with the end indicated by
the return-value's \c next field. Typically this residual data shall
consist of one replacement character per remaining unconverted input
character.
If all residual content has been delivered via \a out, if \a out is
\nullptr, or if there is no residual data, the decoder is reset on
return from finalize(). Otherwise, the remaining data can be retrieved
or discarded by a further call to finalize().
\since 6.11
\sa hasError(), appendToBuffer()
*/
auto QStringDecoder::finalize(char16_t *out, qsizetype maxlen) -> FinalizeResult
{
int count = 0;
if (isValid())
count = QtPrivate::partiallyParsedDataCount(&state);
using Error = FinalizeResult::Error;
const qint16 invalidChars = q26::saturate_cast<qint16>(state.invalidChars + count);
if (count == 0 || !out) {
resetState();
return { {}, out, invalidChars, invalidChars ? Error::InvalidCharacters : Error::NoError };
}
if (maxlen < count)
return { {}, out, invalidChars, Error::NotEnoughSpace };
const char16_t replacement = (state.flags & QStringConverter::Flag::ConvertInvalidToNull)
? QChar::Null
: QChar::ReplacementCharacter;
out = std::fill_n(out, count, replacement);
resetState();
return { {}, out, invalidChars, invalidChars ? Error::InvalidCharacters : Error::NoError };
}
/*!
\typedef QStringEncoder::FinalizeResult
This is an alias for QStringConverter::FinalizeResultChar<char>.
*/
/*!
\fn QStringEncoder::FinalizeResult QStringEncoder::finalize(char *out, qsizetype maxlen)
\fn QStringEncoder::FinalizeResult QStringEncoder::finalize()
Signals to the decoder that no further data will arrive.
May also provide data from residual content that was pending decoding.
When there is no residual data to account for, the return's \c error
field will be set to \l {QCharConverter::FinalizeResult::Error::}
{NoError}.
If \a out is supplied and non-null, it must have space in which up to
\a maxlen characters may be written. Up to this many characters of
residual output are written to this space, with the end indicated by
the return-value's \c next field. Typically this residual data shall
consist of one replacement character per remaining unconverted input
character. When using a stateful encoding, such as ISO-2022-JP, this may
also write bytes to restore, or end, the current state in the character
stream.
If all residual content has been delivered via \a out, if \a out is
\nullptr, or if there is no residual data, the decoder is reset on
return from finalize(). Otherwise, the remaining data can be retrieved
or discarded by a further call to finalize().
\since 6.11
\sa hasError(), appendToBuffer()
*/
auto QStringEncoder::finalize(char *out, qsizetype maxlen) -> QStringEncoder::FinalizeResult
{
qsizetype count = 0;
if (isValid())
count = QtPrivate::partiallyParsedDataCount(&state);
// For ICU we may be using a stateful codec that need to restore or finalize
// some state, otherwise we have nothing to do with count == 0
using Error = FinalizeResult::Error;
const bool usesIcu = !!(state.flags & QStringConverter::Flag::UsesIcu) && !!state.d[0];
const qint16 invalidChars = q26::saturate_cast<qint16>(state.invalidChars + count);
if (!isValid() || (!count && !usesIcu) || !out) {
resetState();
return { {}, out, invalidChars, invalidChars ? Error::InvalidCharacters : Error::NoError };
}
if ((false)) {
#if defined(QT_USE_ICU_CODECS)
} else if (usesIcu) {
Q_ASSERT(out);
auto *icu_conv = static_cast<UConverter *>(state.d[0]);
Q_ASSERT(icu_conv); // bool usesIcu checks that the pointer is non-null
UErrorCode err = U_ZERO_ERROR;
UBool flush = true;
// If the QStringConverter was moved, the state that we used as a context is stale now.
UConverterFromUCallback action;
const void *context;
ucnv_getFromUCallBack(icu_conv, &action, &context);
if (context != &state)
ucnv_setFromUCallBack(icu_conv, action, &state, nullptr, nullptr, &err);
const UChar *dummyInput = u"";
const char *outEnd = out + maxlen;
ucnv_fromUnicode(icu_conv, &out, outEnd, &dummyInput, dummyInput, nullptr, flush, &err);
if (err == U_BUFFER_OVERFLOW_ERROR)
return { {}, out, invalidChars, Error::NotEnoughSpace };
resetState();
#endif
} else if (!(state.flags & QStringConverter::Flag::ConvertInvalidToNull)) {
/*
We don't really know (in general) how the replacement character
looks like in the target encoding. So we just encode 0xfffd, which
is the Unicode replacement character.
Use 4 as a best-guess for the upper-bound of how many characters
would potentially be produced by the leftover UTF-16 characters in
the state
*/
constexpr QChar replacementCharacter = QChar::ReplacementCharacter;
constexpr char16_t repl = replacementCharacter.unicode();
constexpr std::array<char16_t, 4> replacement{ repl, repl, repl, repl };
const qsizetype charactersToEncode = std::min(count, qsizetype(replacement.size()));
if (maxlen < requiredSpace(charactersToEncode))
return { {}, out, invalidChars, Error::NotEnoughSpace };
// we don't want the incomplete data in the internal buffer; we're
// flushing the buffer after all
resetState();
out = appendToBuffer(out, QStringView(replacement.data(), charactersToEncode));
} else /* outputting Null characters for each remaining unconverted input character */ {
if (maxlen < count)
return { {}, out, invalidChars, Error::NotEnoughSpace };
out = std::fill_n(out, count, '\0');
resetState();
}
return { {}, out, invalidChars, invalidChars ? Error::InvalidCharacters : Error::NoError };
}
/*!
Tries to determine the encoding of the HTML in \a data by looking at leading byte
order marks or a charset specifier in the HTML meta tag and returns a QStringDecoder

View File

@ -63,13 +63,6 @@ public:
}
return iface->fromUtf16(out, in, &state);
}
using FinalizeResult = FinalizeResultChar<char>;
Q_REQUIRED_RESULT
Q_CORE_EXPORT FinalizeResult finalize(char *out, qsizetype maxlen);
Q_REQUIRED_RESULT
FinalizeResult finalize() { return finalize(nullptr, 0); }
private:
QByteArray encodeAsByteArray(QStringView in)
{
@ -135,22 +128,6 @@ public:
char16_t *appendToBuffer(char16_t *out, QByteArrayView ba)
{ return reinterpret_cast<char16_t *>(appendToBuffer(reinterpret_cast<QChar *>(out), ba)); }
using FinalizeResult = FinalizeResultChar<char16_t>;
using FinalizeResultQChar = FinalizeResultChar<QChar>;
FinalizeResultQChar finalize(QChar *out, qsizetype maxlen)
{
auto r = finalize(reinterpret_cast<char16_t *>(out), maxlen);
return { {}, reinterpret_cast<QChar *>(r.next), r.invalidChars, r.error };
}
Q_REQUIRED_RESULT
Q_CORE_EXPORT FinalizeResult finalize(char16_t *out, qsizetype maxlen);
Q_REQUIRED_RESULT
FinalizeResult finalize()
{
return finalize(static_cast<char16_t *>(nullptr), 0);
}
Q_CORE_EXPORT static QStringDecoder decoderForHtml(QByteArrayView data);
private:

View File

@ -169,25 +169,6 @@ public:
Q_CORE_EXPORT static QStringList availableCodecs();
struct FinalizeResultBase
{
enum Error : quint8 {
NoError,
InvalidCharacters,
NotEnoughSpace,
};
};
template <typename Char>
struct FinalizeResultChar : FinalizeResultBase
{
using Error = FinalizeResultBase::Error;
Char *next;
qint16 invalidChars;
Error error;
};
protected:
const Interface *iface;
State state;

View File

@ -286,13 +286,8 @@ public:
[[nodiscard]] constexpr storage_type front() const { return Q_ASSERT(!empty()), m_data[0]; }
[[nodiscard]] constexpr storage_type back() const { return Q_ASSERT(!empty()), m_data[m_size - 1]; }
[[nodiscard]] Q_IMPLICIT operator std::string_view() const noexcept
{ return std::string_view{reinterpret_cast<const char*>(data()), size_t(size())}; }
#ifdef __cpp_lib_char8_t
[[nodiscard]] Q_IMPLICIT operator std::u8string_view() const noexcept
{ return std::u8string_view{utf8(), size_t(size())}; }
#endif
[[nodiscard]] Q_IMPLICIT operator std::basic_string_view<storage_type>() const noexcept
{ return std::basic_string_view<storage_type>(data(), size_t(size())); }
[[nodiscard]] constexpr qsizetype max_size() const noexcept { return maxSize(); }

View File

@ -735,24 +735,13 @@
*/
/*!
\fn QUtf8StringView::operator std::string_view() const
/*! \fn QUtf8StringView::operator std::basic_string_view<storage_type>() const
\since 6.7
Converts this QUtf8StringView object to a
\c{std::string_view} object. The returned view will have the
same data pointer and length as this view.
*/
/*!
\fn QUtf8StringView::operator std::u8string_view() const
\since 6.10
Converts this QUtf8StringView object to a \c{std::u8string_view}
object. The returned view will have the same data pointer and length
as this view.
This function is only available when compiling in C++20 mode.
\c{std::basic_string_view} object. The returned view will have the
same data pointer and length of this view. The character type of
the returned view will be \c{storage_type}.
*/
/*!

View File

@ -5,9 +5,7 @@
#ifndef QSCOPEGUARD_H
#define QSCOPEGUARD_H
#include <QtCore/qtclasshelpermacros.h>
#include <QtCore/qcompilerdetection.h>
#include <QtCore/qtconfigmacros.h>
#include <QtCore/qglobal.h>
#include <type_traits>
#include <utility>

View File

@ -100,14 +100,10 @@ if((X11_SUPPORTED) OR QT_FIND_ALL_PACKAGES_ALWAYS)
qt_find_package(XCB 0.3.9 COMPONENTS ICCCM PROVIDED_TARGETS XCB::ICCCM MODULE_NAME gui QMAKE_LIB xcb_icccm)
endif()
qt_add_qmake_lib_dependency(xcb_icccm xcb)
if((X11_SUPPORTED) OR QT_FIND_ALL_PACKAGES_ALWAYS)
qt_find_package(XCB 0.3.8 COMPONENTS UTIL PROVIDED_TARGETS XCB::UTIL MODULE_NAME gui QMAKE_LIB xcb_util)
endif()
qt_add_qmake_lib_dependency(xcb_util xcb)
if((X11_SUPPORTED) OR QT_FIND_ALL_PACKAGES_ALWAYS)
qt_find_package(XCB 0.3.9 COMPONENTS IMAGE PROVIDED_TARGETS XCB::IMAGE MODULE_NAME gui QMAKE_LIB xcb_image)
endif()
qt_add_qmake_lib_dependency(xcb_image xcb_shm xcb_util xcb)
qt_add_qmake_lib_dependency(xcb_image xcb_shm xcb)
if((X11_SUPPORTED) OR QT_FIND_ALL_PACKAGES_ALWAYS)
qt_find_package(XCB 0.3.9 COMPONENTS KEYSYMS PROVIDED_TARGETS XCB::KEYSYMS MODULE_NAME gui QMAKE_LIB xcb_keysyms)
endif()
@ -559,7 +555,6 @@ qt_config_compile_test(xcb_syslibs
LIBRARIES
XCB::CURSOR
XCB::ICCCM
XCB::UTIL
XCB::IMAGE
XCB::KEYSYMS
XCB::RANDR
@ -575,7 +570,6 @@ qt_config_compile_test(xcb_syslibs
"// xkb.h is using a variable called 'explicit', which is a reserved keyword in C++
#define explicit dont_use_cxx_explicit
#include <xcb/xcb.h>
#include <xcb/xcb_util.h>
#include <xcb/xcb_image.h>
#include <xcb/xcb_keysyms.h>
#include <xcb/xcb_cursor.h>

View File

@ -28,9 +28,8 @@
\ingroup qt-basic-concepts
Qt's paint system provides a unified and flexible framework for
rendering graphics on various surfaces, such as on-screen widgets,
images, and printed pages. It is primarily built around the QPainter,
Qt's paint system enables painting on screen and print devices
using the same API, and is primarily based on the QPainter,
QPaintDevice, and QPaintEngine classes.
QPainter is used to perform drawing operations, QPaintDevice is an
@ -243,7 +242,8 @@
Any color in Qt is represented by the QColor class which supports
the RGB, HSV and CMYK color models. QColor also support
alpha-blended outlining and filling (specifying the transparency
effect), and the class is platform and device independent. For more
effect), and the class is platform and device independent (the
colors are mapped to hardware using the QColormap class). For more
information, see the QColor class documentation.
The available fill patterns are described by the Qt::BrushStyle

View File

@ -411,7 +411,8 @@ static QStringList get_colornames()
of the provided QRgb, and the qGray() function calculates and
return a gray value based on the given value.
QColor is platform and device independent.
QColor is platform and device independent. The QColormap class
maps the color to the hardware.
For more information about painting in general, see the \l{Paint
System} documentation.

View File

@ -16,6 +16,7 @@ QT_BEGIN_NAMESPACE
class QColor;
class QColormap;
class QVariant;
#ifndef QT_NO_DEBUG_STREAM
@ -255,6 +256,7 @@ private:
ushort array[5];
} ct;
friend class QColormap;
#ifndef QT_NO_DATASTREAM
friend Q_GUI_EXPORT QDataStream &operator<<(QDataStream &, const QColor &);
friend Q_GUI_EXPORT QDataStream &operator>>(QDataStream &, QColor &);

View File

@ -936,17 +936,16 @@ Q_LOGGING_CATEGORY(QRHI_LOG_RUB, "qt.rhi.rub")
avoided as it will not be supported by all backends. The maximum patch
control point count portable between backends is 32.
\value GeometryShader Indicates that the geometry shader stage is supported.
When supported, a geometry shader can be specified in the QRhiShaderStage
list. Geometry Shaders are considered an experimental feature in QRhi and
can only be expected to be supported with Vulkan, Direct 3D 11 and 12,
OpenGL (3.2+) and OpenGL ES (3.2+), assuming the implementation reports it
as supported at run time. Starting with Qt 6.11 geometry shaders are
automatically translated to HLSL, and therefore no injection of handwritten
HLSL geometry shaders is necessary anymore (but note that gl_in and
expressions such as gl_in[0].gl_Position are not supported; rather, pass the
position as an output variable from the vertex shader). Geometry shaders are
not supported with Metal.
\value GeometryShader Indicates that the geometry shader stage is
supported. When supported, a geometry shader can be specified in the
QRhiShaderStage list. Geometry Shaders are considered an experimental
feature in QRhi and can only be expected to be supported with Vulkan,
Direct 3D, OpenGL (3.2+) and OpenGL ES (3.2+), assuming the implementation
reports it as supported at run time. Geometry shaders have portability
issues between APIs, and therefore no guarantees can be given for a
universal solution. They will never be supported with Metal. Whereas with
Direct 3D a handwritten HLSL geometry shader must be injected into each
QShader for the geometry stage since qsb cannot generate this from SPIR-V.
\value TextureArrayRange Indicates that for
\l{QRhi::newTextureArray()}{texture arrays} it is possible to specify a

View File

@ -388,20 +388,6 @@ void QTextFormatPrivate::recalcFont() const
case QTextFormat::FontKerning:
f.setKerning(props.at(i).value.toBool());
break;
case QTextFormat::FontFeatures:
{
const auto fontFeatures = props.at(i).value.value<QHash<QFont::Tag, quint32>>();
for (auto it = fontFeatures.constBegin(); it != fontFeatures.constEnd(); ++it)
f.setFeature(it.key(), it.value());
break;
}
case QTextFormat::FontVariableAxes:
{
const auto fontVariableAxes = props.at(i).value.value<QHash<QFont::Tag, float>>();
for (auto it = fontVariableAxes.constBegin(); it != fontVariableAxes.constEnd(); ++it)
f.setVariableAxis(it.key(), it.value());
break;
}
default:
break;
}
@ -418,16 +404,6 @@ void QTextFormatPrivate::recalcFont() const
Q_GUI_EXPORT QDataStream &operator<<(QDataStream &stream, const QTextFormat &fmt)
{
QMap<int, QVariant> properties = fmt.properties();
if (stream.version() < QDataStream::Qt_6_11) {
auto it = properties.constFind(QTextFormat::FontFeatures);
if (it != properties.cend())
properties.erase(it);
it = properties.constFind(QTextFormat::FontVariableAxes);
if (it != properties.cend())
properties.erase(it);
}
if (stream.version() < QDataStream::Qt_6_0) {
auto it = properties.constFind(QTextFormat::FontLetterSpacingType);
if (it != properties.cend()) {
@ -471,17 +447,14 @@ Q_GUI_EXPORT QDataStream &operator>>(QDataStream &stream, QTextFormat &fmt)
for (QMap<qint32, QVariant>::ConstIterator it = properties.constBegin();
it != properties.constEnd(); ++it) {
qint32 key = it.key();
if (stream.version() < QDataStream::Qt_6_0) {
if (key == QTextFormat::OldFontLetterSpacingType)
key = QTextFormat::FontLetterSpacingType;
else if (key == QTextFormat::OldFontStretch)
key = QTextFormat::FontStretch;
else if (key == QTextFormat::OldTextUnderlineColor)
key = QTextFormat::TextUnderlineColor;
else if (key == QTextFormat::OldFontFamily)
key = QTextFormat::FontFamilies;
}
if (key == QTextFormat::OldFontLetterSpacingType)
key = QTextFormat::FontLetterSpacingType;
else if (key == QTextFormat::OldFontStretch)
key = QTextFormat::FontStretch;
else if (key == QTextFormat::OldTextUnderlineColor)
key = QTextFormat::TextUnderlineColor;
else if (key == QTextFormat::OldFontFamily)
key = QTextFormat::FontFamilies;
fmt.d->insertProperty(key, it.value());
}
@ -680,10 +653,6 @@ Q_GUI_EXPORT QDataStream &operator>>(QDataStream &stream, QTextTableCellFormat &
\value FontKerning Specifies whether the font has kerning turned on.
\value FontHintingPreference Controls the use of hinting according to values
of the QFont::HintingPreference enum.
\value FontFeatures [since 6.11] Assigns integer numbers to typographical features. See
\l{QFont::setFeature()} for additional information.
\value FontVariableAxes [since 6.11] Assigns floating point numbers to variable axes in variable
fonts. See \l{QFont::setVariableAxis()} for additional information.
\omitvalue FirstFontProperty
\omitvalue LastFontProperty
@ -1840,55 +1809,6 @@ void QTextCharFormat::setUnderlineStyle(UnderlineStyle style)
\sa font(), QFont::hintingPreference()
*/
/*!
\since 6.11
Sets the typographical features of the text format's font to be \a fontFeatures.
\sa QFont::setFeature()
*/
void QTextCharFormat::setFontFeatures(const QHash<QFont::Tag, quint32> &fontFeatures)
{
setProperty(FontFeatures, QVariant::fromValue(fontFeatures));
}
/*!
\since 6.11
Gets the typographical features of the text format's font.
\sa setFontFeatures()
*/
QHash<QFont::Tag, quint32> QTextCharFormat::fontFeatures() const
{
return property(FontFeatures).value<QHash<QFont::Tag, quint32>>();
}
/*!
\since 6.11
Sets the variable axes of the text format's font to be \a fontVariableAxes.
\sa QFont::setVariableAxis()
*/
void QTextCharFormat::setFontVariableAxes(const QHash<QFont::Tag, float> &fontVariableAxes)
{
setProperty(FontVariableAxes, QVariant::fromValue(fontVariableAxes));
}
/*!
\since 6.11
Gets the variable axes of the text format's font.
\sa setFontVariableAxes()
*/
QHash<QFont::Tag, float> QTextCharFormat::fontVariableAxes() const
{
return property(FontVariableAxes).value<QHash<QFont::Tag, float>>();
}
/*!
\fn QPen QTextCharFormat::textOutline() const
@ -2225,22 +2145,6 @@ void QTextCharFormat::setFont(const QFont &font, FontPropertiesInheritanceBehavi
setFontHintingPreference(font.hintingPreference());
if (mask & QFont::KerningResolved)
setFontKerning(font.kerning());
if (mask & QFont::FeaturesResolved) {
const auto tags = font.featureTags();
QHash<QFont::Tag, quint32> fontFeatures;
for (QFont::Tag tag : tags)
fontFeatures.insert(tag, font.featureValue(tag));
setFontFeatures(fontFeatures);
}
if (mask & QFont::VariableAxesResolved) {
const auto tags = font.variableAxisTags();
QHash<QFont::Tag, float> fontVariableAxes;
for (QFont::Tag tag : tags)
fontVariableAxes.insert(tag, font.variableAxisValue(tag));
setFontVariableAxes(fontVariableAxes);
}
}
/*!

View File

@ -14,7 +14,6 @@
#include <QtCore/qlist.h>
#include <QtCore/qshareddata.h>
#include <QtCore/qvariant.h>
#include <QtCore/qhash.h>
QT_BEGIN_NAMESPACE
@ -160,9 +159,7 @@ public:
FontStrikeOut = 0x2007,
FontFixedPitch = 0x2008,
FontPixelSize = 0x2009,
FontFeatures = 0x2010, // Note: Same as OldTextUnderlineColor
FontVariableAxes = 0x2011,
LastFontProperty = FontVariableAxes,
LastFontProperty = FontPixelSize,
TextUnderlineColor = 0x2020,
TextVerticalAlignment = 0x2021,
@ -521,11 +518,6 @@ public:
return static_cast<QFont::HintingPreference>(intProperty(FontHintingPreference));
}
void setFontFeatures(const QHash<QFont::Tag, quint32> &fontFeatures);
QHash<QFont::Tag, quint32> fontFeatures() const;
void setFontVariableAxes(const QHash<QFont::Tag, float> &fontVariableAxes);
QHash<QFont::Tag, float> fontVariableAxes() const;
inline void setFontKerning(bool enable)
{ setProperty(FontKerning, enable); }
inline bool fontKerning() const

View File

@ -385,7 +385,6 @@ qt_internal_extend_target(Network CONDITION QT_FEATURE_ocsp AND QT_FEATURE_opens
qt_internal_add_docs(Network
doc/qtnetwork.qdocconf
SKIP_JAVADOC
)
# See mkspecs/common/msvc-desktop.conf

View File

@ -1380,7 +1380,7 @@ int QNativeSocketEnginePrivate::nativeSelect(QDeadlineTimer deadline, bool check
}
static const short read_flags = POLLIN | POLLHUP | POLLERR;
static const short write_flags = POLLOUT | POLLHUP | POLLERR;
static const short write_flags = POLLOUT | POLLERR;
*selectForRead = ((pfd.revents & read_flags) != 0);
*selectForWrite = ((pfd.revents & write_flags) != 0);

View File

@ -19,57 +19,6 @@ QT_BEGIN_NAMESPACE
Q_DECLARE_LOGGING_CATEGORY(lcAndroidBackendRegister)
/*
\internal
This class is used to [un]register QJniObjects which implement specific interfaces. These
objects can then be fetched or directly called by using that interface.
This is intended to decouple the Qt C++ code from the underlying Java implementation, as Qt now
has multiple separate usecases, each of which may have different implementations and support
different features.
To use this register, the interface must be declared as a JNI class via Q_DECLARE_JNI_CLASS:
Q_DECLARE_JNI_CLASS(ImaginaryInterface, "org/qtproject/qt/android/ImaginaryInterface")
Where ImaginaryInterface is a Java interface like this:
@UsedFromNativeCode
interface ImaginaryInterface {
void doSomething(int imaginary, int imaginary2);
}
After that, the features provided by that interface can be used in the C++ code in two ways:
Use the convenience method callInterface() to call a method directly:
AndroidBackendRegister *reg = QtAndroid::backendRegister();
int imaginary, imaginary2;
reg->callInterface<QtJniTypes::ImaginaryInterface, void>("doSomething", imaginary, imaginary2);
Or get the QJniObject directly and use it as you would any other QJniObject:
AndroidBackendRegister *reg = QtAndroid::backendRegister();
auto imaginary = reg->getInterface<QtJniTypes::ImaginaryInterface>();
// ... do whatever with QJniObject
In order to register a new interface on the Java side, the BackendRegister class must be used,
with its native functions registerBackend() and unregisterBackend():
BackendRegister.registerBackend(ImaginaryInterface.class, imaginaryInterfaceObject);
and
BackendRegister.unregisterBackend(ImaginaryInterface.class);
Note that only one object can be registered for each interface. If multiple objects are
registered, only the latest one is kept. Thus, you only need to declare the interface you want
to unregister, not the object that implements the interface as well.
If the interface needs to be available as soon as possible, it should be registered immediately
after Qt has started, by using the QtNative app state listener functionality.
*/
template <typename T>
using ValidInterfaceType = std::enable_if_t<std::is_base_of_v<QtJniTypes::JObjectBase, T>, bool>;
@ -78,13 +27,6 @@ class AndroidBackendRegister
public:
static bool registerNatives();
/*
\internal
Returns a QJniObject which is registered for the given interface.
Requires the type of the requested interface to be registered via
Q_DECLARE_JNI_CLASS. (see ValidInterfaceType).
*/
template <typename T, ValidInterfaceType<T> = true>
[[nodiscard]] T getInterface()
{
@ -97,15 +39,7 @@ public:
typename std::disjunction<std::is_base_of<QJniObject, Object>,
std::is_base_of<QtJniTypes::JObjectBase, Object>>;
/*
\internal
Convenience function that calls getInterface<Interface>() and then QJniObject::callMethod()
on the resulting object, forwarding the rest of the parameters to that function.
If the interface is not registered, a warning is printed and an empty object is returned.
*/
template <typename Interface, typename Ret = void, typename... Args,
template <typename Interface, typename Ret, typename... Args,
ValidInterfaceType<Interface> = true>
auto callInterface(const char *func, Args... args)
{

View File

@ -58,14 +58,14 @@ namespace QtAndroidInput
void resetSoftwareKeyboard()
{
AndroidBackendRegister *reg = QtAndroid::backendRegister();
reg->callInterface<QtJniTypes::QtInputInterface>("resetSoftwareKeyboard");
reg->callInterface<QtJniTypes::QtInputInterface, void>("resetSoftwareKeyboard");
qCDebug(lcQpaInputMethods) << "@@@ RESETSOFTWAREKEYBOARD";
}
void hideSoftwareKeyboard()
{
AndroidBackendRegister *reg = QtAndroid::backendRegister();
reg->callInterface<QtJniTypes::QtInputInterface>("hideSoftwareKeyboard");
reg->callInterface<QtJniTypes::QtInputInterface, void>("hideSoftwareKeyboard");
qCDebug(lcQpaInputMethods) << "@@@ HIDESOFTWAREKEYBOARD";
}

View File

@ -183,7 +183,7 @@ namespace QtAndroid
#if QT_CONFIG(accessibility)
void initializeAccessibility()
{
m_backendRegister->callInterface<QtJniTypes::QtAccessibilityInterface>(
m_backendRegister->callInterface<QtJniTypes::QtAccessibilityInterface, void>(
"initializeAccessibility");
}

View File

@ -48,13 +48,13 @@ namespace QtAndroidMenu
void resetMenuBar()
{
AndroidBackendRegister *reg = QtAndroid::backendRegister();
reg->callInterface<QtJniTypes::QtMenuInterface>("resetOptionsMenu");
reg->callInterface<QtJniTypes::QtMenuInterface, void>("resetOptionsMenu");
}
void openOptionsMenu()
{
AndroidBackendRegister *reg = QtAndroid::backendRegister();
reg->callInterface<QtJniTypes::QtMenuInterface>("openOptionsMenu");
reg->callInterface<QtJniTypes::QtMenuInterface, void>("openOptionsMenu");
}
void showContextMenu(QAndroidPlatformMenu *menu, const QRect &anchorRect)
@ -75,7 +75,7 @@ namespace QtAndroidMenu
QMutexLocker lock(&visibleMenuMutex);
if (visibleMenu == menu) {
AndroidBackendRegister *reg = QtAndroid::backendRegister();
reg->callInterface<QtJniTypes::QtMenuInterface>("closeContextMenu");
reg->callInterface<QtJniTypes::QtMenuInterface, void>("closeContextMenu");
pendingContextMenus.clear();
} else {
pendingContextMenus.removeOne(menu);

View File

@ -454,7 +454,7 @@ void QWasmAccessibility::setHtmlElementVisibility(QAccessibleInterface *iface, b
container.call<void>("appendChild", element);
visible = visible && !iface->state().invisible;
visible = visible && !iface->state().invisible && !iface->state().disabled;
setProperty(element, "ariaHidden", !visible); // ariaHidden mean completely hidden; maybe some sort of soft-hidden should be used.
}
@ -513,12 +513,6 @@ void QWasmAccessibility::setHtmlElementFocus(QAccessibleInterface *iface)
element.call<void>("focus");
}
void QWasmAccessibility::setHtmlElementDisabled(QAccessibleInterface *iface)
{
auto element = ensureHtmlElement(iface);
setAttribute(element, "aria-disabled", iface->state().disabled);
}
void QWasmAccessibility::handleStaticTextUpdate(QAccessibleEvent *event)
{
switch (event->type()) {
@ -683,7 +677,6 @@ void QWasmAccessibility::populateAccessibilityTree(QAccessibleInterface *iface)
setHtmlElementVisibility(iface, true);
setHtmlElementGeometry(iface);
setHtmlElementTextName(iface);
setHtmlElementDisabled(iface);
handleIdentifierUpdate(iface);
handleDescriptionChanged(iface);
}
@ -860,12 +853,6 @@ void QWasmAccessibility::notifyAccessibilityUpdate(QAccessibleEvent *event)
// Handle some common event types. See
// https://doc.qt.io/qt-5/qaccessible.html#Event-enum
switch (event->type()) {
case QAccessible::StateChanged: {
QAccessibleStateChangeEvent *stateChangeEvent = (QAccessibleStateChangeEvent *)event;
if (stateChangeEvent->changedStates().disabled)
setHtmlElementDisabled(iface);
} break;
case QAccessible::DescriptionChanged:
handleDescriptionChanged(iface);
return;

View File

@ -58,7 +58,6 @@ private:
void setHtmlElementTextName(QAccessibleInterface *iface);
void setHtmlElementTextNameLE(QAccessibleInterface *iface);
void setHtmlElementFocus(QAccessibleInterface *iface);
void setHtmlElementDisabled(QAccessibleInterface *iface);
void handleStaticTextUpdate(QAccessibleEvent *event);
void handleButtonUpdate(QAccessibleEvent *event);

View File

@ -133,8 +133,7 @@ QWaylandDataControlSourceV1::QWaylandDataControlSourceV1(QWaylandDataControlMana
{
if (!mimeData)
return;
const auto formats = QInternalMimeData::formatsHelper(mimeData);
for (const QString &format : formats)
for (auto &format : mimeData->formats())
offer(format);
}

View File

@ -704,7 +704,7 @@ void QWaylandWindow::applyConfigureWhenPossible()
{
if (!mWaitingToApplyConfigure) {
mWaitingToApplyConfigure = true;
QMetaObject::invokeMethod(this, &QWaylandWindow::applyConfigure, Qt::QueuedConnection);
QMetaObject::invokeMethod(this, "applyConfigure", Qt::QueuedConnection);
}
}
@ -725,11 +725,8 @@ void QWaylandWindow::applyConfigure()
mShellSurface->applyConfigure();
mWaitingToApplyConfigure = false;
if (mExposed)
sendExposeEvent(QRect(QPoint(), geometry().size()));
else
// we still need to commit the configured ack for a hidden surface
commit();
QRect exposeGeometry(QPoint(), geometry().size());
sendExposeEvent(exposeGeometry);
}
void QWaylandWindow::attach(QWaylandBuffer *buffer, int x, int y)
@ -884,6 +881,7 @@ bool QWaylandWindow::waitForFrameSync(int timeout)
if (mWaitingForFrameCallback) {
qCDebug(lcWaylandBackingstore) << "Didn't receive frame callback in time, window should now be inexposed";
mFrameCallbackTimedOut = true;
mWaitingForUpdate = false;
QMetaObject::invokeMethod(this, &QWaylandWindow::updateExposure, Qt::QueuedConnection);
}
@ -1746,6 +1744,7 @@ void QWaylandWindow::timerEvent(QTimerEvent *event)
qCDebug(lcWaylandBackingstore) << "Didn't receive frame callback in time, window should now be inexposed";
mFrameCallbackTimedOut = true;
mWaitingForUpdate = false;
updateExposure();
}
@ -1761,6 +1760,13 @@ void QWaylandWindow::requestUpdate()
return;
}
// If we've already called deliverUpdateRequest(), but haven't seen any attach+commit/swap yet
// This is a somewhat redundant behavior and might indicate a bug in the calling code, so log
// here so we can get this information when debugging update/frame callback issues.
// Continue as nothing happened, though.
if (mWaitingForUpdate)
qCDebug(lcWaylandBackingstore) << "requestUpdate called twice without committing anything";
// Some applications (such as Qt Quick) depend on updates being delivered asynchronously,
// so use invokeMethod to delay the delivery a bit.
QMetaObject::invokeMethod(this, [this] {
@ -1798,6 +1804,7 @@ void QWaylandWindow::handleUpdate()
wl_proxy_wrapper_destroy(wrappedSurface);
wl_callback_add_listener(mFrameCallback, &QWaylandWindow::callbackListener, this);
mWaitingForFrameCallback = true;
mWaitingForUpdate = false;
// Start a timer for handling the case when the compositor stops sending frame callbacks.
if (mFrameCallbackTimeout > 0) {
@ -1816,6 +1823,7 @@ void QWaylandWindow::handleUpdate()
void QWaylandWindow::deliverUpdateRequest()
{
qCDebug(lcWaylandBackingstore) << "deliverUpdateRequest";
mWaitingForUpdate = true;
QPlatformWindow::deliverUpdateRequest();
}

View File

@ -314,6 +314,8 @@ protected:
QMutex mFrameSyncMutex;
QWaitCondition mFrameSyncWait;
// True when we have called deliverRequestUpdate, but the client has not yet attached a new buffer
std::atomic_bool mWaitingForUpdate = false;
bool mExposed = false;
std::atomic_bool mExposeEventNeedsAttachedBuffer = false;

View File

@ -52,7 +52,6 @@ qt_internal_add_module(XcbQpaPrivate
Qt::GuiPrivate
XCB::CURSOR
XCB::ICCCM
XCB::UTIL
XCB::IMAGE
XCB::KEYSYMS
XCB::RANDR

View File

@ -1 +1 @@
set(QT_REPO_MODULE_VERSION "6.11.0")
set(QT_REPO_MODULE_VERSION "6.10.0")

View File

@ -503,143 +503,6 @@ void blockUnixSignals()
pthread_sigmask(SIG_BLOCK, &set, nullptr);
}
static std::string_view unixSignalCodeToName(int signo, int code) noexcept
{
switch (signo) {
case SIGFPE:
switch (code) {
#ifdef FPE_INTDIV
case FPE_INTDIV: return "FPE_INTDIV"; // Integer divide by zero.
#endif
#ifdef FPE_INTOVF
case FPE_INTOVF: return "FPE_INTOVF"; // Integer overflow.
#endif
#ifdef FPE_FLTDIV
case FPE_FLTDIV: return "FPE_FLTDIV"; // Floating point divide by zero.
#endif
#ifdef FPE_FLTOVF
case FPE_FLTOVF: return "FPE_FLTOVF"; // Floating point overflow.
#endif
#ifdef FPE_FLTUND
case FPE_FLTUND: return "FPE_FLTUND"; // Floating point underflow.
#endif
#ifdef FPE_FLTRES
case FPE_FLTRES: return "FPE_FLTRES"; // Floating point inexact result.
#endif
#ifdef FPE_FLTINV
case FPE_FLTINV: return "FPE_FLTINV"; // Floating point invalid operation.
#endif
#ifdef FPE_FLTSUB
case FPE_FLTSUB: return "FPE_FLTSUB"; // Subscript out of range.
#endif
#ifdef FPE_FLTUNK
case FPE_FLTUNK: return "FPE_FLTUNK"; // Undiagnosed floating-point exception.
#endif
#ifdef FPE_CONDTRAP
case FPE_CONDTRAP: return "FPE_CONDTRAP"; // Trap on condition.
#endif
}
break;
case SIGILL:
switch (code) {
#ifdef ILL_ILLOPC
case ILL_ILLOPC: return "ILL_ILLOPC"; // Illegal opcode.
#endif
#ifdef ILL_ILLOPN
case ILL_ILLOPN: return "ILL_ILLOPN"; // Illegal operand.
#endif
#ifdef ILL_ILLADR
case ILL_ILLADR: return "ILL_ILLADR"; // Illegal addressing mode.
#endif
#ifdef ILL_ILLTRP
case ILL_ILLTRP: return "ILL_ILLTRP"; // Illegal trap.
#endif
#ifdef ILL_PRVOPC
case ILL_PRVOPC: return "ILL_PRVOPC"; // Privileged opcode.
#endif
#ifdef ILL_PRVREG
case ILL_PRVREG: return "ILL_PRVREG"; // Privileged register.
#endif
#ifdef ILL_COPROC
case ILL_COPROC: return "ILL_COPROC"; // Coprocessor error.
#endif
#ifdef ILL_BADSTK
case ILL_BADSTK: return "ILL_BADSTK"; // Internal stack error.
#endif
#ifdef ILL_BADIADDR
case ILL_BADIADDR: return "ILL_BADIADDR"; // Unimplemented instruction address.
#endif
}
break;
case SIGSEGV:
switch (code) {
#ifdef SEGV_MAPERR
case SEGV_MAPERR: return "SEGV_MAPERR"; // Address not mapped to object.
#endif
#ifdef SEGV_ACCERR
case SEGV_ACCERR: return "SEGV_ACCERR"; // Invalid permissions for mapped object.
#endif
#ifdef SEGV_BNDERR
// Intel MPX - deprecated
case SEGV_BNDERR: return "SEGV_BNDERR"; // Bounds checking failure.
#endif
#ifdef SEGV_PKUERR
// Intel PKRU
case SEGV_PKUERR: return "SEGV_PKUERR"; // Protection key checking failure.
#endif
#ifdef Q_PROCESSOR_SPARC
// these seem to be Sparc-specific on Linux
# ifdef SEGV_ACCADI
case SEGV_ACCADI: return "SEGV_ACCADI"; // ADI not enabled for mapped object.
# endif
# ifdef SEGV_ADIDERR
case SEGV_ADIDERR: return "SEGV_ADIDERR"; // Disrupting MCD error.
# endif
# ifdef SEGV_ADIPERR
case SEGV_ADIPERR: return "SEGV_ADIPERR"; // Precise MCD exception.
# endif
#endif
#ifdef Q_PROCESSOR_ARM
# ifdef SEGV_MTEAERR
case SEGV_MTEAERR: return "SEGV_MTEAERR"; // Asynchronous ARM MTE error.
# endif
# ifdef SEGV_MTESERR
case SEGV_MTESERR: return "SEGV_MTESERR"; // Synchronous ARM MTE exception.
# endif
#endif
#ifdef SEGV_CPERR
// seen on both AArch64 and x86 Linux
case SEGV_CPERR: return "SEGV_CPERR"; // Control protection fault
#endif
}
break;
case SIGBUS:
switch (code) {
#ifdef BUS_ADRALN
case BUS_ADRALN: return "BUS_ADRALN"; // Invalid address alignment.
#endif
#ifdef BUS_ADRERR
case BUS_ADRERR: return "BUS_ADRERR"; // Non-existant physical address.
#endif
#ifdef BUS_OBJERR
case BUS_OBJERR: return "BUS_OBJERR"; // Object specific hardware error.
#endif
#ifdef BUS_MCEERR_AR
case BUS_MCEERR_AR: return "BUS_MCEERR_AR"; // Hardware memory error: action required.
#endif
#ifdef BUS_MCEERR_AO
case BUS_MCEERR_AO: return "BUS_MCEERR_AO"; // Hardware memory error: action optional.
#endif
}
break;
}
return {};
}
template <typename T> static
std::enable_if_t<sizeof(std::declval<T>().si_pid) + sizeof(std::declval<T>().si_uid) >= 1>
printSentSignalInfo(T *info)
@ -656,9 +519,7 @@ printCrashingSignalInfo(T *info, quintptr pc)
auto toHexString = [](quintptr u, HexString &&r = {}) {
return asyncSafeToHexString(u, r.data());
};
std::string_view name = unixSignalCodeToName(info->si_signo, info->si_code);
writeToStderr(", code ", name.size() ? name : asyncSafeToString(info->si_code));
writeToStderr(", code ", asyncSafeToString(info->si_code));
if (pc)
writeToStderr(", at instruction address ", toHexString(pc));
writeToStderr(", accessing address ", toHexString(quintptr(info->si_addr)));

View File

@ -3777,84 +3777,25 @@ int generateJavaQmlComponents(const Options &options)
if (methodData["methodType"_L1] != 0)
return;
const QJsonArray parameters = methodData["parameters"_L1].toArray();
if (parameters.size() > 1)
return;
const QString methodName = methodData["name"_L1].toString();
if (methodName.isEmpty())
return;
const QString upperMethodName = firstCharToUpper(methodName);
if (parameters.size() <= 1) { // Generate a QtSignalListener<T> API for this property/signal
const QString typeName = !parameters.isEmpty()
? parameters[0].toObject()["typeName"_L1].toString()
: "void"_L1;
const QString javaTypeName = qmlToJavaType.value(typeName, "Object"_L1);
stream << indent
<< "public int connect%1Listener(QtSignalListener<%2> signalListener) {\n"_L1
.arg(upperMethodName, javaTypeName)
<< indent
<< " return connectSignalListener(\"%1\", %2.class, signalListener);\n"_L1
.arg(methodName, javaTypeName)
<< indent << "}\n";
} else { // Multi-arg signal; Generate a custom listener interface for this signal
// Returns a comma-separated parameter list of java types deduced from the QML DOM array
const auto getJavaArgsString = [&parameters]() -> QString {
QList<QString> javaArgsList;
for (const auto param : parameters) {
const auto typeName = param["typeName"_L1].toString();
const auto javaTypeName = qmlToJavaType.value(typeName, "Object"_L1);
const auto qmlParamName = param["name"_L1].toString();
const QString typeName = !parameters.isEmpty()
? parameters[0].toObject()["typeName"_L1].toString()
: "void"_L1;
javaArgsList.emplace_back(
QStringLiteral("%1%2").arg(javaTypeName, " %1"_L1.arg(qmlParamName)));
}
return javaArgsList.join(", "_L1);
};
// Returns a comma-separated parameter list of java classes deduced from QML DOM array
const auto getJavaClassesString = [&parameters]() -> QString {
QList<QString> javaArgsList;
for (const auto param : parameters) {
const auto typeName = param["typeName"_L1].toString();
const auto javaTypeName = qmlToJavaType.value(typeName, "Object"_L1);
javaArgsList.emplace_back(
QStringLiteral("%1%2").arg(javaTypeName, ".class"_L1));
}
return javaArgsList.join(", "_L1);
};
const auto javaParamsString = getJavaArgsString();
const auto javaParamsClassesString = getJavaClassesString();
// e.g. "{(String) args[0], (Integer) args[1], (Boolean) args[2]}"
QList<QString> objectToTypeConversion;
for (auto i = 0; i < parameters.size(); ++i) {
const auto typeName = parameters.at(i).toObject().value("typeName"_L1).toString();
objectToTypeConversion.emplace_back("(%1) args[%2]"_L1.arg(
qmlToJavaType.value(typeName, "Object"_L1), QString::number(i)));
}
// Generate new interface type for this signal
const auto signalInterfaceName = "%1Listener"_L1.arg(methodName);
const auto objectToTypeConversionString = objectToTypeConversion.join(", "_L1);
stream << indent << "@FunctionalInterface\n"
<< indent << "public interface %1 {\n"_L1.arg(signalInterfaceName) << indent
<< " default void onSignalEmitted(Object[] args) {\n"
<< indent
<< " on%1(%2);\n"_L1.arg(upperMethodName, objectToTypeConversionString)
<< indent << " }\n"
<< indent
<< " void on%1(%2);\n"_L1.arg(upperMethodName, javaParamsString);
stream << indent << "}\n"_L1;
// Generate the connection function with this new interface type
stream << indent
<< "public int connect%1(%2 signalListener) {\n"_L1.arg(
firstCharToUpper(signalInterfaceName), signalInterfaceName)
<< indent
<< " return connectSignalListener(\"%1\", new Class[]{ %2 }, signalListener);\n"_L1
.arg(methodName, javaParamsClassesString)
<< indent << "}\n\n";
}
const QString javaTypeName = qmlToJavaType.value(typeName, "Object"_L1);
stream << indent
<< "public int connect%1Listener(QtSignalListener<%2> signalListener) {\n"_L1.arg(
upperMethodName, javaTypeName)
<< indent
<< " return connectSignalListener(\"%1\", %2.class, signalListener);\n"_L1.arg(
methodName, javaTypeName)
<< indent << "}\n";
};
constexpr static auto markerFileName = "qml_java_contents"_L1;
@ -4096,7 +4037,13 @@ int main(int argc, char *argv[])
if (!createRcc(options))
return CannotCreateRcc;
if (options.auxMode || options.build) {
if (options.auxMode) {
if (!updateAndroidFiles(options))
return CannotUpdateAndroidFiles;
return 0;
}
if (options.build) {
if (!copyAndroidSources(options))
return CannotCopyAndroidSources;
@ -4108,12 +4055,7 @@ int main(int argc, char *argv[])
if (Q_UNLIKELY(options.timing))
fprintf(stdout, "[TIMING] %lld ns: Updated files\n", options.timer.nsecsElapsed());
}
if (options.auxMode)
return 0;
if (options.build) {
if (Q_UNLIKELY(options.timing))
fprintf(stdout, "[TIMING] %lld ns: Created project\n", options.timer.nsecsElapsed());

View File

@ -31,6 +31,7 @@
#include <private/qdnd_p.h>
#endif
#include "private/qguiapplication_p.h"
#include "qcolormap.h"
#include "qdebug.h"
#if QT_CONFIG(style_stylesheet)
#include "private/qstylesheetstyle_p.h"
@ -479,6 +480,7 @@ void QApplicationPrivate::init()
process_cmdline();
// Must be called before initialize()
QColormap::initialize();
initializeWidgetPalettesFromTheme();
qt_init_tooltip_palette();
QApplicationPrivate::initializeWidgetFontHash();
@ -710,6 +712,7 @@ QApplication::~QApplication()
d->cleanupMultitouch();
QPixmapCache::clear();
QColormap::cleanup();
QApplicationPrivate::active_window = nullptr; //### this should not be necessary
@ -3637,9 +3640,7 @@ void QApplication::setEffectEnabled(Qt::UIEffect effect, bool enable)
bool QApplication::isEffectEnabled(Qt::UIEffect effect)
{
CHECK_QAPP_INSTANCE(false)
const auto primaryScreenDepth = QGuiApplication::primaryScreen() ?
QGuiApplication::primaryScreen()->depth() : 24;
return primaryScreenDepth >= 16
return QColormap::instance().depth() >= 16
&& (QApplicationPrivate::enabledAnimations & QPlatformTheme::GeneralUiEffect)
&& (QApplicationPrivate::enabledAnimations & uiEffectToFlag(effect));
}

View File

@ -3377,25 +3377,8 @@ QAction *QWidget::addAction(const QIcon &icon, const QString &text, const QKeySe
void QWidget::setEnabled(bool enable)
{
Q_D(QWidget);
#if QT_CONFIG(accessibility)
const bool wasEnabled = !testAttribute(Qt::WA_ForceDisabled);
#endif
setAttribute(Qt::WA_ForceDisabled, !enable);
d->setEnabled_helper(enable);
#if QT_CONFIG(accessibility)
// A widget is enabled if it's parent and itself is enabled.
// We do not send state changed events recursively. It is up
// to the receiver of the events to check children if required.
if (QAccessible::isActive() && wasEnabled != enable) {
QAccessible::State states;
states.disabled = 1;
QAccessibleStateChangeEvent scEvent(this, states);
QAccessible::updateAccessibility(&scEvent);
}
#endif
}
void QWidgetPrivate::setEnabled_helper(bool enable)

View File

@ -7,8 +7,6 @@
#include "qscreen.h"
#include "qguiapplication.h"
#include <QtCore/qmutex.h>
QT_BEGIN_NAMESPACE
class QColormapPrivate
@ -44,26 +42,16 @@ void QColormap::initialize()
screenMap->mode = QColormap::Direct;
screenMap->numcolors = -1;
}
qAddPostRoutine(QColormap::cleanup);
}
void QColormap::cleanup()
{
if (screenMap) {
if (!screenMap->ref.deref())
delete screenMap;
screenMap = nullptr;
}
delete screenMap;
screenMap = nullptr;
}
QColormap QColormap::instance(int /*screen*/)
{
static QMutex mutex;
QMutexLocker locker(&mutex);
if (!screenMap)
initialize();
return QColormap();
}

View File

@ -1 +1 @@
set(QT_REPO_MODULE_VERSION "6.11.0")
set(QT_REPO_MODULE_VERSION "6.10.0")

View File

@ -1 +1 @@
set(QT_REPO_MODULE_VERSION "6.11.0")
set(QT_REPO_MODULE_VERSION "6.10.0")

View File

@ -1 +1 @@
set(QT_REPO_MODULE_VERSION "6.11.0")
set(QT_REPO_MODULE_VERSION "6.10.0")

View File

@ -1240,8 +1240,7 @@ void tst_QDir::current()
#if defined(Q_OS_WIN)
QCOMPARE(newCurrent.absolutePath().toLower(), currentDir.toLower());
#else
// getcwd(2) on Unix returns the canonical path
QCOMPARE(newCurrent.absolutePath(), QDir(currentDir).canonicalPath());
QCOMPARE(newCurrent.absolutePath(), currentDir);
#endif
}
@ -1255,25 +1254,21 @@ void tst_QDir::cd_data()
QTest::addColumn<bool>("successExpected");
QTest::addColumn<QString>("newDir");
// use the canonical path for m_dataPath here, because if TMPDIR points to
// a symlink like what happens on Apple systems (/tmp -> /private/tmp),
// then /tmp/.. will not be the same as / (it's /private).
QString canonicalPath = QDir(m_dataPath).canonicalPath();
int index = canonicalPath.lastIndexOf(QLatin1Char('/'));
QTest::newRow("cdUp") << canonicalPath << ".." << true << canonicalPath.left(index==0?1:index);
int index = m_dataPath.lastIndexOf(QLatin1Char('/'));
QTest::newRow("cdUp") << m_dataPath << ".." << true << m_dataPath.left(index==0?1:index);
QTest::newRow("cdUp non existent (relative dir)") << "anonexistingDir" << ".."
<< true << canonicalPath;
QTest::newRow("cdUp non existent (absolute dir)") << canonicalPath + "/anonexistingDir" << ".."
<< true << canonicalPath;
QTest::newRow("noChange") << canonicalPath << "." << true << canonicalPath;
<< true << m_dataPath;
QTest::newRow("cdUp non existent (absolute dir)") << m_dataPath + "/anonexistingDir" << ".."
<< true << m_dataPath;
QTest::newRow("noChange") << m_dataPath << "." << true << m_dataPath;
#if defined(Q_OS_WIN) // on windows QDir::root() is usually c:/ but cd "/" will not force it to be root
QTest::newRow("absolute") << canonicalPath << "/" << true << "/";
QTest::newRow("absolute") << m_dataPath << "/" << true << "/";
#else
QTest::newRow("absolute") << canonicalPath << "/" << true << QDir::root().absolutePath();
QTest::newRow("absolute") << m_dataPath << "/" << true << QDir::root().absolutePath();
#endif
QTest::newRow("non existant") << "." << "../anonexistingdir" << false << canonicalPath;
QTest::newRow("self") << "." << (QString("../") + QFileInfo(canonicalPath).fileName()) << true << canonicalPath;
QTest::newRow("file") << "." << "qdir.pro" << false << canonicalPath;
QTest::newRow("non existant") << "." << "../anonexistingdir" << false << m_dataPath;
QTest::newRow("self") << "." << (QString("../") + QFileInfo(m_dataPath).fileName()) << true << m_dataPath;
QTest::newRow("file") << "." << "qdir.pro" << false << m_dataPath;
}
void tst_QDir::cd()

View File

@ -545,7 +545,7 @@ void tst_QPointer::raceCondition()
for (int i = 0; i < NUM_THREADS; ++i) {
QThread *thread =
QThread::create([&] {
QThread::create([&startSemaphore, &targetObject] {
startSemaphore.acquire();
for (int j = 0; j < ITERATIONS_PER_THREAD; ++j) {

View File

@ -301,7 +301,6 @@ static constexpr int NColorRoles[] = {
QPalette::Accent + 1, // Qt_6_6
QPalette::Accent + 1, // Qt_6_7
QPalette::Accent + 1, // Qt_6_10
QPalette::Accent + 1, // Qt_6_11
};
// +1, because we start from "No Version"

View File

@ -196,9 +196,6 @@ private slots:
void availableCodesAreAvailable();
void finalize();
void finalizeStateful();
#ifdef Q_OS_WIN
// On all other systems local 8-bit encoding is UTF-8
void fromLocal8Bit_data();
@ -2494,104 +2491,6 @@ void tst_QStringConverter::availableCodesAreAvailable()
QVERIFY(QStringEncoder(codecName.toLatin1()).isValid());
}
void tst_QStringConverter::finalize()
{
// encoder
{
auto fromUtf16 = QStringEncoder(QStringEncoder::Utf8);
QString incompleteInput(QChar(0xd800));
QByteArray buffer("cdcdcdcd");
fromUtf16.appendToBuffer(buffer.data(), incompleteInput);
QVERIFY(!fromUtf16.hasError());
QCOMPARE(buffer, "cdcdcdcd");
QStringEncoder::FinalizeResult r = fromUtf16.finalize(buffer.data(), buffer.size());
QCOMPARE_GT(r.next, buffer.constData());
QCOMPARE(r.error, QStringEncoder::FinalizeResult::Error::InvalidCharacters);
QCOMPARE_GT(r.invalidChars, 0);
QVERIFY(!fromUtf16.hasError());
QVERIFY(buffer.startsWith(QString(QChar(QChar::ReplacementCharacter)).toUtf8()));
// Try calling finalize again, no new bytes should be output
std::array<char, 3> extraBytes;
r = fromUtf16.finalize(extraBytes.data(), extraBytes.size());
// Ugly-cast to void to circumvent smart testlib
QCOMPARE((void *)r.next, (void *)extraBytes.data());
QCOMPARE(r.invalidChars, 0);
QCOMPARE(r.error, QStringEncoder::FinalizeResult::Error::NoError);
}
// decoder
{
auto toUtf16 = QStringDecoder(QStringConverter::Utf8);
QByteArray incompleteInput("\xf0", 1);
QString buffer = u"cdcdcdcd"_s;
toUtf16.appendToBuffer(buffer.data(), incompleteInput);
QVERIFY(!toUtf16.hasError());
QCOMPARE(buffer, u"cdcdcdcd"_s);
auto result = toUtf16.finalize(buffer.data(), buffer.size());
QCOMPARE_GT(result.next, buffer.constData());
QCOMPARE(result.error, QStringDecoder::FinalizeResult::Error::InvalidCharacters);
QVERIFY(buffer.startsWith(QChar(QChar::ReplacementCharacter)));
// Try calling finalize again, no new bytes should be output
std::array<QChar, 3> extraBytes;
result = toUtf16.finalize(extraBytes.data(), extraBytes.size());
// Ugly-cast to void to circumvent smart testlib
QCOMPARE((void *)result.next, (void *)extraBytes.data());
}
}
void tst_QStringConverter::finalizeStateful()
{
#if !QT_CONFIG(icu) && !QT_CONFIG(winsdkicu)
// Technically there is _access_ to stateful encoding on Windows, but only
// through the System encoder.
QSKIP("ICU is not enabled in this build => stateful encoding is not tested.");
#else
{
// Test that calling finalize() restores ASCII mode in this stateful encoding:
static const char expected[] = {
0x1b, 0x24, 0x42, 0x25, 0x26, 0x25, 0x23, 0x25, 0x2d, 0x25, 0x5a, 0x25,
0x47, 0x25, 0x23, 0x25, 0x22, 0x1b, 0x28, 0x42
};
QString input = u"ウィキペディア"_s; // "Wikipedia"
QByteArray buffer(20, '\0');
auto stateful = QStringEncoder("ISO-2022-JP");
if (!stateful.isValid())
QSKIP("ICU without support for ISO-2022-JP, cannot continue test.");
char *out = stateful.appendToBuffer(buffer.data(), input);
QCOMPARE(std::distance(buffer.data(), out), 17);
// First without enough space. We assume ICU may or may not output the
// start of the 1b 28 42 sequence, so we handle either.
char * const end = buffer.end();
QStringEncoder::FinalizeResult result = stateful.finalize(out, 1);
QCOMPARE(result.error, QStringEncoder::FinalizeResult::Error::NotEnoughSpace);
// Then with enough space
result = stateful.finalize(result.next, std::distance(result.next, end));
QCOMPARE((void *)result.next, (void *)buffer.constEnd());
QCOMPARE(buffer.toHex(' '), QByteArrayView(expected).toByteArray().toHex(' '));
QCOMPARE(result.invalidChars, 0);
// Try calling finalize again, no new bytes should be output
std::array<char, 3> extraBytes;
result = stateful.finalize(extraBytes.data(), extraBytes.size());
QCOMPARE((void *)result.next, (void *)extraBytes.data());
QCOMPARE(result.error, QStringEncoder::FinalizeResult::Error::NoError);
QCOMPARE(result.invalidChars, 0);
}
{
// Repeat, but calling finalize() without an output
QString input = u"ウィキペディア"_s; // "Wikipedia"
QByteArray buffer(20, '\0');
auto stateful = QStringEncoder("ISO-2022-JP");
QVERIFY(stateful.isValid());
char *out = stateful.appendToBuffer(buffer.data(), input);
QCOMPARE(std::distance(buffer.data(), out), 17);
// This passes some pointers to ICU, we just shouldn't crash
QStringEncoder::FinalizeResult r = stateful.finalize();
QCOMPARE(r.error, QStringEncoder::FinalizeResult::Error::NoError);
QCOMPARE(r.invalidChars, 0);
QCOMPARE(r.next, nullptr);
}
#endif
}
class LoadAndConvert: public QRunnable
{
public:

View File

@ -431,30 +431,6 @@ void tst_QUtf8StringView::std_stringview_conversion()
QCOMPARE(sv.size(), size_t(12));
QCOMPARE(sv, std::basic_string_view<QUtf8StringView::storage_type>("Hello\0world\0", 12));
}
#ifdef __cpp_lib_char8_t
{
QUtf8StringView s;
std::u8string_view sv(s);
QCOMPARE(sv, std::u8string_view());
s = u8"";
sv = s;
QCOMPARE(s.size(), 0);
QCOMPARE(sv.size(), size_t(0));
QCOMPARE(sv, std::u8string_view());
s = u8"Hello";
sv = s;
QCOMPARE(sv, std::u8string_view(u8"Hello"));
s = QUtf8StringView::fromArray(u8"Hello\0world");
sv = s;
QCOMPARE(s.size(), 12);
QCOMPARE(sv.size(), size_t(12));
QCOMPARE(sv, std::u8string_view(u8"Hello\0world\0", 12));
}
#endif
}
namespace QUtf8StringViewOverloadResolution {

View File

@ -124,7 +124,9 @@ void tst_QCalendar::basic_data()
{
QTest::addColumn<QCalendar::System>("system");
const QMetaEnum e = QMetaEnum::fromType<QCalendar::System>();
QMetaEnum e = QCalendar::staticMetaObject.enumerator(0);
Q_ASSERT(qstrcmp(e.name(), "System") == 0);
for (int i = 0; i <= int(QCalendar::System::Last); ++i) {
// There may be gaps in the enum's numbering; and Last is a duplicate:
if (e.value(i) != -1 && qstrcmp(e.key(i), "Last"))

View File

@ -1161,23 +1161,38 @@ void tst_QDate::operator_insert_extract_data()
QTest::addColumn<QDate>("date");
QTest::addColumn<QDataStream::Version>("dataStreamVersion");
const QMetaEnum e = QMetaEnum::fromType<QDataStream::Version>();
for (int version = QDataStream::Qt_1_0; version <= QDataStream::Qt_DefaultCompiledVersion;
++version) {
if (e.value(version) == -1 || qstrcmp(e.key(version), "Qt_DefaultCompiledVersion") == 0)
continue;
const auto dataStreamVersion = static_cast<QDataStream::Version>(version);
const char *const tag = e.key(version);
QTest::addRow("(invalid) %s", tag) << invalidDate() << dataStreamVersion;
QTest::addRow("(1, 1, 1) %s", tag) << QDate(1, 1, 1) << dataStreamVersion;
QTest::addRow("(-1, 1, 1) %s", tag) << QDate(-1, 1, 1) << dataStreamVersion;
QTest::addRow("(1995, 5, 20) %s", tag) << QDate(1995, 5, 20) << dataStreamVersion;
QMap<QDataStream::Version, QByteArray> versionsToTest;
versionsToTest.insert(QDataStream::Qt_1_0, "Qt_1_0"_ba);
versionsToTest.insert(QDataStream::Qt_2_0, "Qt_2_0"_ba);
versionsToTest.insert(QDataStream::Qt_2_1, "Qt_2_1"_ba);
versionsToTest.insert(QDataStream::Qt_3_0, "Qt_3_0"_ba);
versionsToTest.insert(QDataStream::Qt_3_1, "Qt_3_1"_ba);
versionsToTest.insert(QDataStream::Qt_3_3, "Qt_3_3"_ba);
versionsToTest.insert(QDataStream::Qt_4_0, "Qt_4_0"_ba);
versionsToTest.insert(QDataStream::Qt_4_1, "Qt_4_1"_ba);
versionsToTest.insert(QDataStream::Qt_4_2, "Qt_4_2"_ba);
versionsToTest.insert(QDataStream::Qt_4_3, "Qt_4_3"_ba);
versionsToTest.insert(QDataStream::Qt_4_4, "Qt_4_4"_ba);
versionsToTest.insert(QDataStream::Qt_4_5, "Qt_4_5"_ba);
versionsToTest.insert(QDataStream::Qt_4_6, "Qt_4_6"_ba);
versionsToTest.insert(QDataStream::Qt_4_7, "Qt_4_7"_ba);
versionsToTest.insert(QDataStream::Qt_4_8, "Qt_4_8"_ba);
versionsToTest.insert(QDataStream::Qt_4_9, "Qt_4_9"_ba);
versionsToTest.insert(QDataStream::Qt_5_0, "Qt_5_0"_ba);
for (auto it = versionsToTest.constBegin(); it != versionsToTest.constEnd(); ++it) {
const QByteArray &version(it.value());
const char *const tag = version.constData();
QTest::addRow("(invalid) %s", tag) << invalidDate() << it.key();
QTest::addRow("(1, 1, 1) %s", tag) << QDate(1, 1, 1) << it.key();
QTest::addRow("(-1, 1, 1) %s", tag) << QDate(-1, 1, 1) << it.key();
QTest::addRow("(1995, 5, 20) %s", tag) << QDate(1995, 5, 20) << it.key();
// Test minimums for quint32/qint64.
if (dataStreamVersion >= QDataStream::Qt_5_0)
QTest::addRow("(-4714, 11, 24) %s", tag) << QDate(-4714, 11, 24) << dataStreamVersion;
if (it.key() >= QDataStream::Qt_5_0)
QTest::addRow("(-4714, 11, 24) %s", tag) << QDate(-4714, 11, 24) << it.key();
else
QTest::addRow("(-4713, 1, 2) %s", tag) << QDate(-4713, 1, 2) << dataStreamVersion;
QTest::addRow("(-4713, 1, 2) %s", tag) << QDate(-4713, 1, 2) << it.key();
}
}

View File

@ -2631,20 +2631,18 @@ void tst_QDateTime::operator_insert_extract_data()
const QByteArray westernAustralia("AWST-8AWDT-9,M10.5.0,M3.5.0/03:00:00");
const QByteArray hawaii("HAW10");
const QMetaEnum e = QMetaEnum::fromType<QDataStream::Version>();
for (int version = QDataStream::Qt_1_0; version <= QDataStream::Qt_DefaultCompiledVersion;
++version) {
if (e.value(version) == -1 || qstrcmp(e.key(version), "Qt_DefaultCompiledVersion") == 0)
continue;
const auto dataStreamVersion = static_cast<QDataStream::Version>(version);
const char *const tag = e.key(version);
QTest::addRow("%s WA => HAWAII %d", tag, 2012)
const QDataStream tmpDataStream;
const int thisVersion = tmpDataStream.version();
for (int version = QDataStream::Qt_1_0; version <= thisVersion; ++version) {
const QDataStream::Version dataStreamVersion = static_cast<QDataStream::Version>(version);
const QByteArray vN = QByteArray::number(dataStreamVersion);
QTest::addRow("v%d WA => HAWAII %d", version, 2012)
<< 2012 << westernAustralia << hawaii << dataStreamVersion;
QTest::addRow("%s WA => WA %d", tag, 2012)
QTest::addRow("v%d WA => WA %d", version, 2012)
<< 2012 << westernAustralia << westernAustralia << dataStreamVersion;
QTest::addRow("%s HAWAII => WA %d", tag, -2012)
QTest::addRow("v%d HAWAII => WA %d", version, -2012)
<< -2012 << hawaii << westernAustralia << dataStreamVersion;
QTest::addRow("%s HAWAII => HAWAII %d", tag, 2012)
QTest::addRow("v%d HAWAII => HAWAII %d", version, 2012)
<< 2012 << hawaii << hawaii << dataStreamVersion;
}
}

View File

@ -45,8 +45,6 @@ private slots:
void setFont_collection_data();
void setFont_collection();
void clearCollection();
void setFontFeatures();
void setFontVariableAxes();
#ifndef QT_NO_DATASTREAM
void dataStreamCompatibility();
@ -669,89 +667,6 @@ void tst_QTextFormat::clearCollection()
QCOMPARE(collection.defaultFont(), f); // kept, QTextDocument::clear or setPlainText should not reset the font set by setDefaultFont
}
void tst_QTextFormat::setFontFeatures()
{
{
QFont font;
font.setFeature("abcd", 1234);
font.setFeature("efgh", 5678);
QTextCharFormat format;
format.setFont(font);
QFont resolvedFont = format.font();
QCOMPARE(resolvedFont.featureTags().size(), 2);
QCOMPARE(resolvedFont.featureValue("abcd"), 1234);
QCOMPARE(resolvedFont.featureValue("efgh"), 5678);
QHash<QFont::Tag, quint32> features = format.fontFeatures();
QCOMPARE(features.size(), 2);
QCOMPARE(features.value("abcd"), 1234);
QCOMPARE(features.value("efgh"), 5678);
}
{
QTextCharFormat format;
QHash<QFont::Tag, quint32> features;
features.insert("abcd", 4321);
features.insert("efgh", 8765);
format.setFontFeatures(features);
QFont resolvedFont = format.font();
QCOMPARE(resolvedFont.featureTags().size(), 2);
QCOMPARE(resolvedFont.featureValue("abcd"), 4321);
QCOMPARE(resolvedFont.featureValue("efgh"), 8765);
features = format.fontFeatures();
QCOMPARE(features.size(), 2);
QCOMPARE(features.value("abcd"), 4321);
QCOMPARE(features.value("efgh"), 8765);
}
}
void tst_QTextFormat::setFontVariableAxes()
{
{
QFont font;
font.setVariableAxis("abcd", 12.25);
font.setVariableAxis("efgh", 13.25);
QTextCharFormat format;
format.setFont(font);
QFont resolvedFont = format.font();
QCOMPARE(resolvedFont.variableAxisTags().size(), 2);
QCOMPARE(resolvedFont.variableAxisValue("abcd"), 12.25);
QCOMPARE(resolvedFont.variableAxisValue("efgh"), 13.25);
QHash<QFont::Tag, float> axes = format.fontVariableAxes();
QCOMPARE(axes.size(), 2);
QCOMPARE(axes.value("abcd"), 12.25);
QCOMPARE(axes.value("efgh"), 13.25);
}
{
QTextCharFormat format;
QHash<QFont::Tag, float> axes;
axes.insert("abcd", 12.25);
axes.insert("efgh", 13.25);
format.setFontVariableAxes(axes);
QFont resolvedFont = format.font();
QCOMPARE(resolvedFont.variableAxisTags().size(), 2);
QCOMPARE(resolvedFont.variableAxisValue("abcd"), 12.25);
QCOMPARE(resolvedFont.variableAxisValue("efgh"), 13.25);
axes = format.fontVariableAxes();
QCOMPARE(axes.size(), 2);
QCOMPARE(axes.value("abcd"), 12.25);
QCOMPARE(axes.value("efgh"), 13.25);
}
}
#ifndef QT_NO_DATASTREAM
void tst_QTextFormat::dataStreamCompatibility()
{
@ -880,73 +795,6 @@ void tst_QTextFormat::dataStreamCompatibility()
}
}
// Don't mix up FontFeatures and OldTextUnderlineColor
memory.clear();
{
{
QBuffer buffer(&memory);
buffer.open(QIODevice::WriteOnly);
QFont font;
font.setFeature("abcd", 1234);
QTextCharFormat format;
format.setFont(font);
QDataStream stream(&buffer);
stream << format;
}
{
QBuffer buffer(&memory);
buffer.open(QIODevice::ReadOnly);
QDataStream stream(&buffer);
QTextFormat other;
stream >> other;
QMap<int, QVariant> properties = other.properties();
QVERIFY(properties.contains(QTextFormat::FontFeatures));
auto features = other.property(QTextFormat::FontFeatures).value<QHash<QFont::Tag, quint32>>();
QCOMPARE(features.value("abcd"), 1234);
}
}
memory.clear();
{
{
QBuffer buffer(&memory);
buffer.open(QIODevice::WriteOnly);
QFont font;
font.setFeature("abcd", 1234);
QTextCharFormat format;
format.setFont(font);
QDataStream stream(&buffer);
stream.setVersion(QDataStream::Qt_5_15);
stream << format;
}
{
QBuffer buffer(&memory);
buffer.open(QIODevice::ReadOnly);
QDataStream stream(&buffer);
stream.setVersion(QDataStream::Qt_5_15);
QTextFormat other;
stream >> other;
QMap<int, QVariant> properties = other.properties();
QVERIFY(!properties.contains(QTextFormat::FontFeatures));
QVERIFY(!properties.contains(QTextFormat::OldTextUnderlineColor));
}
}
}
#endif // QT_NO_DATASTREAM

View File

@ -3,7 +3,7 @@
** Copyright (C) 2024 Intel Corporation.
** SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
**
** Created by: The Resource Compiler for Qt version 6.11.0
** Created by: The Resource Compiler for Qt version 6.10.0
**
** WARNING! All changes made in this file will be lost!
*****************************************************************************/

View File

@ -38,7 +38,6 @@ private slots:
void initiallySuspended();
void modality();
void modalityWithoutTransientParent();
void grabbingSiblingPopups();
};
void tst_xdgshell::initTestCase()
@ -846,18 +845,15 @@ void tst_xdgshell::suspended()
QVERIFY(!window.isExposed()); // not exposed until we're configured
QCOMPOSITOR_TRY_VERIFY(xdgToplevel());
uint serial = 0;
exec([&] { serial = xdgToplevel()->sendCompleteConfigure(); });
exec([&] { xdgToplevel()->sendCompleteConfigure(); });
QCOMPOSITOR_TRY_VERIFY(xdgToplevel()->m_xdgSurface->m_committedConfigureSerial);
QTRY_VERIFY(window.isExposed());
QCOMPOSITOR_TRY_COMPARE(xdgToplevel()->m_xdgSurface->m_committedConfigureSerial, serial);
exec([&] { serial = xdgToplevel()->sendCompleteConfigure(QSize(), {XdgToplevel::state_suspended}); });
exec([&] { xdgToplevel()->sendCompleteConfigure(QSize(), {XdgToplevel::state_suspended}); });
QTRY_VERIFY(!window.isExposed());
QCOMPOSITOR_TRY_COMPARE(xdgToplevel()->m_xdgSurface->m_committedConfigureSerial, serial);
exec([&] { serial = xdgToplevel()->sendCompleteConfigure(QSize(), {}); });
exec([&] { xdgToplevel()->sendCompleteConfigure(QSize(), {}); });
QTRY_VERIFY(window.isExposed());
QCOMPOSITOR_TRY_COMPARE(xdgToplevel()->m_xdgSurface->m_committedConfigureSerial, serial);
}
void tst_xdgshell::initiallySuspended()
@ -936,67 +932,5 @@ void tst_xdgshell::modalityWithoutTransientParent()
QCOMPOSITOR_TRY_VERIFY(!xdgDialog());
}
void tst_xdgshell::grabbingSiblingPopups()
{
class Window : public QRasterWindow {
public:
void mousePressEvent(QMouseEvent *event) override
{
QRasterWindow::mousePressEvent(event);
auto popup = new QRasterWindow;
popup->setTransientParent(this);
popup->setFlags(Qt::Popup);
popup->resize(100, 100);
popup->show();
m_popups << popup;
}
QList<QRasterWindow*> m_popups;
};
Window window;
window.resize(200, 200);
window.show();
QCOMPOSITOR_TRY_VERIFY(xdgToplevel());
exec([&] { xdgToplevel()->sendCompleteConfigure(); });
auto triggerPopup = [&](int popupIndex) {
// we need a click to be able to create a grabbing popup
exec([&] {
auto *surface = xdgToplevel()->surface();
auto *p = pointer();
auto *c = client();
p->sendEnter(surface, {100, 100});
p->sendFrame(c);
p->sendButton(c, BTN_LEFT, Pointer::button_state_pressed);
p->sendButton(c, BTN_LEFT, Pointer::button_state_released);
p->sendFrame(c);
});
QCOMPOSITOR_TRY_VERIFY(xdgPopup(popupIndex));
exec([&] {
xdgPopup(popupIndex)->sendConfigure(QRect(100, 100, 100, 100));
xdgPopup(popupIndex)->m_xdgSurface->sendConfigure();
});
};
triggerPopup(0);
// QtWayland will make popup1 a child of popup0, despite them being siblings at a Qt level
triggerPopup(1);
// This is illegal from a wayland POV as popup2 is the latest grabbing popup
// popup2 must be closed first but we should handle it gracefully
// and not trigger an error in the compositor
delete window.m_popups.takeFirst();
// check the compositor does not throw an error when the popup is closed
auto native = qGuiApp->platformNativeInterface();
auto display = static_cast<struct ::wl_display *>(native->nativeResourceForIntegration("wl_display"));
wl_display_roundtrip(display);
// cleanup
delete window.m_popups.takeFirst();
}
QCOMPOSITOR_TEST_MAIN(tst_xdgshell)
#include "tst_xdgshell.moc"

View File

@ -7,6 +7,6 @@ macos
[scrollTo]
android
[overshoot_segments]
[overshoot]
macos #QTBUG-134105
windows #QTBUG-134105

View File

@ -117,8 +117,6 @@ private slots:
void scrollTo();
void scroll();
void overshoot();
void overshoot_data();
void overshoot_segments();
void multipleWindows();
void mouseEventTimestamp();
@ -402,77 +400,11 @@ void tst_QScroller::scroll()
#endif
}
void tst_QScroller::overshoot_data()
{
QTest::addColumn<qreal>("dragDistance");
QTest::addColumn<qreal>("scrollDistance");
QTest::addColumn<QVariant>("scrollMetric");
QTest::addColumn<QRectF>("rectangle");
QTest::addColumn<QPointF>("from");
QTest::addColumn<QPoint>("touchStart");
QTest::addColumn<QPoint>("touchUpdate");
QTest::addColumn<QPoint>("touchEnd");
QTest::addColumn<bool>("overshoot");
QTest::addRow("scrollable good case") << qreal(0.2) << qreal(0.2) << QVariant(QVariant::fromValue(QScrollerProperties::OvershootWhenScrollable))
<< QRectF(0, 0, 1000, 1000) << QPointF(500, 500) << QPoint(0, 0) << QPoint(400, 0) << QPoint(490, 0) << bool(true) ;
QTest::addRow("scrollable bad case") << qreal(0.2) << qreal(0.2) << QVariant(QVariant::fromValue(QScrollerProperties::OvershootWhenScrollable))
<< QRectF(0, 0, 0, 1000) << QPointF(0, 500) << QPoint(0, 0) << QPoint(400, 0) << QPoint(490, 0) << bool(false);
QTest::addRow("overshoot always on") << qreal(0.2) << qreal(0.2) << QVariant(QVariant::fromValue(QScrollerProperties::OvershootAlwaysOn))
<< QRectF(0, 0, 0, 1000) << QPointF(0, 500) << QPoint(0, 0) << QPoint(400, 0) << QPoint(490, 0) << bool(true);
QTest::addRow("overshoot always off") << qreal(0.2) << qreal(0.2) << QVariant(QVariant::fromValue(QScrollerProperties::OvershootAlwaysOff))
<< QRectF(0, 0, 1000, 1000) << QPointF(500, 500) << QPoint(0, 0) << QPoint(400, 0) << QPoint(490, 0) << bool(false);
QTest::addRow("max overshoot null") << qreal(0.0) << qreal(0.0) << QVariant(QVariant::fromValue(QScrollerProperties::OvershootAlwaysOn))
<< QRectF(0, 0, 1000, 1000) << QPointF(500, 500) << QPoint(0, 0) << QPoint(400, 0) << QPoint(490, 0) << bool(false) ;
}
void tst_QScroller::overshoot()
{
#if QT_CONFIG(gestures) && QT_CONFIG(scroller)
QScopedPointer<tst_QScrollerWidget> sw(new tst_QScrollerWidget);
QScroller::grabGesture(sw.data(), QScroller::TouchGesture);
sw->setGeometry(100, 100, 400, 300);
sw->show();
if (!QTest::qWaitForWindowExposed(sw.data()) || !QTest::qWaitForWindowActive(sw.data()))
QSKIP("Failed to show and activate window");
QFETCH(const qreal, dragDistance);
QFETCH(const qreal, scrollDistance);
QFETCH(const QVariant, scrollMetric);
QFETCH(const QRectF, rectangle);
QFETCH(const QPointF, from);
QFETCH(const QPoint, touchStart);
QFETCH(const QPoint, touchUpdate);
QFETCH(const QPoint, touchEnd);
QFETCH(const bool, overshoot);
QScroller *s1 = QScroller::scroller(sw.data());
QScrollerProperties sp1 = s1->scrollerProperties();
sp1.setScrollMetric(QScrollerProperties::OvershootDragResistanceFactor, 0.5);
sp1.setScrollMetric(QScrollerProperties::OvershootDragDistanceFactor, dragDistance);
sp1.setScrollMetric(QScrollerProperties::OvershootScrollDistanceFactor, scrollDistance);
sp1.setScrollMetric(QScrollerProperties::HorizontalOvershootPolicy, scrollMetric);
s1->setScrollerProperties(sp1);
sw->reset();
sw->scrollArea = rectangle;
kineticScrollNoTest(sw.data(), from, touchStart, touchUpdate, touchEnd);
QTRY_COMPARE(s1->state(), QScroller::Inactive);
QVERIFY(qFuzzyCompare(sw->currentPos.x(), 0));
QVERIFY(qFuzzyCompare(sw->currentPos.y(), 500));
QCOMPARE(sw->receivedOvershoot, overshoot);
#endif
}
void tst_QScroller::overshoot_segments()
{
#if QT_CONFIG(gestures) && QT_CONFIG(scroller)
QScopedPointer<tst_QScrollerWidget> sw(new tst_QScrollerWidget);
sw->scrollArea = QRectF(0, 0, 1000, 1000);
QScroller::grabGesture(sw.data(), QScroller::TouchGesture);
sw->setGeometry(100, 100, 400, 300);
sw->show();
@ -486,25 +418,102 @@ void tst_QScroller::overshoot_segments()
sp1.setScrollMetric(QScrollerProperties::OvershootDragDistanceFactor, 0.2);
sp1.setScrollMetric(QScrollerProperties::OvershootScrollDistanceFactor, 0.2);
// -- try to scroll with overshoot (when scrollable good case)
sp1.setScrollMetric(QScrollerProperties::HorizontalOvershootPolicy, QVariant::fromValue(QScrollerProperties::OvershootWhenScrollable));
s1->setScrollerProperties(sp1);
kineticScrollNoTest(sw.data(), QPointF(500, 500), QPoint(0, 0), QPoint(400, 0), QPoint(490, 0));
QTRY_COMPARE(s1->state(), QScroller::Inactive);
//qDebug() << "Overshoot fuzzy: "<<sw->currentPos;
QVERIFY(qFuzzyCompare(sw->currentPos.x(), 0));
QVERIFY(qFuzzyCompare(sw->currentPos.y(), 500));
QCOMPARE(sw->receivedOvershoot, true);
// -- try to scroll with overshoot (when scrollable bad case)
sw->reset();
sw->scrollArea = QRectF(0, 0, 0, 1000);
sp1.setScrollMetric(QScrollerProperties::HorizontalOvershootPolicy, QVariant::fromValue(QScrollerProperties::OvershootWhenScrollable));
s1->setScrollerProperties(sp1);
kineticScrollNoTest(sw.data(), QPointF(0, 500), QPoint(0, 0), QPoint(400, 0), QPoint(490, 0));
QTRY_COMPARE(s1->state(), QScroller::Inactive);
//qDebug() << "Overshoot fuzzy: "<<sw->currentPos;
QVERIFY(qFuzzyCompare(sw->currentPos.x(), 0));
QVERIFY(qFuzzyCompare(sw->currentPos.y(), 500));
QCOMPARE(sw->receivedOvershoot, false);
// -- try to scroll with overshoot (always on)
sw->reset();
sw->scrollArea = QRectF(0, 0, 0, 1000);
sp1.setScrollMetric(QScrollerProperties::HorizontalOvershootPolicy, QVariant::fromValue(QScrollerProperties::OvershootAlwaysOn));
s1->setScrollerProperties(sp1);
kineticScrollNoTest(sw.data(), QPointF(0, 500), QPoint(0, 0), QPoint(400, 0), QPoint(490, 0));
QTRY_COMPARE(s1->state(), QScroller::Inactive);
//qDebug() << "Overshoot fuzzy: "<<sw->currentPos;
QVERIFY(qFuzzyCompare(sw->currentPos.x(), 0));
QVERIFY(qFuzzyCompare(sw->currentPos.y(), 500));
QCOMPARE(sw->receivedOvershoot, true);
// -- try to scroll with overshoot (always off)
sw->reset();
sw->scrollArea = QRectF(0, 0, 1000, 1000);
sp1.setScrollMetric(QScrollerProperties::HorizontalOvershootPolicy, QVariant::fromValue(QScrollerProperties::OvershootAlwaysOff));
s1->setScrollerProperties(sp1);
kineticScrollNoTest(sw.data(), QPointF(500, 500), QPoint(0, 0), QPoint(400, 0), QPoint(490, 0));
QTRY_COMPARE(s1->state(), QScroller::Inactive);
QVERIFY(qFuzzyCompare(sw->currentPos.x(), 0));
QVERIFY(qFuzzyCompare(sw->currentPos.y(), 500));
QCOMPARE(sw->receivedOvershoot, false);
// -- try to scroll with overshoot (always off, slow)
sw->reset();
sw->scrollArea = QRectF(0, 0, 1000, 1000);
sp1.setScrollMetric(QScrollerProperties::HorizontalOvershootPolicy, QVariant::fromValue(QScrollerProperties::OvershootAlwaysOff));
s1->setScrollerProperties(sp1);
kineticScrollNoTest(sw.data(), QPointF(500, 500), QPoint(0, 0), QPoint(200, 0), QPoint(250, 0));
// Check that segment parameters are consistent
QScrollerPrivate* priv = s1->d_func();
QVERIFY(priv->xSegments.size() == 1);
const auto& segment = priv->xSegments.head();
QCOMPARE_LT(segment.startPos + segment.deltaPos, segment.stopPos);
QTRY_COMPARE(s1->state(), QScroller::Inactive);
QVERIFY(qFuzzyCompare(sw->currentPos.x(), 0));
QVERIFY(qFuzzyCompare(sw->currentPos.y(), 500));
QCOMPARE(sw->receivedOvershoot, false);
// -- try to scroll with overshoot (always on but max overshoot = 0)
sp1.setScrollMetric(QScrollerProperties::OvershootDragDistanceFactor, 0.0);
sp1.setScrollMetric(QScrollerProperties::OvershootScrollDistanceFactor, 0.0);
sw->reset();
sw->scrollArea = QRectF(0, 0, 1000, 1000);
sp1.setScrollMetric(QScrollerProperties::HorizontalOvershootPolicy, QVariant::fromValue(QScrollerProperties::OvershootAlwaysOn));
s1->setScrollerProperties(sp1);
kineticScrollNoTest(sw.data(), QPointF(500, 500), QPoint(0, 0), QPoint(400, 0), QPoint(490, 0));
QTRY_COMPARE(s1->state(), QScroller::Inactive);
QVERIFY(qFuzzyCompare(sw->currentPos.x(), 0));
QVERIFY(qFuzzyCompare(sw->currentPos.y(), 500));
QCOMPARE(sw->receivedOvershoot, false);
#endif
}
void tst_QScroller::multipleWindows()
{
#if QT_CONFIG(gestures) && QT_CONFIG(scroller)

View File

@ -1,5 +1,6 @@
:: Copyright (C) 2024 The Qt Company Ltd.
:: SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
qsb --glsl 320es,410 --hlsl 50 test.vert -o test.vert.qsb
qsb --glsl 320es,410 --hlsl 50 test.geom -o test.geom.qsb
qsb --glsl 320es,410 test.geom -o test.geom.qsb
qsb -r hlsl,50,test_geom.hlsl test.geom.qsb
qsb --glsl 320es,410 --hlsl 50 test.frag -o test.frag.qsb

View File

@ -4,7 +4,6 @@
layout(points) in;
layout(line_strip, max_vertices = 7) out;
layout(location = 0) in vec4 v_position[];
layout(std140, binding = 0) uniform buf {
float radius;
@ -17,7 +16,7 @@ void main(void)
{
float theta = float(i) / 6.0f * 2.0 * M_PI;
gl_Position = v_position[0];
gl_Position = gl_in[0].gl_Position;
gl_Position.xy += radius * vec2(cos(theta), sin(theta));
EmitVertex();

View File

@ -1,10 +1,8 @@
#version 440
layout(location = 0) in vec3 position;
layout(location = 0) out vec4 v_position;
void main()
{
v_position = vec4(position, 1.0);
gl_Position = v_position;
gl_Position = vec4(position, 1.0);
}

View File

@ -0,0 +1,26 @@
struct VertexOutput
{
float4 position : SV_Position;
};
struct PixelInput
{
float4 position : SV_POSITION;
};
cbuffer buf : register(b0)
{
float radius : packoffset(c0);
};
[maxvertexcount(7)]
void main(point VertexOutput input[1], inout LineStream<PixelInput> OutputStream)
{
PixelInput output;
for (int i = 0; i < 7; ++i) {
float theta = float(i) / 6.0f * 2.0 * 3.14159265;
output.position = input[0].position;
output.position.xy += radius * float2(cos(theta), sin(theta));
OutputStream.Append(output);
}
}