Commit Graph

68167 Commits (4b4c5b06a0bb08b77e391a6efa4e3671d4eefd90)

Author SHA1 Message Date
Wladimir Leuschner 4b4c5b06a0 QWindows11Style: Use QProgressStyleAnimation for QProgressBar
Currently for an indeterminate QProgressBar in QWindows11Style, a busy
drawing is triggered, consuming more CPU resources than necessary. This
patch avoids the busy drawing by using QProgressStyleAnimation, which
only triggers a redraw for specified Fps.

Fixes: QTBUG-127112
Pick-to: 6.7
Change-Id: I46da8ffcb849563c771dbc72af4c7e8b306b4802
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit 384acdc1cf2cc6472c9eb9d2d79077736ded0e92)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-19 10:11:40 +00:00
Christian Ehrlicher f18862e91d SQL/IBase: Don't let open() fail when lastError() is set
Since QSqlDriver::lastError() always contains the last error, it is not
a valid source to check if the last operation failed or not. Therefore
remove the check for lastError() when initializing the timezone mapping
- the function is optional since an old database might not contain the
timezone mapping table which is perfectly fine.

Fixes: QTBUG-127175
Task-number: QTBUG-125467
Change-Id: I22ea75c004654cead9a4461d2eaccfcbe8a116be
Reviewed-by: Andreas Bacher <andi.bacher@outlook.com>
Reviewed-by: Hamish Moffatt <hamish@risingsoftware.com>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 9844da5036d7a7a185ddd4eb3fa59bc4ede9e5d7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-19 06:33:42 +00:00
Christian Ehrlicher 0ff64a5b99 SQL/MySQL: honor schema when retrieving table record
Honor the schema when retrieving the table record - otherwise we might
end up getting the data for the wrong table (same tablename but wrong
schema).

Fixes: QTBUG-127129
Task-number: QTBUG-122723
Change-Id: Ia3e9293dbdc77da760dd4d0702104048187fad5f
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 920dfb2f443042777ea9547ff7a8beef56e90d92)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-19 06:33:35 +00:00
Alexandru Croitor 49193d4afd CMake: Don't add platform CPE to SBOM
It triggers vulnerabilities when loading the SBOM into tools that look
for CVEs matching those CPEs.

Task-number: QTBUG-122899
Change-Id: Ic4949ca5749ce4e297344760d3500d982c9a4449
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
(cherry picked from commit ad0ed9fe307ac01ceb3fadd32816ada961a5afa6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-19 06:32:59 +00:00
Allan Sandfeld Jensen 9dcedc184c Avoid assert on nonsense input
Fixes oss-fuzz 69439. Credit to OSS-Fuzz for finding the case.

Change-Id: I5211900073377c7bdccb904dbc6ff172419e76f1
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Reviewed-by: Robert Löhning <robert.loehning@qt.io>
(cherry picked from commit 913cc91c0abb8087a85984930049f208965b05c9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-19 06:32:48 +00:00
Volker Hilsheimer aabaf64c25 Doc: fix links to QMetaContainer members
QMetaContainer was not documented at all, so links from QMetaSequence
back to its parent class member functions failed.

Add generic class documentation for QMetaContainer. The QMetaAssociation
class is also undocumented, but since QMetaContainer's purpose is to
provide common APIs for both QMetaSequence and QMetaAssociation, mention
it anyway.

Fix warnings from incorrectly named parameters in the QMetaContainer API
documentation, which now gets generated.

Change-Id: I50a9f3ebf90b03f049804be2256ff135f57dab14
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 84be9b069c93afe62082ecd6aa5ec97ce44a8e0f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-19 06:32:08 +00:00
Thiago Macieira 091d732b15 QDnsLookup/Unix: fix buffer size on sending DNS queries
Commit f2f00b2a46 ("QDnsLookup: implement
DNS-over-TLS") added the use of QSpan, but confounded the size of the
buffer array with the size of the query we prepared. The queryLength
variable was never used after checking if the preparation had failed.

Task-number: QTBUG-127073
Change-Id: Iac1ff680887641888e00fffd17e0e49faab1d579
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 59133b16cd3adffc70833bb2b81332c9649fa51e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-19 04:21:50 +00:00
Marc Mutz c3477a7375 [docs] qvsnprint(): mention %a and %ls differences on WASM/Android
Pick-to: 6.7 6.5 6.2
Task-number: QTBUG-127110
Change-Id: I919170881846f3a08890ac0a8accfb859157d193
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 1aedd4d7c9968054a1c2880000a5007bb826a179)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-18 13:32:03 +00:00
Marc Mutz 6c21f8103b q(v)snprintf(): mark the functions as \obsolete
We can't deprecate them, yet, because there are way too many users in
Qt and 6.8 is too close by now, but we should give users a heads-up
that better alternatives exist these days.

Pick-to: 6.7 6.5 6.2 5.15
Task-number: QTBUG-127110
Change-Id: Ic14e9d12fc746fdc65d6c0006756c37339aa25f0
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 3f54c71b78e4ed4ab513190bbcda89ae27256377)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-18 13:31:49 +00:00
Allan Sandfeld Jensen 85b7aeaddc Fix source compatibility with existing toString() extensions
Change-Id: I946ebf0f0fa82450105e720489c4da35a77078d8
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 7dd2c5f91dd62840d37c5e17cc3f1f5ad46d9366)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-18 11:55:37 +00:00
Mate Barany 1f72315adc Pass QNetworkRequest::Priority by value
It is a small and trivially copyable type.

