74507 Commits

Author SHA1 Message Date
Marc Mutz
c51a038615 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.10 6.9 6.8
Change-Id: I7732465f222032b2833396576873fed370f71d11
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2025-06-12 20:22:38 +02:00
Thiago Macieira
4f0156fa4b Q*Mutex: unexport for Qt 7
Those weren't caught for the Qt 6.0 release.

Pick-to: 6.10
Change-Id: I5831d4ad80b7f60d8782fffd6c64ef552f82ad6e
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2025-06-12 11:22:38 -07:00
Alexey Edelev
d91d49ffe2 Move Android ABI detection to the separate function
Allows reusing the Android ABI detection.

Pick-to: 6.8 6.9 6.10
Change-Id: I8e452605b25e522c953f39a525c038a88174094b
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2025-06-12 18:58:33 +02:00
Alexey Edelev
1f10cd4b45 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.8 6.9 6.10
Change-Id: I2f10834b0dca3d2aa08fe13fba69849e97fa77d0
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2025-06-12 18:58:33 +02:00
Mårten Nordheim
1bcfbfa3bc 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.10 6.9 6.8
Change-Id: I3f1f09edfd9fb3135ccc12bf98e06254327e76fe
Reviewed-by: Mate Barany <mate.barany@qt.io>
2025-06-12 16:58:33 +00:00
Mårten Nordheim
3af5e42bdd 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.10 6.9
Change-Id: I55d69bbedc027893f6ad125c29468a34e7fb406f
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2025-06-12 18:58:33 +02:00
Mårten Nordheim
f9fbdba3a1 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.10 6.9 6.8
Change-Id: I850c9f0b899a15603b4c5ac83693019b856effb2
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2025-06-12 16:58:33 +00:00
Marc Mutz
6c18b438a3 QMetaObject: port QArgumentType to QByteArrayView
Now that argumentTypesFromString() actually doesn't normalize types
anymore, all type names are substrings of the signature, and so
QByteArrayView suffices (was: QByteArray) to hold the result.

QArgumentType in only used transitively, during QMetaObject member
function or QObject::connect() calls, so the source string will also
never go out of scope before the QArgumentType object that references
it.

As a drive-by, make the QArgumentType ctor explicit and port from
QVLA::op+=() to emplace_back().

No discernable impact on tst_bench_qobject's connect_disconnect.

Task-number: QTBUG-135572
Change-Id: If6544917b9df8191a256dc2a67e31c6b7e5a38cb
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2025-06-12 18:03:50 +02:00
Marc Mutz
afdf37ad8f 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
Pick-to: 6.10
Change-Id: I7fd9293bba5d2b57b4452e55499ffbf360bc6123
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2025-06-12 16:03:50 +00:00
Olivier De Cannière
5aa1bc4621 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.10 6.9 6.8
Change-Id: I83d7a3ea7b9bab98889791bb807988a74e355b93
Reviewed-by: Santhosh Kumar <santhosh.kumar.selvaraj@qt.io>
2025-06-12 17:22:23 +02:00
Petri Virkkunen
76bf2512e7 Android: Add default template argument return type to AndroidBackendRegister
For AndroidBackendRegister::callInterface, it would be more convenient
to call simple functions without parameters, without being forced to
specify the void return type. Added a default void type argument for
the return type.

Change-Id: Ib7f631c172955cdf0b2e853155fd57c06bef9843
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2025-06-12 13:37:19 +00:00
Petri Virkkunen
43e52253d5 Android: Add some developer documentation to AndroidBackendRegister
A quick blurb to explain the usecase and limitations of
AndroidBackendRegister, meant for future developers.

Also documents the two public-facing functions, getInterface()
and callInterface().

Change-Id: I79f07d4a19fdb1f4a53529ab42a8663999759f85
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2025-06-12 16:37:19 +03:00
Morten Sørvig
c2ec20b226 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.

