71231 Commits

Author SHA1 Message Date
Joerg Bornemann
7138834c91 CMake: Fix permissions of qt-internal-(strip|ninja).bat.in on Unices
These files should not have executable permissions.

Fixes: QTBUG-125534
Change-Id: I893d4d373ee098864b64200dc6c88b57d05d6209
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit ba103a6fee8e66748e2f3c52ce9f9e19ff89a850)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-03-11 10:18:09 +00:00
Marc Mutz
93c37162af Simplify QLocale::formattedDataSize()
- Introduce symbolic constants for the magic numbers 3 (= log10(base))
  and 10 (= log2(base)).

- Add and use QtPrivate::log2i() instead of manual bit fiddling. This
  makes the two cases nicely symmetric now.

Amends 9d23aebb271ea534a66cb3aceb2e63d9a1c870d6.

Pick-to: 6.8 6.5
Coverity-Id: 474294
Change-Id: I657f34878bc3a9b67b03a4d014b91e6d4de31e13
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 9fee7cdfcce00ce6500b8eebf67f4a6c91be98bd)
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2025-03-11 10:18:09 +00:00
Cristian Le
477e9216f3 Make RunCMake compatible with CMake<3.18
Avoid using `cmake_language`.

Reverting commit:
67f97f5478

Pick-to: 6.8
Change-Id: I8311508c904cbc66aa663a0b62f861b7b056b526
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 3617409325fb3757d9126e72d4b852fa571f42f7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-03-11 10:18:08 +00:00
Marc Mutz
2886996de4 Don't leak memory when tst_QOpenGL::fboTextureOwnership() fails
Hold 'fbo' in a (const) unique_ptr instead of a raw pointer, so it is
deleted even if a following QVERIFY/QCOMPARE fails.

This shows that the leak (cf. QTBUG-134557) is not due to the test
itself.

Amends dcbb16a45212d263496df1e5875da6205e4f5f53.

Pick-to: 6.8 6.5 5.15
Task-number: QTBUG-134557
Change-Id: I2f854d5ff036b7ca5e51d2e9ecb1d04bf7a39a61
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
(cherry picked from commit b615c477f6472f0e3935aea05c099966c1d3ef47)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-03-11 10:18:08 +00:00
Marc Mutz
b2feff382d tst_QOpenGL: don't leak 1399341 byte(s) [...] in 1439 allocation(s)
That's what asan reported for a run of this test executable.

Create `ctx` on the stack instead of the heap to fix the leaks.
For `fbo`, use a std::optional.

After these fixes, the test still leaks 64 bytes in 2
allocations. These seem to be QOpenGLSharedResourceGuards in a
QOpenGLFramebufferObject. Created QTBUG-134557 to track the issue.

Amends
- 68974d8e647febb80a47d9cf6ce9452f3ce4fa21 (fboHandleNulledAfterContextDestroyed())
- bb760d9514ed617ee8e7344152b3fa697b2c4171 (bufferMapRange()/bufferCreate())
- 0541516907da117c391b6c8d9820209673fcd9cd (vaoCreate())

Pick-to: 6.8 6.5 5.15
Task-number: QTBUG-134557
Change-Id: Icc318cd76b9f3ddf71bc294cb96d88485c42d7bc
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
(cherry picked from commit 7a1cd692e0b36acfc005332b50d7ef3e11b94e71)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-03-11 10:18:08 +00:00
Tim Blechmann
b7ec18cfdb cmake: don't pass ftemplate-depth with clang-cl
clang-cl does not support -ftemplate-depth. so we should not pass it
when MSVC is defined.

Pick-to: 6.8
Change-Id: I7f411187c476fa275b677f96a19f782262dc4545
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 39015c049b3f39a27737236b6740f7f5038ab75b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-03-11 10:18:08 +00:00
Lauri Pohjanheimo
935d1d633c QRhi test renderToTextureArrayOfTexturedQuad unblacklisted
On CI an Android emulator with SwiftShader software graphics
implementation is used. SwiftShader implementation is unable
to emulate this OpenGL functionality.

Blacklisting removed. QSKIP the test if it is run in Android platform,
OpenGL and SwiftShader sw graphics implementation is found.

Task-number: QTQAINFRA-6330
Pick-to: 6.8
Change-Id: Ib0832f35b63540d57a273fc6dba1e310de917439
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2025-03-11 12:18:08 +02:00
Christian Ehrlicher
6f4ddfaef3 QFusionStyle: Disable SH_EtchDisabledText
SH_EtchDisabledText is not widely used in fusion style and where it is
used it
 - does not make any real difference for light mode
 - makes the text look like one missed the glasses

Therefore disable this hint for fusion.

Pick-to: 6.8
Fixes: QTBUG-134533
Change-Id: I42fc20349603cf610ee725802f1095008eafd183
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit c8338d8e77699d1b8d239a4cba30adf22f15acf2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-03-11 05:12:51 +00:00
Tim Blechmann
246c644622 unreachable: silence warning with clang-cl
clang-cl does not warn about return after unreachable, but would warn
about the unused variable after return.

Pick-to: 6.8
Change-Id: Ia0fcff4f536d51d56eb915a9130cc3f72437d8d1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 1bdf5059ceae7b202f015728bf8817b644e2e5fc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-03-10 11:13:59 +00:00
Marc Mutz
7ee176bcbe QUnicodeTools: reduce unneeded relocations
Turn the charAttributeFunction array of function pointers into a
switch. This has two benefits:

- The compiler now warns when we introduce a new QChar::Script value
  and statically forces us to think whether a new attribute handling
  function is needed.

