18581 Commits

Author SHA1 Message Date
Marc Mutz
532400a722 tst_QPointer: make capture compatible between C++17..23
Clang 19 -std=c++23 complained that ITERATIONS_PER_THREAD was
captured, but not used, so 668d81f73a5c2f4ec14764d1892f2eaf6494c0f1
dropped it, after making the variable constexpr.

Picking that change back to older branches, we found that MSVC
(14.29?) complains that it's _not_ captured anymore:

   tst_qpointer.cpp(491): error C3493: 'ITERATIONS_PER_THREAD' cannot be implicitly captured because no default capture mode has been specified

To appease both compilers, and cover the maximum range of C++ standard
editions, use implicit [&] capture, which should work everywhere.

Not picking to 6.5, because the cherry-pick of
668d81f73a5c2f4ec14764d1892f2eaf6494c0f1 already had to make that
change in order to pass CI.

Pick-to: 6.10 6.9 6.8
Change-Id: Iacbd53d3904608e8c9cd73edf31ba7924fd508e6
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
2025-06-15 16:37:14 +00:00
Frédéric Lefebvre
00750cd8ba Refactor tst_QScroller::overshoot
tst_QScroller::overshoot was initially a boilerplate, making it
difficult to understand what was actually being tested.

Refactor this test to be data-driven. Additionally, create a new test
function, overshoot_segments, which was part of
tst_QScroller::overshoot and should be tested independently.

Transfer the blacklisted platform of overshoot to overshoot_segments.

Change-Id: I59d89dfab4bb09c41fce99ad4f40163736c6ef78
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2025-06-15 17:44:06 +02:00
Matthias Rauter
bb48dbb113 Add conversion from QUtf8StringView to std::u8string_view
Writing the tests for QUtf8StringView showed that this conversation does
not work if the underlying storage_type is not char8_t. This is
something a user rightfully expects from our library and we therefore
added an explicit conversion operator for it.

[ChangeLog][QtCore][QUtf8StringView] Added std::u8string_view operator
if compiled with C++20.

Pick-to: 6.10
Change-Id: Ia80507bdd76686bee16a40745be064e9bdfef130
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2025-06-15 09:35:08 +00:00
Fabian Kosmale
f2ef861688 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.10 6.9 6.8
Fixes: QTBUG-136097
Change-Id: I7284e97dea12d1637b38349d32e090c0102124e7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2025-06-14 12:48:30 +02:00
Thiago Macieira
54069d37ef 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.10 6.9 6.8 6.5
Change-Id: Ie661f7361a8d86648b21fffdaf9e7d076f86ebe9
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2025-06-13 21:24:29 -07:00
Axel Spoerl
444e5b63c3 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.10 6.9
Change-Id: I2e53ab8de08575f13c950dd92d24ad3017a7dc0a
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2025-06-13 12:25:08 +00:00
Volker Hilsheimer
5dc261357e 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.10 6.9 6.8 6.5
Fixes: QTBUG-137157
Change-Id: Ifa485734b290284bd5a1286e3b3c18454442fa10
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2025-06-13 14:25:08 +02:00
Marc Mutz
b9a43e7767 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.10 6.9 6.8 6.5
Change-Id: Ia0e35e87934abebc76b719e3bd8124ac77ea07f5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2025-06-13 14:25:04 +02:00
Thiago Macieira
e1d418bcd0 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.10 6.9 6.8
Change-Id: I8d93f6db83a28d70a192fffd6668734a8024b88b
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
2025-06-12 23:14:37 -03:00
Marc Mutz
668d81f73a 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.10 6.9 6.8 6.5
Change-Id: I27d94763058e1dcea3a65d4ff2c859b40336446f
Reviewed-by: David Faure <david.faure@kdab.com>
2025-06-12 18:22:38 +00:00
Marc Mutz
901a6e7986 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.10 6.9 6.8
Change-Id: I59c7a322ecbcc564baa1263e02b234bc53563fac
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2025-06-12 20:22:38 +02:00
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
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
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
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
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
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
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
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
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
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
Frédéric Lefebvre
cb97b31906 Unblacklist tst_qBackingStore::flush on Ubuntu Wayland
tst_qBackingStore::flush is no longer flaky on Ubuntu Wayland

Fixes: QTBUG-127920
Pick-to: 6.10
Change-Id: I16d91ceb8854f4aee8c569c792e8cb7977cb95ca
Reviewed-by: Liang Qi <liang.qi@qt.io>
2025-06-10 18:41:34 +02:00
Mårten Nordheim
8d5db24c14 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.10 6.9
Change-Id: I345448efd7da92f4f74033b03a5c040b5db9d271
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2025-06-10 17:09:25 +02:00
Mårten Nordheim
904aec2f37 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.10 6.9
Change-Id: I5f2b2d5660866f1ad12aaafbb4e572b08ed5a6e4
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2025-06-10 17:09:25 +02:00
Fabian Kosmale
f1c0bd2e06 QStringConverter: Introduce finalize()
When doing a streaming conversion, it is not enough to check whether
there are errors. Once all input has been consumed, one must also check
whether there has been any data that was consumed, but not converted
yet. Provide finalize() to do the check, set an error if there was
incomplete data, and to optionally write replacement characters for it
to an output buffer.

[ChangeLog][QtCore][QStringDecoder] Added finalize(), a function to
force the converter to consider the sequence of inputs as complete,
flushing potential partial character sequences.