Found by an Axivion scan.

Task-number: QTBUG-125026
Pick-to: 6.7 6.5
Change-Id: I7990d07a7062472108ab3fff8a135f1917c4f7c7
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 8448292074e72095ed177d77910abe47a24f318c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-18 11:16:58 +00:00
Alexey Edelev 7b8cbbff76 Add the note about the runtime encoding in the QString-like classes and QT_NO_UTF8_SOURCE
Mention that QT_NO_UTF8_SOURCE has no effect on runtime encoding of
QString-like classes.

Amends 37e6159ab0c1456e8dc38f38f3b21643585c1273

Pick-to: 6.7 6.5
Task-number: QTBUG-126435
Change-Id: I3629b8af0e3eb7353c9268e23167dbef6802bb00
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
(cherry picked from commit bba0150200e16e6e0a8926dac1f32b00b8b1493b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-18 10:26:00 +00:00
Marc Mutz fc4a3a8cfc qxptype_traits.h: include q20type_traits.h
A qNNfoo.h should always include qMMfoo.h, MM=NN-3, if that exists, to
avoid a user having to include both qNNfoo.h and qMMfoo.h, which later
become two <foo> includes on automated replacement. For the purpoes of
this argument, NN=xp is considered equal to max({MM : ∃qMMfoo.h}) + 3.

Following this logic, qxptype_traits.h should include q20type_traits.h
(q23type_traits.h doesn't, yet, exist).

It didn't, so fix.

Amends def2a3de37.

Pick-to: 6.7 6.5
Change-Id: I8153d241783dc4e505fddf2407d27990e5c522f4
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 720ae32f79038a5db763a2371c0e8d25d32d93cf)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-18 08:42:51 +00:00
Marc Mutz 4c55f496d7 QThread::terminate(): don't depend on stack unwinding
Posix doesn't seem to specify whether the stack of cancelled threads
is unwound, and there's nothing preventing a QThread from
terminate()ing itself, so be extra careful to drop the mutex before
calling pthread_cancel.

We can't drop the mutex in general, as that would open a window for
the following race condition:

   T1                       T2
   t3->terminate()
     lock();
     read ID;
     terminated = true;
     unlock();
   ----------- t3 exits naturally -----------
                            t3->wait();
                            t4->start(); // gets ex-t3's ID
     pthread_cancel(ID) // oops, cancels new t4

But we can drop it when this == currentThread(), because said window
does not exist: While this_thread is executing terminate(), it cannot
at the same time exit naturally.

As drive-by, scope a variable tighter.

Pick-to: 6.7 6.5
Change-Id: I77a628e62d88e383d5aa91cfd97440186c997fc4
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 272c0215c2058bc267abf0a247da878f652eaffa)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-18 08:42:45 +00:00
Andras Mantia 7b9505eb86 Fix copy-paste error in the QMultiHash documentation
Pick-to: 6.7 6.5
Change-Id: I769a94710994a17160cca7f00243a634d8caf29c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 6f70ab027e785590f61357f907002aa3b4fd1aca)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-18 08:10:31 +00:00
Marc Mutz 93e39f7b79 QAnyStringView: check QASV(char) isn't UTF-8
... it is. Filed QTBUG-125730 to track this and discuss how to deal
with it.