- A table of function pointers requires relocations. A switch might
  not. GCC uses a jump table to implement this switch, jumping to
  distinct lea instructions fetching distinct function pointer values,
  and thereby removes relocations, while Clang actually forms a
  function pointer table and turns the switch into an indexing
  operation (with compiler-generated guards). I didn't check whether
  Clang's table actually requires relocations, relinfo.pl doesn't
  report any reductions, but it's become unreliable over the years,
  because it doesn't for GCC, either.

Difference:
  qunicodetools.cpp.o:
- 0000000000000000 l     O .data.rel.ro.local     0000000000000108 QUnicodeTools::Tailored::charAttributeFunction
  0000000000000000 l    d  .data.rel.ro.local     0000000000000000 .data.rel.ro.local

See
  https://stackoverflow.com/questions/19067010/finding-where-relocations-originate/19338343#19338343
for the script to generate this output.

See https://www.akkadia.org/drepper/dsohowto.pdf Section 1.6 for why
we care.

Instead of collapsing identical return statements from adjacent case
statements into one, keep the per-case return statements for now, to
aid review, and clean up in a follow-up commit.

Amends dd7d8304bbe599320b163b94e9a4ad9a6f35b740.

Pick-to: 6.8 6.5
Task-number: QTBUG-100536
Change-Id: Ic5b6bd29e3a3a88f0d194fa7d76272a4770b9840
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 74765ebe65b8b67b2d2bbe3f4fa3eb1879d030aa)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-03-10 11:13:59 +00:00
Marc Mutz
b173da88f4 QMovableArrayOps::Inserter: move the displace() call into the ctor
Coverity complained that ~Inserter() will access at least displaceFrom
and displaceTo uninitialized, which is correct, if none of the
insert() overloads have been called in-between. This is a brittle
construct, even though, currently, all users of the class comply.

To help Coverity (and other readers of the code) understand what's
going on, move the displace() call that creates the hole in the
container which the insert() overloads then fill from said overloads
into the ctor, original-RAII style (ctor acquires the hole, dtor closes
it, if needed). This means all fields are initialized in the ctor now.

This is safe, as displace() cannot fail by itself (just a memmove()),
but requires moving the (pos, n) (= hole) information into the ctor
instead. The displace() call in the insert() overloads now becomes a
read of its return argument, displaceFrom.

(Incidentally, that shows that we have maintained the same pointer
twice in the insert overloads, something we'll clean up in a
follow-up.)

In order to verify the insert() post-condition (ie. that we filled the
whole hole created by the ctor, or threw an exception trying),
continue to pass the count to insert().

As a drive-by, rename the insert()-overloads to insertRange() and
insertFill() to match the existing insertOne() function, and to better
express what their purpose is.

Pick-to: 6.8 6.5
Coverity-Id: 378364
Coverity-Id: 378461
Coverity-Id: 378343
Change-Id: I1a6bc1ea0e5506d473f6089818797b02d09ba13e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit aa8e8ffd321dc96650c11ebe3cd4017e7cc8edac)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-03-10 11:13:59 +00:00
Lauri Pohjanheimo
e37e3d9045 Unblacklist tst_QRhi::RenderToFloatTexture and skip on Android-Sim
On CI an Android emulator with SwiftShader software graphics
implementation is used. SwiftShader implementation is unable
to emulate this OpenGL functionality.

Blacklisting removed. QSKIP the test if it is run in Android platform,
OpenGL and SwiftShader sw graphics implementation is found.

Task-number: QTQAINFRA-6332
Pick-to: 6.8
Change-Id: I241a2c6772291795d26b9c2a563f4f9412605cf6
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2025-03-10 07:52:42 +00:00
Thiago Macieira
8e94b67ba1 CBOR/JSON: fix crash when comparing strings with different length
Amends 8e5ce9cd369230256045864d6fad38dbd8bee413, which introduced the
QtPrivate::equalStrings() call. At that time, equalStrings() had already
required equal lengths (see 1560e0161af70b5cf88a70e55c0b502612d433cd),
so no excuse.

[ChangeLog][QtCore][QCborMap and QJsonObject] Fixed bug that could
result in a crash or failing to find a entry in the map/object with non-
ASCII keys.

Manual conflict resolution for 6.9:
- Port from keyView() to key(), because the former is a 6.10+ feature.

Pick-to: 6.8
Fixes: QTBUG-133744
Change-Id: I6b0f8b0a2e47d3ef905afffda6c4c079814a0914
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 54daec43a041cb69cff31cbfd1dd0b7127e8ba87)
2025-03-10 08:52:41 +01:00
Giuseppe D'Angelo
8181c4868a Disable -Werror=tsan on GCC < 15
QGlobalStatic has a warning suppression for -Wtsan because of its
usage of std::atomic_thread_fence, which TSAN doesn't support.
That header is included in QtCore's PCH, and that triggers a GCC bug
that causes the warning to be emitted despite the suppression [1].

In a developer build, the warning turns fatal.

We could either disable PCHs in such a build configuration
(TSAN+developer-build+GCC < 15), or: simply make the warning non-fatal
on earlier compiler versions.