[ChangeLog][QtCore][QStringEncoder] Added finalize(), a function to
force the converter to consider the sequence of inputs as complete,
flushing potential partial character sequences or restoring state for
stateful text encodings.

Change-Id: I5fe26ae8e5d1477a86b365cc49c430b057876893
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2025-06-10 15:28:31 +02:00
Marc Mutz
a97ac8507e 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.10 6.9 6.8 6.5
Task-number: QTBUG-135572
Change-Id: I91d769d494489fe63dbbb67f849b78fc7aa39ec6
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
2025-06-06 22:16:36 +02:00
Mårten Nordheim
1a870f4bf2 tst_QHttp2Connection: fix typo of tested variable
Accidentally used clientStream instead of clientStream2.
Test still passes though.

Pick-to: 6.10 6.9
Change-Id: I118f1e429faa0367f0b4d02c74a221027ecb2b4d
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2025-06-06 19:06:04 +02:00
Eskil Abrahamsen Blomfeldt
fb89d498a9 Add support for font features and variable axes to QTextCharFormat
These can be set on the font directly, but had not been added to
QTextCharFormat, so there would be no way to override them by
formatting in a rich text document.

Fixes: QTBUG-134060
Change-Id: I4494e24cb9b99d84fb376ba895e2461fc3cd054b
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2025-06-06 16:27:54 +02:00
David Edmundson
1ede87a735 wayland: Add unit test for sibling client grabbing popups being created
Task-number: QTBUG-119110
Change-Id: Ie31da8073d0107f6515ce2e0152cb2bbc97c8582
Reviewed-by: David Redondo <qt@david-redondo.de>
2025-06-06 15:13:15 +03:00
Thiago Macieira
4e57583f33 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.

Pick-to: 6.10
Change-Id: Id27938950c196d6d3397fffd2fbf1a66fe7504f9
Reviewed-by: Liang Qi <liang.qi@qt.io>
Reviewed-by: David Redondo <qt@david-redondo.de>
2025-06-05 17:15:28 -03:00
Marc Mutz
687fb92440 tst_QMetaObject: refactor indexOfMethod() test
Removes duplication in preparation of adding more tests.

Pick-to: 6.10 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>
2025-06-05 21:26:02 +02:00
Ivan Solovev
5b03d9f68b 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
Pick-to: 6.10
Change-Id: Id3ed48738cc462b5b0820fa3b25d80d4d4414548
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2025-06-05 16:42:43 +02:00
Jani Heikkinen
7f1e6f8079 Bump version to 6.11.0
Change-Id: I14ec3a08bf704535b9b10e33ec8ee0f9415f2d7c
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-06-05 00:07:53 +01:00
Marc Mutz
5c563a98a5 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.10 6.9 6.8 6.5
Task-number: QTBUG-135572
Change-Id: Id28bf3c4163099f07213bfbf7d296b4fd76b71a5
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
2025-06-04 23:22:45 +02:00
David Edmundson
a639807a8f 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
Pick-to: 6.10
Change-Id: I9a46b5be607c84436864afcf7eb063275e065738
Reviewed-by: Liang Qi <liang.qi@qt.io>
2025-06-04 00:23:23 +03:00
Lars Schmertmann
36b5854af5 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.10 6.9 6.8
Change-Id: I30d561cc0b74645c939e7d3dd595926b6013caf9
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2025-06-03 19:55:47 +02:00
Marc Mutz
c485c07c6d 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.10 6.9 6.8 6.5 5.15
Change-Id: Ic21d15da25944d4897357dd27e2986d448b5ee60
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2025-06-03 17:13:55 +00:00
Thiago Macieira
7bd7df5aa1 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.10 6.9
Change-Id: Iddf6f46edf6f3b6c3222fffd1e1e5479f0be92a9
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
2025-06-03 11:54:37 +00:00
David Edmundson
602fa3f337 wayland: Ack configure events when suspended
All configure events should be acked, and that acknowledgement is double
buffered with the surface commit.

If a window is not exposed, for example being in a suspended state, us
sending an expose event is semantically wrong. It also ends up not
resulting in a commit as at some point it no-ops, we have to commit
manually.

Change-Id: I020b06f04030c1209f2fc768adc8bd66d57975b1
Reviewed-by: David Redondo <qt@david-redondo.de>
2025-06-02 20:18:03 +03:00
Eskil Abrahamsen Blomfeldt
ab7a80a955 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.5 6.8 6.9
Change-Id: I63779e44c10c7021486787d1e1e818f4c6e47835
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2025-06-02 11:34:02 +02:00
Ahmad Samir
1f2863ae48 qdataurl: fix parsing parameter values with percent-encoded comma
Change-Id: I2faa8ce7c9932eb82a853421290c39a37ad91bcf
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2025-06-01 19:39:59 +03:00
Frédéric Lefebvre
4db3961ee1 Fix flaky tst_QFocusEvent::checkReason_ActiveWindow on openSUSE
tst_QFocusEvent::CheckReason_ActiveWindow is flaky on openSUSE where
the childFocusWidgetOne is unable to receive focus after d has been
hidden.

This is due to some asynchronicity when setActive is being called
while d is already active.

Remove the call to activateWindow on d as it is already active by
calling show.

Pick-to: 6.9 6.8 6.5
Change-Id: Id01c6704122df42982d65d28ddb94d184d00d9aa
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2025-06-01 14:07:43 +02:00