Pick-to: 6.10
Task-number: QTBUG-120138
Change-Id: I929b9bb51153007c16630b1a991399f01ebffa62
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2025-06-12 15:37:19 +02:00
Gleb Popov
59c29436db QNativeSocketEngine: React on POLLHUP too when selecting for writing
FreeBSD may return a single POLLHUP revent not coupled with any of POLLOUT nor
POLLERR. This causes a busy-loop, so put POLLHUP into write_flags.

Change-Id: Ief62138eeb6de8e2caf1d6937507bfd828adfb81
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2025-06-12 15:20:49 +03:00
Gleb Popov
4ba106b38f QEventDispatcherGlib: Put G_IO_HUP into pfd.events for all cases of QSocketNotifier::Type
On FreeBSD when asked for POLLOUT the poll() syscall returns only POLLHUP to
signify the fact that the other side closed the connection. It never sends
POLLERR for EOF cases, which results in a busy-loop inside the Glib dispatcher:
- poll() returns immediately with POLLHUP for a closed socket
- socketNotifierSourceCheck() does not detect it, because .events = POLLOUT | POLLERR
  and we get .revents = POLLHUP. The (events & revents != 0) condition evaluates to false
- the code decides there is nothing to do and a new iteration starts

A similar issue in dbus code: https://gitlab.freedesktop.org/dbus/dbus/-/merge_requests/526

Change-Id: I2660a5179031da8eb9fe2562abe7fb283c77f64a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2025-06-12 15:20:49 +03:00
David Boddie
5b86fca7cf Doc: Remove redundant "see also" link
Pick-to: 6.9 6.10
Change-Id: Id48d97a171b55f3dbf8d1fa32e23b82d28e5552d
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2025-06-12 12:20:49 +00:00
Thiago Macieira
25f396218d 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.

Pick-to: 6.10
Task-number: QTBUG-137478
Change-Id: Idd01170c3396c5b6fefefffd748f3335fc42fd79
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2025-06-12 12:20:49 +00:00
Marc Mutz
184d0bf2ec 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.10 6.9 6.8 6.5
Change-Id: Ib76b4bc00b08289bb8d6d58096b43501b47814d1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2025-06-12 14:04:58 +02:00
Marc Mutz
e4b0549a4c 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.10 6.9 6.8 6.5
Change-Id: Iee0d75ce10a589390afdd9069b7040a1c9c608e1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2025-06-12 14:04:58 +02:00
Marc Mutz
5aefe2d9a1 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.10 6.9 6.8 6.5
Change-Id: I4b765aed329211984c35c40fbc5648bf104990ce
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2025-06-12 14:04:58 +02:00
Jani Korteniemi
3047d6a8a1 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.5 6.8 6.9 6.10
Fixes: QTBUG-126743
Change-Id: If45766152c6cbf9e2ee916baa5a15282d3fedaf2
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2025-06-12 08:58:39 +03:00
Marc Mutz
270b219410 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.

Pick-to: 6.10
Change-Id: Ic1242436bf87d7067e3c5240eb2687505e24800f
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
2025-06-12 00:34:17 +02:00
Marc Mutz
f1e1a933a6 qdebug.h: remove duplicate includes
Added by 51f702d4029148570d255daef80d071d98cf1e16 w/o rationale.

Found in API-review.