[1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64117

Pick-to: 6.8 6.5
Fixes: QTBUG-134415
Change-Id: If80a4acdb1372d00804a60361f6c3d6893b96106
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit a72077a88903fe532f6a749677eb4da4ea99f79f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-03-10 07:52:41 +00:00
Eskil Abrahamsen Blomfeldt
d7127c02ff windows: Fix rendering monochrome glyphs in color fonts
If we encounter a normal, monochrome glyph in a color font, we
go via the normal glyph rendering code path. But since we are
drawing into a color-capable glyph cache, we need to make sure
the image we draw has an alpha channel.

This was inadvertedly broken by the refactoring in
1b85143d217042876209794bf8d0361b7ce8834f, causing black
backgrounds on all such glyphs. Since the default font in Qt Creator
is a color font, it was noticed when upgrading this to 6.9.

Fixes: QTBUG-134473
Change-Id: Iee7eb73a5727324e2ff3bacc2d9ae45cb64fd0b9
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
(cherry picked from commit 54555755f8780e4e7c665a1502309da9fa807066)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 81bbbc3fc47e47b9cd77248bbaaf35477f562895)
2025-03-10 07:52:41 +00:00
Juha Vuolle
7ad9a2d391 qtwasmserver to serve assets from the provided path parameter
qtwasmserver accepts a positional path argument which tells where to
serve the assets from. The argument wasn't actually used, and this
resulted in always using the cwd.

In addition add a check for the path directory existence. Otherwise
this becomes only visible as a 404 Not Found error.

Amends: 156e5c8b690d01ad3043d2163168c4ea3608a046

Fixes: QTBUG-134393
Change-Id: Iacfafe8a2fb2409169b09a17dbc9ffed0ad16fdf
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
(cherry picked from commit fcada7c5c395a7006ecef184c3ca43fff1023616)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-03-10 07:52:41 +00:00
Tim Blechmann
aca60117ee QWindows11Style: fix clang-cl warnings
QRect QRect rect and tableView are not used and clang-cl warns about
that.

Pick-to: 6.8
Change-Id: I35ae933b437952c6748e4b09d139cc06c9ce33cb
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
(cherry picked from commit 1d83bffb291192f04db6f33313291147472f7014)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-03-10 04:53:49 +00:00
Thiago Macieira
87c790851e tst_Q*Application: avoid race conditions during exitFromThread
Amends commit bfbd1a281dd00c47df315c06e895bf5d53cd8764. I've noticed
this on my Mac, because the main thread crashed at the same time as the
exitFromThread() thread was exiting and was running ~QLibraryStore:

* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x106)
  * frame #0: 0x00007ff8020533be libobjc.A.dylib`getMethodNoSuper_nolock(objc_class*, objc_selector*) + 47
...
    frame #19: 0x0000000103839694 QtCore`QCoreApplication::exec() at qcoreapplication.cpp:1454:32
    frame #20: 0x0000000101fc94ea QtGui`QGuiApplication::exec() at qguiapplication.cpp:1993:12
    frame #21: 0x0000000100004b59 apphelper`exitFromThread(argc=1, argv=0x00007ff7bfeff318) at apphelper.cpp:50:5
  thread #8, name = 'QThread'
...
    frame #11: 0x00007ff8020c4f94 dyld`dyld4::APIs::dlclose(void*) + 178
    frame #12: 0x0000000103e82476 QtCore`QLibraryPrivate::unload_sys(this=0x0000600001254160) at qlibrary_unix.cpp:252:24
    frame #13: 0x0000000103e793fc QtCore`QLibraryPrivate::unload(this=0x0000600001254160, flag=UnloadSys) at qlibrary.cpp:561:36
    frame #14: 0x00000001039740c8 QtCore`QFactoryLoader::~QFactoryLoader(this=0x00000001029e5e70) at qfactoryloader.cpp:438:21
    frame #15: 0x00000001039745e9 QtCore`QFactoryLoader::~QFactoryLoader(this=0x00000001029e5e70) at qfactoryloader.cpp:425:1
    frame #16: 0x0000000101eb723c QtGui`void std::__1::__destroy_at[abi:sn180100]<QFactoryLoader, 0>(__loc=0x00000001029e5e70) at construct_at.h:67:11
    frame #17: 0x0000000101eb7209 QtGui`void std::__1::destroy_at[abi:sn180100]<QFactoryLoader, 0>(__loc=0x00000001029e5e70) at construct_at.h💯3
    frame #18: 0x0000000102046762 QtGui`QtGlobalStatic::Storage<QFactoryLoader, (anonymous namespace)::Q_QGS_piLoader>::destroyYourself(nextState=Destroyed) at qglobalstatic.h:61:9
    frame #19: 0x0000000102046736 QtGui`QtGlobalStatic::Holder<(anonymous namespace)::Q_QGS_piLoader, (anonymous namespace)::Q_QGS_piLoader>::~Holder(this=0x00000001029e5e61) at qglobalstatic.h:83:9
    frame #20: 0x00000001020465d9 QtGui`QtGlobalStatic::Holder<(anonymous namespace)::Q_QGS_piLoader, (anonymous namespace)::Q_QGS_piLoader>::~Holder(this=0x00000001029e5e61) at qglobalstatic.h:82:5
    frame #21: 0x00007ff8022f4231 libsystem_c.dylib`__cxa_finalize_ranges + 402
    frame #22: 0x00007ff8022f4052 libsystem_c.dylib`exit + 35
    frame #23: 0x000000010000755a apphelper`exitFromThread(int, char**)::$_1::operator()(this=0x000060000175612c) const at apphelper.cpp:47:9

Pick-to: 6.9.0 6.8
Change-Id: Ib1c72c7975b247cc2d17fffd6c5de89a95c22dad
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit e6a6757c1485d09a4b7a124d67260f06d8022fef)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-03-10 00:14:29 +00:00
Thiago Macieira
e7edc43913 tst_Q*Application: debug a crashing application
Implemented for lldb and gdb. MSVC comes with lldb.exe (it doesn't work,
but maybe some day). I couldn't find out even how to install cdb.exe, so
that's left as a task for someone else.