Pick-to: 6.7 6.5 6.2
Task-number: QTBUG-125730
Change-Id: I2c680e1a9e8dda43700468a544ac645e1fa3aa53
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 3ff55648cee8365fb7825ca7a038596b63757ea3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-17 16:26:27 +00:00
Marc Mutz dabfdb5f2d QSingleShotTimer: de-inline [4/4]: clean up includes
Include what you need, don't rely on transitive
includes. Forward-declare what you need in-name-only.

Also port the one unchanged include in the header
(qabstracteventdispatcher.h) to idiomatic form. It's an unrelated
change, but it looked so lost among the QtCore/ headers, I felt pity.

Amends e0573e7364.

Change-Id: I4f25df7465f08378bc4e003bde12c28f4d231f14
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit 49d5b0a5a10634841122bbbc5e986ce307e7017a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-17 13:40:56 +00:00
Kai Köhne 661ab8398e Doc: Fix typo in snippet
Change-Id: I1a93a5f58bc5edc07c5449f20eb2444ebc252a61
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit 3e1f73aa30761533b5a897ee0ee6d7ce33f5b4bb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-17 13:40:55 +00:00
Alexey Edelev 861664b9d9 Add documentation for the QT_NO_UTF8_SOURCE property
Add the missing documentation for the QT_NO_UTF8_SOURCE. The property
can be set directly or using the qt6_allow_non_utf8_sources function.

Fixes: QTBUG-126435
Pick-to: 6.7 6.5
Change-Id: I2a255e6d4f761f14a2fa30ae51b4f671ed75586f
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
(cherry picked from commit 37e6159ab0c1456e8dc38f38f3b21643585c1273)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-17 13:40:55 +00:00
Edward Welbourne 6a0f00ac4e Update CLDR to v45, adding language Kuvi
This was in fact present in v44, but we overlooked it somehow. The new
version also fixes some inconsistencies in the data, that I reported
against v44.1; in particular, Tamil no longer claims to override the
root AM/PM markers (probably because it uses 24-hour time so doesn't
need them).

Add the test-file under util to the list of files containing generated
content.

Conflict at 6.8 resolved by regenerating the data; this only changed
the date of generation, not the data. Then hand-edited the date to
match the picked upstream commit, to avoid future conflicts.

[ChangeLog][Third-Party Code] Updated CLDR data, used by QLocale, to
v45.

Task-number: QTBUG-126060
Pick-to: 6.7 6.5 6.2
Change-Id: I81a5bcca49519b55091fc541de6b73b606661bb4
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit f79548e268a496698d77d0e78365334d0e507212)
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2024-07-17 12:57:30 +02:00
Edward Welbourne b68eaebc86 Update benchlib's 3rdparty cycle counter to FFTW v3.3.10
Document cycle_p.h's provenance - thanks to Morten Sørvig for digging
that up - and update to its version in the most recent release of
FFTW. Include patches to apply (after purging dangling hspace) for
future updates.

[ChangeLog][Third-Party Code] QtTest's benchlib now uses FFTW
v3.3.10's version of the clock-cycle counter, Cycle.

Task-number: QTBUG-126080
Change-Id: Ib59bc53e5d74cfdc889c03e78f9dd72100168f64
Reviewed-by: Jason McDonald <macadder1@gmail.com>
(cherry picked from commit 6e7c158152cef6a1ae6a628f08661fcc4b27de90)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-17 10:33:01 +00:00
Volker Hilsheimer 8e703f6e21 Touch event dispatching: change qCWarning to qCDebug if no target window
Warning messages are by default emitted for qt.* logging categories. But
neither the end user nor the application developer can do anything about
this particular warning (which gets emitted on macOS when using the
touch pad) - it's only useful for Qt developers.

So change the logging level to debug.