Pick-to: 6.10
Change-Id: Ia0afd3d3aaf7a8bc392333b8359ce5b5496bec7f
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2025-06-12 00:34:17 +02:00
Mårten Nordheim
9ed754e754 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.10 6.9 6.8 6.5
Fixes: QTBUG-137041
Change-Id: I268f3bad669df77351fc458f56e318db75ecac7b
Reviewed-by: Mate Barany <mate.barany@qt.io>
2025-06-11 21:22:55 +02:00
Volker Hilsheimer
33dc247b6a 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.10 6.9
Change-Id: Iab9b819e70b71fade6a58286edff8e022748d9f6
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2025-06-11 20:10:43 +02:00
Fabian Kosmale
3f0261ebe3 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.10 6.9 6.8 6.5
Change-Id: I363f2f34a06cc5de031fa87c6274322bf03bd77f
Reviewed-by: David Faure <david.faure@kdab.com>
2025-06-11 20:01:04 +02:00
Topi Reinio
a9a68a87b9 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.10 6.9 6.8
Fixes: QTBUG-136990
Change-Id: I72adbeaca46cd9dd99c54368257268dc8db6bfdc
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: David Boddie <david.boddie@qt.io>
2025-06-11 17:21:52 +00:00
Matthias Rauter
25df8042a4 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.10 6.9 6.8
Change-Id: I1817ec4da947cd91729d0ce35defc9f63cd784d9
Reviewed-by: Mate Barany <mate.barany@qt.io>
2025-06-11 18:46:52 +02:00
Marc Mutz
fe7f01019c 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.10 6.9 6.8
Change-Id: I1810f90c7cf6e3760f1d99e026b291311501c3aa
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2025-06-11 18:46:52 +02:00
Matthias Rauter
26bf2bedca 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.10 6.9 6.8 6.5
Task-number: QTBUG-132097
Change-Id: I1efc0c2d2f474f6644261575a745aa8f7e5ac4b2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2025-06-11 18:18:04 +02:00
Volker Hilsheimer
7ac8815a19 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.

Pick-to: 6.10
Change-Id: I63090891988e677cf3ae2d871418b1abd4d1dc71
Reviewed-by: Matthias Rauter <matthias.rauter@qt.io>
2025-06-11 18:18:04 +02:00
Matthias Rauter
dd81b42127 Make include guard match its filename
Pick-to: 6.10
Change-Id: I57af3c237bddffc424cab734faa30deacaa9bcdb
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2025-06-11 16:59:46 +02:00
Laszlo Agocs
fdbc8079c9 rhi: Update the docs and manual test for geometry shaders
Task-number: QTBUG-137521
Change-Id: Ic9256eaaa55aef20c622429058fda9235c1f73c1
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2025-06-11 15:15:42 +02:00
Aaron McCarthy
7dd952667c Copy Android files from the application source in aux mode
The application provided overrides of the Android files were not being
used in aux mode. In aux mode androiddeployqt was only copying the
Android files from the Qt sources and updating them.

With this change androiddeployqt also copies the Android files from the
application source, allowing overrides prior to template processing.

Change-Id: Idf790f1c270691dab8fe093c20e84bed79bf481d
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2025-06-11 23:15:42 +10:00
Cristian Le
00a96237fd 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.8 6.9 6.10
Change-Id: I2b7f3996315169d840bab3dff011927288c9782d
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2025-06-11 09:14:06 +02:00
Tor Arne Vestbø
cdb33c3d56 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.10 6.9 6.8 6.5
Change-Id: Ia1d0e37dda177f333646e598e517f4af20215dad
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2025-06-10 21:17:22 -07:00
David Faure
5e971101f0 QIdentityProxyModel: avoid emitting reset in no-op setSourceModel
QSortFilterProxyModel does this exactly, it was missing in
QIdentityProxyModel.

Pick-to: 6.10
Change-Id: If14bc7a377c1ad9235dd70222e3bfbf88eef11c0
Reviewed-by: Santhosh Kumar <santhosh.kumar.selvaraj@qt.io>
2025-06-11 04:08:35 +02:00
Tor Arne Vestbø
b9c77b9685 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.10 6.9 6.8 6.5
Change-Id: I0c3203f92851ad9fa862aed237823f0e1e28f6ff
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2025-06-10 15:41:35 -07:00
Samuli Piippo
0f6c93c453 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.

Pick-to: 6.10
Change-Id: I2c284219e83fecf862520a2f667d561adf4d4357
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2025-06-10 21:32:56 +00:00
Samuli Piippo
ccb854799d 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.

Pick-to: 6.10
Change-Id: I3fb6400d87ba08f03c30e33924c8c7d483486c3b
Reviewed-by: MohammadHossein Qanbari <mohammad.qanbari@qt.io>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2025-06-10 21:32:56 +00:00
Volker Hilsheimer
1ee43844d4 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.