Pick-to: 6.8
Change-Id: I9d93747476531d4cfd53fffddecc5b3339d2fd7c
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit 0f9860618ff9d045c8371338274f633e38994e3e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-03-10 00:14:27 +00:00
Thiago Macieira
eaff6a7a03 tst_Q*Application: centralize even more the running of the helper app
Instead of having to make changes to both tst_qcoreapplication.cpp and
tst_qapplication.cpp.

Pick-to: 6.8
Change-Id: Ib451048e40b163c2c3a3fffdf7b39bcb28c9cccf
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit b03921eb9fad7a71dc13d92af2e0e994fcc1ca67)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-03-10 00:14:27 +00:00
Thiago Macieira
9e18d7ded5 tst_Q*Application: centralize the mainAppInAThread skipping
By adding a way for the apphelper to let the caller know that it must
skip this test.

Pick-to: 6.8
Change-Id: I750e7188b8f54cea7278fffd584f8fbf433f496b
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 00a30f4312876f6f2919b6a47ff404d503255e2f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-03-10 00:14:26 +00:00
Marc Mutz
f2cc2c9074 QTriangulator: Q_DISABLE_COPY_MOVE(QInt64Set)
The class is unsafe for copy, as it would double-delete m_array,
and the move operations aren't implemented, either.

Found while fixing CID 11295.

Pick-to: 6.8 6.5 5.15
Coverity-Id: 11295
Change-Id: I8a615aaea3a8a4ad6abc8a5a9990c2dba5cfa65d
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit d429fceeebff24c112df3cf202e48bc338551554)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-03-09 13:16:28 +00:00
Marc Mutz
7f01e20c37 QHttpHeaderParser: remove unneeded relocations
Instead of a static constexpr QL1SV object (which force the compiler
to allocate storage and therefore causes relocations), use a mere
automatic constexpr object (which doesn't). There never was a need to
make this object static, as constexpr is enough to force the compiler
to constant-fold them. The lambda doesn't have access without a
capture, of course, but that is easily solved my moving the object
definition into the lambda itself.

See
  https://stackoverflow.com/questions/19067010/finding-where-relocations-originate/19338343#19338343
for the script to detect these issues.

See https://www.akkadia.org/drepper/dsohowto.pdf Section 1.6 for why
we care.

Amends 18aff2b424577b4560b32698038e9bcf68a54b88.

While at it, remove the static from the lambda, too. While it doesn't
cause relocations, it might, on weaker compilers, cause a thread-safe
static prologue to be emitted, and it's not needed, either.

Pick-to: 6.8 6.5
Task-number: QTBUG-100536
Change-Id: Iaede4d02a84ea2e49b42f3da93a77cb8391df5bb
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit f8647f8951207b66e3a2d7130fd5f75c3b14b5e6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-03-08 02:55:16 +00:00
Edward Welbourne
a872a3a73c Narrow some #if-ery on QT_BUILD_INTERNAL to test more normally
Only a small early part of tst_QTimeZone::utcTest() actually needed
access to internal APIs, so only apply the #if-ery to that part.

Pick-to: 6.8 6.5 5.15
Change-Id: Ifebd70005f87bbef5d03fa24fe33134fd802e2e5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 92ec27e461ef3d3567cad11c5ca83368b985669d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-03-07 13:47:37 +00:00
Edward Welbourne
103a636e00 Turn a comment in a test into an actual check
Saying the code should produce no warnings is all well and good, but
testing it produces no warnings is obviously better.

Pick-to: 6.8 6.5
Change-Id: Iafa82027fde9ef6c7157b42ff3bbcccb3d097230
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
(cherry picked from commit 0b67d446566005e6409f816a6f223f26ef1994ca)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-03-07 13:47:31 +00:00
Edward Welbourne
26cda01b29 Distinguish system locale from corresponding CLDR-derived one
Previously it was displayed as if it had been constructed from its
language, script and territory; but it is distinct from the locale
constructed in this way and may produce different results.

Report the system locale as QLocale::system() with its language,
script and country within /*...*/ following it, instead of as
QLocale(...) with these as its parameters. Add a test of the debug
output, verifying that it has the form intended.

[ChangeLog][Important Behavior Changes][QLocale] Message logging now
distinguishes the system locale from the corresponding locale -
generated from its language, script and territory - based on CLDR
data.

Fixes: QTBUG-133922
Change-Id: Ic6fb137821fb7bf29d0f6446a46225cadd54b82a
Reviewed-by: Mate Barany <mate.barany@qt.io>
(cherry picked from commit e323d46cdaecffebb3f9fa55934e4eb4868611cf)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-03-07 13:47:30 +00:00
Marc Mutz
887c7a4b89 Revert "QString::replace: fix a performance regression"
This reverts commit 315210de916d060c044c01e53ff249d676122b1b.

The change was not correct. If the newly-inserted reserve() call
actually grows the string, and `after` aliased a part of the old
string, it will now reference deleted data, as the q_points_into_range
check now comes too late.

Change-Id: I2e016b8b90f74126dfc7126800b7b7fde96a091e
Pick-to: 6.8 6.7
Task-number: QTBUG-127549
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
(cherry picked from commit d1539331dd813c83916a323f6cdc7fd6aacb0043)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-03-07 13:12:06 +00:00
Topi Reinio
f08721bb39 Doc: Fix incorrect \fn signatures
Several \fn signatures were either incorrect or missing qualifiers
required to make QDoc match the documentation with the declarations.

These were not caught in the CI when testing documentation builds due
to a bug in QDoc.

Task-number: QTBUG-134250
Change-Id: I7a4af11d9bc3687597b348cc2d4ee15212e0281f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit b6a01d7d22583263a16242af604e74bbe694d766)
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2025-03-07 08:19:24 +00:00
Axel Spoerl
9c58b6ce1d Re-implement QPlatformTheme::requestColorScheme() in QGtk3Theme
QGtk3Theme remained unresponsive to programmatic color scheme changes,
after QPlatformTheme::requestColorScheme() had been introduced.