Pick-to: 6.7 6.5
Fixes: QTBUG-125589
Change-Id: I36e6e553494054488209139e3238b7bd11bd170a
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
(cherry picked from commit 2b021b2f927eaabbb3b7892b3dfe35d41368cf32)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-17 10:32:59 +00:00
Lena Biliaieva c373e728c8 QHttp2Connection: Add test for CONTINUATION frames
Task-number: QTBUG-122458
Change-Id: I6c87a7361852bb04173f0216e69cd7c5309a242b
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit 6aa1cb05e357cf4221aaedd4cf742c45983af446)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-17 10:32:58 +00:00
Marc Mutz 4e26c36171 QThread: fix race condition between parallel terminate() calls
QThread::terminate() is documented to be thread-safe, but had a race
condition: If multiple threads call terminate() on the same thread,
the following could happen:

  T1                     T2

  t0->terminate();
    lock();
    read ID;
    pthread_cancel(ID);
    unlock()
                         t0->terminate();
                           lock();
                           read ID;
    (OS thread finishes)
  t3->start();
    (creates a new OS
     thread with same ID)
                           pthread_cancel(ID); // cancels new t3!
                           unlock();

To fix, record that the thread was already terminated using a new
boolean flag.

An alternative would have been to fetchAndSet() the threadId to nullptr
and only let the thread that actually nulled it call pthread_cancel(),
but that would be harder to restore to the previous state in case
pthread_cancel() fails, and a null threadId might cause other problems
down the line, esp. if cancellation is currently disabled. The
explicit state is much simpler to reason about.

Fixes: QTBUG-127055
Pick-to: 6.7 6.5 6.2 5.15
Change-Id: Iec180bdfaaf913a3a1560210c781966dc99c0d42
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit d8bd4c2306f2acfefc75f8163b58f2037596dc65)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-17 09:30:17 +00:00
Volker Hilsheimer d2730bc303 Logging: use qCDebug/Warning/Info when for categorized logging
When building qt with QT_NO_DEBUG/WARNING/INFO_OUTPUT set, then the
qDebug/Warning/Info macros expand to `QMessageLogger::noDebug`. That
helper is not defined to take a logging category or category function,
so using `qDebug(lcX, ...)` breaks the build. The correct way to emit
categorized logging is to use the qCDebug/Warning/Info macros.

Task-number: QTBUG-125589
Pick-to: 6.7 6.5
Change-Id: I968b0e826871a09023c11fec9e51caa5a2c4dc0b
Reviewed-by: Jonas Karlsson <jonas.karlsson@qt.io>
(cherry picked from commit 1e1c68017338c89265d6664a27f4137fc8960473)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-17 01:49:15 +00:00
Axel Spoerl 678dccb7ac Revert "Update window state in QWindowsWindow and QXcbWindow geometry setters"
This reverts commit 99c8ffb9f2. It fixed
QTBUG-104201, which in essence pointed out a state mismatch between
widgets and platform windows on Linux (X11 and wayland). Mismatches
occurred in the margins between calls to QWidget and async screen
rendering: While the widget layer reported the expected size, the
platform layer did so only after the rendering thread had finished.

As mentioned in the comments of QTBUG-104201, the state mismatch is
predictable, temporary and consistent.

By bridging the time gab, an async operation was made to look
synchronous. That gave more comfort to application developers. By
oversight, it broke code that relied on the platform window state
reflecting physical rendering. This has caused QTBUG-126479 as a
regression.

Both purposes can't be served at the same time: The platform window
state either reflects rendering, or the expected state. It's therefore
justified to revert.

Reason for revert: <Causes QTBUG-126479>