Pick-to: 6.10
Change-Id: Ia4290c9b21eb8163180d725ed200629e36e85f1f
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2025-06-10 22:57:53 +02:00
Christian Ehrlicher
46c2aa2b61 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.10 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>
2025-06-10 18:30:25 +00:00
Edward Welbourne
5e9efe45df 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.10 6.9
Change-Id: I36f02a7dfb195616ce68babedbccc61480935fb9
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2025-06-10 20:11:54 +02:00
Edward Welbourne
dd5f409c58 Rework tst_QDate{,Time} QDataStream test to include all versions
In tst_QDate the test previously had a hard-coded list of versions by
name. This, however, needed updates on each new release (or at least
new version of QDS), which have been neglected since Qt 5.0. The
tst_QDateTime version, meanwhile, only identified versions by their
numeric value, not their symbolic names.

So borrow the way tst_QCalendar enumerates QCalendar::System, making
QDataStream a Q_GADGET and its Version a Q_ENUM to support this, to
iterate over all versions algorithmically. Apply to both data stream
tests to get a more consistent form for their data tags.

Change-Id: I04d1060cfec822cfcdc0bce6d15b636fc165fe36
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2025-06-10 20:11:54 +02:00
Edward Welbourne
3905d3c4df Use QMetaEnum::fromType() instead of staticMetaObject.enumerator()
The old way relied on the order of enums within the type; using
fromType() makes the enum specific.

Change-Id: I418473a6983861ca105ccc5eb249f441dbbb28cf
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2025-06-10 20:11:54 +02:00
Tor Arne Vestbø
f67ef4934b Add QOperatingSystemVersion/QSysInfo support for macOS 26 (Tahoe)
Pick-to: 6.10 6.9 6.8 6.5
Change-Id: If6e7ee92e7c491c91a17e2730112319a132ca623
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2025-06-10 11:11:54 -07:00
Frédéric Lefebvre
372a8f904a Unblacklist tst_qListView::styleOptionViewItem on Ubuntu Wayland
tst_qListView::styleOptionViewItem is no longer flaky on Ubuntu
Wayland.

Fixes: QTBUG-127920
Pick-to: 6.10
Change-Id: Ia79292c283bc21bb84b3cc30a7d6c1863c8d0836
Reviewed-by: Liang Qi <liang.qi@qt.io>
2025-06-10 18:41:35 +02:00
Liang Qi
22e193e293 Unblacklist tst_qGraphicsItem::itemUsesExtendedStyleOption on Wayland
tst_qGraphicsItem::itemUsesExtendedStyleOption is no longer flaky on
Ubuntu Wayland.

Fixes: QTBUG-115293
Pick-to: 6.10
Change-Id: Ic971a13c37398bd2eaa9ccb16c10bcf62fdb8d69
Reviewed-by: Liang Qi <liang.qi@qt.io>
2025-06-10 18:41:35 +02:00
Frédéric Lefebvre
ccd7eda005 Unblacklist tst_qGraphicsItem::cursor on Ubuntu Wayland
tst_qGraphicsItem::cursor is no longer flaky on Ubuntu Wayland.

Fixes: QTBUG-127920
Pick-to: 6.10
Change-Id: Ie9096f8790bd031b642c5f5c259445859848c2f5
Reviewed-by: Liang Qi <liang.qi@qt.io>
2025-06-10 18:41:35 +02:00
Frédéric Lefebvre
e3225008cb Unblacklist tst_qPrinter::testPrintPreviewDialog on Ubuntu Wayland
tst_qPrinter::testPrintPreviewDialog is no longer flaky on Ubuntu
Wayland.

Fixes: QTBUG-127920
Pick-to: 6.10
Change-Id: Iea857db7be3ef6656667b32011009d561b92a749
Reviewed-by: Liang Qi <liang.qi@qt.io>
2025-06-10 18:41:35 +02:00