Add functionality to QGtk3Theme.
Fall back to qt_fusion_palette, when the requested color scheme isn't
supported by the current GTK3 theme (e.g. Adwaita-dark doesn't support
light mode).

Functionality has to be manually tested with the widget gallery
example.

Fixes: QTBUG-134022
Task-number: QTBUG-132929
Pick-to: 6.8
Change-Id: I1160c7afc1f1fcb6ec93d65ef54cb45a65a63863
Reviewed-by: Santhosh Kumar <santhosh.kumar.selvaraj@qt.io>
(cherry picked from commit 738c180c4f03bf82efce04dc4c751cd6eb0043c7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-03-07 03:13:29 +00:00
Marc Mutz
d4e0f8ee11 QUrl: add a missing std::move()
The deslashified QString can be moved into place here.

Found by Coverity.

Amends 5e936b60fc921e21b8153a83113886a1de333b57.

Pick-to: 6.8
Coverity-Id: 477475
Change-Id: Ibdaae0a9acae56960e16d5a6fd77fc1e08036af0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Øystein Heskestad <oystein.heskestad@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
(cherry picked from commit 692f1a38a405b8bbef961b64d2577b4fbb2a03f9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-03-06 22:02:08 +00:00
Marc Mutz
8e564bd00f qurlrecode.cpp: fix Coverity ARRAY_VS_SINGLETON issue
Coverity has this checker where it complains if you use a T as a
T[1]. The C++ standard says that this is fine¹, but qurlrecode.cpp,
specifically, is security-critical, so we shouldn't leave Coverity
issues unfixed in there.

So replace ucs4 with a buffer[1] array and make both dst and ucs4
point to buffer's first (and only) element.

Amends 2b82923c8fba5dcff707e344acdf9db8c444a55e.

¹ https://eel.is/c++draft/basic.compound#3.sentence-11

Pick-to: 6.8 6.5
Coverity-Id: 378435
Change-Id: I8ab2f70b542088e90dc43e616a0202e8c756f204
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 7a32a2238f52217bc4f0dc4c9620a2a2d350a1ca)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-03-06 21:57:50 +00:00
Marc Mutz
e744561c35 QFontEngine: reduce unnecessary relocations
Instead of static constexpr QL1SV objects (which force the compiler to
allocate storage for them and therefore cause relocations), use mere
automatic constexpr objects (which don't). There never was a need to
make these objects static, as constexpr is enough to force the
compiler to constant-fold them.

Difference:
  qfontengine.cpp.o:
- 0000000000000040 l     O .data.rel.ro.local     0000000000000010 QFontEngine::findGlyph(QLatin1String) const::gid
- 0000000000000000 l     O .data.rel.ro.local     0000000000000010 QFontEngine::findGlyph(QLatin1String) const::uni
  0000000000000000 l    d  .data.rel.ro.local     0000000000000000 .data.rel.ro.local

See
  https://stackoverflow.com/questions/19067010/finding-where-relocations-originate/19338343#19338343
for the script to generate this output.

See https://www.akkadia.org/drepper/dsohowto.pdf Section 1.6 for why
we care.

Amends 176816f21324bf736389037c62538a25f2522808.

Task-number: QTBUG-100536
Change-Id: I3cdf42c9758ec32654b378a2b27b565a6c92c26b
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru>
(cherry picked from commit 511ee39570a104d07eb4c9fb0d8a8fb775e9b38a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-03-06 21:57:45 +00:00
Marc Mutz
3c1b01ec3e ucstricmp8: fix Coverity ARRAY_VS_SINGLETON issue
Coverity has this checker where it complains if you use a T as a
T[1]. The C++ standard says this is fine¹, but qstring.cpp,
specifically, is security-critical, so we shouldn't leave Coverity
issues unfixed in there.

So replace uc1 with a decoded[1] array and make both output and uc1
point to decoded's first (and only) element.

Amends 45838673df6e64a6fd42570c4e8874c5181f7717.

¹ https://eel.is/c++draft/basic.compound#3.sentence-11

Pick-to: 6.8 6.5
Coverity-Id: 378348
Change-Id: Ib149386defd8b263df522a4f12b1af1b3fc1a20c
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 4eb9e0d3eedfc1b6de968308167af01b19f6ffe7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-03-06 21:57:44 +00:00
Marc Mutz
ece3fefdd0 QGenericUnixTheme: reduce unnecessary relocations
Instead of static constexpr QL1SV objects (which force the compiler to
allocate storage for them and therefore cause relocations), use inline
functions or mere automatic objects (which don't).

We'd normally call the inline functions fooKey() { return "foo"_L1; },
but since one of them "foo"s ends with "Key" already, put them into a
namespace instead, the name of which is taken from the comment that
used to introduce the static constexpr objects in the old code.

For the QL1SVs in the ctor: port them to QStringLiterals, because
their only use is to pass them to a function taking const QString&, so
this saves allocations. There never was a need to make these objects
static, as constexpr would be enough to force the compiler to
constant-fold them.

Unlike my earlier advice about how to create an empty QString most
efficiently, don't keep using ""_L1, use u""_s. This is because
there's no shared empty QString in Qt 6 anymore. It might still make
sense to add a more light-weight way to create an empty QString,
esp. one which is not referencing local data, but QString::_empty, to
extend the lifetime of the payload until QtCore unload time, but that
is outside the scope of the current patch.

Difference:
  qgenericunixthemes.cpp.o:
- 0000000000000000 l     O .data.rel.ro.local     0000000000000010 QGenericUnixThemeDBusListener::QGenericUnixThemeDBusListener()::signal
- 0000000000000040 l     O .data.rel.ro.local     0000000000000010 QGenericUnixThemeDBusListener::QGenericUnixThemeDBusListener()::interface
- 0000000000000080 l     O .data.rel.ro.local     0000000000000010 QGenericUnixThemeDBusListener::QGenericUnixThemeDBusListener()::path
  00000000000000c0 l     O .data.rel.ro.local     0000000000000010 QGenericUnixThemeDBusListener::QGenericUnixThemeDBusListener()::service
  0000000000000000 l    d  .data.rel.ro.local._ZTV24QGenericUnixThemePrivate      0000000000000000 .data.rel.ro.local._ZTV24QGenericUnixThemePrivate
  0000000000000000 l    d  .data.rel.ro.local._ZTV16QKdeThemePrivate      0000000000000000 .data.rel.ro.local._ZTV16QKdeThemePrivate
  0000000000000000 l    d  .data.rel.ro.local._ZTV18QGnomeThemePrivate    0000000000000000 .data.rel.ro.local._ZTV18QGnomeThemePrivate
  0000000000000000 l    d  .data.rel.ro.local._ZN13QMetaSequence12MetaSequenceI5QListIN2Qt3KeyEEE5valueE  0000000000000000 .data.rel.ro.local._ZN13QMetaSequence12MetaSequenceI5QListIN2Qt3KeyEEE5valueE
  0000000000000000 l    d  .data.rel.ro.local     0000000000000000 .data.rel.ro.local
- 0000000000000000 l    d  .data.rel.ro.local._ZN29QGenericUnixThemeDBusListener6s_rootE  0000000000000000 .data.rel.ro.local._ZN29QGenericUnixThemeDBusListener6s_rootE
- 0000000000000000 l    d  .data.rel.ro.local._ZN29QGenericUnixThemeDBusListener9s_signalsE       0000000000000000 .data.rel.ro.local._ZN29QGenericUnixThemeDBusListener9s_signalsE
- 0000000000000000 l    d  .data.rel.ro.local._ZN29QGenericUnixThemeDBusListener9s_settingE       0000000000000000 .data.rel.ro.local._ZN29QGenericUnixThemeDBusListener9s_settingE
- 0000000000000000 l    d  .data.rel.ro.local._ZN29QGenericUnixThemeDBusListener10s_providerE     0000000000000000 .data.rel.ro.local._ZN29QGenericUnixThemeDBusListener10s_providerE
- 0000000000000000 l    d  .data.rel.ro.local._ZN29QGenericUnixThemeDBusListener9s_dbusKeyE       0000000000000000 .data.rel.ro.local._ZN29QGenericUnixThemeDBusListener9s_dbusKeyE
- 0000000000000000 l    d  .data.rel.ro.local._ZN29QGenericUnixThemeDBusListener14s_dbusLocationE 0000000000000000 .data.rel.ro.local._ZN29QGenericUnixThemeDBusListener14s_dbusLocationE
  0000000000000000 l    d  .data.rel.ro.local._ZN9QtPrivate25QMetaTypeInterfaceWrapperIvE8metaTypeE       0000000000000000 .data.rel.ro.local._ZN9QtPrivate25QMetaTypeInterfaceWrapperIvE8metaTypeE
  0000000000000000 u     O .data.rel.ro.local._ZN13QMetaSequence12MetaSequenceI5QListIN2Qt3KeyEEE5valueE  00000000000000d8 QMetaSequence::MetaSequence<QList<Qt::Key> >::value
  0000000000000000  w    O .data.rel.ro.local._ZTV24QGenericUnixThemePrivate      0000000000000020 .hidden vtable for QGenericUnixThemePrivate
  0000000000000000  w    O .data.rel.ro.local._ZTV18QGnomeThemePrivate    0000000000000020 .hidden vtable for QGnomeThemePrivate
  0000000000000000  w    O .data.rel.ro.local._ZTV16QKdeThemePrivate      0000000000000020 .hidden vtable for QKdeThemePrivate
- 0000000000000000 u     O .data.rel.ro.local._ZN29QGenericUnixThemeDBusListener6s_rootE  0000000000000010 .hidden QGenericUnixThemeDBusListener::s_root
- 0000000000000000 u     O .data.rel.ro.local._ZN29QGenericUnixThemeDBusListener9s_signalsE       0000000000000010 .hidden QGenericUnixThemeDBusListener::s_signals
- 0000000000000000 u     O .data.rel.ro.local._ZN29QGenericUnixThemeDBusListener14s_dbusLocationE 0000000000000010 .hidden QGenericUnixThemeDBusListener::s_dbusLocation
- 0000000000000000 u     O .data.rel.ro.local._ZN29QGenericUnixThemeDBusListener9s_dbusKeyE       0000000000000010 .hidden QGenericUnixThemeDBusListener::s_dbusKey
- 0000000000000000 u     O .data.rel.ro.local._ZN29QGenericUnixThemeDBusListener10s_providerE     0000000000000010 .hidden QGenericUnixThemeDBusListener::s_provider
- 0000000000000000 u     O .data.rel.ro.local._ZN29QGenericUnixThemeDBusListener9s_settingE       0000000000000010 .hidden QGenericUnixThemeDBusListener::s_setting
- 0000000000000000 u     O .data.rel.ro.local._ZN9QtPrivate25QMetaTypeInterfaceWrapperIvE8metaTypeE       0000000000000070 .hidden QtPrivate::QMetaTypeInterfaceWrapper<void>::metaType
  RELOCATION RECORDS FOR [.data.rel.ro.local._ZTV24QGenericUnixThemePrivate]:
  RELOCATION RECORDS FOR [.data.rel.ro.local._ZTV16QKdeThemePrivate]:
  RELOCATION RECORDS FOR [.data.rel.ro.local._ZTV18QGnomeThemePrivate]:
  RELOCATION RECORDS FOR [.data.rel.ro.local._ZN13QMetaSequence12MetaSequenceI5QListIN2Qt3KeyEEE5valueE]:
- RELOCATION RECORDS FOR [.data.rel.ro.local._ZN29QGenericUnixThemeDBusListener6s_rootE]:
- RELOCATION RECORDS FOR [.data.rel.ro.local._ZN29QGenericUnixThemeDBusListener9s_signalsE]:
- RELOCATION RECORDS FOR [.data.rel.ro.local._ZN29QGenericUnixThemeDBusListener9s_settingE]:
- RELOCATION RECORDS FOR [.data.rel.ro.local._ZN29QGenericUnixThemeDBusListener10s_providerE]:
- RELOCATION RECORDS FOR [.data.rel.ro.local._ZN29QGenericUnixThemeDBusListener9s_dbusKeyE]:
- RELOCATION RECORDS FOR [.data.rel.ro.local._ZN29QGenericUnixThemeDBusListener14s_dbusLocationE]:
  RELOCATION RECORDS FOR [.data.rel.ro.local._ZN9QtPrivate25QMetaTypeInterfaceWrapperIvE8metaTypeE]:

See
  https://stackoverflow.com/questions/19067010/finding-where-relocations-originate/19338343#19338343
for the script to generate this output.

See https://www.akkadia.org/drepper/dsohowto.pdf Section 1.6 for why
we care.

Amends 0328e4297e339de8a2acd84979c667936f6fadf8.

Pick-to: 6.8 6.5
Task-number: QTBUG-100536
Change-Id: I1fd65e3ed5bceeb2a49141834dbd12f4bf42cc8c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 1370ecf293b258ba74a1187c5bbf8e1a192765e4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-03-06 21:57:38 +00:00
Marc Mutz
72fddb0935 QZip: fix Coverity warning about reading uninit'ed fields from z_stream
Coverity complains that inflateInit2() will read stream.opaque, which
wasn't initialized by us. At least in the copy of zlib that is
contained in Qt, this is false.

But xxflate() in qbytearray.cpp value-initializes its z_stream (and
therefore doesn't manually need to set .zalloc and .zfree), so do that
here, too.

Amends the start of the public history.

Pick-to: 6.8 6.5
Coverity-Id: 310213
Change-Id: I487072a0d2375a932f3ffb9a1f252fec9e2f2d0d
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit a817ba8e9c42dfffd31eb26ac522488c2a4ec61e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-03-06 21:57:36 +00:00
Christian Ehrlicher
660a63d739 QIcon::pixmap() make sure to always return a correctly sized pixmap
Some icon engines might not be able to return a properly sized pixmap.
Therefore we must make sure within QIcon::pixmap() to return a pixmap
with the requested size. This is done by simply adjusting the device
pixel ratio instead scaling to avoid the loosy scaling until the icon is
drawn later on.
The dpr adjustment was already done for dpr == 1.0 so the function
returned different results for different device pixel ratios ...

Pick-to: 6.8
Fixes: QTBUG-133412
Change-Id: I66f2ac76ebf240a625649171b4553a3b95d7c3a1
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit f142bd121c5be67a5701c849cea25e7abe4cd720)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-03-06 21:40:09 +00:00
Jøger Hansegård
69cdf3cbbb Add missing comparison operators for Microsoft::WRL::ComPtr on MINGW
MINGW's implementation of Microsoft::WRL::ComPtr lacks comparison
operators, and calling operator==() on them will implicitly convert them
to bool before comparing the resulting bool values. Two non-zero ComPtr
instances will therefore always compare equal, even if they point to
different interfaces.

This patch adds ComPtr comparison operators if they are missing, and
replaces existing includes to wrl.h or wrl/client.h with
QtCore/private/qcomptr_p.h

Pick-to: 6.8
Change-Id: I8123d9d874ae53ebfd6d381b69097e75527848b6
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 6d1384034deb681c1c4a656a1582f3e1606b1c1a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-03-06 21:23:04 +00:00
Cristian Le
d7e2d6b22c Use _qt_internal_dealias_target
Pick-to: 6.8
Change-Id: Iffc1148ed7655c724ea0609be01978ab7d5e7f8f
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 10affadd125b615b47979c4469be55bdbe5a189d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-03-06 21:09:24 +00:00
Cristian Le
7394e342f7 Add helper function _qt_internal_get_real_target
Also a shortcut `_qt_internal_dealias_target`

Pick-to: 6.8
Change-Id: Ic772896f7bf2f3fb05dd4799b1a8aabbc4379930
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 86c4a179e52b096fe3825e0fb8be3a362637230f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-03-06 21:09:18 +00:00
Alexandru Croitor
6e0139caf7 CMake: Add a special skip genex marker when walking libs
Useful to annotate certain linking expressions that need to be skipped
for inclusion in prl file generation. E.g. $<TARGET_OBJECTS>
expressions that represent propagated object libraries, which are
handled by the rcc_objects walk lib code path, and thus need to end up
in prl RCC_OBJECTS section, instead of the
QMAKE_PRL_LIBS_FOR_CMAKE one.

Pick-to: 6.8
Change-Id: Ib08b00200b6b06d32eab15ecb15c0820eec2a908
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit ce0004dff7b8a5f5030c2f060a659b9c5e6e62ea)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-03-06 20:29:05 +00:00
Juha Vuolle
0c7bea06c4 Allow unhandled custom uri-scheme opens to create QFileInfoEvent
On macOS custom uri-scheme opens may generate a QFileOpenEvent that
the applications can handle. However when adding support also for
QDesktopServices::setUrlHandler(), this delivery mechanism stopped
from working because the event was unconditionally consumed /
delivered to only the url handler.

Instead change the logic such that if the url handler does not
handle it, allow a QFileInfoEvent to be created.

Amends: 664c7ffb212eb898ed03f7b19c883400fa027b6b

Fixes: QTBUG-134316
Pick-to: 6.9.0 6.8 6.8.3
Change-Id: Ib1ed371ef531586bf549cf473b2a54748584d91d
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 4755f52c08aac424b18ad94404ca8f7dabf8220d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-03-06 20:29:03 +00:00
Matthias Rauter
15ea46495f Correct the diagrams in string overview
Amends 80b6f2e63dc537f419186585a528ff749f9ff739

Pick-to: 6.9.0 6.8
Task-number: QTBUG-133882
Change-Id: If53f8feb73255f8ba035290944b10af2cdf6baf9
Reviewed-by: Mate Barany <mate.barany@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit feefea87b7130bea23510819ea34b3c620686f53)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-03-06 19:02:37 +00:00
Assam Boudjelthia
a6e68f636e Android: account for edge-to-edge in tst_android
When running on Android 15 with target sdk set to 35 (Android 15),
the new edge-to-edge behavior is enforced, so the test needs to
account for that and take the full screen size instead of deducting
the insects.

Pick-to: 6.9.0 6.8
Task-number: QTBUG-132311
Change-Id: I178265b02878206ba95c8f83507963ce0bd0d732
Reviewed-by: Petri Virkkunen <petri.virkkunen@qt.io>
(cherry picked from commit 1f3c5f8f9025057f9a7f6b6143f33a529583ab19)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-03-06 18:43:54 +00:00
Rami Potinkara
07f088d340 Android: bump Android target API level to 35
This patch
-updated target API level to 35 into build tools
-updated target API level to 35 in build.gradle files

Task-number: QTBUG-129461
Task-number: QTBUG-130284
Pick-to: 6.9.0
Change-Id: Iebdc99e6f607352652c3f0022f17de60eae97d58
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 997a1fae98d35cd0d4d16f37ab68afe2729ff551)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-03-06 18:43:48 +00:00
Mitch Curtis
c785ab7a62 Improve QList::move docs
- State that both arguments must be within bounds.
- Add example.

Pick-to: 6.8 6.5
Change-Id: Ieba9c3469a2c8cf8c20d867abff5865d96c3ee6e
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
(cherry picked from commit 6b361119ef413a229b95145ed3d3f51a7388a020)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-03-06 17:50:51 +00:00
Giuseppe D'Angelo
f45d0214f9 CMake: map more -sanitize options in the doc
These were supported by Qt 5's configure.

Pick-to: 6.8
Change-Id: I3d902bb9e211f1dfecbf0835203e7b9e60fb41f6
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 077412a3cfd52b326cdba768156683cd94841330)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-03-06 02:45:47 +00:00
Lucie Gérard
20cca622cc Remove unnecessary comment
Pick-to: 6.8
Change-Id: I8407ddb117941bc9e28b18998ff1e824ded2b1d9
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 38e39902c6b2056d4600c2f8b425fde26cca179c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-03-06 02:45:40 +00:00
Ivan Solovev
7a7c7322fa QFuture: avoid warnings about unreachable code with /W4 in MSVC
... when instantiating the MetaTypeQFutureHelper for QFuture<void>.