Pick-to: 6.7 6.5
Fixes: QTBUG-126479
Task-number: QTBUG-104201
Change-Id: I22380a6a463822a1cb4be90a44d2775954c7ca82
Reviewed-by: Liang Qi <liang.qi@qt.io>
(cherry picked from commit 7d7be38d95eb82ef3e0be5250440072d8b5bc4b2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-17 01:49:09 +00:00
Rym Bouabid 35562e8e0a QExplicitlySharedDataPointerV2: Add unit-tests
The tests are needed for the next patch where we modernize comparisons
and wrap the pointer, which involves changing most of the functions.

Pick-to: 6.7 6.5 6.2
Change-Id: If635538bfca33e410e19472d32b9666d258f96a9
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit b44541d8a42b7fc0b24cde4086b0030623280cc0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-16 15:37:55 +00:00
Ivan Solovev 4cdb6991c5 Remove QBAV(QL1SV) and QBAV(QU8SV) constructors
They were added because of conditional noexcept on the relational
operators that was preventing the other constructors from being picked
up by the compiler.

Now when we removed the conditional noexcept on the relational
operators, we no longer need this constructors.

This patch reverts bd581e35e7485cf42fbefd250be7b146737d9d41 and
partially reverts fff6562f8c.

Change-Id: I22cb4507bff0a929a25d2f15caed66cc30d20dc9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 6cafe0f2b48c5f07f07de52490b1d07c7325557b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-16 11:32:19 +00:00
Ivan Solovev 65ef677131 Rework comparison helper macros to get rid of conditional noexcept
The conditional noexcept in comparison operators is known to cause
problems in various cases.
For example, we had a problem in QBAV, where gcc and clang tried to
expand conditional noexcept before the class was complete, and, as a
result, discarded some of the QBAV constructors (see
fff6562f8c for a more detailed
explanation).
Other problem is related to the GHS compiler which tries to compile
the noexcept specification and provides a hard error instead of
SFINAE'ing out in case of failure
(see e1f45ad818 or
0ac0b412c754e53d167716f207be9d76a7fe16be as examples).

This patch reworks the macros to get rid of the conditional noexcept.
Instead, it demands that all operators are noexcept by default, and
adds another set of helper macros that can be used if it's not
possible to make the relational operators noexcept.
The new macros end with the _NON_NOEXCEPT suffix.

The patch also adds static_assert() to the generated operators to
verify that the proper macros are used. However, some platforms
(e.g. QNX and Integrity) fail to handle conditional noexcept on
lambdas, and so we have to use yet another macro to generate the
checks only on platforms that handle them properly.

This patch also applies the new approach to qtbase, adding noexcept
where possible, and falling back to the _NON_NOEXCEPT macros
otherwise.

As a drive-by: fix the macro implementation to use
QtOrderingPrivate::reversed() instead of manually reimplementing it.

I decided to pick the patch to 6.8, because it allows to fix some
questionable APIs (see QBAV story above).

Change-Id: I72f56778acb469f18b578b3418c0c41b4f6d62e7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit d292648d0bbac50388dae035dc34782accb3807f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-16 11:32:19 +00:00
Lena Biliaieva c26e16e1d4 QHttp2Connection: Return connection error if CONTINUATION isn't expected
According to RFC 9113: A CONTINUATION frame MUST be preceded by
a HEADERS, PUSH_PROMISE or CONTINUATION frame without the END_HEADERS
flag set. A recipient that observes violation of this rule MUST respond
with a connection error of type PROTOCOL_ERROR.

Task-number: QTBUG-122458
Change-Id: I1a052b1f4fc80aa73fad4fc18e3c063fb738ae4e
Reviewed-by: Øystein Heskestad <oystein.heskestad@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit 10b7b7fcf06d4ed5492e946ac93eb232c168e686)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-16 11:32:18 +00:00
Nodir Temirkhodjaev e90a61ca49 qwindowsscreen.cpp: Fix memory leak of SetupDiGetClassDevs()
Use SetupDiDestroyDeviceInfoList() to delete the returned device information set.

Fixes: QTBUG-127168
Pick-to: 6.7 6.5
Change-Id: I810e0f284e0d53d9b84d8c64022e566d6b740ab4
Reviewed-by: Pavel Dubsky <pavel.dubsky@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 5183ca14344c04015b32ef407e4cdad1b370c841)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-16 11:32:18 +00:00
Oliver Wolff 2623d34003 Revert "Revert "Ensure that we make case-insensitive comparison of CMAKE_SYSTEM_PROCESSOR""
This reverts commit 361d0b7222fd35133186571762640aada67fa39b.

The qmake behavior is fixed by b66ecb295ecc3981b1c21f01d62c9066f5d6e6ca
so that the original fix can be reinstantiated.

Change-Id: I5338e4cbebc963f48469e7492f18375e56a46200
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 39c36d3230ea26ff327bb1d727c1fd049932fb93)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-16 11:32:18 +00:00
Allan Sandfeld Jensen 646fb238e7 Add virtual stub to QAbstractEventDispatcherV2
To be implemented in 6.9, but added here to avoid a
QAbstractEventDispatcherV3.

Change-Id: If8bd98f6299e39999d09b2c8857565d5fd890eec
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 404ad4e17d9d36566881e0f398e24ccbc2af4a72)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-16 11:32:18 +00:00
Joerg Bornemann c359af7bfb CMake: Fix exposing source files after target finalization
Calling _qt_internal_expose_source_file_to_ide after a target has
already been finalized did run the function's fallback code for targets
that are not finalized at all. That added the source files under a new
${target}_other_files target, which is a tad ugly in an IDE.