Simply enabling /W4 for tst_qfuture also generates this warning, but
also much more. So I'm not providing any unit-test here.

Amends 90d9a86c2e762c9426d0facbd54ed5dbff574ecd.

Fixes: QTBUG-133406
Pick-to: 6.9.0 6.8 6.5
Change-Id: I22a53b872818763b80f333f597ddd19a1c1e30ac
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit ff6bf61b17ee4fc8ca11e016242d7c3399a02045)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-03-06 02:45:32 +00:00
Allan Sandfeld Jensen
01d1a2265c Add copyright holder to the SPDX line
Fixes: QTBUG-134392
Change-Id: I50f36af1c4ff91e3ab51db0abaf5b2b088fd8742
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 06b50e5d6c22bbf59fba61bb0e000fdd6a1bf347)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-03-06 02:45:25 +00:00
Fabian Kosmale
0f4cd43bc2 Warn about QML registration macro without include
In some setups, e.g. when using precompiled headers, the compiler will
see all definitions necessary to compile a class containing a QML
registration macro. However, moc won't be able to resolve the macro to
its expanded text, and thus miss the information.

This leads to a runtime failure when the QML engine cannot find the
type, because it has not been registered (as qmltyperegistrar relies on
the information collected by moc).

To avoid this, teach moc about the registration macros, and warn
when encountering them. We do this by comparing identifiers inside
classes against the names of the QML registration macros.
We do not error out, as a user might use the names of the macros as
normal identifiers, especially in a non-QML project (as unlikely as this
might be).

Warning out when finding a registration macro might sound
counter-intuitive, but works because moc should not actually see the
macros at this stage: When the header is included, macro expansion will
replace the macro with its expansion; only when the header is missing
will we ever see the macro as an identifier.

Task-number: QTBUG-134148
Pick-to: 6.8
Change-Id: I2f213444993a9d782a027c2dc25ffcbe0824ddca
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
(cherry picked from commit fd88f44c15e969da3228ab2b0a302e78e2ccc8de)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-03-06 02:45:16 +00:00