A situation where this occurs is for instance:
- qt_add_executable in a subdirectory
- adding additional files (licenses, documentation, .ts files) to the
  "main" target in the top-level CMakeLists.txt

The code flow is like this:
- enter subdirectory
  - qt6_add_executable(foo)
- leave subdirectory
  - qt6_finalize_target(foo)
    - calls _qt_internal_expose_deferred_files_to_ide(foo)
- _qt_internal_expose_source_file_to_ide(foo bar.txt)
  - sees that the target does not need finalization and runs the
    fallback code

Fix this by immediately running
_qt_internal_expose_deferred_files_to_ide if a target was already
finalized.

Task-number: QTBUG-127052
Change-Id: I1eda9acd48442ba35c6c61d9a185f6ed9ed6307f
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 469533fe8108cc56e90201919126502235c5cee6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-16 09:14:43 +00:00
Lucie Gérard 4091f4ede0 Add Files field
[ChangeLog][Third-Party Code] Specify the source file that the "Mipmap generator for D3D12" component consists of.

Pick-to: 6.7
Change-Id: Icb4581c95b925904b25343d8373c907f02cbf8a5
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
(cherry picked from commit 766d95edb3e8cdaff1a7712a20218804e688b06f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-15 19:29:32 +00:00
Alexandru Croitor 9f1ced55cd CMake: Add risky workaround for archiving dSYMs with an Xcode project
CMake by default generates an Xcode project with an overridden
CONFIGURATION_BUILD_DIR Xcode attribute pointing to an absolute path
build dir.

Due to a bug in Xcode, that causes dSYMs not to be included in an
xcarchive after invoking the Xcode archiving task.

This can be worked around by re-setting the CONFIGURATION_BUILD_DIR
attribute to have the value "$(inherited)". That ensures that Xcode
places the dSYMs into an expected location, that can then be included
in an xcarchive.

Unfortunately overriding CONFIGURATION_BUILD_DIR breaks certain CMake
build path preconditions, which can result in broken behavior like
$<TARGET_FILE:app> genex evaluation not working, as well as ignoring
of the CMAKE_RUNTIME_OUTPUT_DIRECTORY property.

So modifying the CONFIGURATION_BUILD_DIR can only be done as an
opt-in, where the project developer knows the risks and can decide if
it will affect the project.

The project can opt into the risky fix by setting the
QT_USE_RISKY_DSYM_ARCHIVING_WORKAROUND cmake variable to ON before
creating any targets using qt_add_executable.

If Xcode fixes this bug in the future, we can make the variable a
no-op when we detect a new enough Xcode version.

Pick-to: 6.7
Task-number: QTBUG-126866
Change-Id: I37e8dee569fc45654f149219b8933769ed237fda
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit ff1ba4f1c9da383b357745c2261de5b0050cdf3c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-15 18:54:17 +00:00
Alexandru Croitor 2347afc419 CMake: Add partial fixes for archiving dSYMs with an Xcode project
CMake by default uses the Release configuration for the Xcode archiving
task, providing no way to choose a different configuration. CMake also
sets the "generate debugging symbols" Xcode option aka the -g flag to
NO for the Release config, because it is not the RelWithDebInfo
config. This means that by default the archived project will never have
debugging symbols.

Change the GCC_GENERATE_DEBUGGING_SYMBOLS Xcode attribute to YES for
all the release configs (Release, MinSizeRel, RelWithDebInfo), as well
as the debug config. This matches the defaults of a project created
in Xcode directly and ensures debug symbols are generated for all
configs.

Another issue is that the Xcode project generated by CMake shows no
values for the debugging format option, which is controlled by the
DEBUG_INFORMATION_FORMAT attribute. In contrast a project created in
Xcode directly, sets the Debug config format to "dwarf" and the
Release config format to "dwarf-with-dsym".
This prevents inclusion of the dSYMs into the archive, because the
dSYM would not be created in the first place.

Override the DEBUG_INFORMATION_FORMAT per-config. The release configs
get the 'dwarf-with-dsym' variant, while the debug config will have
'dwarf'.
This matches the values of a new project created directly in Xcode.

Each of these assignments can be opted out by setting one of the
following variables:
- QT_NO_SET_XCODE_DEBUG_INFORMATION_FORMAT
- QT_NO_SET_XCODE_GCC_GENERATE_DEBUGGING_SYMBOLS

These changes improve the defaults for a CMake generated Xcode
project, but are not sufficient to ensure that dSYMs are included into
the archive created by the Xcode archiving task.

For that, the project also needs to set the CONFIGURATION_BUILD_DIR
attribute to '$(inherited)' to avoid a bug in Xcode, where it can't
copy dSYMs out of a non-inherited build dir into the archive.
Qt can't do that unconditionally, because it violates CMake's build
path preconditions, resulting in things like $<TARGET_FILE:app> genex
evaluation not working, as well as ignoring of the
CMAKE_RUNTIME_OUTPUT_DIRECTORY property.

A follow up change will provide an opt-in to do that, but only at the
project developer's own risk.

[ChangeLog][CMake] CMake-generated Xcode projects will now include
debugging symbols by default, regardless of configuration type, and
Release-like configurations will default to using dSYM bundles instead
of keeping the debug symbols in object files, to match Xcode project
defaults.

Pick-to: 6.7
Task-number: QTBUG-126866
Change-Id: Ie17b40e53ba22658a098f9a162c7bcfb1711c45b
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 7ccf30ae46272ace13bedc33ccf5f116ff57091b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-15 18:54:17 +00:00
Alexandru Croitor 9775f52cd5 CMake: Fix lookup of qml plugins for external project examples
There was a typo in the original change, which caused none of the qml
plugins in a prefix per-repo build being picked up.

Amends 06fef6219e

Pick-to: 6.7
Task-number: QTBUG-90820
Task-number: QTBUG-96232
Change-Id: Ibf14d9e0cbb0302c69d32071f4ba090f24a5798d
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 1ab33d575a6993ceb8d9482c20d5c7d6deb252ea)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-15 16:02:57 +00:00
David Faure ed2f80b75d QMimeDatabase: pick up XML mimetypes from :/qt-project.org/mime/packages
[ChangeLog][QtCore][QMimeDatabase] QMimeDatabase can now pick up XML
mimetype definitions from :/qt-project.org/mime/packages. GPL-compatible
projects which provide self-contained binaries can use this to provide
a copy of freedesktop.org.xml that will be used instead of the TIKA
mimetypes.

Change-Id: Id363317f920ae2cb1e054f32feb732e0e9168de3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit b12542c964c15d074393a7594c97a96d5c2b047d)
2024-07-15 14:47:41 +02:00
David Faure 2d2975bd9f Change the mimetype database embedded into QtCore
Instead of freedesktop.org.xml (which is GPL), use the tika mimetypes
definition (Apache licensed), as fallback on platforms where
shared-mime-info isn't installed.

[ChangeLog][QtCore][QMimeDatabase] For licensing reasons, QtCore
no longer ships a copy of the MIME database from freedesktop.org's
shared-mime-info project, but the one from the Apache Tika project.
The tika definitions don't have icons or translated descriptions, but
are sufficient for matching file types.

[ChangeLog][Third-Party Code] Added TIKA mimetypes and the corresponding
attribution file.

Change-Id: I360ed973f6d89a470dc2f17a21abdf5630c6d15d
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 74ad4cbeef40b1f51a59b3168f8c0b62eb0b29c8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-15 12:47:37 +00:00
Oliver Wolff b0dd8d748e qmake: Add support for arm64 hosts on Windows
Change-Id: I0096300fce870ef4411b071f074588a6420188e0
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit b66ecb295ecc3981b1c21f01d62c9066f5d6e6ca)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-15 11:11:56 +00:00
Mate Barany 9107807653 Use NSDMI to initialize the member variables of QIpPacketHeader
While adding senderPort to the initializer list of the constructor we
have decided that NSDMI would be a better approach for the member
variables.

Task-number: QTBUG-125026
Pick-to: 6.7 6.5
Change-Id: Ibc65251f99a66f1d7ee0c3570e608c2b534aa8b3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 5e2635e3456f2a4251f8194b3115382e63fdb49b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-15 01:07:52 +00:00
Mate Barany 7af02a5860 Call base class assignment operator in QHttpNetworkRequest::operator=()
Address a "Do call the base class copy constructor or assignment
operator, if you implement a copy constructor or assignment operator
in a derived class." warning found by an Axivion scan.

Call the assignment operator of the base class explicitly in the
assignment operator of the derived class.

Task-number: QTBUG-125026
Pick-to: 6.7 6.5
Change-Id: I5a76c9ea96275d569b3a036b1e1b791c57d0042f
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 84bb06fc5699c88b6edc175cc3cf67d88307481b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-14 12:03:33 +00:00
Mate Barany 504968117a Pass HPack::BitPattern by value
It is a small and trivially copyable type.

Found by an Axivion scan.

As a drive-by, forward-declare struct BitPattern at namespace scope
instead of in the argument of a function declaration.

Task-number: QTBUG-125026
Pick-to: 6.7 6.5
Change-Id: Ic3f58cb71a0fd0ad5b0555767af879e813612e72
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 9a41ea0934a745aa4e33280a2cf7a45372cb4073)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-14 12:03:30 +00:00
Christian Ehrlicher 68608585a5 Windows style: paint treeview indicators with correct dpr
The QTreeView indicators in windows style are drawn with the help of
windows themes. Sadly, indicators have to be drawn in the explorer
style.

This was already done correctly for visible windows. Hidden windows, however, using this drawing method, were not dpi-aware.
As a consequence, the dpi of the primary screen was used for drawing. This lead to wrong results on a second monitor with a different dpi.

Create a hidden window for every screen and use this for the painting
instead.

The fix can't be covered by an autotest. It will result in baseline test
mismatches, which must be accepted as new baselines.

Fixes: QTBUG-126533
Change-Id: Ie86cdb69f4cef1b293a5ac65541e5ada12959180
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 7f08822c499f624246d3f4c35dd97a7ba81d85ae)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-13 23:00:44 +00:00
Volker Hilsheimer 2a677940a0 JNI: add swap to QJniArray
It's a value type and should implement swap.

Change-Id: I811377843b6ede1d6d750a701ae7a6b12434f4e6
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 0789dd8723b03d255ff203c717c5e12b6945015e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-13 23:00:28 +00:00
Volker Hilsheimer 92b1923e31 JNI: clean up move and swap semantics in QJniObject
QJniObject is a value type with move semantics, but didn't provide swap,
so add it.
Make it safe to check a moved-from QJniObject for validity, and to
compare it with another QJniObject. As before, two invalid objects
compare as equal.

Change-Id: Ie08bb7c50da831f3e7e98e731e8ddbc0ebb3af78
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 3e0c21691dd2be6911c417f4cbfaf54d10b4d634)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-13 23:00:24 +00:00
Mate Barany 6d55e0b053 Initialize the senderPort member variable in QIpPacketHeader
Address the "A constructor must initialize all data members of the
class" warning found by an Axivion scan.

Just as the destinationPort is defaulted to 0 initialize the senderPort
to be 0 as well.

Task-number: QTBUG-125026
Pick-to: 6.7 6.5
Change-Id: Ifec55ba4b6c23a6feed2b4816d4ba6aae061f1cd
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 213127a013b6ecafb36eae1014d5988198736712)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-13 01:27:22 +00:00
Edward Welbourne 3f85834a47 Tidy up fix for calendar/locale data lookup
Save duplication of fetching and sanity-checking the locale-dependent
calendar index data by packaging it as a lookup function. This can
then take care of making the assertion of consistency with the
matching QLocaleData entry and also lets me add, without duplicating,
the slightly messy assert that m_data is what we expect (and are
relying on) it to be.

Task-number: QTBUG-126390
Change-Id: Ib514bee669956f432c007c858d01a9f7b6bbf86e
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit c9c498b5d1f5797c714fb07f06a84df881edb928)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-13 00:43:55 +00:00
Alexey Edelev 474c7dbf6e Revert "Ensure that we make case-insensitive comparison of CMAKE_SYSTEM_PROCESSOR"
This reverts commit 7ae19cee1c782fadfbd0c617568fdad8aba9a493.

Reason for revert: breaks non-cross QMake builds on
Windows on ARM64. The QMake mkspec is now reported as
win32-arm64-msvc, and apparently, QMake is not prepared for this.

Change-Id: I45c19719c6f0862580dbff09244337283305ee6c
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 361d0b7222fd35133186571762640aada67fa39b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-12 22:55:28 +00:00