After finding the end marker `---`, the code expected more characters
beyond: typically at least a trailing newline. But QStringView::sliced()
crashes if asked for a substring that starts at or beyond the end.
Now it's restructured into a separate splitFrontMatter() function, and
we're stricter, tolerating only `---\n` or `---\r\n` as marker lines.
So the code is easier to prove correct, and we don't need to check
characters between the end of the marker and the end of the line
(to allow inadvertent whitespace, for example). If the markers are
not valid, the Markdown parser will see them as thematic breaks,
as it would have done if we were not extracting the Front Matter
beforehand.
Amends e10c9b5c0f8f194a79ce12dcf9b6b5cb19976942 and
bffddc6a993c4b6b64922e8d327bdf32e0d4975a
Credit to OSS-Fuzz which found this as issue 42533775.
[ChangeLog][QtGui][Text] Fixed a heap buffer overflow in
QTextMarkdownImporter. The first marker for Front Matter
must begin at the first character of a Markdown document,
and both markers must be exactly ---\n or ---\r\n.
Done-with: Marc Mutz <marc.mutz@qt.io>
Fixes: QTBUG-135284
Pick-to: dev 6.9 6.8
Change-Id: I66412d21ecc0c4eabde443d70865ed2abad86d89
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Amends commit 6763e25cbc16cf8c54ab9b1ef97030aab9bb0eec, which refactored
static struct Cleanup {
to move the body if said cleaning up closer to the rest of the clean up
code in QThreadDataDestroyer::EarlyMainThread. But it accidentally
forgot the static keyword. As a result, we attempted to clean up before
::currentThreadData was set yet, resulting in a no-op and no clean up.
Task-number: QTBUG-135044
Task-number: QTBUG-134080
Task-number: QTBUG-133861
Task-number: QTBUG-132697
Task-number: QTBUG-102984
Task-number: QTBUG-132381
Pick-to: dev 6.9 6.8
Change-Id: Ibe40567bba8dea205401fffdb71f7e6a3be130e4
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Caching the scaled QPixmap directly in QIcon is not a good idea
- the cached pixmap might be used as starting point for a pixmap with
another size so it gets blurry
- QIcon has no caching mechanism to throw away unneeded QPixmaps after
some time so the memory usage grows indefinitely
Fixes: QTBUG-134930
Change-Id: Ic490ba15438a5cd07a555692e1d08cd1c211d005
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 7a238e1225f49b81772516ed5d0a5a4f4f2e9268)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 04cb0a1b55cc3c2b402d22f9f7a76b726407dc71)
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
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>
(cherry picked from commit f08721bb3962125f4207a5dccdb4415990161084)
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
[ChangeLog][Third-Party Code] The copy of TinyCBOR in Qt was updated to
0.6.1.
Manual conflict resolution for 6.9:
- worked around 34f60877bdb54786c62fd1bf5b44a81430aa411f not having
been picked to older branches
Change-Id: If5d5ef6220874ae8858efffd1712a567597b6317
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 7df128675a22391bc3ade2a45b558bc38eee1c67)
(cherry picked from commit cd395a79993e6d088f0d539d7f2516671524ee53)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
As noted in the comment, we had a chicken-and-the-egg problem with
plugins and the event dispatchers: we need to destroy the event
dispatcher when plugins are still loaded (otherwise we could and did
crash) but we also wanted the QThreadData to exist when the plugins
unload.
The solution for that is to split the work: destroy the event dispatcher
first, then unload pugins, then destroy the current thread's
QThreadData. On ELF systems, this is guaranteed to work because we set
the init_priority to call destroy_current_thread_data() to higher than
QLibraryStore. In other systems, it's a best effort with dynamic
libraries and not guaranteed at all with static builds (don't even
report bugs).
Fixes: QTBUG-134080
Fixes: QTBUG-133861
Task-number: QTBUG-132697
Task-number: QTBUG-102984
Task-number: QTBUG-132381
Change-Id: Ifaa28bb87338f4117d51fffdf721da68c0762e5a
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 6763e25cbc16cf8c54ab9b1ef97030aab9bb0eec)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 97b41af2a2e89c9b64a78246cba4778fd12a02f5)
By adding a way for the apphelper to let the caller know that it must
skip this test.
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>
(cherry picked from commit 9e18d7ded574dc24fe3b699f9e4ff4eaa471d7e4)
Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
Follow the standard syntax for property documentation.
Amends cbd2f56c14159a1a566f4e423b910256724fdb6a.
Change-Id: I3557eba1990b684a35ab70f95e7f8ccf33850537
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit df96b28f65ad0ba1094c756929cfcdd9f19e4529)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit c90130a72d17219842b6936a952ccd2e5b3a2a01)
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.
Pick-to: dev 6.9
Fixes: QTBUG-134473
Change-Id: Iee7eb73a5727324e2ff3bacc2d9ae45cb64fd0b9
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
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
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>
(cherry picked from commit 0c7bea06c4871d25ebd334512cf1c38879b4b547)
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
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>
(cherry picked from commit 07f088d340568a3e47cf5cd487c96a6160354afa)
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.
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>
(cherry picked from commit a6e68f636e2116d4fc771f1a5a5da8b19620df7d)
We use QCocoaWindow::windowStyleMask to compute a new styleMask for the
NSWindow, based on the QWindow flags. However, some styleMask bits we
do not control in this function, so we need to preserve them in case
they were already set on the NSWindow, as otherwise we end up clearing
those bits. We did this already for NSWindowStyleMaskFullScreen, but now
we do it for all style mask bits we don't control.
This fixes an issue after QCocoaWindow::applyContentBorderThickness()
started calling setWindowFlags to control NSWindowStyleMaskTexturedBackground,
after the introduction of the Qt::NoTitleBarBackgroundHint window flag in
a1e6fed44964a3eb14045bf819d232d6cbad9f59 and then
bddc0198297828ba29e5cf4b39e07412a506a551.
The symptom was losing the NSWindowStyleMaskDocModalWindow style mask
for sheets or other modal windows with a QTabWidget in them, as that
widget ends up calling applyContentBorderThickness().
Fixes: QTBUG-134447
Pick-to: 6.9 dev
Change-Id: Ie3e9ca3ff14f84ce70438d3633bd283fb78b9e8c
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
\brief tags are not used for member function documentation.
Explicitly set the prototype for qdoc instead, it doesn't seem to
know what to do with the definition in an ObjectiveC file and
produces link warnings.
Change-Id: I89252e7b84586e987ed6d950d90142e916d8f1df
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 03efe9a21bb7a879ae51e3ad007dd2cdb8c6d981)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit cb8a6a5ea90edef666cd769c233f937147fbb436)
... 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
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>
(cherry picked from commit 7a7c7322fa820425aa4896bb15172e922dc974ea)
Don't do proxy checks for the thing you want to test. Whenever possible,
test the thing you want to test.
We can't check for the definition of certain structs, though. Those have
to remain a proxy check.
Change-Id: I5003e785706cd66923e4fffd6b11254233d09dc5
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 9c4c5dc9f9c4358489d138dc4cf5aa6131b1bd24)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 2125135064ad8ce192d861e510eddde4c5946ba9)
When certain features are disabled, qguiapplication.h does not get
included which results in a compiler error. Therefore add it directly.
Fixes: QTBUG-134235
Change-Id: I7836fc52c5037ca15c7ce48617c9f814d71963aa
Reviewed-by: Liang Qi <liang.qi@qt.io>
(cherry picked from commit 98653cca453fe3d88807d1a314ae17efadd7c958)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 8b59467d20598527206d43ea1543e4d0961080b1)
- Replace colors in offline-dark.css
- Do not use the note and attention icons in offline templates
Task-number: QTBUG-133761
Change-Id: I55e81d6c3887764542e23c8f85f4d46e273b3885
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
(cherry picked from commit c770015876390de0cc9c77a3d5b123637204b92c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 9a0716b7281b31fbfc9fdb1d342829c8ec3008b0)
When split APKs, when an AAB is used for example, the native libraries
are kept in a separate APK and not under the main app APK, thus, we
need to use that instead to get the path of the native libs otherwise
the app would crash failing to load Qt libraries.
Amends 0db5b424cdaede8724886e8a1eda1380382d9aaf.
Fixes: QTBUG-134101
Change-Id: I930ba005aaefc15e4500b7290167892dc2428066
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 75367d1cfe564953d980b0c6917257f8ec0faa93)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit b172090299b4296fc2ad60aefe15eea3f27f4bd1)
Set the initial style to be automatic, that's the default. With this
change we also get rid of the warnings shown on application startup
complaining about the application not defining an initial immersion
style:
"Since your app does not define an initial immersion style in its
Application Scene Manifest, the default immersion style will be
applied. This does not match the immersion style defined at runtime
'full'. To make sure your app's state matches its runtime behavior
define an initial immersion style."
Change-Id: I1b8bba5f919b72d4f2507a19a30de49e8bfcd708
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 08146377db8ce782bac5b9561338ba20f7101ac5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Test is flaky on macOS.
Use QCOMPARE_LT instead of QVERIFY(a < b).
Blacklist on macOS.
Task-number: QTBUG-134105
Pick-to: 6.8
Change-Id: I8f1274ad67bd9ead392ecd0f9c9b7a01dc3edb1e
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 7c7731a8229a44050c02d33c7111e4d522909c1d)
Correct previously mixed up parameters to pushSegment(). stopProgress
can be set to 1 so stopPos is the only terminating condition.
Pick-to: 6.8
Change-Id: If590555ed08170800b67063aa10e853411180aa3
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
(cherry picked from commit 84e09e060bedd37d8de7cded7e430371e335c029)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
We have divergence in the way we document function, operator and
constructor constraints. About half use \note, while the other
doesn't. Some say "if and only if" while others say just "participates
only if".
So add a qdoc macro, \constraints, to semantically mark up these
constraints. It expands to a section titled `Constraints`, and
uses a predefined sentence (prefix) for constraints.
Documentation for constraints is moved to the end of the comment
blocks to separate them from the rest of the text.
Apply them to all the standard-ish constraint documentation blocks
(grepped for "participate"). I didn't look for other, one-off, ways
documentation authors may have documented constraints, but I'm also
not aware of any.
Re-wrap lines only if the result fits into a single line.
As a drive-by, drop additional "if"s, as in "only if X and -if- Y" to
make the texts work with the `Constraints` section.
Fixes: QTBUG-106871
Pick-to: 6.8 6.5
Change-Id: I18c2f9f734474017264e49165389f8c9c7f34030
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit b7a67b46e66f161def5bf879f19c66d3fcec1d8b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Add a link to QFontMetrics, which provides more information about the
differences between QFontMetrics and QFontMetricsF and why the latter
is the preferred choice.
Fixes: QTBUG-127528
Pick-to: 6.8 6.5 6.2
Change-Id: Ib5713a9d39bf312a6eae6b8b1a6d1dc1d47e25be
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
(cherry picked from commit bdf453afd7613d3e88099defb759444537527195)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
CUPS treats the "landscape" option as a boolean value
(IPP_TAG_BOOLEAN). In this case, all values other than "true", "on" and
"yes" are considered as false. As a result, using an empty string as the
value for the "landscape" option results in the print area still being
portrait.
Currently, the problem with printing landscape images (png, jpeg, etc.)
in Qt programs (e.g. Okular, Gwenview) occurs on Fedora 41 and other
distributions using cups-filters v2.0+.
The patch adds passing the value "true" instead of an empty string for
the "landscape" option, as CUPS expects for changing the orientation.
Pick-to: 6.8
Change-Id: Ib7ad1e2debcfff10e673757c97ef5614fb59a6ca
Reviewed-by: Albert Astals Cid <aacid@kde.org>
Reviewed-by: Lars Knoll <lars@knoll.priv.no>
(cherry picked from commit a77173486aaf9d2e4107f6e1120ac2316ae1c96f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
"Android" is trademarked and needs to be referenced in a certain way.
The following steps were taken:
-Created qdoc macro.
-Updated "Qt Android" and "Qt for Android" to use \Q4A in qdoc files.
The macro will need to be adopted in all documentation projects.
Task-number: QAA-2836
Pick-to: 6.8 6.5
Change-Id: I4b52247a4ed52047242a06404e6d3aa19de9c16c
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 9c6c6d7d388bee01ea4e5ea102d3b0ed359c3f00)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
[ChangeLog][QtGui][QColorDialogOptions] The class no longer
automatically saves settings such as the custom colors to a global
QSettings("QtProject") shared by all applications and no longer restores
custom colors from there. Applications that wish to retain the custom
color settings should use customColors() and setCustomColor() with their
own settings files.
Task-number: QTBUG-133805
Change-Id: I49cd7312054f41ca4cdbfffdcb60d6ea242393fc
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 9a753fa656a9bcae4193ceb38cfaf6e21641ddc2)
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
On my machine this gives me:
```
********* Start testing of tst_QTimeZone *********
Config: Using QtTest library 6.10.0, Qt 6.10.0 (x86_64-little_endian-lp64 shared (dynamic) release build; by GCC 14.2.1 20250207), arch unknown
PASS : tst_QTimeZone::initTestCase()
PASS : tst_QTimeZone::utc()
RESULT : tst_QTimeZone::utc():
358.686871 nsecs per iteration (total: 358,686,513, iterations: 999999)
896.524312 CPU cycles per iteration, 2,5 GHz (total: 896,523,416, iterations: 999999)
2,227.000427 instructions per iteration, 2,484 instr/cycle (total: 2,226,998,200, iterations: 999999)
560.000375 branch instructions per iteration, 1,56 G/sec (total: 559,999,815, iterations: 999999)
PASS : tst_QTimeZone::cleanupTestCase()
Totals: 3 passed, 0 failed, 0 skipped, 0 blacklisted, 374ms
********* Finished testing of tst_QTimeZone *********
```
Profiling shows some quite unexpected code paths that
I will try to optimize in follow-up patches. Note that
this function can be called frequently when deserializing
QDateTime over a QDataStream e.g. - I have stumbled over
it while profiling some KDE PIM code in akonadi.
Pick-to: 6.8 6.5 5.15
Change-Id: I7439df53ae8512c766f63cb4b0d4f33d14aa3a01
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 29c7beac2e0065cc0d03b9db6a701f7c690c6f56)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Some time ago, we spent a lot of time fine-tuning the behavior of
indexOf() and split() w.r.t. matching of empty needles, or in empty
haystacks. Make sure that (QByteArray) replace() is behaving
consistently.
It isn't. Filed QTBUG-134079 to track the issue.
Pick-to: 6.8 6.5
Task-number: QTBUG-134079
Change-Id: I16af5d2bb5b309a56e81854be434fa9430ae284f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 5fc1e9fa0c1925654412af5bf46ff95da99bc190)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Move the setting up of options like QT_GENERATE_SBOM into a separate
function, that can be called by projects other than Qt.
Pick-to: 6.8
Task-number: QTBUG-122899
Change-Id: I337c4e9b0b3154ff97f494887bf88ee01e8ed00c
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit dc5c7f9ead7e47b92c5717ca24d585a718a8b5f0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Some attribution entries don't have a SPDX license id specified, in
that case it's good to at least include the free-form license name and
file path.
Pick-to: 6.8
Task-number: QTBUG-122899
Change-Id: I75bb5c30645684ea74fe94da92ea30eb29965ad4
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit cf9f09cd60e3db37643ac6cf6cfd51aa00749892)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The PQ EOTF formula for BT.2100 [1][2] was incorrect. Fix it; while at
it, rename the variables to match the symbols used in the original
formula.
The inverse EOTF was correct, but also rename the variables there (for
the same reason).
[1] https://www.itu.int/rec/R-REC-BT.2100-2-201807-I/en
[2] https://en.wikipedia.org/wiki/Perceptual_quantizer#Technical_details
Change-Id: I6ce3a609824bee82053a16b3ff3cfc7cb396ce8f
Pick-to: 6.8
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit a7ff4679facb9a44dff8b63a7e461ababa6aedfb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
It somehow concludes that asize may be negative and would then cast to
an obscenely large size_t. This produces the following warning:
.../qbytearray.cpp: In member function ‘replace.constprop.isra’:
.../qbytearray.cpp:2579:23: warning: ‘memcpy’ specified bound between 9223372036854775808 and 18446744073709551615 exceeds maximum object size 9223372036854775807 [-Wstringop-overflow=]
2579 | memcpy(d + to, a, asize);
| ^
Check for asize > 0 rather than asize != 0.
Pick-to: 6.8 6.5
Change-Id: I63bccb1bf3ff45d539af4efe6843d2c648d7cb86
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 177cd123d29f818413db4bb7a9d92b8485c95947)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Such lines are rendered by drawing a capless line that is pen-width
long, i.e. a square, to represent the two line caps. However, the line
length offset was added before any transformation, so one could end up
with a long line being rendered if the world transform had a large
scale, say.
Pick-to: 6.8
Change-Id: Idff8a2de54c97e35facc8f4e09c43dfea7397588
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
(cherry picked from commit 56de11397559af3b9694ef2b99d93a469889ae5e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The docs for D3D11_TEX3D_UAV do not mention accepting -1 as WSize,
unlike D3D12_TEX3D_UAV. Hence passing in m_depth for D3D11.
Fixes: QTBUG-129300
Pick-to: 6.8
Change-Id: I517d23e076039543361d2bca1b91cddd47abcfaa
Reviewed-by: Jonas Karlsson <jonas.karlsson@qt.io>
(cherry picked from commit 6f89357f59b507c0dcdc177bc1ecfbbc94d6fed3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QVLA preallocates space for 256 entries, and while that should be
enough for most uses, it may be too much in the way of stack usage.
Instead of using a QVLA with a non-standard preallocation, use the
more compact std::string benefitting from its SSO.
Pick-to: 6.8 6.5
Change-Id: Ia22543fb287a1976f316f7a4d27b23a22f511463
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit 7c21630ce625817f1dc8e7182023b3fc6d36ac37)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This reverts commit 22f33e1bd2c43e0223cd52b94e6ecead56a2e1b5.
Reason for revert: Needed provisioning changes are now in
Change-Id: Ibc1d1833942394efec0c24dc7e7a3e6ada5b8eea
Reviewed-by: Jukka Jokiniva <jukka.jokiniva@qt.io>
Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
It's possible for a project to install a custom file with the same name
into different destination directories, and want to include them in
the SBOM.
Previously this failed at CMake generation time with an error like:
CMake Error: Files to be generated by multiple different commands:
qt_sbom/SPDXRef-PackagedFile-foo-bar.cmake
This happened due to using a non-unique filename for the generated
SBOM building file, as well as the spdx id the file name is based on.
Include a short hash based on the installed relative path of the file
to avoid spdx id clashes, and thus generated file name clashes.
Pick-to: 6.8
Task-number: QTBUG-122899
Change-Id: I4c2ecd4652708504ef299af9b6f53d680d542382
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 9245d0a0f0761364e7b5b3d1c5c96cba16522820)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Previously one could only pass an explicit list of FILES to
_qt_internal_sbom_add_files. Add a new DIRECTORIES option, which will
glob the given directory paths, and include the found files in the
SBOM.
Pick-to: 6.8
Task-number: QTBUG-122899
Change-Id: Ia27afa93460d9f2e4462a49e30e4d6338300e8f7
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 9db03c9dca1b7e403458fd9f43adb17a0ac8e55c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Nested SBOM attribution targets were always created with the
QT_THIRD_PARTY_SOURCES type even in user projects.
Set an appropriate type depending on whether we are handling a qt
entity type or not.
Pick-to: 6.8
Task-number: QTBUG-122899
Change-Id: Id8144d1b8093de78f2987a611a6de8e6d4777084
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 0d9106bf7670b08c4bae11c3986b9cf3e0818b52)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
It mirrors the Qt-specific QT_THIRD_PARTY_SOURCES one, to be used when
creating an SBOM attribution target that references a 3rd party
library's sources, as opposed to a complete 3rd party library.
Pick-to: 6.8
Task-number: QTBUG-122899
Change-Id: I8f7f9f7386ffdc18dd8ae6ee32e39019639f5303
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 8b06d37fb08d22e9f81ae2653aeafc105fc5bb61)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Put the attribution file path and entry first, followed by the id,
and the rest of the fields.
Pick-to: 6.8
Task-number: QTBUG-122899
Change-Id: I478a48980e6207646189d6b80ec57dbc9efb4902
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit a5c7eb97ceb19ac90f8117240ad04cc717803555)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Allow creating nested SBOM attribution targets also for non-Qt targets
in user projects. This will allow using qt_attribution.json files in
user projects.
Rename PARENT_TARGET to ATTRIBUTION_PARENT_TARGET to make it clear
what the parent target is for.
Pick-to: 6.8
Task-number: QTBUG-122899
Change-Id: Ia08ee934a9dc03827fcc26d0fc90e072499e8a21
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit a2ddd4fbd88353b21617e539266196b592683a3a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Previously one could attach all attributions from a
qt_attribution.json file to a target, or a specific entry based on a
given numeric index.
This is not always practical, as the index of an entry can change, and
including all entries might be too much.
Allow specifying a list of attribution ids to include in the SBOM.
This will parse all the attribution entries and only include those
that match the given ids.
If a list of ids is provided, and any of them is not found, an error
will be shown.
Pick-to: 6.8
Task-number: QTBUG-122899
Change-Id: I2ca442fe0cd6d18773861f90f32ab7380aaeacdd
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 52045e51e7e95f31a37127215c53e430fa77c8d3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
So it can be used in other non-Qt projects.
Pick-to: 6.8
Task-number: QTBUG-122899
Change-Id: I11d81d2c6819906fffbffe81f4db1b7af28cb99b
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 6cd7f0c09b71ea49bdd3dd925b9a85dfe6cc943e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
So it can be read / used in other non-Qt projects. We don't have such
a restriction on other keys read from the qt attribution files.
Pick-to: 6.8
Task-number: QTBUG-122899
Change-Id: I225d83b26c68323761a8b13b3e6442057b5f7c7f
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 422f5d859f3056433e6ee33ea389f2ecff1543d5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Extends e75c1a00e31723f1c9deb8427725fa0a58fae2a8 because calling
receivers() in disconnectNotify() can deadlock too.
As a drive-by, some statements are generalized further:
* "expensive initialization" -> "expensive operations" since that is
what the relevant snippets actually show.
* The potential race condition is not limited to "after this function
returns and before the signal gets emitted"
Task-number: QTBUG-106025
Change-Id: Iff014706b9e8d8147e3bbb9ac51542197eec5db3
Pick-to: 6.8 6.5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit f5b874fd2d393b783dad85c95a158383420e481a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
It's thread-safe, whereas trying to load qApp isn't in Qt 6.x (will be
in 7.0) and dereferencing it to call QObject::thread() will probably
never be. It's also faster, being a single function call instead of two
or three.
This is not an exhaustive search, it's just a few places I found while
searching for QThread::instance().
Pick-to: 6.8
Change-Id: I3b4e1c75bb3966e2cd2dfffd79bfc8a40f6cf40b
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 6fb39ca2cbb111469ce09c8342997eb5375e3239)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This patch updates the macro AndroidBuildToolsVer to
version 35.0.1.
The version 35.0.1 is used elsewhere, see
b49421a984ac2b203b7995f3787b67184c990089
Amends: 9b475eadfcf04194a094454f65295c3a456000a4
Task-number: QTBUG-129462
Pick-to: 6.8 6.5
Change-Id: Ic15e12c563fa3d16315daa13b6f6b6ef19535954
Reviewed-by: Nicholas Bennett <nicholas.bennett@qt.io>
(cherry picked from commit 7a7093eb87ebc986555b855611018066e2c39bed)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Clang 20 has fixed the referenced issue. Once more this shows the
importance of versioning compiler-related checks...
Amends 1b1ae345025d1cac953985d4cfebd20fadb6bc99.
Change-Id: Iea88d466883562b0130639d7c0f2f3b984acdbc2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit fb1824a9d669c601ebd540c9ca16a9687d7d9706)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Introduce a new module `TestInternalPrivate`.
Kitware's RunCMake allows to create more granular unit tests using
`cmake -P` scripts instead of configuring, generating and building full
projects.
[ChangeLog][Third-Party Code]
Add upstream cmake's RunCMake test infrastructure module to
src/testinternal/3rdparty/cmake to aid in creation of cmake auto-tests.
Pick-to: 6.8
Change-Id: I08cb7c6dc6f61bde29f176d58295f4f660b34ca8
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 39e7946cb6562c6f9b1baf5c44b1694922d0538e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
To more easily spot white space differences.
Pick-to: 6.8
Change-Id: I1e07960f78c95ca536243ce5c4fc6c302c47a7db
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 2dd0c4520fdee50a3511ca2f83decdf807ba2cb3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
When reconfiguring an MSVC -release build with 'cmake .' after a full
build, instead of being a no-op, it rebuilt everything.
This happened because of CMAKE_CXX_FLAGS_RELEASE being accidentally
modified on each reconfiguration, resulting in extra whitespace being
added to the compiler command line rules.
Specifically, this was because we always added '-O2 -Ob3 ' as a string
to the compiler flags, but due to stripping, always tried to remove
only '-O2 -Ob3' (no trailing white space) when removing the
optimizations flags, resulting in an extra white space for each run.
Remove the trailing white space after '-Ob3 '.
Amends 2fb134f3fe8fdeb1f36c346cff3b09a2b7a095a7
Pick-to: 6.8
Change-Id: I46eb4c3b769ae6b063fe62df05c0cb92f13bda30
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit fdb9a5141446ed8aa767d88a921c24221b0704ea)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
If the source file sets `QT_INSTALL_PATH` property, it will install the
CMake files in the relative path starting from the config-dir in both
the build and install paths.
Pick-to: 6.8
Change-Id: I86197d62bfac96f9c142d8abfe85c9b6f6f1a527
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit aef789ad97ee9b8f3254a0e315a0d8a4785bcbf7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
It should be spelled UTF-8 (official name by the Unicode Consortium).
Pick-to: 6.8
Change-Id: Ib358d0870e77f0cb4cdb920ed5ca829f100707a1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 0770171dcda24a567d6f57b87fdd284011e56e16)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
- Do not use a version for the executable module target
- Rely on QTP0001 for the RESOURCE_PREFIX (via
qt_standard_project_setup)
- Do not use OUTPUT_DIRECTORY to avoid a URI mismatch, potentially
causing issues with the implicit import. Instead, use
RUNTIME_OUTPUT_NAME to avoid a conflict between folder and executable
name.
Change-Id: Ic6188d96042e7b34eb3f423daf2b57290ca18a11
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit e84145d6c14e92c3a499904f70046bc3ceee5960)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Commit 2140edaaab0bf61f354db521efca773568becc56 introduced
QWizard::setCurrentId that allows setting the property
directly, so drop the obsolete sentence in the QWizard::currentId
doc stating that this isn't possible.
Pick-to: 6.8 6.5
Change-Id: I5e7da2323e66a6e8bfd653dfebcba4363023b744
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 71246cbdc64c4a5b3b3859421221bcc36c4a61c3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
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-6331
Pick-to: 6.8
Change-Id: I4a7e64e464ea04409154be2e7b3135ecd88a29fc
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Amends commit be0f1af3f1829da0d321c12dbd40d5743d3b2eb5 ("CBOR: remove
the X11 True and False for good"), which removed the #define from the
top of the files, but didn't remove the checking of the macro from the
bottom of them.
Change-Id: I92e76842a4117f6feed3fffdac2fcec01367101e
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
(cherry picked from commit 00f3ca950a6cab105c95b53ce2b3b93282abcea8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The macro, as it was, makes debugging REALLY hard:
FAIL! : tst_QStorageInfo::operatorEqual()
The computed value is expected to be equal to the baseline, but is not
Computed (lhs == rhs) : 0
Baseline (expectedEqual): 1
Loc: [qcomparisontesthelper_p.h(178)]
It prints the location of the macro helper, not the line that called it,
so one has to guess which of the many uses in a function has failed. And
it prints the boolean of whether the comparison result is the expected
value, not the values of left and right.
QT_TEST_ALL_COMPARISON_OPS also needs a similar fix, but I don't have
time for it. Ideally we'd replace the qScopeGuard with a proper QTest
failure report, which would extract the printers for Left and Right.
Change-Id: I7a643066137c5fcdb9e7fffd83d9bf7cf4cccd6c
Reviewed-by: Rym Bouabid <rym.bouabid@qt.io>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 4a4c4252919d4894c7e5c6f2e636dda5dc1b1d0d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This amends 073fae097ce40bee1532c252a8c696840b5dfc16 which added
an escape before calculating the vertical metrics if they were too
big and would overflow. It missed one spot, which was when using
the winAscent/winDescent instead of the typo-metrics.
Change-Id: Ib6a7705f6676c66bfd04b37efa30fe2d1b99581c
Reviewed-by: Robert Löhning <robert.loehning@qt.io>
(cherry picked from commit f846754663aae1652e4eec9a441ee222af352319)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Previously, only 3 purl entries could be added to a target, which
tightly coupled to Qt's needs: a QT one pointing to code.qt.io,
a MIRROR one pointing to github, and an upstream one pointing to some
upstream third party location.
Rework the implementation to allow for an unlimited number of PURL
entries and to allow more flexibility when adding PURLs in a user
project.
The new syntax for adding PURLs to a target, which is also the basis
for a future public API is as follows:
qt_internal_add_sbom(<target>
PURLS
[[PURL_ENTRY
PURL_ID <id>
PURL_TYPE <type>
PURL_NAMESPACE <namespace>
PURL_NAME <name>
PURL_VERSION <version>]...]
PURL_VALUES
[purl-string...]
)
The PURLS keyword is used to specify multiple PURL entries, each
starting with the PURL_ENTRY keyword. The PURL_VALUES keyword is used
to specify a list of pre-built purl strings.
PURL_ID is an optional argument used to identify a specific purl
entry, which is mostly needed for Qt's needs, to post-process them
further.
The rest of the options are pre-existing from the previous
implementation.
Implementation-wise, there's a new custom parser to be able to parse
and validate PURL_ENTRY arguments.
The VERSION option was renamed to PACKAGE_VERSION, to avoid some
issues in cmake_parse_arguments parsing with nested VERSION options.
The NO_PURL option was removed because it makes no sense in the new
implementation, because if you specify some PURL arguments, there is
already an intention to generate a PURL entry.
Qt entities no longer have a restriction on which specific purl ids
they can have.
The new Qt specific purl IDs have been renamed:
- QT -> GENERIC
- MIRROR -> GITHUB
Amends f7e1123620b623be0c321b54eaba7a1d618a7ce1
Pick-to: 6.8
Task-number: QTBUG-122899
Change-Id: I050decece1c6d9e6e0e06547043f864d6f497ea7
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit a28a9e194cbcaf501c93df988c7dc6f5e09ee5d1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Move generic PURL function from qt-specific file to main one. It was
mistakenly added to the wrong file during the initial split.
Amends f1ac316191c010b1389f6f3549c9f0b4424b9936
Pick-to: 6.8
Task-number: QTBUG-122899
Change-Id: I1884f53ee7d30a25b873d85ee04b8c8d1e0532f5
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit fd622bc3ae90ba27069744bf61524139f1642872)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
GetSysColor(COLOR_HIGHLIGHT) did not report the right highlight color in
light mode palette, Leading to a wrong accent color on
Windows. This patch uses the accent color analog to the dark mode
palette for QPalette::Highlight.
Fixes: QTBUG-130458
Pick-to: 6.8
Change-Id: If21f392e31c3187c28e871919ff17f417c8d144b
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
(cherry picked from commit a55db2cbee914d7bdc5678f35da297b79aec7613)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Running many tests on the VxWorks in the emulator without
restarting it between can cause exhaustion of some
resources and cause an RTP spawn fail in some tests.
This change will restart the emulator in such cases, which
allows the test to try again on fresh boot.
Change-Id: I5ad715f243867d43b055271d6bc61ca4ccb3089b
Reviewed-by: Simo Fält <simo.falt@qt.io>
Reviewed-by: Michał Łoś <michal.los@siili.com>
(cherry picked from commit 5be7a9773e106f9675e8d57121c298539f4ce343)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The result of d.begin() is only used in one of the branches, so
defining it outside both branches is a bit unmotivated; instead, drag
toRemove_start out of the else branch and reuse it in the then branch,
too.
Amends 358b7a9e747549f85c1d1631dfb21210b52b36f5.
Pick-to: 6.8 6.5
Change-Id: I162d72de7097a1257c8a0a01b69c36fc87466114
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 2831ce613fdaebe94e35a8afe45a057004548991)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Don't go and build (among other things) a Boyer-Moore table for the
trivially optimizable replacement of single characters with single
characters. Just call the existing replace(char, char) overload.
Pick-to: 6.8
Change-Id: Ic69527bdaa5ce95bf937295366b94366e2ace933
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit 60af93847e365fc00ccc4bcf61bb90ef6da1f0b2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Coverity complains that qCountLeadingZeroBits() may return 64 and then
the RHS will be out-of-range for int. Of course, 64 leading zero bits
means that the argument is 0, which we excluded in the first `if` of
the if-else chain.
I can only guess (because it doesn't tell me which value of `bytes` it
is using for the analysis) that Coverity assumes bytes ==
numeric_limits<qint64>::min() and considers the overflow in qAbs() to
yield a 0, because, it being UB, it may yield anything.
Be that as it may, the fact remains that formattedDataSize() invokes
UB when passed numeric_limits<qint64>::min(), as confirmed by ubsan:
global/qnumeric.h:479:26: runtime error: negation of -9223372036854775808 cannot be represented in type 'long long int'; cast to an unsigned type to negate this value to itself
text/qlocale.cpp:5062:82: runtime error: signed integer overflow: -2147483648 * 3 cannot be represented in type 'int'
text/qlocale.cpp:5062:26: runtime error: division by zero
FAIL! : tst_QLocale::formattedDataSize(English-Decimal-min) Compared values are not the same
Actual (QLocale(language).formattedDataSize(bytes, decimalPlaces, units)): "-inf bytes"
Expected ("output") : "-9.22 EB"
So fix the overflow by using the new QtPrivate::qUnsignedAbs(). Then
sit back and await Coverity's verdict on the next run.
[ChangeLog][QtCore][QLocale] Fix issue when calling
formattedDataSize() with numeric_limits<qint64>::min().
Amends 9d23aebb271ea534a66cb3aceb2e63d9a1c870d6.
Pick-to: 6.8 6.5 6.2 5.15
Coverity-Id: 474294
Change-Id: I9a5a5acbdcf881a624bb827ca1dd970771f1bb6e
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit b93575de01760ff2ab0d817557a642c71cdb4414)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The ensureLargeData() and 'large' members were only used in BigData
tests that have since moved to a different executable.
Amends fff217824b532da7306af1ac755581e76e098a27.
Pick-to: 6.8 6.5 6.2 5.15
Change-Id: Idc99a868e082098dda4e1bee62470370c7e20f62
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 5cd046f154a0a31635c935bf6c9f1abd27837b80)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
While the idea to delay the construction of the QVLAs until we know we
need them is elegant, we're doing a lot of checks twice or thrice this
way, so merely re-set the a, b pointers and otherwise continue
executing.
This requires us to default-construct the QVLAs before potentially
assign()ing to them, but that ought to be cheap, given the compiler
can see everything that's going on in QVLA.
Pick-to: 6.8 6.5
Change-Id: I4e42d5ab48711af91cc1785171524be5fb45ae2f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit 4308ab70cafa4398aa72dfe63bc580a6ecff9e52)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Cleanup QSqlTableModelTest:
- use pmf QSignalSpy ctor
- use QCOMPARE/QCOMPARE_GE instead QVERIFY where possible
- properly close additional databases so temporary folders created for
sqlite can be deleted on exit
Pick-to: 6.8
Change-Id: I84e8960b81128c141a0e2cd6d03837c9b5ac6652
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit a47dc990793a1e299e9ba869e1d6c76fa0bf9d65)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The argument must be added in qt_cmdline.cmake to work.
Pick-to: 6.8
Change-Id: Ic256c0fda0caf3794b37ad8c5e8b6515fb45b0e6
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 5971e94bafacfebdcd28ef84a7cfea61ffd48689)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The Clang analyser in Qt Creator was letting us know that <memory> was
unused in this header. Also, this is Include What You Need.
Pick-to: 6.8
Change-Id: Id7c260818f9e84847971fffda11da096169a0047
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit 9dc8bc80de03ccf52fabf63855128c5852d51605)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
We used to call focus on the input element even for things
like pushbuttons.
This will display a keyboard on android, instead call
focus on the focus window.
Fixes: QTBUG-133781
Pick-to: 6.8
Change-Id: Ide4d6ec21a14f17b40d3d3de077c0ab073682f19
Reviewed-by: Lorn Potter <lorn.potter@qt.io>
(cherry picked from commit 442e2f4aeb2081c1b8344a8f5cc2c6f2e7bb7d5b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
We normally override the entrypoint to _qt_main_wrapper via the -e flag
to the linker, but if a Swift file is added to the Xcode project, Xcode
does some magic, building the app as a shared library, and wrapping it
with the Swift code into a custom executable. The -e flag will then be
a noop when linking our shared library.
To work around this we set the custom LD_ENTRY_POINT Xcode build setting,
which triggers Xcode to pass -e when linking the wrapper-executable.
This works in practice, but produces a warning on the console that the
entrypoint is not found, which has been reported as FB16519113.
Fixes: QTBUG-133577
Pick-to: 6.8
Change-Id: I9d8310b39ac5a4900693df55c2e5bfa346c0300a
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 430ba7c0f826ee6f91fbfdc861525cb62b8e725c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The progressbar label overlaps with the progressbar grove, when
vertically centered aligned. This patch adds a y offset to the
label, in case it is vertically centered to avoid the overlap.
Fixes: QTBUG-128458
Pick-to: 6.8
Change-Id: Iac977f83f09c2e4d12d1e0ed5f0eab3120c07b96
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit 564633f9d4e4cc8fa361de8165a9dfb203b7248e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
A potential rounding error in calculating the padded scanline length
could lead to the biSizeImage field being assigned a too small value.
Fixes: QTBUG-133782
Pick-to: 6.8 6.5
Change-Id: I251212cf2859f7268fc8ad6ca1cbc57f2bb1f1c0
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit 3d389ee2ac6478a470f19e73826a3889dd117337)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
We should only pass the VERSION option if we have a value to pass.
Fixes warnings like the one below when using CMake 3.31:
CMake Warning (dev) at cmake/QtPublicSbomAttributionHelpers.cmake:511
(cmake_parse_arguments):
The VERSION keyword was followed by an empty string or no value at
all.
Policy CMP0174 is not set, so cmake_parse_arguments() will unset the
arg_VERSION variable rather than setting it to an empty string.
Call Stack (most recent call first):
cmake/QtPublicSbomHelpers.cmake:954
(_qt_internal_sbom_replace_qa_placeholders)
Amends bc3bbb51b7b48d3c4a44a432441938863582242c
Pick-to: 6.8
Task-number: QTBUG-122899
Change-Id: I671a9153d72b21b6aed2112bea45f577a5cee4eb
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 4174f388e6804fb138f625aab3eb75b90c2c7bd4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The implementation of GET requests with body (QTBUG-112871) keeps the
body after it has been redirected. However, in case of temporary
redirect (status code 307) this seems to be an incorrect behavior.
Reset the headers and the body in case of temporary redirect.
Pick-to: 6.8
Change-Id: I10be702b017a42cca27a37dfe2249da2f59c0328
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit f6a5c7e011d24db22afa5a3bf92749b9bb9e9354)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
When the style name is included in the request to
QtFontFoundry::style(), then it will ignore the other properties
and just return the hit that matches it. This is because we want
the style name to take precedence over all other properties when
the user specifies it in a request.
However, we were using the same function to check if a specific
font already exists. If we are registering a font and it is
already in the database, we want it to replace the existing one.
But for fonts such as the variable "Noto Sans Display" there would
actually be multiple styles in the family that were called the
same ("Regular") but had very different properties.
Due to how fonts are populated on GDI, this issue did not occur
there, so the issue is perceived as a regression in Qt 6.8 when
we switched to DirectWrite as the default backend.
We fix this by ignoring the style name when checking if the font
already exists and instead prioritizing the specific properties
it has. If multiple different styles with the same name exists,
they will all be registered.
Note that it will not be possible to differentiate between the fonts
using the style name, same as before, but you will now at least
be able to select the different styles by specifying properties
such as weight.
[ChangeLog][QtGui][Fonts] Fixed an issue with font families where
only the last of multiple sub-families sharing the same name would
be registered.
Pick-to: 6.8
Fixes: QTBUG-131574
Change-Id: I86a04547065c2d9ef88d9a761af95af33eb9b3d6
Reviewed-by: Lars Knoll <lars@knoll.priv.no>
(cherry picked from commit 1d6f71779f05df1af3daacd48f309cd92523152a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
If you open a QFont on an invalid image, its dpi will be 0. In
other places we check for this before calculating the point
size, but this was missing in one spot, causing divide by
zero.
This would happen e.g. in the tst_QFontMetrics::same() test.
While it would pass normally, running this with an undefined sanitizer build would warn about the division by zero.
There's nothing useful we can do with the fonts on the invalid
image, so like in the other places, we just leave the point size
as is when this happens.
Pick-to: 6.8 6.5 5.15
Change-Id: I4769e23e2b4dbb92f675cb8a77f8554c90bc2afd
Reviewed-by: Robert Löhning <robert.loehning@qt.io>
(cherry picked from commit c136de2deb46fb5f60728bc5a4083b9439ea0a3a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
It's possible for the QVariant to have been created by an older or newer
build of the library in question in which the type in question was
relocatable but has ceased to be, or wasn't relocatable but now is.
[ChangeLog][QtCore][QVariant] Fixed a bug where QVariant could misbehave
regarding types that changed from non-relocatable to relocatable (or
vice-versa) and not all uses of it were recompiled. To benefit from this
fix, applications must be recompiled, but they will be safe going
forward.
Pick-to: 6.8
Change-Id: I222806b3804df6272abdfffd45f96312d23be1af
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit eb87b0444ac8fec4d86bc26dc4bec80f82953f7c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This reverts commit e60b493c2e5c672528efd7e0bc8f659e0fd2e2e5.
Reason for revert: temporarily revert it to pass submodule
update round.
Change-Id: I63e8cf78c93d84add4aaaee388b01f2c15cca312
Reviewed-by: Jukka Jokiniva <jukka.jokiniva@qt.io>
This fix the FatalSignalHandler destructor to restore properly the
signal handler which cause an infinite loop when a signal is emitted
like SIGABRT or SIGINT and when we are using two QTest object in same
program.
Fixes: QTBUG-132121
Pick-to: 6.8 6.5
Change-Id: Ie9476e1ff9c0f29c3e35ae6dff565fab4a77ba86
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 50d1a22e5c6361e7c1ef09432b2a151eee3e6114)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
When using alternating rows in ItemViews, the currently selected item is
hard to distinguish from the background colors. This patch uses for
ItemViews with alternating row colors the highlight color for the
selected and hovered item.
Fixes: QTBUG-133118
Pick-to: 6.8
Change-Id: Ib5dbe0f58d5970c41cc9d14cf2188a7e5b1abd1a
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
(cherry picked from commit c3d2a4972ca6bec5bfe9dbe989e2dc6e347f02c1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The checkNode(p) call relies on p being non-null, so CodeChecker
grumbled. In any case, we should be returning node_impl if we fall off
the end of the structure (which shouldn't be possible, since we
descended into the three and can't come back out on the way up without
passing through node_impl, for which we check). Include a null-check
in checkNode(), save the nsURI.isNull() check when !p->isElement()
makes it redundant and fix some coding style nits while I'm about it.
Amends commit 8609982791928a30a6d836b25810143a064f8c6f
Coverity-Id: 474724
Coverity-Id: 474725
Coverity-Id: 474726
Change-Id: Id622a91d2e443276756e50729cf155b10f7164a1
Reviewed-by: Matthias Rauter <matthias.rauter@qt.io>
(cherry picked from commit 82ae262de27534170060e61e8d1f4b045ae13fb8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Negating a negative value may attempt to negate the minimal value for
the signed type, whose only set bit is its sign; this is UB. So don't
do that. Since the non-decimal branch of the code just prepends
locale.negativeSign(), and we're passing -1 as width parameter to the
QLocalePrivate formatters (so there's no zero-padding, whose size
would be reduced to make space for a sign), we can treat decimal the
same as all other bases. This, furthermore, simplifies the code.
In the process, I noticed (because a test only done for decimal
failed) that if QTextStream::ForceSign is set, this code-path for
negatives would prepend the minus sign before a plus sign supplied by
QLocaleData. Skip the flag to include sign, for negative input, since
we'll be including a negative sign anyway. Remove the QEXPECT_FAIL()
from the test I've added for this in a preparatory commit.
Purge one now-redundant comment and revise some others. Expand on why
we need to hack octal zero to display two zeros. Add a second test row
to keep the lonely zero-row company in the test for that.
Fixes: QTBUG-133269
Pick-to: 6.8 6.5 5.15
Change-Id: I35c9bdf34b812cff578de9b0a2570a60e6145c80
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 44ddb34da07f7fdb2214cb39b56cf114d4aa209e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Coverity thinks that r may be negative and not -1 and warns that the
cast to quint64 may overflow.
Change the check for `== -1` to `< 0` to help Coverity (and other
readers of the code) understand that this cannot happen.
Amends c63420a117fe67107466d806890e901d091cb1d5.
Pick-to: 6.8 6.5 6.2 5.15
Coverity-Id: 474172
Change-Id: I7615e0ef152e1e6e9cbc6dec1b8ecd4f8879521c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 24a26ed3a3842398276ae54602e8e1936a2f2323)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
... not just int, and not just non-negative values.
Reveals a problem with bytes == numeric_limit<qint64>::min(), says
ubsan (example; all min64 fail):
global/qnumeric.h:479:26: runtime error: negation of -9223372036854775808 cannot be represented in type 'long long int'; cast to an unsigned type to negate this value to itself
text/qlocale.cpp:5062:82: runtime error: signed integer overflow: -2147483648 * 3 cannot be represented in type 'int'
text/qlocale.cpp:5062:26: runtime error: division by zero
FAIL! : tst_QLocale::formattedDataSize(English-Decimal-min) Compared values are not the same
Actual (QLocale(language).formattedDataSize(bytes, decimalPlaces, units)): "-inf bytes"
Expected ("output") : "-9.22 EB"
So exclude that from testing, for now.
Pick-to: 6.8 6.5 6.2 5.15
Coverity-Id: 474294
Change-Id: Ia1f8e87c58a9fdc2668b6745956e913384cff4c7
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit 562cb8e4d9c5e6482b8c6b85fbb6f735d3000ad2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
`SKIP_AUTOGEN` was a bit too zealous.
Hotfix for 6865c21e41be5d86b5a04889bfe28fac55c89f29
Fixes: QTBUG-133850
Change-Id: I6ec984a7a5d8eefb56e53a0f56c4f4384a56e0ae
Reviewed-by: Nicolas Fella <nicolas.fella@kdab.com>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 97517b20aaaccb9f2bfa6d571a71f40560507476)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The SHA-1 test has started to time out in CI ASAN builds recently, so
skip it there. Keep it on non-CI or non-ASAN builds, though.
Amends c6e092a5f84b7fc72556897b50c7697152967925.
Pick-to: 6.8 6.5 6.2
Change-Id: I8d653c2a8304cfae290befafda570d5c49dd4536
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 929466ba64c503cc1a7c6205f0a424350a9a201f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Unblacklist test function by skipping it with Android with Vulkan.
Fixes: QTQAINFRA-6335
Pick-to: 6.8
Change-Id: I2ee093542f09f68044baa044b697a09af066fcd8
Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Lauri Pohjanheimo <lauri.pohjanheimo@qt.io>
(cherry picked from commit 83a4128ecbc260231b942f811b34fbe7595b14bc)
childNumber() has been renamed to row() in the code, but not in
the documentation.
Correct it.
Pick-to: 6.8 6.5
Change-Id: Ibe6f1f27c0dd1982ff663dc680738babf2db87d7
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
(cherry picked from commit d0cb3c0acdd4a482fd749684f282451bdd13557f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
These warnings are false positives when testing in the CI
when a documentation module containing the base type is meant
to be loaded as a dependency; In the CI, the .index files for
doc dependencies are not available so we see this warning.
Ignore these warnings for now in the global documentation config.
Pick-to: 6.8
Change-Id: Ic1711bf7389e9f9d4a04e3b72b2c9f8b25539357
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
(cherry picked from commit 3336422289079b421797ac2d194241976929c7d8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QtC doesn't use the make_[apk|aab|aar] targets, it runs the deployment
manually. The top-level android build target for QtC is the
<target>_prepare_apk_dir target. Make it depending on
<target>_copy_apk_dependencies target, to ensure that all abi-specific
artifacts are copied before running the deployment procedure, from
either QtC or command line.
Amends 44149f9d8b62b5343a5d06628b0c9588f035ccc2
Fixes: QTBUG-133810
Fixes: QTBUG-131862
Pick-to: 6.8
Change-Id: I4f3630798658a793b0c96a99fc4644ec1dd0504b
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 7a6b3e1a9c0555e91f3e510b63bc0cc18bb1ef16)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This warning here was very confusing (so I'm also updating the language
to be clearer what it means). It is here to advise users of
QThreadStorage that they may have destroyed the object before all
threads using the object have finished. That means there will be memory
leaks, hence the user should fix the issue.
But the one time we don't care (too much) about memory leaks is when the
application is about to exit -- all memory is being released back to the
OS anyway. This may happen because of Static De-Initialization Order
Fiasco: the Q_GLOBAL_STATIC or equivalents holding QThreadStorage were
destroyed before the QThreadData for the exit()ing thread did. That
problem became more prevalent after the series of changes ending in
commit 2f69a05bd0cd7ce63890f709ff3ed7a4f78acd70, because that made the
QThreadData clean up happen very late in the execution.
Unfortunately, there's no way for us to know when we're being called
during application exit, so this is the next best thing:
QCoreApplication::instance() does not exist. We're using a private
function in QCoreApplication because in Qt 6.x, QCoreApplication::self
is not atomic and reading it would be a data race.
The QThread::currentThread() call was superfluous, because it was always
true. It was a relic from Qt 3, from before we had QAdoptedThread.
Pick-to: 6.8
Fixes: QTBUG-133500
Change-Id: I48d84d76f2b72483ed92fffdd54c6ad17e3d67d3
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit fd857d400a098598072ff08b0a54f4ba2589357b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The CI is flakey, likely due to missing timer events. Instead of
skipping the first event, start the timer only when the new state has
been set.
Task-number: QTBUG-30133
Pick-to: 6.8
Change-Id: Ia58e4b091d8791d1b77642ded67312bc3927d0b7
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit c093b57c8696079fc3408796e0e17c62a990bce2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Make sure to specify the creator organization when calling reuse to
generate the source SBOM.
This replaces
'Creator: Organization: Anonymous'
with
'Creator: Organization: TheQtCompany (https://qt.io)'
Pick-to: 6.8
Fixes: QTBUG-133796
Change-Id: I3532d9f35ca3eacd9c20bee7db88f35c76db9672
Reviewed-by: Lucie Gerard <lucie.gerard@qt.io>
(cherry picked from commit 52a64aca2099a1efc5a8819c9e60a57aefde4370)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This enables generation of pkg-config files that work with Qt's
libdir-installed macOS frameworks. QtFinishPkgConfigFile.cmake
wasn't modified as POSTFIX has no impact on framework name.
Change-Id: I2da8f43608e778aa286ad625b70c5be20b447193
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 7a31e402f24ec29c571f825e06bd569477501dfc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The variation selectors only make sense in the context of the
previous glyph and should never be shaped by themselves, therefore
we should not pick a different font engine for these even if
the cmap does not support it. They are sometimes needed to
properly resolve the emojis, but the OpenType rules in the font
may not be written with them in mind.
If the cmap lookup fails for these, then Harfbuzz will map them
to a zero-width space, thus ignoring them when resolving the
OpenType rules.
We treat these the same as other control characters and just
ignore them when doing font merging.
Note: This was handled through an ad hoc mechanism prior to
the introduction of the emoji segmenter in 6.9.When the emoji
segmenter is disabled, we still use this mechanism, which
depends on us not ignoring the character in that case.
Fixes: QTBUG-133480
Change-Id: I8fa4e8d5e1aabad0946b8fd3fff044e2b2af5d0e
Reviewed-by: Lars Knoll <lars@knoll.priv.no>
(cherry picked from commit cf674f38450f623d94e5695a221a186c0e551e27)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Both enable_if and is_null_pointer belong to type_traits, include it.
Amends 631a0cc45cbe70940746cd944d325d7d3bab8c15.
Pick-to: 6.8
Fixes: QTBUG-133808
Change-Id: I9626ba80b2d9799d1bfed8ca9c9090691b8d8715
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 72cde6f7dd9102d0c3730a75a6c85af69b8a0e3c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Write every byte only once.
Amends 83c2c5055405f09043c35b93cd5ba9b9969f3174 (as well as the start
of the public history).
Pick-to: 6.8
Task-number: QTBUG-106185
Change-Id: I883b2f00c754806882131a09dc3cbc5613420151
Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit 2753924fcbeb29fa5b34782bd6ad6ed4fe4b51f1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
There is no need to screw up the palette of buttons in polish() - the
colors are not honored at all.
Pick-to: 6.8
Task-number: QTBUG-132433
Change-Id: I4df1f046690d1aa9b07fc538441d6ea50d0216ce
Reviewed-by: Wladimir Leuschner <wladimir.leuschner@qt.io>
(cherry picked from commit 6a46395614bf89a8b69fd2b7edb9503bd8f16ceb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
StablePosition was in some cases recording a wrong position, as it was
taking the framePosition and considering it to be the widget's
position. That erroneous position was then used to place the window,
resulting in a correct position but a wrong framePosition.
Wait and check for the window.geometry() and the
window.frameGeometry() to be different. If not the frame
has not been updated, or there is no frame when there
should be one. The test will most likely fail because
of this.
Fix flakiness on Opensuse 15
Pick-to: 6.8 6.5
Change-Id: I8e05ee7769de4efc2ac55ec7afbe366f76e325db
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 21ef8bed6d738551c1a322e78366d3c347a0e09e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Detailed docs were omitted before (and QTextMarkdownImporter::Feature is
not public) because
- "GitHub dialect" is a moving target (although we may have supported
all known features when it was introduced). We should reserve the
right to add to the feature set accordingly: so the numeric flags
can be expected to change.
- the writer mostly ignores the feature flags and writes back to
GitHub dialect; only the front matter can be omitted that way
- recognizing non-URL links seems fuzzy; md4c does it, so we allow that
feature, but if it goes wrong it would be an md4c bug
- hex flags look strange: in fact they come from
https://github.com/mity/md4c/blob/master/src/md4c.h#L306
If we assume that they might change, it would be better not to
document the numeric values in detail. But so far, md4c has never
removed any, only added a few (and we don't yet support all the
new ones).
Change-Id: I6552da1226bf7ad6242432c1d5d3df9ec8f61d6f
Reviewed-by: David Boddie <david.boddie@qt.io>
Reviewed-by: Tommi M. Tauriainen <tommi.m.tauriainen@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
(cherry picked from commit 280025fc7e97ad943ed2938f6434cadf94bd635f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Create a function `_qt_internal_set_source_file_generated` that sets the
source file property `GENERATED` along with Qt relevant properties:
- `SKIP_LINTING` if CMake>=3.27 and `QT_FEATURE_lint_generated_code`
Task-number: QTBUG-125077
Change-Id: I0ef5f7901f502366aaf2d020554c72e4845101b6
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit f654519c7bd142d5cc9f81e0c826dfd31956791d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Will be used by WebEngine configure checks to check if the
dependencies are met and show an according error message if not.
Pick-to: 6.8
Task-number: QTBUG-122899
Change-Id: I56d46fe5cf12051903d1aec893336be5ae8983a2
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 414b73075c537481280179ea78748dd2a6b45f9e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
When converting a json SPDX document to a tag/value SPDX document, we
need to make sure that the python dependencies are looked up.
After they are looked up, either error out or silently return
depending on whether the operation is required or not.
By default when _qt_internal_sbom_generate_tag_value_spdx_document is
called it is required to succeed and thus requires the python
dependencies to be present. A caller can opt out using the OPTIONAL
argument.
Pick-to: 6.8
Task-number: QTBUG-122899
Change-Id: Iccb68f900f4892a816360843dd87f9e469104bf7
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 8b6b17ae87abcdb2120255b490ce6fe03b0e2e08)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Improve wording when python or some dependency is missing, deduplicate
the strings and make sure to mention what is actually missing.
Pick-to: 6.8
Task-number: QTBUG-122899
Change-Id: I26af38f0330a5462c6001cae03c46284e742fbda
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit ad82afb05417e2b07a55a4520105b1f01a802487)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Upstream CMake has a nasty bug where AUTOGEN dependencies are
discarded if a library is added as a dependency more than once (or
rather the number of times it is added is not equal to the number of
configured build configs).
This can result in racy build failures, where a <module>_autogen
target is supposed to depend on some <other_module>_sync_headers
target, but doesn't, and thus moc generates empty metatypes files
because it can't find a synced header.
To avoid the AUTOGEN dependencies from being discarded, manually
add all dependencies passed to qt_internal_extend_target to the
AUTOGEN_TARGET_DEPENDS property.
The issue is fixed in CMake 4.0, so the workaround is gated on the
cmake version used. Add a flag called
QT_NO_AUTOGEN_DISCARDED_DEPENDENCIES_WORKAROUND to disable the
workaround, in case the fix gets reverted upstream.
Pick-to: 6.8 6.5
Fixes: QTBUG-133725
Change-Id: I857d7e774fc9f9f5203a58311daea5e7177e0d67
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit fcb20586316aff2ccc39e2ae840b79f8b0e904a7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
To ensure that when we find the interpreter, but not some python
dependency, we actually show the error about the dependency.
Pick-to: 6.8
Task-number: QTBUG-122899
Change-Id: Ib4f42e04f071f800d0f5bbe3700a1208e1017a19
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 46ee11a426292bc1538b5138501136b2dadc7173)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
New upstream version.
Importing note: 10.45 is missing a licence file for the sljit
dependency. This is tracked upstream at
https://github.com/PCRE2Project/pcre2/issues/686
so it may get fixed in 10.46 (in which case the import script /
qt_attribution.json may need to be amended).
[ChangeLog][Third-Party Code] PCRE2 was updated to version 10.45.
Pick-to: 6.8 6.5
Change-Id: Ifa0430782bed8ffb1c26f44ca6eb06cd26aaa1f9
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 3cb58b053c26603ba1d541b3c9c51ec25212ee80)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Don't call qEnvironmentVariableIsSet(), since it locks the environment
mutex. Since qgetenv() and qEnvironmentVariable() both report whether
the value was set (returning non-isNull()), we can avoid the extra
mutex lock (and envvar lookup) by just calling those and then checking
for isNull().
In qEnvironmentVariableOptionalReal(), in addition, use qgetenv()
instead of qEnvironmentVariable(). While on Windows, that may convert
encoding, QString::toDouble() first converts to Latin-1, and only then
converts to double, so we avoid one encoding conversion, even on
Windows; on Unix we avoid two.
Amends 4d1f13f3549a73f5ca4e64dac9137e83138080fa.
Pick-to: 6.8 6.5
Change-Id: I6803e2277b324c2568726765245681bcbf517362
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit 8669bc97ff6811bae304a8bb2a0e3af2bb78cfe0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit moves the third-party-libraries.html topic to the qmake
documentation. The topic is renamed and links to it are corrected.
See also: 623150
Task-number: QTBUG-132504
Change-Id: I711400d887b7e4894021b0433eb1cd61dfdd5349
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 1e7e0b0cacaae4fb0bb2b730dd6cdb34d7e93afe)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QMenuPrivate::mousePopupPos is a QPoint which gets set to
QGuiApplicationPrivate::lastCursorPosition, and only read from
QMenuPrivate::hasMouseMoved to determine if the mouse has moved enough.
When the last mouse position is not known, lastCursorPosition.toPoint()
returns {INT_MAX,INT_MAX} (see c5792dcfd631abb4f9e2b92cd6e88d7e5c373406
for the reasoning). This is extremely prone to overflows. In fact, one
was happening into QMenuPrivate::hasMouseMoved:
(mousePopupPos - globalPos).manhattanLength()
On the first mouse move the subtraction yields an enormous result which
overflows manhattanLength.
The solution is simple, make mousePopupPos so that these calculations
happen in fp coordinates. The length itself is only used as a threshold
against QApplication::startDragDistance, so its representation doesn't
actually matter.
Pick-to: 6.8
Change-Id: I9c8e30a637de120d086d6f7171725702c205da78
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: David Faure <david.faure@kdab.com>
(cherry picked from commit 7736823500fe8d97bc6d12ffb88001d34d1980bb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This was missed in 3e1a223318dbda50a010ba851841a9e51c80c42b
Task-number: QTBUG-127953
Pick-to: 6.8
Change-Id: I2ff6cafe852ec2696aea37e2e79e3c8b95c0e8ca
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit b8b6382b02457963fa5d0e67e069dc92e6d6c9d9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Similar to commit 12d4bf1ab52748cb84894f50d437064b439e0b7d, which was
for QLocale. Like it, QResource can be used very late in the execution,
like for example the logging system. For example (simplified):
#9 0x00007ffff759d497 in resourceMutex () at /io/qresource.cpp:188
#10 0x00007ffff759d615 in QResourcePrivate::load (this=0x41c940, file=...) at /io/qresource.cpp:333
#11 0x00007ffff759dc19 in QResourcePrivate::ensureInitialized (this=0x41c940) at /io/qresource.cpp:386
#14 0x00007ffff75011a9 in QLibrarySettings::load() at /global/qlibraryinfo.cpp:80
#22 0x00007ffff7501756 in havePaths () at /global/qlibraryinfo.cpp:149
#23 0x00007ffff75028e3 in QLibraryInfoPrivate::paths (p=QLibraryInfo::DataPath, usageMode=QLibraryInfoPrivate::RegularUsage) at /global/qlibraryinfo.cpp:613
#26 0x00007ffff758e4f0 in QLoggingRegistry::initializeRules () at /io/qloggingregistry.cpp:309
#34 0x00007ffff758f007 in QLoggingRegistry::instance () at io/qloggingregistry.cpp:424
#35 0x00007ffff758c50b in QLoggingCategory::init () at io/qloggingcategory.cpp:188
#43 0x00007ffff758c6bb in QLoggingCategory::defaultCategory () at io/qloggingcategory.cpp:317
#44 0x00007ffff750ff8e in qt_message_print (msgType=QtWarningMsg, context=..., message=...) at global/qlogging.cpp:2036
#45 0x00007ffff7509515 in qt_message(msgType=QtWarningMsg, context=..., msg=...) at global/qlogging.cpp:360
#46 0x00007ffff750a712 in QMessageLogger::warning (this=0x7fffffffd8b0, msg=...) at global/qlogging.cpp:600
#47 0x00007ffff790e083 in QThreadStorageData::finish (p=0x41b588) at thread/qthreadstorage.cpp:160
#50 0x00007ffff78ed423 in QThreadPrivate::finish (this=0x41b5e0) at thread/qthread_unix.cpp:404
#51 0x00007ffff78ec8ed in destroy_current_thread_data (p=0x41b520) at thread/qthread_unix.cpp:154
#52 0x00007ffff78ec9ec in Cleanup::~Cleanup () at thread/qthread_unix.cpp:204
Task-number: QTBUG-133206
Task-number: QTBUG-133500
Pick-to: 6.8
Change-Id: I7b653afb1b41ef3c1c9afffdaa93e6558740016b
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit ba18ae3869fd6703fbaad548d2421a82e7e675cc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Neater and more debuggable. This code was added in Qt 5.4, before we
could use C++11.
Pick-to: 6.8 6.5 6.2 5.15
Change-Id: Icd8acccb4a9ae1f500e7fffdc4d4fc7c310cbb89
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit b888bc09ce33a91800cb2119a52097897f3d62d1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This meant a string containing the octal form of INT_MIN (-020000000000)
would be just too long and getenv_s() would fail. This was never caught
because code that was meant to test different bases simply forgot to use
the base. Amends commit bb56586e32677ee9be23bffa4f3cc9a913ef192f.
I've renamed the rows to be the text being parsed, so it matches the
previous rows and it makes clear what was being parsed just by reading
the test's output. That also revealed a duplicate row to be removed.
[ChangeLog][QtCore][QtEnvironment] Fixed a bug that caused
qEnvironmentVariableIntValue() to fail to parse octal values from
-020000000000 to -010000000000 with MSVC. Other compilers were not
affected.
Pick-to: 6.8 6.5
Change-Id: I9095d86cccd9e8001e85fffd6fbbcd6a9a1678c3
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 83f2d1130aa49228a8a87547660791708735dd4b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This is what QDir::isRelativePath() does, for better or worse. We've
used QDir::isRelativePath() before and we shouldn't change the behavior.
Amends commit c74cba1117355a6312b1f0cc815efa4cdea4bbfa
Pick-to: 6.8
Change-Id: I03e3e921977af2b9c6ff2593535d846d6ce28fe2
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit dd2dc8c70d0227ff235a8c7feaca7d7c4ead9c63)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
That's not a valid type for the Standard's string, because the Standard
doesn't allow for std::char_traits<signed char> either.
Pick-to: 6.8
Fixes: QTBUG-133689
Change-Id: Icd0d4928fa4cdc9d806bfffd4053f0eb1073e6b4
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 0cc41083c30c1474a862a34b59a4f755d4c51640)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Nothing else calls it.
Drive-by initialize the two pointers via NSDMI.
Pick-to: 6.8
Change-Id: I8c51cf5126aeb8bd6254fffdd21a37526329bbf3
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit c7ec043e4643d4b18731fdf2efc14976a81e1809)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
[ChangeLog][QtGui][QDesktopServices] Fixed a bug that caused
QDesktopServices::openUrl() to discard a query when opening a local file
URL that contained a query but no fragment.
Pick-to: 6.8
Fixes: QTBUG-133663
Change-Id: Ie8fa190036417f590540fffdcf03e53f3c99b38f
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit aad0ab897f61bcb6ac9ba908afd1ee33e05fe4db)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
It's an internal class containing the common content between
QStringConverter and QTextCodec (Qt5CoreCompat) so the latter didn't get
the new API from the former.
This allows us to remove the QStringConverter::Flags qdoc hack too.
Change-Id: Iacf32fb88e3c3d0ea369fffd153356cec308e3dd
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit c2fa41a081e4c9fe308dcd47283537eedf05c24a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Otherwise we would traverse beyond bounds.
We calculate the delta in sizes between the haystack and the needle and
if this delta is smaller than the starting position
(the `from` argument) then we start from there.
The default value for `from` is size(). With the needle being longer
than the haystack, the delta is negative and we set our starting
position to be the delta, i.e. we start before the start of the
haystack.
[ChangeLog][QtCore][QByteArray/QByteArrayView] Fixed a bug in
lastIndexOf() that could lead to out-of-bounds access when the needle
is longer than the haystack.
Pick-to: 6.8 6.5 6.2 5.15
Change-Id: Id5cd772f00b0c3c50fbf61b4e888bba5587391ee
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit d25e5e2cb78a2e2f2a1791fed250421ce9eefc46)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Specifically on Windows we use COM, which requires being
de-initialized in the same thread as it was initialized.
Given that QNetworkInfo is a GLOBAL_STATIC with a qAddPostCondition
(iirc APPLICATION_STATIC was not yet implemented at the time) to
delete the backend when qApp is destructed, we need to cope with
destruction happening on the main thread.
If the backend is loaded on a secondary thread, the thread may
have shut down, or we may not otherwise be able to rely on
emitting Queued emissions to perform the destruction.
Conversely we also can't trivially move the construction to the
application thread (eg. using BlockingQueued emission during first load)
because we may cause a deadlock.
This leaves us with just documenting where the first load should happen.
Fixes: QTBUG-133644
Pick-to: 6.8 6.5
Change-Id: I7f52e884151c6c24acc34f1112faabc897d9b0f9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 6ad2918de4a300d11472edcafe62f07ae2f63cd8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QAnyStringView::fromArray() was not documented, leading to a broken
auto-link that referred to it.
Pick-to: 6.8
Change-Id: Ibf3704da8b3f16e56589bd649ce1e63a7cbd3739
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit f9334be98e4deb9e9a4a30f5f22e92b571670938)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
It appears that there are no longer relevant begin() and end() functions
to link to. constBegin() and constEnd() are the relevant alternatives.
Pick-to: 6.8
Change-Id: If6fc421ee08364de9a879fb704a7989046b9b43a
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
(cherry picked from commit c8e59d682cc2c6a5cbe124575bb54316af55bed1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Building Qt with e.g. a version 1.2.x Vulkan SDK and then running
on an implementation providing 1.3 or 1.4, one will likely get an
assert in debug builds upon initializing the memory allocator.
Work it around by restricting the apiVersion passed in based on the
preprocessor macros.
Pick-to: 6.8
Change-Id: Ia689ffc29d5675b84b6683e289d0725d7e47220b
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
(cherry picked from commit b6d4c1368d38242a8c677efc3144c10cfe363179)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The documentation claims that this is where the namespace and the macro
definitions live, and it's convention to have a Qt<Namespace> header for
Qt namespaces.
Pick-to: 6.8
Change-Id: Ia49001d61f0967df84344779909860cf65c3623c
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 6c61d7b0f804ae5c048af95abef4d41ecc8862df)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The applicationWillResignActive documentation describes that the app
should "use this method to pause ongoing tasks, disable timers, and
throttle down OpenGL ES frame rates". Similarly, the more modern
sceneWillResignActive describes that the app should "use this method
to quiet your interface and prepare it to stop interacting with the
user. Specifically, pause ongoing tasks, disable timers, and decrease
frame rates or stop updating your interface altogether."
In practice the application enters the inactive (as opposed to the
backgrounded) state when the user brings up the app switcher, or
enters split-view mode, as described by the "Adopting Multitasking
Enhancements on iPad" documentation.
We do propagate the inactive state as Qt::ApplicationInactive, but
it was up to the application itself to react to the state.
To adhere to the documented behavior, we now skip update request
delivery if the app is not active. Once it becomes active again
we re-try the update request delivery.
Relying on the exposed state of window was not an option, as the
window is still technically exposed, even if the app itself is
inactive.
This hopefully fixes a GPU crash observed (only) on A10 iPads
(iPad 7) with iOS 18, when the user entered split-view mode,
possibly due to changes in the system Metal-based OpenGL driver:
void IOGPUScheduler::signalHardwareError(eRestartRequest, int32_t)
void IOGPUScheduler::hardware_error_interrupt(IOInterruptEventSource *, int)
void IOGPUCommandQueue::retireCommandBuffer(IOGPUEventFence *)
Deny submissions/ignore app[openglwindow] with 2 GPURestarts in 31 submissions.
Execution of the command buffer was aborted due to an error during execution
Caused GPU Timeout Error (00000002:kIOGPUCommandBufferCallbackErrorTimeout)
GLDRendererMetal command buffer completion error
Error Domain=MTLCommandBufferErrorDomain Code=2
Execution of the command buffer was aborted due to an error during execution
Ignored (for causing prior/excessive GPU errors)
Terminating due to blacklisting by kernel driver
The back-trace always pointed to the display-link callback,
so the assumption is that the crash was triggered by the app
rendering when it shouldn't, during the split-view transition.
Fixes: QTBUG-132314
Pick-to: 6.8 6.5 5.15
Change-Id: Idf1f692daa9d437ee69f9436706777b220fbfbf4
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit c812190a921660c748be3324c3a34245b24354e9)
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
This is more efficient, because it maps to a single assembler
instruction on most ISAs, and also avoids a Coverity warning about the
loop not terminating and thus 1 << i overflowing, if type == {}.
The clone class, QSizePolicy, is not affected, since it already uses
qCountTrailingZeroBits().
Amends 6c322a917ad57d57f0ee76825eab3e2e008c5bd4.
Coverity-Id: 474336
Pick-to: 6.8 6.5
Change-Id: Idf62d045d8ac3f0cb15196dd8664ac37d92a9cc2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit d71379d447e87843c5a5d91857c4ff253ad4b847)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
std::slist doesn't seem to even exist on Google, while std::forward_list
exists in the standard since C++11.
Pick-to: 6.8
Change-Id: I9869c716fb631bc743e656a3b8bbb8ca35c9a1ed
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 9e5dae9b8c3d43cfd86719e429f35b032d14c66c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
That becomes an error. So only allow them in GCC-compatible compilers.
Fixes: QTBUG-133376
Change-Id: Idd04be795dd9fd2b43affffd08cd7b8a444bbc43
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 5da95322bd0ed7bfb94028582a82689124646dbd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
A few values have meaningful defaults, for the rest only warn about
implemented metric.
Pick-to: 6.8
Change-Id: I80c6c8dba6c8d2715daac0463a411bc5117f0bc0
Reviewed-by: David Faure <david.faure@kdab.com>
(cherry picked from commit da1fbf6053c07df76a4d2518103bdfc40d59cfa8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This is hot code, run early in the application's life, usually as a
result of the first qDebug() because QLoggingRegistry wants to find
qtlogging.ini. So let's not use QFileInfo, which allocates memory, just
to do string manipulation. These are always filesystem paths.
See commit d59e640c868f3db2d661970f3d34a22013d49053 for a similar change
in findConfiguration().
Pick-to: 6.8
Change-Id: I012daf4a3aa2ebc2c5abfffd2ef7ceac1df2626d
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit c74cba1117355a6312b1f0cc815efa4cdea4bbfa)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit adds a new parameter (--pre-test-adb-command) to
AndroidTestRunner. The new parameter allows to pass an extra adb command
which will be called by AndroidTestRunner after installation and before
running the test.
To set the mentioned argument the new parameter for qt_internal_add_test
was proposed: ANDROID_TESTRUNNER_PRE_TEST_ADB_COMMANDS.
The new parameter is needed especially for multimedia screen capture
tests. ScreenCapture feature needs an acceptation of Security Popup. It
can be automatically accepted with additional adb command.
Fixes: QTBUG-132249
Pick-to: 6.8
Change-Id: Ib70cd05d60d4594961ca68b554c7aae11cf42240
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit b4c82eba03388aa4f9e5b56f633e0e679a3b0123)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Commit 353ce5344fbde5a6cecbdd2c131e1cf0f4b7f383 made QMenu::exec()
return immediately (without showing the menu), which meant it never
emitted aboutToHide() and QToolButton didn't reset mouseButtonDown.
Therefore, on the next click on the toolbutton (maybe by then the
menu has actions), it won't even try to show it (because mouseButtonDown
is still true).
Pick-to: 6.8
Task-number: QTBUG-129108
Change-Id: I3f84b9a35eb444fc33d8516c4be130293c04017d
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit f0508b7ff3d2393521f49dcb1a9e880bf7665a87)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Previously we had complicated logic trying to differentiate between Qt
targets, system libraries, vendored libraries, custom sbom targets,
whether they are in external documents or not, when generating SBOM
dependencies for a target.
We also lacked the ability to handle regular non-Qt non-system
libraries. This was discovered while creating the SBOM for Qt Creator,
where the code treated all Creator helper libraries as system
libraries rather than just regular dependencies.
Simplify the code by unifying most of the code branches, removing
nested ifs, and removing special handling of some targets when
checking whether they are in external documents.
Now system libraries are marked at qt_find_package time by setting the
_qt_internal_sbom_is_system_library property on the target, rather
than trying to infer it base on the target name and other markers.
Now the logic goes as follows:
- check if system library based on the presence of the
_qt_internal_sbom_is_system_library property
- check if it's a vendored lib based on walking its libs and checking
if the _qt_module_is_3rdparty_library property is set
- mark system libraries as consumed
- if not a system library, handle it as a regular dependency, taking
into account if it's external or not
Also add some debug messages to help keep track of system libraries.
And remove some of the unnecessary code in
in _qt_internal_sbom_is_external_target_dependency and
_qt_internal_sbom_add_external_target_dependency.
Pick-to: 6.8
Task-number: QTBUG-122899
Change-Id: Ic43fe53446b74badee2cde6d18146e952587c292
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 66261ac0f1f2807916c80b2050536d52b8fe6d3a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Introduce a helper function to silence this lengthy warning, and use
it consistently in all places where the warning was triggered.
Amends 502a7706b94380d4957a7e594fc7c4c4db8ae81b which introduced the
warning.
Pick-to: 6.8 6.5
Change-Id: Ifa5c7e0182a12885af4db42ef5d68b1f27a0c6bc
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit a30289ee0be41e8311aef6d8737885b354a9f047)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The SBOM functions so far had a lot of Qt-specific logic inside them.
Decouple this logic into separate Qt-specific functions or explicitly
guard the code with Qt-specific handling options, to prepare for a
cleaner SBOM public API.
The generic functions then call the Qt-specific ones if various
internal options are set.
This approach is used, rather than directly passing values to the
generic functions because:
- we have cases where we need to recursively pass the values all the
way down to all recursively created attribution targets
- some of the logic needs to know about values before and after qt
processing, and this could be achieved with something like lambdas
but it's not worth the complexity
Pick-to: 6.8
Task-number: QTBUG-122899
Change-Id: I4399c41f4d976f20b16a0bb0c674d4f07ee1ccd4
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit f1ac316191c010b1389f6f3549c9f0b4424b9936)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This amends commit 353ce5344fbde5a6cecbdd2c131e1cf0f4b7f383 so that
the behavior doesn't depend on the widget style.
If QStyle::PM_MenuPanelWidth returns 2, then size will be (2x2),
which is hardly a valid menu to show - don't show that either.
Pick-to: 6.8
Task-number: QTBUG-129108
Change-Id: I2daa05932ea00971880747daeffdfa20a8be3f22
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 9dfd8410b07b0c484443ad6355004ace5f9b2b8b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
On some very rare cases the continuation could be executed twice in a
multithreaded scenario. Consider the following example:
auto f = QtConcurrent::run(someFunction);
f.then(someOtherFunction);
Assuming that QtConcurrent::run() is executed on Thread B, and the
continuation is attached in Thread A, the following call stack is
possible:
1. Thread B: someFunction() is finished
2. Thread B: QFutureInterface::reportFinished() is called
3. Thread B: QFutureInterfaceBase::reportFinished() is called and
finished.
4. Thread A: then() is called. It checks that the future is already
finished, so the attached continuation is executed
immediately.
5. Thread B: QFutureInterfaceBase::runContinuation() is executed.
At this point it sees that a continuation exists, and
executes it again.
Step 5 will lead to a crash, because we'll try to access a moved-from
QPromise.
To fix the issue, introduce a flag that is explicitly used to test if
the continuation was already executed or not.
The pre-existing code already uses a concept of a continuation state,
but it cannot be easily extended without convering it from an enum
to flags, because the canceled continuation should still be called
in order to actually execute the onCanceled() handler.
Wrapping QFIBP::ContinuationState into QFlags would increase its size
from 1 to 4 bytes, and manually treating the enum as flags will result
in a more complicated code. So, I simply picked the approach of adding
an explicit flag for this case.
Writing a unit-test is not really possible, but I verified that the
reproducer from the linked Jira ticket does not crash anymore.
Amends dfaca09e85a49d2983bb89893bfbe1ba4c19eab4 that introduced the
continuations, so picking to all active Qt 6 branches.
Fixes: QTBUG-118032
Pick-to: 6.8 6.5
Change-Id: I3e07722495e38367e8e4be2eded34140e22b0053
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 04b5d2b94f96c73a13973f6a57cefbf07d2e850b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
For build time sboms to be found in a no-prefix qt build of a repo,
specifically when finding external sbom documents, the build time
sboms have to be in the same location.
Previously they were in each repo's build dir.
Align the location to be in the qtbase build dir, just like for super
builds.
Also check for QT_BUILDING_QT because we don't want to apply the logic
for QT_WILL_INSTALL not being set in user projects.
Pick-to: 6.8
Task-number: QTBUG-122899
Change-Id: I04a066fc0efc91a4f2ee938c190b8632c8c946aa
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 3a5c62d4af9cb07fba065de8a2d1b97531b6fd30)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
It can happen that qt repo version bumps are direct pushed, and not
merged in DAG-dependency order. This can cause a mismatch between the
qttools package version and any of its dependencies, which would block
integrations. To avoid this, we disable the warning about incompatible
package versions when building the doc tools. The version check in
that case doesn't make sense, so it's safe to do.
Amends f7f02c791bcbee44597f1fe24570ebdf352ec648
Pick-to: 6.8
Task-number: QTBUG-128730
Change-Id: I6180ecb09c6a3dee415ae73c11549ee0f709f240
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Toni Saario <toni.saario@qt.io>
(cherry picked from commit a8f55f4729918700b9597843c98f9f2505ff0d23)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
tst_QGestureRecognizer::swipeGesture() is flaky as sometimes the
gesture event is being sent before the widget's position has
been updated.
The gesture starts in the window frame.
Set flag Qt::FramelessWindowFrame to prevent this from
happening.
Fix flakiness on Opensuse 15
Pick-to: 6.8
Change-Id: I794b022b5a51146ddfa7d6029509c6fa43b9aad6
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 6dc0e593939cbeaeb45392d8daf7fcd90e8cb0f8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QStringViews should be passed by value, not cref, so sane ABIs pass it
in registers instead of forcing the variable to the stack.
As a drive-by, s/QVector/QList/ in the return type.
Amends 51e2a64ed9360c8e889726c3fbaf649a4d260e0d.
Pick-to: 6.8 6.5
Change-Id: I6b51dfda87643f6c7ec219ac4a8970537bb6b2ed
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 8113a50d71cb9ea320e69c2b10452972e3310f4d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QT_CHAINLOAD_TOOLCHAIN_FILE might not be set, but
__qt_chainload_toolchain_file falls back to the value initially set
when building qtbase in per-module build scenario. Use the correct
variable(__qt_chainload_toolchain_file) when specifying
VCPKG_CHAINLOAD_TOOLCHAIN_FILE.
Pick-to: 6.8
Change-Id: I331c305a17172a1cc67a6ed8b43b2baa380abc0b
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit c65d6319f9379a724ddb4c0757245fe51c93fac5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
All iterations through QDomNodeListPrivate were going through the
forEachNode function with its own internal logic. The newly introduced
iterator works with the similar logic but is written a bit more compact.
Thus it makes sense to replace the forEachNode logic with internal
functions of the iterator.
Change-Id: I22b7ae7a49e2bfaf84bede2fe0b45530a32f8d55
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit b1c32afb914a8dda0b1b38bf9d85c1c316b27cf1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QAnyStringView is designed to replace overload sets containing QString
and QChar, among others, so it needs to accept types that merely
implicitly convert to QString and QChar. It achieves this by
maintaining a hidden container to hold the converted QString or QChar
for the duration of the full-expression, much like the compiler would
do if the function took QString/QChar.
This patch adds a check for the single-char ctors to determine whether
they convert or not, by comparing QASV::data() to the address of the
QASV's argument. While it would be interesting to have the same test
for QString, that is outside the scope of this patch.
Task-number: QTBUG-126054
Pick-to: 6.8 6.5 6.2
Change-Id: I30ac2d1199da5a03fe6fee4c9d5ea2a209a003d6
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit f31c37a1312fc4e21a58906e2b883099629fb9e1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
They added some new scripts.
There were a few changes to the line break algorithm,
most notably there is more rules that require more context than before.
While not major, there was some shuffling and additions to our
implementation to match the new rules.
IDNA test data now disallows the trailing dot/empty root label,
technically to be toggled off by an option that controls a few things,
but we don't have options. For test-data they changed the format a
little - "" is used to mean empty string, while a blank segment is
null/no string, update the parser to read this.
[ChangeLog][Third-Party Code] Updated the Unicode Character Database to
UCD revision 34/Unicode 16.
Fixes: QTBUG-132902
Task-number: QTBUG-132851
Pick-to: 6.8 6.5
Change-Id: I4569703659f6fd0f20943110a03301c1cf8cc1ed
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit 85899ff181984a1310cd1ad10cdb0824f1ca5118)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The titlebarAppearsTransparent property of NSWindow depends on whether
the window has a NSWindowStyleMaskTexturedBackground, so we need to
re-apply the window flags after updating the style mask to ensure we
pick up the updated value for titlebarAppearsTransparent.
Amends a1e6fed44964a3eb14045bf819d232d6cbad9f59.
Fixes: QTBUG-133525
Change-Id: Ifff594f54569ac43ad27917e5f4b2f8a3bae5901
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit bddc0198297828ba29e5cf4b39e07412a506a551)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
tst_QGestureRecognizer::panGesture() is flaky as sometimes the gesture
event is being sent before the frame and position has had time to
update. The event then starts in the frame and is not received by the
widget.
Set FramelessWindowHint flag to the widget, to remove the need of
updating its frame position and position.
Fix flakiness on Opensuse 15
Pick-to: 6.8 6.5
Change-Id: Id88510a91e3ed0d5ff92fdc31422503744448b3e
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit fc0e788d029beac251fda40650154fc6865e1649)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This fixes some read-past-end issues in assertions that verify the
next row of a table after the last for a specific locale belong to a
later locale. Since those assertions happen without sight of the table
of which the locale's range is a part, they can't tell when the
range's end is in fact the table's end - so they shouldn't have been
reading from a row there. Fix by putting a row there, that belongs to
a nominal locale with index out of range.
Change-Id: Ib9d227ca4f86c372c13f963a08a8d637eae63ed0
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit b37c580169890d5ccacb5746eb4b99dd711efda4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
It no longer inherits QHash, so drop the references to this.
And remove an extra 'and'.
Pick-to: 6.8
Change-Id: I5c19f7793571fe04f93e0ede37d280d215d95dfc
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit dc8055c9149c0ceb42b4313fb7af0a5b78fe1c16)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
ReadOnly was used in places where ReadWrite was the correct value.
Pick-to: 6.8
Change-Id: I26a2f0de55665ac015fe269e8e5f0d23a2f00e5f
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 4dcff4ed6d24e6aa061e145bb9de9ff93351a2b1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
After the commit 28df9a49776a88cb1a8e69348ae19a59b16a5b7e, a regression
occurred in the positioning of cursorHandle and EditPopup.
Previously, these positions were calculated using QtEditText
coordinates, which worked correctly because the QtEditText size matched
the QtWindow size. However, after the mentioned commit, the QtEditText
size no longer reflects the window size. In this case, we need to use
the parent View for calculations.
This adjustment was already made for the single cursorHandle.
This commit also updates the positioning of selection handles and the EditPopup.
Fixes: QTBUG-132589
Pick-to: 6.8
Change-Id: I861292e363452d487284e3f603fe03a21a334aa4
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 5bd26fda7a3f0a509a64847b58b916830ebc2d0c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The new (6.9) iterator for QDomNodeList was implemented as random access
iterator. The underlying structure of QDomNodeList is similar to a
linked list and therefore it is better suited for bidirectional
iterator.
This patch changes the iterator to a bidirectional iterator. Further the
tests are expanded because the new implementation uses more custom code.
Fixes: QTBUG-132527
Change-Id: I796f445e0b883abc2aea613f1fed6f17c4d93dcd
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 8609982791928a30a6d836b25810143a064f8c6f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Having the input field length too wide causes the view to scroll
to contain it. Since it is not visible, setting it to 1px width and
height should work.
Further, input field contents where set on the showInputPanel
call. At this point in time we do not necessarily have an updated
focus object. Hence the input contents is now set on the
setFocusObject call.
Ignore input on showInputPanel/hideInputPanel. This reflects
the current design where showInputPanel do not act unless
inputMethodAccepted(), and hideInputPanel do not act if
m_focusObject.
Still hideInputPanel used to set m_usingTextInput to false,
this behavior is not kept.
Fixes: QTBUG-132057
Pick-to: 6.8
Change-Id: I2d7088def8060df267c5da9e045824decd913faa
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
(cherry picked from commit 7dd94d74e4497647ff62c85460643487baf372bc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
On 150% DPI scaling, the Radio/Checkbox indicators were clipped. This
patch adds an extra margin to the left to avoid this clipping.
Fixes: QTBUG-133117
Pick-to: 6.8
Change-Id: I2e0186cbdad12481922de5ddf00f50daeb94bb37
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
(cherry picked from commit 3d45d22b536cd5fa074f6de4d02b1fd049e6b220)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
It's not just with tesselation we're using these buffers, but also for
multiview, which meant we'd continuously grow the pool until we run
out resources when multiview was enabled. Interesting observation
from this is that newBufferWithLength would 'hang' instead of
returning erroneously unable to acquire a new buffer.
Change-Id: Ie30ca44bc7b4b8f29c517fe6c88fafbe46be3d17
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
(cherry picked from commit 3c81c8907633fbc154ec4ae3a89e8d86c9ca0832)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
It was using int for two flag columns; we can pass the relevant flag
types now, and we get better type-checking by doing so. Expand the
integral numeric column from int to qlonglong, since that's the type
we actually end up with by the time we're asking QLocale to do our
formatting for us. Add test-cases for things we've lately noticed
aren't right, notably including the min-qlonglong test (which passes
because compilers handle the UB straightforwardly), that needed the
integral numeric column's expansion. Sign-handling for negative values
in hex fails; a later commit shall fix and remove the QEXPECT_FAIL().
Pick-to: 6.8 6.5 5.15
Task-number: QTBUG-133269
Change-Id: I39c5339b144b40a30886d8253fa464828ed87629
Reviewed-by: Mate Barany <mate.barany@qt.io>
(cherry picked from commit 5a230596c8c1f63e662ce17e094e2ae187066d6d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
tst_QGestureRecognizer::panGesture() is flaky as sometimes
the gesture event is being sent outside of the parent. It
is being sent in the window frame instead of in the widget.
Fix position of the parent and verify that it is correct.
Fix flakiness on Opensuse 15
Pick-to: 6.8
Change-Id: I00eacb80a7e2e658345d3bc56cdef0c0024d1a1d
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 3766b9cb3cb49fdef626526181b6a7fe26870e29)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The format of the Xcode preferences has changed, so we need to account
for the new format when looking up the default development team.
Pick-to: 6.8 6.5
Change-Id: Ib34c2e5245c13db4d81218a5a2460417e4fc6347
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 469e4237cf32d27609661132727555490086750b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The format of the Xcode preferences has changed, so we need to account
for the new format when looking up the default development team.
The account identifier (previously an email address) was not used by
any consumers of the provisioningTeams() function, so it was left out.
Pick-to: 6.8 6.5
Change-Id: I81a400000615594336e14c95db86ffa71a5c5ff9
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 380a9fdc872e14e537f3e148c7a1e72be5face2d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
As well as the _qt_internal_apple_development_team_id_computed
property.
It's used for macOS as well, so use `apple` infix instead of `ios`.
Pick-to: 6.8 6.5
Change-Id: I7932166d094a14ac32cce95e6c9fcbfa44bb97b4
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit d688c73e083cecc9b9478f09b202b66b92c87e4d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This is a first step for adding QT_NO_INTEGRAL_STRINGS in the next
commit.
Mark setUtf16(const ushort *) as obsolete.
Use the weak overload workaround, so that the call isn't ambiguous if
it's called on a nullptr.
[ChangeLog][QtCore][QString] Added setUtf16(const char16_t *) and
setUnicode(const char16_t *) overloads.
Task-number: QTBUG-125871
Change-Id: I25d12c19876466c235c0d9928aae6fd332836bf5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit be3bf632e1cf80b16475f8353e4753b38317626b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Insert line breaks in the content the \tab macro expands to. This
produces nicer-looking html and also fixes an issue related to
the post-processing done to the generated files.
Fixes: QTWEBSITE-1202
Pick-to: 6.8
Change-Id: If4e7f7242f8687ef84ad715744653c4167cf907f
Reviewed-by: Andreas Eliasson <andreas.eliasson@qt.io>
(cherry picked from commit 88e4e952d73db9bc442593a96c88ca22ba7ab673)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
When UUID definitions are placed within Qt namespace MinGW build fails because specializations of struct __mingw_uuidof_s are now defined in a different namespace.
Fixes: QTBUG-133516
Pick-to: 6.8 6.5
Change-Id: I49270aa2a892d407675dab7b90d3929d120c5224
Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io>
(cherry picked from commit 84b7cef13913139b2ed7e506ace0fa6b97269829)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
In preparation of changing the random access iterator to a
bidirectional iterator, the tests are extended to ensure complete
test coverage.
Task-number: QTBUG-132527
Change-Id: I8caf93417282631f7982cb12a82b39c00d67c913
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit e4bcd9f1cb0e787c9353589ea48dca6823592d41)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Amends 73405890b8911dd1a58120665ce63a38281c6ce4. The patch here
does the same for D3D12 as that previous one did for the Vulkan
backend.
Others, like D3D11, are not effected because the loop logic there
does not branch.
Pick-to: 6.8
Fixes: QTBUG-133405
Change-Id: I88ac7c841dc0c28fc3f6b37c3402315b52de0a66
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
(cherry picked from commit 68e48ac60a9681887999e31f6dff622eb81bdb7d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
We were accidentally closing it along with all the other file
descriptors if the CloseFileDescriptors flag was active. That meant we
were unable to report start problems back to the parent process.
So instead of closing everything immediately, we simply mark everything
as FD_CLOEXEC so they'll be closed by execve()'s success. Because we're
using CLOSE_RANGE_CLOEXEC now to detect the system call, we don't need
the configure-time test.
[ChangeLog][QtCore][QProcess] Fixed a bug that caused QProcess not to
report start failures if the UnixProcessFlag::CloseFileDescriptors flag
was active.
Pick-to: 6.8
Change-Id: I4d81d763281354e886d9fffd56ef6ab8b6115715
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
(cherry picked from commit 3d007ff2e9caf328f92d65f71a94fd869552b1b6)
bf805455d40b4445f61321439d529cd85cb6bc65 deprecated the QString()
operator in Qt5. Later dccf28b7c344822b7459635099ebe3abdf5fd107 and
2eee9e6fcf9b70681c5d9202d1509d176e48fc31 attempted to remove it
entirely, but a reference to it still remained.
This change also removes the detailed documentation for toString() in
the same paragraph, which previously stated that it generates strings
for use in menus. However, this is not always the case due to
toString(QKeySequence::PortableText). The differences between the two
serialization methods are already well-documented in the toString()
documentation.
Change-Id: I42dbb353bc56354f37b8fc22170f8e588eb97176
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit f06dd091696fed5b47a1bb071a8d5c28abb5c8a2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
When rendering hinted text on Windows with DirectWrite, the goal was
to keep the rendering and metrics as close to GDI as possible,
minimizing the impact of changing the default font backend.
Therefore, the DWRITE_RENDERING_MODE_GDI_CLASSIC was always preferred
when hinting was on.
However, DWRITE_RENDERING_MODE_GDI_CLASSIC only applies antialiasing
in the horizontal direction, but GDI applies vertical antialiasing
as well. The result is that text will look more aliased with
DirectWrite than it did with GDI, which arguably looks ugly
especially at large sizes and can be perceived as a regression.
Microsoft documentation recommends using symmetric antialiasing
when the pixel size exceeds 16, so this patch enables
DWRITE_RENDERING_MODE_NATURAL_SYMMETRIC for fonts larger than
16px regardless of whether hinting is on.
It's worth noting that for fonts with heavy hinting, such as
Times New Roman, the rendering using
DWRITE_RENDERING_MODE_NATURAL_SYMMETRIC is different from
GDI, although more similar to Freetype. However, the impact
of not having vertical antialiasing is worse and as native apps
are moving towards using DirectWrite, the GDI rendering is not
going to be the definition of a "native" look anymore.
A second thing to note in this patch is that we always pass in false
for the useGdiNatural argument in GetGdiCompatibleGlyphMetrics().
According to the documentation, we should be passing in true for text
rendered with CLEARTYPE_NATURAL_QUALITY. However, doing this causes
wider kerning in certain cases. Since the tighter kerning matches
the layouts we get in native apps, as well as when using Freetype,
I've chosen to pass false for now, to be consistent.
This change also adds a manual test which can be used to switch
between DirectWrite, GDI and Freetype rendering on Windows, so
that it's easy to compare.
[ChangeLog][Windows] Improved hinted text rendering at font sizes
larger than 16px.
Pick-to: 6.8
Fixes: QTBUG-131946
Change-Id: Iebbe5c7affe7df6266ade6b161c31bde3d2caa84
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit 407a98d94fb05780f30e77463fb2bd535041a044)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
memcpy() takes void*, not char*, so the cast from QChar* to char* is
not necessary (and potentially harmful).
Amends the start of the public history.
Pick-to: 6.8 6.5
Change-Id: I7b7178290bd30d93ed9e64b6b84294d0f7576c80
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 7206f6a39d298ed9c94bccf7bdc57498fa73ac36)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The test is flaky every now and then on the CI, so increase the timeout from
5s to 20s (a previous TRY_VERIFY precheck reported just shy of 10s waiting
time, doubling should be™ sufficient).
Amends the start of the public history.
Pick-to: 6.8 6.5 6.2 5.15
Change-Id: I8e64bf8ac1576c0ac71790a03936635016b3b2b7
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 40e65f029341a01e16dc88871eb7b24979aea9bf)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This allows Qt Quick items to react to the QContextMenuEvent, rather
than immediately showing a native edit menu.
Task-number: QTBUG-35598
Change-Id: Id8f492b549431a42aa26f2d72b418301d2cab3dd
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit e426737d73bdda1b936e52179b08108250907e03)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This is from one of the 90s books on C++ Coding Style:
Destructors of (public) base classes should be either public and
virtual or else protected and non-virtual.
The dtors of the various QFlags helper classes were public and
non-virtual, allowing slicing and use outside of QFlags.
Fix both following the rule and making the dtors protected.
Previously, this would have been enough, but Clang started to warn
about undeclared copy- and move-SMFs in the presence of a user-declared
dtor, so need to declare all five.
Found in API-review.
Change-Id: I70d1163f7bb42d981bf550418d2775a784bd416e
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit f080f161237e3310fca0955742218276069e4868)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
... because it is not really related to IO.
We were choosing between serialization and text, and ended up with
text, because that's where the standard itself puts format [0].
[0]: https://eel.is/c++draft/format.functions
Amends ffac33964d51971a1c1f61308b6f0a60a4133296.
Found in Qt 6.9 API review.
Change-Id: I827322175da81bc027a9e136098b7e84677f43f7
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 584ac8185255da9b15360bf0ca50677cba46ac9f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
... and add more specific #errors.
There are two distinct error cases here:
- First, someone could add more Q_STL_ macros to qstdlibdetection.h,
so like a switch with -Wswitch, list them all here and #error out if
there's a Q_STL_ we haven't yet seen. The audience here is Qt
developers, via the CI.
- Second, one of the "non-major" libraries (ie. not libc++, libstdc++
or MS-STL) add support for C++20, specifically the std::ordering
types as announced by __cpp_lib_three_way_comparison, in which case
we need to retroactively add the correct unordered value here. The
audience here is both Qt developers, via CI, but also Qt users.
So separate the two error conditions.
Also, for platforms where we don't know the numeric value of
std::partial_ordering::unordered, use Qt's legacy value, for
potentially faster conversions to/from QPartialOrdering. There's no
point in guessing which value _might_ be used by a future STL, and
swapping STLs is _always_ BiC, so we don't need to guess which STL
will follow the Dinkumware ones on QNX and VxWorks.
Amends 0231f33ad121a85368bb3f43273973b9632735dc.
Change-Id: I1d06a18ca5bb26aceb7c76a0f035ecd8d4673547
Reviewed-by: Michał Łoś <michal.los@siili.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 1a74f77f57fff52e0166dd895a8c6d9e09b388a4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Fixes clicking UI elements with a mouse on Android.
8d8cbe87e21f05b7d611ed4be47299977288b267 introduced changes to support
mouse buttons other than Qt::LeftButton, but the release always looked
like no buttons changed, nor were they tracked (m_buttons is always
Qt::NoButton). Qt was not notified of mouse up, so nothing was clickable.
Now all mouse events go through sendMouseButtonEvents, and the last seen
button state is tracked for every event. If a mouse up with no buttons
occurs, the last seen set of buttons is used instead, so Qt correctly
handles the event. Also adds the mouse button state information to
mouse move events from Android, so the workaround for delivering
Qt::LeftButton when a window is tracking a move while a button is
pressed has been removed.
Tested on a Samsung A1 with a Bluetooth mouse.
Fixes: QTBUG-132700
Fixes: QTBUG-130297
Pick-to: 6.8
Change-Id: I241282c2915d7e6cf99db7f0bc1ad2d541349077
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit d908e043984dcfed3aa80e30cd1cafacd13b644d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Like QGuiApplication does as well. Also add a note that screen and
window DPR can be different.
Pick-to: 6.8
Change-Id: I1a24cf7f11e945187da9dce4421039350e811997
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 97049278443860d3dd1b1efd20d1f7dabaf72a35)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The various base classes that abstract away template-independent parts
of QVLA have protected destructors to prevent slicing. Re-add the
special 5 (using the macro) and a defaulted default constructor.
Pick-to: 6.8 6.5
Change-Id: I60f036eafc808862a1abee72fd53023dd99b4cc3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit c10072895d1061e258d23f3cc2a9050de5236a46)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Application developers using Qt from their distribution, or from the
official installer, get a release-mode Qt build, where QT_DEBUG wasn't
defined. That's no reason to hit the issue that a breakpoint in
code that gets hit when opening a popup menu should lead to a complete
desktop freeze due to the mouse/keyboard grab.
Change-Id: Idf0df03ce5afb792261b62cabb06fab17b5e2952
Reviewed-by: Liang Qi <liang.qi@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
(cherry picked from commit a176f87a6451412a632866fda1fd79290b9d7520)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
If a class honors the RO0 we usually just leave a comment in the class'
body, and don't explicitly redeclare any of the RO5 special member
functions.
In some cases we may need to redeclare (some of) them. The main use-case
so far is to declare a protected destructor for a base class that is
not polymorphic, in order to prevent slicing; the compiler-provided
destructor is always public.
We can easily declare and default such a protected destructor, but that
comes with the problem that now we're violating the RO5 (as far as C++
is concerned, declaring a SMF counts towards the RO5, even if it's
immediately defaulted).
Specifically: by declaring the destructor, the class loses the
compiler-generated move operations, and the copy operations are
generated but deprecated. Clang >= 18 warns about this.
In such a scenario we *must* redeclare all five SMFs... and default them
all. This is boilerplate, therefore I'm adding a macro to streamline it.
Apply the new macro to a couple of cases were manual refactoring has
already been done.
Pick-to: 6.8 6.5
Change-Id: I5dc0ff9770621fbec0b1057c164d0623f901e3e9
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit fcb57391f73d36914e10ba964dbd9b01fe6f3af2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
- There is no load() in Q*Atomic (unlike std::atomic), so link to
loadAcquire()/loadRelaxed(), depending on context.
- Also remove the template argument, <T>, which prevents qdoc linking.
Amends b62c3a85452aecf4f6c863645db34857b05d5ebf and
329e09a3c303fad1ab001de74924288aae1e7a9d.
Pick-to: 6.8 6.5 6.2 5.15
Change-Id: I8c58674ffc7e779fee982555edcd45ed40d4c17d
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 9854482835071993968a524878b601c1d9327f1e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The selection of which set to iterate over and which one to remove
from based on their relative size violates the function's
documentation, which clearly states that items are removed from *this,
and not from `other`, so the result must never contain any elements
from `other`.
Amends 4f2c96eaa8bfa4d8a6dfb92096e4e4030d0cdea7. Instead of reverting
to the gruesome old code with the forced detach-just-to-remove copies,
distinguish four cases:
- if the two sets are shallow copies of each other, then their
intersection is *this
- otherwise, if either set is empty, clear() *this. This is required
for one of the tests that 29017f1395b1bc52e60760fa58c92f6fa4ee4f60
added to succeed.
- otherwise, if *this is detached, perform the operation in-place,
using removeIf()
- otherwise, create a new set and move-assign to *this to avoid
detaching just to remove something again. In this case, we can
continue to iterate over the smaller set, but we need to keep
picking elements from LHS into the result.
[ChangeLog][QtCore][QSet] Fixed a regression (introduced for Qt 5.2)
in intersect() that caused equivalent elements of `*this` to be
overwritten by elements of `other` if `other.size()` was larger than
`this->size()`.
Not picking to 5.15, as users will have likely adjusted their code to
the buggy behavior, and because removeIf() isn't available there.
Pick-to: 6.8 6.5
Fixes: QTBUG-132536
Task-number: QTBUG-106179
Change-Id: Idfa17c3b3589c4eacec27259fc01df6aeaa6c45f
Reviewed-by: Øystein Heskestad <oystein.heskestad@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 162015e9c6f469951d9212ef655cff16dcace071)
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
This reverts commit 92acc94fa98d19929d28feb5d543acf8c50c2290.
The change broke QSet ordering guarantees: The documentation clearly
states that each item from `other` that isn't already in `*this` is
inserted ("STL insertion behavior"). Swapping *this and other breaks
this.
Independent of STL vs. Qt insertion behavior, making the picking of
elements from containers "random" in the sense that the size of the
container is now important, and not merely LHS vs. RHS, is a bad idea.
[ChangeLog][QtCore][QSet] Fixed a regression in unite() that caused
equivalent elements of `*this` to be overwritten by elements of
`other` if `other.size()` was larger than `this->size()`.
Pick-to: 6.8
Fixes: QTBUG-132500
Change-Id: Ia636b62325139d618b5467a643ff710716324296
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit 2d1b3028673493cb144060cbec49b1b95f4188d2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
In Qt versions 5.0..6.7, at least, this used to be the implemented
behavior for unite(). For intersect(), it was implemented up to and
excl. 5.2. Even the documentation states as much:
intersect(): Removes all items from _this set_ that are not
contained in the other set.
unite(): Each item in the other set that isn't already in this set
is inserted into this set.
Add checks that the functions behave as documented (hint: they no
longer do, since 6.8 (unite()) and 5.2 (intersect()), resp.), this
being the only correct way to implement these functions (items in
sets may be equivalent, but not identical; it is important that the
set operations work in a manner consistent with insert(), to meet
user's expectation of how these functions work (unite() just
inserts() the rhs, intersect() removes if !rhs.contains). Note that
QSet, unlike other Qt associative containers, actually has STL-style
insertion behavior (insert() doesn't overwrite).
subtract() is the only one that's still true to its docs. A test for
this function will be added in a follow-up commit - eventually.
In anticipation of adding rvalue-other overloads of at least
unite(), add a test with that, too.
Pick-to: 6.8 6.5 6.2 5.15
Task-number: QTBUG-132500
Task-number: QTBUG-132536
Change-Id: Id309ab5192e6d1c9bbeef496cbd7116d306eaae8
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit 0d4fd5c545b47966c56ed0b9eb9b5c0a8f75c02a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The original patch that added this feature was disabling the core dumps
unconditionally. I guess the check was simply forgotten.
Amends 9df6e8ad3b3a7a57af87e6a3fef2ef793610cb3d.
Found in Qt 6.9 API review.
Change-Id: If3f9cb35d11a0262241a465626a25f6d7d2bbdb4
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 9860f6522919d154dd4f95ff6f6ae58d3e4c435e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
It usage of libc++ was never detected if the compiler was explicitly set
to a specific clang binary and clang wrapper.
Change-Id: I5fd3c84223cafedf06b34afe91d975e71c199e24
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 982fe396e5908a6f1089ba577ed6220d90eaaa95)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Fixing warnings/errors about QFile::open() return value not being
checked, and print the name of the file and the error message that
occurred.
Task-number: QTBUG-132902
Change-Id: I099b300b5fd4563334fa547ffa365ec3f68e08cf
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit e99d5c6268862e5773056a008c273e18bf5b4ef7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
We look it up with a binary search, so it needs to be sorted.
Pick-to: 6.8 6.5
Change-Id: I0aa25e6ff9722372c0a09f2dce9f9c839fedf00e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 382a7d006b52faa08b84e56d97cc6c216925a43e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
On MSVC the values stored end up as negative.
Task-number: QTBUG-132902
Pick-to: 6.8 6.5
Change-Id: I963c57c34479041911c1364a1100d04998bdfaed
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 62685375a2d71fa34015faac76f03e709e4217c7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Use QPainter::setPen(QColor) and QPainter::setBrush(QColor) overload
instead creating a temporary QPen/QBrush to gain advantaged of the newly
introduced QPen and QBrush assignment functions from
ab53500cfa11b988e7e4234583fa6eb5027b4c08
Change-Id: I3b8c4f7d669a08558cf6abcc77c23a4fdda99c02
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 82a5e8bdb788179d1323e76b725d57efaab0b217)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
On Windows, using a URL of "file:///c:/" as a base to be resolved with
"../" should not result in the Windows drive being removed.
[ChangeLog][QtCore][QUrl] Fixed a bug (regression from 6.7) where
resolving a base URL of an absolute file path containing a Windows drive
could result in said drive being removed (e.g., resolving "file:///c:/"
with "../" would result in "file:///").
Fixes: QTBUG-133402
Pick-to: 6.8
Change-Id: I58286b9c5e5d02363f0efffdb06f983b560340df
Reviewed-by: David Faure <david.faure@kdab.com>
(cherry picked from commit 340c9d88ab353e201f117d64609fa5f7d2fa2b21)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
We set it when manipulating full URLs. If you're creating them from
parts, you may end up with one without a host. We will still fix that up
in QUrl::toString() ("manipulates full URL").
This allows the path normalization code to avoid accidentally creating a
URL with no host/authority and with a path that starts with double
slash.
[ChangeLog][QtCore][QUrl] Fixed a bug (regression from 6.7) where
QUrl::resolved() could create invalid URLs when the relative URI being
resolved contained a path with double slashes (e.g., combining
"scheme:a" with "..//b.txt")
Pick-to: 6.8
Fixes: QTBUG-133403
Change-Id: I3fe9d5fbd2efcaa66d66fffdc010e5a84066b641
Reviewed-by: David Faure <david.faure@kdab.com>
(cherry picked from commit 7d05f5ed7d3472028e28a09eeda175bb1b1eeb00)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Definitely a compiler bug because it passes for everything we threw at
the compiler in the CI but fails for a user. At least the workaround is
simple.
Fixes: QTBUG-133032
Pick-to: 6.8
Change-Id: Ie84590c466cf1d6f01bbfffd3ca1d6c262d77200
Reviewed-by: Irfan Omair <irfan.omair@gmail.com>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 0a5b37b706ee72c7d9042efcde244aa93a5ce9a5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
To prevent colored glyphs (like emoji) from being cut off at the edges,
we can simply apply the solution from bbba71748438dc05d344bb9727f10b7f55a5d229
to colored glyphs as well (i.e. to glyphs with QFontEngine::Format_ARGB format).
Fixes: QTBUG-133297
Pick-to: 6.8
Change-Id: I5578e2d12f956d0635b662b3ecf714aa63474945
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
(cherry picked from commit 7cc0ea0b5a1dc1d9e1a9a8cc8639958e42adba3a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Added the link to the qtcore-toc.
Task-number: QTBUG-130085
Change-Id: I765e01aeda0bce694157bf15ff5a036f239168f5
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 43cb7f93a4da2d57513acb3c4cbdd56c1eaf188f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
I've been meaning to add this since at least 2012 (cf. commit message
of 9180d9aa8bfb9e9f66fad13f194398a98698eb77), this is as good a time
as any.
Detection taken from qcompare.h, except for
- libstdc++: using version macro instead of date one
- Dinkumware, which is taken from the above-mentioned commit (adjusted
for the LIBCPP->CPPLIB typo),
- STLport/SGI, which are taken from stlport's _stlport_version.h,
- RogueWave, which is taken from Apache stdcxx's rw/_config.h, a fork
of RogueWave, contributed to Apache by RogueWave themselves.
It looks like not all STLs provide a version macro, and those that do
vary a lot in granularity, so for the time being, just define these
macros to nothing and not to some form of version.
[ChangeLog][QtCore] Added Q_STL_ macros for stdlib detection (libc++,
libstdc++, MSSTL, Dinkumware, STLport, SGI, RogueWave). If your STL is
lacking, please file a bug report. Note that these macros are not
considered public API just yet.
Picking to all active branches, since not picking is more risky (code
that assumed these macros existed in older branches could silently
change behavior if they don't).
Fixes: QTBUG-132908
Fixes: QTBUG-132909
Pick-to: 6.8 6.5 6.2 5.15
Change-Id: I8f956d131292483b7727f11f69b460b12a06b583
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit b6f825a857d0d2266ea89879f26703f86ddf669a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The replacement is new in 6.9, so the deprecation should be done in a
later Qt release.
Amends 90fe9874d22f0c4b809a3e493766ef852c72cc39.
Found in Qt 6.9 API review.
Change-Id: If68685f98928015163cd4aa0e65fed2c6578e429
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit b0364bc2633f322630028a13fe1143e222015cd1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Amends commit 19b7f854a274812d9c95fc7aaf134a12530c105f, which removed
the __PIE__ check because of the GCC version check that was alongside.
GCC and Clang define both __PIE__ and __PIC__ for -fPIE, so checking for
__PIC__'s presence isn't enough.
Drive-by amend the no-PIC #error message to also suggest
-DFEATURE_no_direct_extern_access=ON, which is more modern and produces
better code for executables too. Because of that, I've also changed the
reduce_relocations option to the CMake one, as there is no configure-
style equivalent for the modern option.
Pick-to: 6.8 6.5
Fixes: QTBUG-133101
Change-Id: I957b264eaee360fd964afffd60617964b26fe934
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 014e77801fa4b99cdb03330ccce1e212ac13a0af)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
When "address" is a QBAV, it points to line(QBAV) which points to
lineArray(QBA), so its data will be overwitten after every read:
while(file.readLineInto(&lineArray))
This amends f0aa391ef89a393221d77d5ad3c1616a4727f11a .
Fixes: QTBUG-133445
Change-Id: Id23e726327529c44e205c4c0720af0dad42c175b
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Liang Qi <liang.qi@qt.io>
(cherry picked from commit 07eeb45d881bb0240e472167217912b08be44371)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The NSFontPanel emits changeFont even when not the active window, and
applications are expected to update their views accordingly.
As the changeFont action message is sent through the responder chain we
were only picking up the changes when the font panel was active, thanks
to the NSWindow delegate we were installing on the panel.
But when the active window is one of our other windows, we were failing
to process the changeFont message in our QNSView.
We now handle the message by forwarding it to the font dialog delegate,
so that we enter the same code path as before, and emit the right
signals for QFontDialog and friends.
Pick-to: 6.8
Change-Id: I97427c73fe46f129ca11afa6b2c222bf0f0fb0af
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit 3d42f31243ce52e517e09843b93f40b79925652f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QSqlQuery has been made movable in Qt 6.2
(14f9f00fdb2dc428610c08e3d9d03e38e9602166). The pre-existing copy
operations have been deprecated, but not removed, in order to preserve
SC/BC.
This left us with two issues:
1) Whether or not to keep the deprecated copies in Qt 7. The answer is
no: the copy operations are impossible to implement in a way consistent
with value semantics (the state of the DB driver can't be copied in
general). Therefore, mark the related APIs as to-be-removed, and not
just deprecated.
2) While we no longer copy QSqlQuery from Qt code directly, QMetaType
still detects the presence of the copy constructor and extracts it,
triggering the deprecation warning.
Rather than unconditionally suppressing the warning (which will hide any
similar issue we might have in the future), add a local workaround that
raises a runtime warning if QSqlQuery is copied through QMetaType, while
not raising the deprecation warning when building Qt itself.
[ChangeLog][QtSql][QSqlQuery] Copying a QSqlQuery object via QMetaType
now raises a runtime warning. Note that copy operations for QSqlQuery
objects have already been deprecated since Qt 6.2, and are planned to be
removed in Qt 7.
Fixes: QTBUG-132752
Task-number: QTBUG-91766
Change-Id: I48714ad53ec706a5e4e055c45a1c05f372382940
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit f744cef06cf3a56591782f487c545b55b2a673fb)
Following qtbase/1c8884fc277c5916a420a3c14de68547a391f9fc's making
syncqt error out when an installable header contains #pragma once, we
can now flip the coin and use #pragma once as a static assertion that
the given header is not going to be installed, making it easier to
understand which headers are "public", which ones are "private" and
which ones are "neither, since never installed".
Do this for the XCB platform support files.
In qxcbglintegration.h, the header guard was actually broken (had only
#ifndef and #endif, was missing the actual #define).
As a drive-by, normalize vertical whitespace.
Pick-to: 6.8 6.5
Change-Id: Iede0605c38cda7606edfc7155bd8bfc95990c5bc
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 91f9ba2993a2652bcb349ce639aff67b5bfc8938)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Go straight for QResource, because this is run very early in Qt's
initialization, usually as a result of some debug message, via
QLoggingRegistry::initializeRules(). This bypasses the need to create
QResourceFileEnginePrivate, QResourceFileEngine, QFileInfoPrivate, and
QFileInfo, all of which would end up in this .isValid() call.
Additionally, I'm making it query in the C locale, which will also avoid
initializing the system & default QLocales. If a resource exists in any
language, the C locale query will find it.
Pick-to: 6.8
Task-number: QTBUG-133206
Change-Id: I434b498903d793c12d35fffd3e297bfdbdc1b6fe
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit d59e640c868f3db2d661970f3d34a22013d49053)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Use QPainter::setPen(QColor) overload instead creating a temporary QPen
to gain advantaged of the newly introduced QPen operator=(QColor)
function from ab53500cfa11b988e7e4234583fa6eb5027b4c08
Change-Id: Ib29a932a183b629f2c5f3ce32f4e00bd7ab24a03
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 678564291d8faa7689b4a65376b2c60118fc9936)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Reportedly, some unofficial DirectWrite ports are missing the
default values to the arguments for IDWritePaintReader's
MoveToFirstChild() and MoveToNextSibling(), so we make this
explicit to work around the problem.
Fixes: QTBUG-133336
Change-Id: Ia9a01e371e7424508db0d5ad3c75037caaf16854
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit cbce69ebd643bb4841de20f34c5b23bddbcde0c6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Otherwise running the deployment script fails on macOS with something
like
CMake Error at
.qt/deploy_qml_app_texteditorexample_32987d3e6e.cmake:1 (include):
include called with invalid argument:
2/build/.qt/QtDeploySupport.cmake
due to the following generated content:
include(build/texteditor space 2/build/.qt/QtDeploySupport.cmake)
Pick-to: 6.8
Task-number: QTBUG-126827
Change-Id: I8f9923db8dc670a6efbd6f75c48da5dfd1af687d
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 65f08c09713b6d167638c4e19ebafcac045fc1c5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The feature names are normalized using `qt_feature_normalize_name`, but
a user might read `qt_feature` usage and not realize that they should
normalize the name in the `FEATURE_*` variable.
This change emits an error if it detects such invalid names.
Fixes: QTBUG-132464
Pick-to: 6.8
Change-Id: I33c7ab9f589c92e11e16d376660e8b6152339d12
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit b71647d06970b2cc3b63b93c020eca8caf0a519f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The patch provides two documentation snippets: for an arbitrary arg
and for \c {*this}. That is because qdoc does not support passing
a command (e.g. \c) as a part of the snippet's parameter.
Amends e95fb04202b3f786037c10942fd4e912644fd7d2.
Found in Qt 6.9 API review.
Change-Id: I4eed234d18e39f2fc0c30a647a423f3240e31d40
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 8511149d886e5aef2a065efffc336c7b25e6540e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This is both more accurate and also more stable: The suffix-list
update usually takes several days to go through all branches; using
the commit date avoids using newer fetch dates in older branches.
Pick-to: 6.8 6.5 6.2 5.15
Change-Id: Ifefd7158e4104c7bbdfe6a2d8a505d8acf7275b4
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit cbea57f80b43a969d2e15d53b759abb9924d52c1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
When two actions in one menu have the same hotkey and the first action
is not enabled, the action search was selecting the first, disabled
action despite the fact that it could not be selected later on.
Pick-to: 6.8
Fixes: QTBUG-56952
Change-Id: I894ee09d9ccc7154ca506ef907924cd150ac6ed2
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 13636f848da6932f9864bf9335d19b439b8387cd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QT_ANDROID_SYSTEM_LIBS_PREFIX and QT_ANDROID_NO_DEPLOY_QT_LIBS were
added in Qt 6.4, but they were missing \cmakepropertysince 6.4.
Pick-to: 6.8
Change-Id: Ife0f68e79d331f4923d1015431f5af65d80dca36
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 51474d795a4c801933f9444b73d536fb1c407e72)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Those Android CMake properties have been carrying the documentation tag
of \preliminarycmakeproperty by mistake.
Pick-to: 6.8
Change-Id: I739fee2f078300427557a29b25e1898d57cf04d7
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 2abc4594791823f1e56d692df38ede69f83e45cf)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
It's semi-private API (ie. undocumented) and for most platforms¹, the
change is a no-op, which is why the approach here is a bit different
than your usual REMOVED_SINCE:
Normally, when only the return value changes, we mark the new overload
as QT6_*_NEW_OVERLOAD to allow the two function to coexist and the old
function to call the new one.
But the extra argument backing QT6_*_NEW_OVERLOAD would change the
mangling of the function even on platforms that don't mangle the
return type (the majority), and we'd have to decorate all calls that
could possibly be seen by QtCore's removed_api.cpp TU with
QT6_CALL_NEW_OVERLOAD. The main user of the API is moc-generated code,
though, and so I didn't want to have to change moc's output, even
though, currently, nothing in removed_api.cpp includes moc-generated
code. But it may, at some point in time.
This means I needed to grasp the nettle and duplicate the (granted,
trivial) implementation. Even a private helper function would mean
(maintenance and runtime) overhead for "normal"¹ platforms, so I opted
not to go there, either.
¹ those that (rightfully) don't mangle the return type, ie. all except
... MSVC.
As a benefit, we catch the mistake of modifying the dynamic
QMetaObject under the object's radar already now.
[ChangeLog][Potentially Source-Incompatible Changes][QtCore][QObjectData] This
(undocumented) class' dynamicMetaObject() function now returns a const
QMetaObject* (was: non-const). The backwards-compatible fix is to
receive the result in a const QMetaObject* variable (or to use auto),
and applying a manual const_cast, if a non-const object pointer was
actually required. Modifying the meta object that was returned by this
function was never supported and may lead to problems elsewhere.
Amends 0b044e8b055f9c1d93b278ed69aba76f7c886cb1.
Change-Id: I4ebc43018a2a87433ab7a97554196842b97cf1ba
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 2c212e15f8b9dc2578d93ac69a0f5826ea9de18f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The pmr::monotonic_buffer_resource ("pmr::mbr") strategy can only
allocate buffers; deallocation is a no-op. I chose it for
QDuplicateTracker because the tool was only used one-off: build it,
then destroy it. There were no other operations.
That changed when 090c7e3262dce93df83c73a4a822761e5d9b4650 added
clear().
Calling pmr::unordered_set::clear() will deallocate the nodes (but not
the bucket array), but due to pmr::mbr, nothing is actually
deallocated, so memory that was freed by the container isn't actually
reused by it, later. IOW: repeated grow-clear-grow-clear cycles would
forever grow the monotonic_muffer_resource, using more and more memory
and thus appear to be leaking it.
This isn't exactly optimal behavior, so try to shed the pmr::mbr's
extra memory with a call to mbr::release().
Unfortunately, C++17 originally failed to nail down the semantics of
pmr::mbr::release(), prompting LWG 3120 in response to observed
implementation divergence. In particular, MSSTL, at the time of LWG
3120 filing, didn't appear to allow to allocate() after release(). In
our tests, it does allow it, it just never falls back to the original
(stack) buffer, and, looking at the implementation, it doesn't look
like it can do so anytime soon (it doesn't remember the buffer, and
everything is inline, so they would seem to need a BC break to fix it.
We tried to work-around the problem by hard-resetting 'res' by going
through a destroy-recreate cycle. pmr::mbr is neither copy- nor
move-constructible, so that blunt instrument is, unfortunately,
necessary (std::optional would be an alternative, but has overhead
that affects all platforms). This crashed, though, so just call
release() and handle MSSTL's failure to reuse the initial buffer as a
QoI issue.
For all platforms, before release(), we also need to make sure that
`set` no longer holds any references into it, and, since clear()
doesn't shed capacity, we need to use the C++11 version of the
swap-trick (swap is actually UB here, because the allocators differ):
move-assign a default-constructed set.
Amends 090c7e3262dce93df83c73a4a822761e5d9b4650.
Fixes: QTBUG-132945
Pick-to: 6.8 6.5 6.2
Change-Id: I4796806e427602255439dcb1518aa9b661c7933e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 9f4325e67354ce6c4c98e7a206f17729b378dc04)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QSet::remove() calls QHash::remove(), which unconditionally detaches,
so fixing the detach there, by pulling the isUnused() check to before
detach(), fixes it for both.
For removeIf(), the old code used begin()/end() for iteration,
detaching unconditionally, even if nothing was removed in the end.
In this case, fix by using cbegin()/cend(). That delays the detach()
until the first erase(), where it belongs. The end() iterator of QHash
(and therefore QSet) are stateless sentinels in all but name, so we can
continue to cache end(). Add a code comment to that effect.
Amends 62dad9be9e172597c56a970202299563aa04918e (for removeIf()) and
5b7c3e31b538376f2b4733bd868b5875b504cdb3 (for remove()).
[ChangeLog][QtCore][QSet] remove() and removeIf() no longer
unconditionally detach, but only if something is actually being
removed.
[ChangeLog][QtCore][QHash] remove() no longer unconditionally
detaches, but only if something is actually being removed.
Pick-to: 6.8 6.5
Task-number: QTBUG-106179
Fixes: QTBUG-132831
Change-Id: I807577eafa1be478b0a2da45cf8c44936d5e48ed
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 3a284dc19d1c77692f2faddedc674cc293d51a00)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Sometimes test causes kernel crash. Test is skipped until
gnome-shell 46.1 or newer is backported to Ubuntu 24.04 LTS.
See also https://bugs.launchpad.net/ubuntu/+source/gnome-shell/+bug/2095396
Task-number: QTBUG-132070
Pick-to: 6.8
Change-Id: Ia1c7f1737e225189b86cb2b2d2ff68a7cc1e838c
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 1c0406ee17d5747f8e5b107db81949055aaa7f9e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
While LWG 3870 changed the const/static_cast'ing for C++23, this is
q17, so use the C++17/20 semantics of casting away const- and
volatile-ness.
Found in API-review.
Amends 364ac13a79a8fff0447a62e9af5588db397c0bfd.
Change-Id: Ie11589cbc96b8c3c36deaa6101a897f527d92a46
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit c05982fda39bbfa9fa3641c7e5938f204a8b1bf5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
These functions expose implementation details of their respective
class, so, seeing as the classes are pimpl'ed and their op==s are
out-of-line, too, these functions ought to be out-of-line, too.
De-inline them, by calling a private out-of-line helper function. This
way, they can remain unexported and "real" hidden friends (= with an
inline definition).
As drive-by:
- in QBrush/QColor: check the properties in the order of cheapness
(style(), color(), transform()), and don't copy QTransform just to
check isIdentity() (access the member directly).
- in QPen/QColor: avoid the QBrush copy (access the member
directly). This also retroactively endorses the noexcept on this
function.
- in QPen/PenStyle: amend the comment that says it's allocating with a
`// ### optimize`
Amends f0186862e16128343705abd0de5994e8ca05a909.
Found in API-review.
Change-Id: Ibfd43b1f2200ef030d6739dad1bf026cc190606b
Reviewed-by: Tatiana Borisova <tatiana.borisova@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit d769ca41fc11e1af81e4cdf7cacb3884f98b108c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Amends commit 0756cc1eae5fd8981983319fef1d084762a67b8d.
The generic instantiation of this function had a std::nullptr_t *
parameter, but callers had special code to pass a nullptr there because
we never needed a value of a nullptr (it's always a null pointer). For
example, in compare_ptr_helper():
auto lhsFormatter = Internal::pointerToString<QObject>;
auto rhsFormatter = Internal::genericToString<std::nullptr_t>;
return compare_helper(t1 == nullptr, "Compared QObject pointers are not the same",
const_cast<const QObject *>(t1), nullptr,
lhsFormatter, rhsFormatter, actual, expected, file, line);
But in debug mode, some compilers did emit a load from this memory
location, causing a crash. So we just specialize this function to avoid
such.
We had a test for this... except it was never reached because the
earlier QCOMPARE() had already failed. For the test, this amends
commit ae021882330abc5f6fbaadca290e6e5670c89028.
Fixes: QTBUG-133330
Pick-to: 6.8
Change-Id: I2cd3bb475788431c6a0dfffd28e730e8b613e033
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit e19b633c468123526660b40ae110f46090682c76)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Setting permissions manually require the user to point to the manually
managed AndroidManifest.xml file.
Pick-to: 6.8
Change-Id: Iae289ad32a12f869a5a0ec0261bc3e771d94a15d
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 40e18c7c7e3afd8dacf22879ec1bc442ecbd9877)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Cloning the git sources will:
- allow embedding the git sha1 into the SBOM generated by the build
system
- ease development process in CI VMs when investigating issues.
This will slightly slow down the CI build phase by a minute or two.
Pick-to: 6.8
Task-number: QTBUG-122899
Task-number: QTQAINFRA-6520
Change-Id: If554ed0fedca26ff77d04752288ee8497bc4b9ce
Reviewed-by: Toni Saario <toni.saario@qt.io>
(cherry picked from commit 5717a4fd4a3fd2ba530a7eb4812ce2a5c34515cb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
On back-porting commit 7f9ee43de783105d8de0a0b614751eec639131f8 to
6.8, I worked out how to move the maximal version of each locale ID to
the front, while keeping it after a shorter ID that can't be derived
from it. Forward-port a refactored (and more systematic) version of
those changes now to dev (and thus 6.9) so that we get reasonable
compatibility between versions (albeit with 6.8 still lacking
truncated forms, since its QTranslator takes care of those).
This, however, brought to light a problem in the subsequent addition
and insertion of truncations. Since non-equivalent truncations of the
maximal version may (and often do) use the same script, they match
equivalents that are now later than the maximal one, which caused all
truncations to be appended, where some should be inserted just after
the equivalents. Furthermore, had the truncations of the maximal one
been inserted, they'd have appeared just after it, before some of its
equivalents, where it should be after. Reworked the handling of
truncations to take account of the fact that entries come in blocks of
equivalent forms; any truncations inserted instead of appended should
be inserted after this block, not between its members.
Adapt tests to match. As a "drive-by", shuffle some Punjabi tests so
that the comment that applies to two of them is followed by those two.
Task-number: QTBUG-131894
Change-Id: I67ea21cf279e8a3b2e8413c27ac0fa5dfabdaca7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit b6122866962880251fa8a82856d1fb9db43900d6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The ctor refuses to be called with a nullptr painter, but a moved-from
QPainterStateGuard object _will_ have a nullptr painter. An assert
gives a slightly nicer error message than "nullptr deref".
Extract Method verifyPainter() to not litter the executable with
string literals for every one of the these functions (some compilers
don't use the leeway extended to them by the standard to fold duplicate
string literals).
Found in API-review.
Amends ec3a5f4994a2bafc65fa8e01fb0861219580f622.
Change-Id: I562e6a0ff5a4c8ce86418b998ed78c501441b61a
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
(cherry picked from commit 5c20f9aa5c31d30a2dccfc617e93c6d6ac0fc96c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
There are no Q_ENUM/Q_FLAG/Q_INVOKABLEs defined in it, so drop
Q_NAMESPACE. We can always add it back in when something is added to
it that does require a meta object.
Found in API-review.
Amends 5ac4f04325a56d47812f528fe31ceb0d4932f664.
Change-Id: I8b197f2cd835d1fe4893f2e9608dcaf0ffd14cd9
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 530b2e1fc7d289c12507696137996a02bdbeb439)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
It can't, pfew. Was wondering for a moment, but of course, even the
QSet::iterator is really a const_iterator.
Pick-to: 6.8 6.5 6.2
Change-Id: I85caa64c1caca6d77569aa2ceb868a4aa0e5578d
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Magdalena Stojek <magdalena.stojek@qt.io>
Reviewed-by: Lena Biliaieva <lena.biliaieva@qt.io>
(cherry picked from commit a4fd95c51a4347482d6d0a815657d0b5bdaf06db)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
In QtCreator, the file lit up like a Christmas tree from all the
undefined types :)
Amends the start of the public history.
Pick-to: 6.8 6.5 6.2 5.15
Change-Id: I558ad493a4848e6a28bd37a38f2432c5605e0f43
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 768ab2051765f3825903c449a2f0e2c07e665152)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
If an executable has a .bat or .cmd extension, and is executed without
a prepended 'call' command within a batch script, the parent batch
script execution will not continue once the child process has
finished.
Prepending call to the command ensures that the parent batch script
continues execution.
This changes ensures that configuration succeeds for the use case when
cmake is actually a batch script called cmake.bat or cmake.cmd.
We already use 'call' in qt-configure-module, so do it also in
configure.
Pick-to: 6.8
Change-Id: Ia42cb71787e88c850f1cbd1fcef5b6decbdeaabf
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 062a7dc4248904bed51dc87466ec29b407945950)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
So it doesn't confuse me or anyone else again
Change-Id: I8ad5d4cb1b00e0edaffa90ed67e30246211e1a97
Reviewed-by: Liang Qi <liang.qi@qt.io>
(cherry picked from commit 7fcfc3790512b6d467732119330ea886de2a72fb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
If `value` is INT_MAX and `lastPaintedValue` is -1 (the default), the
subtraction will overflow. Extend the arguments to 64 bits. The result
is only used for a double comparison anyhow.
Change-Id: Id4a5396c61da81932ac626b3102e583a74264df4
Pick-to: 6.8
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit 8e843ddba8de6b9dbe9851856fd4524af5d3c584)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The check for SH_Menu_AllowActiveAndDisabled is done in eight places.
Simplify it by added a helper function which checks if an action should
be considered (i.e. is not a separator, is enabled or
SH_Menu_AllowActiveAndDisabled is enabled).
Pick-to: 6.8
Task-number: QTBUG-56952
Change-Id: I65c6dc67b804dd4c5cf463767a525ec6f785bf1a
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit e0a44cd32ed3884fd665c112a9dfc2bc45a6597d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
While the code checks for the possibility that leftMillis-rightMillis
may overflow, it fails to take into account that the result may be
minimal ("INT64_MIN", so to speak) and passes it to qAbs, triggering UB
in there. Since it's just a range check and we don't need the result to
be signed, use qUnsignedAbs.
Change-Id: I7f1a4bbc521fdc164ca20fedf0e995359a67ea4d
Pick-to: 6.8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit 45e90b73c75b2c7997a0f8d750f9927f64e05a0e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The typical usage of a QDuplicateTracker should be to pass the
guesstimate for the number of entries as a constructor argument, or,
failing that, default-construct the object. In those cases, everything
is peachy:
QDuplicateTracker<int> seen(n);
QDuplicateTracker<int> seen;
But for users that subscribe to a AAA view and use
auto seen = QDuplicateTracker<int>{};
or that emplace() a QDuplicateTracker in e.g. std::optional, we need
to make sure that value-initializing QDuplicateTracker doesn't
value-initialize the internal buffer (which can be several KiB in
size).
So don't = default the default ctor, but implement it as empty.
Amends f21a6d409ea0504c64cd72861fc16b6f3e080086.
Pick-to: 6.8 6.5 6.2 5.15
Change-Id: I930f40d2bb85b74d2216378d8b8ca854a53a49e4
Reviewed-by: Dennis Oberst <dennis.oberst@qt.io>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 15154fa4c5d216b1c943a3b37be24f5fb2e4fa73)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This isn't strictly necessary, as it doesn't affect anything we use
the header for, but it brings us back in sync so future updates don't
involve as many changes to review. Document why we amend the upstream
SPDX identifier (to a non-deprecated equivalent).
[ChangeLog][Third-Party Code][QtTest] The perf_event_p.h from Linux is
updated to match Linux kernel 6.13.
Pick-to: 6.8
Task-number: QTBUG-132871
Change-Id: I101734b743f6689ca64054008455b98e4f6b827c
Reviewed-by: Lucie Gerard <lucie.gerard@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 019d2e5974326cac1803bb860f280c1b8fd104c3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
In the git version of CLDR v46.1, Acre's metazone inherits a generic
long name. However, root provides no metazone data for it to inherit.
So we ended up with an empty entry for Acre in the QlocaleXML file.
Harmless, but easy to avoid, so avoid it.
Pick-to: 6.8
Task-number: QTBUG-132851
Change-Id: I392d0922bebff731632e729a4931caa02dc3a404
Reviewed-by: Mate Barany <mate.barany@qt.io>
(cherry picked from commit b60be8c14d9f39358d00ef06a8ea5562fba17d98)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
There already exists a method to do this, but seems at some point
calling it has been dropped. Add a call to update the native
reference whenever the reference in Java gets updated.
Task-number: QTBUG-130614
Change-Id: If9654b504c88340feff2432973f8f9f2eaffa272
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit acd331cd15785dda444b1a34f343a42c6b3c89fe)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
isActive() may return true if a (transient) parent window
is active (has focus).
Compare against QGuiApplication::focusWindow() instead.
Fixes: QTBUG-129233
Pick-to: 6.8
Change-Id: I834a5814a5db161bdea2ba3524d1010e0c0e3e6e
Reviewed-by: Even Oscar Andersen <even.oscar.andersen@qt.io>
Reviewed-by: Piotr Wierciński <piotr.wiercinski@qt.io>
Reviewed-by: Lorn Potter <lorn.potter@qt.io>
(cherry picked from commit 31762e2e704673057a292ac59977b501919f2450)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QTextStream's operator<<(number) uses qAbs to extract the "absolute
value" of number, and passes that and the number's sign to an internal
formatting function. However qAbs is unsuitable for the task, because it
will fail if `number` is minimal, as it returns the same type of
its input.
Since we can afford to change the type of the result, call the private
qUnsignedAbs() function instead.
Change-Id: Ib813a199503f2d07c78bb76862ab2e15d68d0ec2
Pick-to: 6.8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 8f762b546fe6b2254029c4804a32d9ae6bbf4495)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This fix ensures that each call to QTest::qRun() runs all tests the
requested number of repetitions.
This fixes an issue where QTEST_QUICKCONTROLS_MAIN would only test the
first style, and skip remaining styles. The cause was that the repeat
counter was not reset between QTest::qRun() calls. Subsequent calls to
QTest::qRun() would therefore not run any tests.
Amends: 80a14c86b2739492d7f7fbdb1cbde1da85d1341d
Fixes: QTBUG-133207
Pick-to: 6.8 6.7
Change-Id: Idb164fd01ac0b8e04e5dd74c3625f2c343f742c5
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
(cherry picked from commit 07318c81a700b4d4a46c81ae2e4f17c6b1e501c0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
... instead a QString as it gets converted to an utf-8 string anyway to
avoid this conversion.
Task-number: QTBUG-132303
Change-Id: I3fcf721f9fd0d1dd181af262663fddd532262ee3
Reviewed-by: Thierry Bastian <thierryb@filewave.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 892a020cc3ad7e3d5cdcb38d26091343e78695da)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
There's little we can do, but a lot of content ends up in QLocale very
late in the execution. Let's at least not crash.
Task-number: QTBUG-133206
Pick-to: 6.8
Change-Id: I77d41141cb115147f9befffdd5e69dac19c96044
Reviewed-by: Albert Astals Cid <aacid@kde.org>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit e32f28034ad2383393645777bcd96eab3f696076)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Checking qAbs preconditions reveals that several places into Qt are
calling it with minimal values, causing UB. Those places do not actually
need that the absolute value is of the same type as the parameter.
Therefore, introduce qUnsignedAbs, which is like qAbs() but whose return
type is always unsigned, and therefore can accept everything.
This function is private; I don't want to encourage users to rely on our
extension.
Aggressively cherry picking because this will be needed in subsequent
bugfixes.
Change-Id: I2047768a5fd35f12bf898ca8c2008813434edd8d
Pick-to: 6.8 6.5 6.2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 83c812e1322a2b004bc604be3e6f61fb83246eb0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
We'll need it higher up in the file, but we don't want to/can't move
code around, so make -127 a symbolic constant.
Amends 39c7bf4631b401c681c24bb5a732a0359c8a6d7c, which, however,
merely moved the code around.
Pick-to: 6.8
Change-Id: Id6f2d51e5678b3bad7ae658cc3e38fd3909861d7
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 57aabff91eed41fb7ba0cf67df4fe7767c6e0e43)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
While the application's a11y object doesn't have a parent
within Qt's a11y hierarchy, the AT-SPI registry/desktop is the
parent of all application objects.
Therefore, report that one instead of using a null path.
With that in place, querying the application parent
via Accerciser's IPython console now gives the expected
result:
In [16]: acc.role
Out[16]: <enum ATSPI_ROLE_APPLICATION of type Atspi.Role>
In [17]: acc.parent
Out[17]: <Atspi.Accessible object at 0x7fbebc3fc1c0 (AtspiAccessible at 0x139d6410)>
In [18]: acc.parent.role
Out[18]: <enum ATSPI_ROLE_DESKTOP_FRAME of type Atspi.Role>
While at it, also add a "m_" prefix for the
AtspiAdaptor::accessibilityRegistry member.
Fixes: QTBUG-132935
Change-Id: I0e174f73c837b233fe4d5788d1c375b404000025
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
(cherry picked from commit befce757faa0b0abd2c1f4ec408c1a0932794b0c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Modifying the process environment can cause crashes in application code
that accesses the environment via non-qt functions on worker threads.
When launching a process, we can avoid modifying the environment of the
caller by using QProcess with setEnvironment. The codepaths without
QProcess support is still prone to these issues and could potentially be
improved via execve
Task-number: QTBUG-129222
Pick-to: 6.8
Change-Id: I4e2d93abaa0e392b341041faaae0ffd11e225bcb
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 673400679dca23840174c9882cea5b796b52b2f7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QTest::createTouchDevice() passes ownership of the device to the caller,
so make sure to delete it.
Change-Id: I100d3de9eab8ec9f88ed3e0850ada9d988bd962e
Pick-to: 6.8
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 28d0e658e297b5de52fb0cccaede08179c7f4b8c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QRect::width() and height() may overflow: they're only safe to call
when right-left+1 (or bottom-top+1) is representable by an `int`.
Therefore, avoiding calling them from QDebug, which is supposed to
"always work" (otherwise, it's not of great debugging help...).
QRectF does not have this issue as it stores the width directly.
Change-Id: I438dbacae42c17730afb92f05d16e3eebb161255
Pick-to: 6.8 6.5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 0f336500a0add3e3a8bb31c5cc605e5e13e23833)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
added a details about code paths that cannot happen and added constexpr
Fixes: QTBUG-132303
Change-Id: I98340c5a1f275c00aafb3294cf8e5e8368126b76
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
(cherry picked from commit e574cda7fc3f6be5a81489d8d9cdb859625d4e88)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The legacy infrastructure does not map very well to the modern one:
it turns out that, somewhat counterintuitively, targeting a
QRhiSwapChain for a QWindow may still mean rendering into a texture,
when using OpenGL on certain platforms.
For example, the Wayland platform plugin implements client-side
decorations by binding an FBO upon making a context current on a
surface for a (decorated) window, and it also makes
defaultFramebufferObject() on the context return the FBO id.
The expectation is that this is why errors such as
GL_INVALID_OPERATION are encountered in glDrawBuffers on Linux.
The QRhi GL backend's assumption that the QRhiRenderTarget being
a QRhiResource::SwapChainRenderTarget implies that the target
really is the color buffer(s) of a window surface is not in practice
sufficient on these platforms.
The bound FBO was already correct always (whatever defaultFbo reports),
but the code path hit was the wrong one. And there is different code
for MRT support (textures only) and stereo rendering (window surface
only).
Make sure defaultFbo() is queried before taking the decision which path
to hit.
Pick-to: 6.8
Fixes: QTBUG-122819
Fixes: QTBUG-132780
Change-Id: Iaaab57b031f430178ee4611a4f7a02c854010441
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
(cherry picked from commit 3869106cc5914fb4a8eda30ae1bd5f68dcee2fda)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
imageFence seems to have no purpose. And some of the
comments seem to be out of date / misleading.
More importantly, do the command buffer completion wait
before the acquireNextImage. Otherwise frame.imageSem
may have wait operations pending if the queueSubmit
did not get to wait on it yet. The expectation is that
this potential issue is what triggers the recent
validation layer releases' enhanced synchronization
checkers.
Pick-to: 6.8
Fixes: QTBUG-132808
Change-Id: Ib8e3884ccea343f5a839aa2ee17cd358fafeac69
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
(cherry picked from commit 24d62ffd720b5bec5d07b07b8d2c9dda7635f3c0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Because we called this before opening the target file, we did not check
that the destination file engine is the QFSFileEngine, and therefore we
may have passed a path that referred to a Qt resource path. We still do
that on Windows, but Qt resource paths start with a ':' character and
that is not allowed on Windows, so the Win32 CopyFile() function fails.
Moreover, this function *can* clone directory trees, which we don't want
to happen because it doesn't happen on other OSes. Instead, fall back to
the fcopyfile() call in cloneFile(). It will still do cloning where
permitted.
This was added in commit db0064b767474a89bc72ea4374f477682983c5f4,
before the fcopyfile() in 974b3adf8a099ca95fc2eabfc434038ce73f62c8,
though both were for Qt 5.10.
[ChangeLog][QtCore][QFile] Fixed a bug on Apple systems that would cause
copy() to copy a directory if the QFile pointed to a directory and the
destination was in the same volume. Now copy()'s behavior is the same as
in other OSes: directories are never copied.
[ChangeLog][QtCore][QFile] Fixed a bug on Apple systems that allowed
copy() to create a file with the name that referred to a Qt resource
path, if one tried to copy to that path. Qt resource paths can't be
modified using QFile.
Change-Id: I996368f4c656ff10ff5efffd5b47c6ddde34fd10
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 45886e6a81016c5c9212fffb5c0a83fd2431223e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Use the cross-platform renderer code in Freetype as well as
DirectWrite to share as much code as possible.
Change-Id: I643dced6b913138890b39eafc3984cca5ced0aae
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit d58ad990e227fecf5526df1a89736afc0c9268fa)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This traverses the paint node graph and renders
the emoji through a generic renderer. This renderer
is largely based on the renderer in the FreeType
backend and will be used there as well in a follow-up
patch.
Fixes: QTBUG-113458
Change-Id: I44d17b0be8d85e38589edeb68793bf4ee4491eca
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 9f22a51987614ce51b3c12ced420bc4ca5b1ec61)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Specify that since 6.8 tab focus can transfer in and out of the
embedded window if using a Qt Quick based window.
Pick-to: 6.8
Change-Id: I21d04457ee79497431f889e261f1cb6bd9fd39ee
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 059210b17e50fd7c45af4ca0631ddcf8dd7c67f8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QLocale is very often accessed during global static destructors, so
let's try and survive if the default has already been destroyed. In that
case, we shall fall back to the C locale.
I've placed the call to systemData(), which updates the system locale,
before the initialization of defaultLocalePrivate, as the initialization
of the latter depends on the former.
Task-number: QTBUG-133206
Pick-to: 6.8
Change-Id: I48e29b45f9be4514336cfffdf5affa5631a956a3
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Albert Astals Cid <aacid@kde.org>
(cherry picked from commit e0a1f491567f2495443babc5aa36a038260f96c6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This does some refactoring on the color font support in
the DirectWrite backend and introduces support for loading
embedded PNGs from the font.
This gives us support for CBDT and SBIX fonts, which are both
based on embedding image files.
[ChangeLog][Windows] Added support for color font formats with
embedded pixmaps in DirectWrite backend.
Task-number: QTBUG-113458
Change-Id: I695901b62600c37619c80aa915f60de13a4fca3f
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 1b85143d217042876209794bf8d0361b7ce8834f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Active window should always be in front of the stack so bring it to the
front of the stack if it's not.
Pick-to: 6.8
Fixes: QTBUG-112758
Change-Id: Iff123d1e95f728f51b786106d83a429c111aa6a8
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit e6e210c2406e8d4cfe67543871af5fe14a2bda82)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This includes:
- turning VERIFY_SOURCE_SBOM ON
- adding exception to the licenseRule.json files
- correcting the licensing given via REUSE.toml files
- renaming license files not located in LICENSES folder.
They need to be named LICENSE. to be ignored by reuse and
excluded from the source SBOM. The name are updated in the
corresponding qt_attribution.json
A lot of files are skipped during the license test,
but all are present in the source SBOM.
This is why correction are needed before turning the
source SBOM check on.
[ChangeLog][Third-Party Code] Renaming the license files with prefix
LICENSE. to have them ignored by reuse tool.
Task-number: QTBUG-131434
Change-Id: Iab517215bb10a17357d2d2436bba8d3af76e5cd1
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 7cb90e15631a9e6f12469a7ca8c070781c4aafc2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The license check is only called if VERIFY_SOURCE_SBOM is set to ON
in the module_config.yaml. This way, a module can turn on the check
only when ready.
The license check is done via a perl script. Since no perl is
available for Windows on ARM64, VERIFY_SOURCE_SBOM is set to OFF
in this case.
Task-number: QTBUG-131434
Change-Id: I183b7726928bbc925940330d39779a4ac2307254
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 153002f7d2904988efdd8abc68adff0f9927943b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
deallocatePreparedStmt() knows by itself when to call the psql cleanup
routines or not. No need to have this logic outside this function.
Task-number: QTBUG-132303
Change-Id: Ib1a5ba7b53c156f6a6b93f23a3ec8c851d7398fc
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Thierry Bastian <thierryb@filewave.com>
(cherry picked from commit 9094ad18b0d909f7490dec3451ec7ef9c312f42a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Requiring users to do find_package(Qt6FooPrivate) to use private modules
turned out to be a too invasive change for Qt 6.9. We turn off this
behavior and restrict it to the dev branch.
[ChangeLog][CMake] The requirement to do find_package(Qt6FooPrivate) in
user projects was postponed to a later Qt version.
Task-number: QTBUG-87776
Change-Id: Ifbf676288587ae5fabe100bf3bd93b220ddbc5ac
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
A project might want to find_package all available (installed) Qt CMake
packages that contain qt modules.
A use case might be a qml app that needs to link to all of Qt, and
support showing qml files that can load any Qt qml module.
Add a new Qt6 COMPONENT called ALL_QT_MODULES.
It can be used like this:
find_package(Qt6 COMPONENTS ALL_QT_MODULES).
The implementation will find all installed Qt modules by globbing over
all json files installed in $qt/modules dir, and treat the file names
as package names.
It will then tell Qt6 to find_package each of those packages.
Pick-to: 6.8
Change-Id: I89242307438576a0cbb3cdca80a9cb72818b6035
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit c7027880aa746a01362ac12491910479d7fc67e3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Just like we do with qt plugins, collect all found qml plugin targets
into two new directory scoped variables:
- QT_ALL_QML_PLUGINS_FOUND_VIA_FIND_PACKAGE
- QT_ALL_QML_PLUGINS_VERSIONED_FOUND_VIA_FIND_PACKAGE
The plugin target names are derived from the Config.cmake file names,
based on the existing assumption that qt_internal_add_plugin always
uses the target name when generating the Config.cmake file.
Pick-to: 6.8
Change-Id: I78c76488e133fb3c0374cbc149425726077f6c31
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit bf83fffd13c176391d353080cd76bc68ae7ea184)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The code is moved into a macro without any modifications aside from
removing the escaping of variable evaluation and escaping of quotes.
It's kept as a macro similar to __qt_internal_include_plugin_packages,
because there might be calls to find_package() that set variables in
the current scope.
The reason for moving is easier maintenance (no more escaping).
Pick-to: 6.8
Change-Id: Ie6ddc26fe4ff8db0134f3542c2886f8b5d68dc51
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 47006aca44c16c78f00940574170640f19e9fb43)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Introduce two new directory-scoped variables containing versioned
(prefixed with Qt6::) target names of qt modules and qt plugins found
as a result of finding Qt packages:
- QT_ALL_MODULES_VERSIONED_FOUND_VIA_FIND_PACKAGE
- QT_ALL_PLUGINS_VERSIONED_FOUND_VIA_FIND_PACKAGE
To be consistent in the naming of the variables going forward,
deprecate the old QT_ALL_PLUGINS_FOUND_BY_FIND_PACKAGE variable
in favor of a new QT_ALL_PLUGINS_FOUND_VIA_FIND_PACKAGE.
The difference is 'BY' vs 'VIA'.
The non-versioned variables are modified not to contain duplicates:
- QT_ALL_MODULES_FOUND_VIA_FIND_PACKAGE
- QT_ALL_PLUGINS_FOUND_VIA_FIND_PACKAGE
Also remove duplicates from the variable that collects all found qt
plugin types:
- QT_ALL_PLUGIN_TYPES_FOUND_VIA_FIND_PACKAGE
A follow-up change will collect qml plugin targets.
This information can be useful to find out what Qt targets are
available in a project, for example to know what plugin targets or
types can be linked into another target, or which libraries can be
deployed.
Pick-to: 6.8
Change-Id: I4f158872f4a8f6ef6008f081270604f75b77ad9d
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit f7b8ff71778bde94741402216269c2de2dda32c1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QAbstractItemModelTester performs non-destructive tests on test models.
It helps with catching the most common errors in the test model.
Task-number: QTBUG-132880
Change-Id: I719f4223d84e66c1d94cbd0380bfdb77b07da7b6
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit b751a12f7af533049ff46c6a63bd12eb6082415a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Previously we were using raw zero-based integer values
for roles in QtAbstractItemModel tests.
Roles starting from 0x0 to 0xFF are reserved for pre-defined roles
defined in Qt::ItemDataRole enum.
This change will change the base role value to Qt::UserRole.
It will later help us to use QAbstractItemModelTester as this
tester class expects certain types from pre-defined role values.
Task-number: QTBUG-132880
Change-Id: Ie19739cd7bf49829fe58f5ad53078942d47a433b
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 967d9b8cf200163b25a3c1a3b3d79a107f9073b2)
When closing a popup window on macOS, and the NSView needs display,
for example due to the frame geometry having changed, the system will
ask our NSView to display one last frame, via NSOrderOutAnimationProxyWindow
initWithSnapshotOfWindow.
If this happens during the close() that the QWidget destructor does,
we no longer have a QWidget subclass to handle the corresponding paint
event, so we'll end up flushing an empty frame, using that for the
animation transition instead of the last valid frame of the widget.
Worse, if the top level is using RHI to flush, the texture list
might be stale, as there is currently no plumbing for a widget to
tell QWidgetRepaintManager about it deleting a texture that was
previously picked up and placed in the QPlatformTextureList. When
this happens we end up crashing on dereferencing the stale texture.
To mitigate these issues we now skip the expose event if the widget
is already in ~QWidget. This potentially means the close animation
will use a stale frame, but we can live with that.
Pick-to: 6.8 6.5
Change-Id: Iabe1d97019923ee3a1a86039630095d00c966156
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 9509434ecb4a11409d8c2bea9c010b40f8f7894d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
As part of 3d99f90b50ab22ef5ab4433c57f9ee584a0a7cae we added logic
to look up the toolbar for a QMainWindowLayoutSeparatorHelper. In
the case of QDockWidgetGroupWindow the logic was broken, as it was
casting the layout's parentWidget(), the group window, to a QMainWindow,
instead of using the group window's parent.
However for QDockWidgetGroupWindow we shouldn't look for a toolbar
at all, as QDockWidgetGroupWindow can't have a toolbar. Using the
parent main window's toolbar is wrong, as mouse events for that
window will not affect mouse events for the group window, so the
bug in 3d99f90b50ab22ef5ab4433c57f9ee584a0a7cae is not triggered.
Fixes: QTBUG-132952
Pick-to: 6.8 6.5
Change-Id: Ic7845254e05bc358a39f79ec7622029d90173b45
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 81ed068a510421e6204193ec37448a628324543d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
To be used in network-related tests where we potentially are
using private/public keys and (on macOS) end-up with keychain
access blocking a test with dialogs requesting a permission
to access the keychain.
Task-number: QTBUG-132645
Pick-to: 6.8
Change-Id: Ide74633bf88b0453d5d8f8de56282c8cf8207380
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 13109ba350686cd8ce8e298db5d76d0e7c209bd1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Makes it easier to debug diffs of SBOMs, due to lower amount of
content in generated files.
Pick-to: 6.8
Task-number: QTBUG-122899
Change-Id: I5a1e8a9868cda199de4a7344b86a12f68fec31bf
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 3c516ffa8739a6d8729780138f07a6bea7cfea8c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The code relies on -Wswitch, but lacked the Q_UNREACHABLE_RETURN() at
the end that compiler and code readers need to understand that we don't
accept values other than those enumerated, even though an enum variable
could hold other values, too.
Since the function is constexpr, can't use that macro directly, but
need to copy the usual GCC 8 magic incantation.
Amends 171ff57be1b8fd1c1b33cffbffa389790f239b5c.
Pick-to: 6.8
Change-Id: I6c9dd0e4178211f57da61aa6df70f8036370f158
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 420ca3463ee8adf2d986af5802d8da4bb24ce14d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Add them to the PackageComment field of the SBOM.
Can be useful to map back the SPDX Package to the CMake target or
package.
Pick-to: 6.8
Task-number: QTBUG-122899
Change-Id: Icbbb90132038c489b55c4ee7a038aea593ce1ff6
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 0be13fb6994feade6777a17cc405d9b2f32f2aa3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Replaces content like timestamps, version strings and checksums with
constant values to make the SBOM generation deterministic.
This is useful for reproducible builds, to allow cleaner inter-diffs
while developing new SBOM features.
Can be enabled by configuring with
-DQT_SBOM_FAKE_DETERMINISTIC_BUILD=ON
Pick-to: 6.8
Task-number: QTBUG-122899
Change-Id: Id0003bdd23fe57abd70213a2a108885861693242
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit d2dea0bc08036925cb93c226af19aeb896926309)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Reduce the groove size of QSlider when using Windows11Style, so that the
minimum selectable value does appear so.
Fixes: QTBUG-133128
Pick-to: 6.8
Change-Id: I3e5a5378e2eace3920c06db8cb1198122c0937b5
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
(cherry picked from commit dee731ae981eb4f41f4b00be80f75c7a0a5c0e11)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
We never ended up calling _qt_internal_finalize_sbom for generic Qt
repo executables, and we never passed an SBOM type, so this code never
worked.
Remove it to avoid confusion.
It might be re-added in the future.
This doesn't affect the SBOM generation for Qt tools and apps.
Pick-to: 6.8
Task-number: QTBUG-122899
Change-Id: Iffde964efe2a6b70e6e0b64ec0803af5e84172fb
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit f2472c2e6a5b93dfbda166582620c30ea8855edb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
XML requires escaping for certain characters, and we need to consider
this when writing out qrc files (which use XML).
This commit introduces a helper function,
_qt_internal_escape_xml_characters, to take care of the escaping.
It uses regular expressions to process the input strings. We take care
to start with '&', as '&' needs to be escaped, too.
We minimize the amount of escaping we're doing (the exact rules
differing between attributes and text), to avoid unnecessary work that
needs to be done when configuring a project. This is achieved by a
SUBSET option which can be passed to _qt_internal_escape_xml_characters.
Pick-to: 6.8
Task-number: QTBUG-131916
Change-Id: Ic1bd0eedee0343c3d70b6954842e21b3c550b092
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit e4fbbdea05540723d4c4429d673d25efa3201d7a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Add a few internal functions to allow
- getting the sbom project supplier
- project supplier url
- project namespace
- computing a project namespace
- computing a project file name
- getting a sanitized spdx id given a hint
Pick-to: 6.8
Task-number: QTBUG-122899
Change-Id: I0dc3df274eaf6882a6af021aabee75501b5083f8
Reviewed-by: Moss Heim <moss.heim@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit dbf44b61c11d63a4e3242a62c3be34ebf1f3f012)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
If the tests are built and run as standalone or non-prefix build and a
find hint was used, e.g. `Qt6_ROOT`, then this type hint should be
forwarded to the `ctest --build-and-test` otherwise the internal
package would fail when it tries to `find_package`.
Change-Id: If71852dd5124b8deeddd28ba835f1943d96ba2b8
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 599ad25a65ddf3b3fb7dcdc7c446da070800e507)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
[ChangeLog][CMake] CMake packages of public Qt modules don't provide the
targets of their private counterparts anymore. User projects must now
call find_package(Qt6 COMPONENTS FooPrivate) to make use of the
Qt6::FooPrivate target. User projects that rely on the old behavior can
set the CMake variable QT_FIND_PRIVATE_MODULES to ON.
For user projects, the warning message we know from QMake is displayed.
The warning can be disabled by setting the CMake variable
QT_NO_PRIVATE_MODULE_WARNING to ON.
Within Qt itself, find_package(Qt6Foo) will still
find_package(Qt6FooPrivate).
For static Qt builds, we need to wrap usage of private Qt modules in
$<BUILD_INTERFACE> or $<BUILD_LOCAL_INTERFACE> (if CMake's version is >=
3.26). Static builds with CMake < 3.26 will always load the private
modules if the Qt6FooConfig.cmake from Qt's build tree is loaded. This
is the case in non-prefix builds and (in the future) when building
examples as external project.
This amends commit fbbf4ace0188b9718b6d7808021c0b887fd52d9f.
Task-number: QTBUG-87776
Change-Id: I78e95248f2b3fa73c3005c61df2fe4f71ad8eeb8
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit ad7b94e163ac5c3959a7e38d7f48536be288a187)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
When drawing an itemview item, the rounded corners (for current and
hovered item) were not properly drawn - the rounded corners of the
windows11 style were sometimes also visible where they should not be.
Fix it by using a clip rect and move the rounded corners out of the clip
rect on the appropriate places.
Task-nubmer: QTBUG-131585
Change-Id: I4eccc1e65768306a5511cda6e18db8f56fe1eff6
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit ed18ad9543ae4b30307bb178d1ee8b309062b9e3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Otherwise when no other context is made current until thread exit, the
QGuiGLThreadContext destructor will try to call doneCurrent() on an
already deleted context.
Pick-to: 6.8
Change-Id: If55dd69a72b8ab4012780a449f6a02729dd0ed43
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
(cherry picked from commit cd1686e55f706048286cbc962bbe02032c2396cd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
It expects one mask per wait semaphore, where only one was given,
leading to an out-of-bound read.
Amends 202dd3cb39ab4408c44a8588b8d6fb9a1cc3a184.
Fixes: QTBUG-132356
Change-Id: I6f7d33eb4568d1577e09411f7be751c8dc520429
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
(cherry picked from commit ff68e05bc3f8c98ccfc26b03ec68b183af9172f1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Adds functionality to communicate with a desktop manager. This feature
is only enabled if "desktop" is added to the QT_QPA_PLATFORM environment
variable (e.g., "QT_QPA_PLATFORM=qnx:no-fullscreen:desktop").
Pick-to: 6.8
Change-Id: If98e0dda43692abce47f2d8f5f340bd7276ec901
Reviewed-by: James McDonnell <jmcdonnell@blackberry.com>
(cherry picked from commit 70b1db9c0e0a53ec7e47ba296a534d38559c702f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Incremental updates don't always work
due to a misinterpretation of the rectangles passed in by the upper
layers.
Pick-to: 6.8
Change-Id: Id30c97f80904209726b3aaf37c52b2e14ee2f187
Reviewed-by: James McDonnell <jmcdonnell@blackberry.com>
(cherry picked from commit d0e64a36d2806ae2892cb34cb44ef63b2d56abd1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This reverts commits 729c0960b84183bcf9576f974cb5e3b3c3fdc6ef and
348b680ae56e92f061424a10c4baa726cf7f15d2. Friendship is not required.
The removal of the forward-declaration in qflags.h implied adding it
where it had been required but not present.
Change-Id: Ie17963f95bb5fa98fd75fffd7e6e5289b58f1960
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit c7a069870ae80f47b32479dc1f8f7161a3238201)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Test was failing on Android because of three issues:
1. Mouse selection does not work well with Android, especially when
predictive text is enabled. After changes in
de5ae6917c819ff23f7d9c5742b50b15e0824877 commit, mouse selection on
Android needs ImhNoPredictiveText to be set for correct handling.
2. Test sends mouse press events on center position of the QLineEdit.
On some devices, the text would sometimes end before this center
position. To avoid this situation the width is set directly.
3. Android expects the mouse click to be released before the next
click. If it doesn't, the next selection won't work properly
This commit fixes all those issues and unblacklists
testQuickSelectionWithMouse test
Fixes: QTBUG-87417
Fixes: QTQAINFRA-6896
Pick-to: 6.8
Change-Id: Id19850446954196a077047e250ea24a91ae7255e
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 1b02900ffe02980cb3e69c60ca415fd694cd773a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This helps with better debugging where in most cases the tests are run
without --verbose, but if there's a build error, it won't be clear what
went wrong, and only re-running with --verbose would give such details,
which is just annoying to deal with.
Change-Id: Icb8bcb8e5ba297d48b9e166c93523f25a21937b2
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
(cherry picked from commit 48dbc72c4467d120353dba46fdbc2f8ddc145629)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Print logcats only if it's explicitly requested with the respective
argument or if there was a crash, i.e. where we can't get the test's
exit code. Otherweise, in case of normal failure, we don't really need
to pollute the output.
Change-Id: Ic4e6db5d9fd6786bd28204a3ec87f63a7ec9764a
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
(cherry picked from commit 256fd95a712384c6d5b8b1841ab9c749fca89970)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
There's no need to have the QIODevice layer buffer the data and thus
allocate memory. In the case of QFile::copy(), it also improves the
error message output.
Previously:
"Cannot create /tmp/tmp/f for output: No space left on device"
Now:
"Failure to write block: No space left on device"
Change-Id: I537a2a79ead9d1d9ac2efffdd650702a4424bac6
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit 8a720c162d500369810674930884e36cf2494d88)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
In case there is no valid QStyleOption::styleObject, default the
PE_IndicatorRadioButton to the selected and unselected appearances.
Fixes: QTBUG-132906
Pick-to: 6.8
Change-Id: I5e9c13cb3384321e025e5af08ee3dab81feb07fe
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
(cherry picked from commit b717945812b16f957421bc2a2b1c4220f8148e64)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
In many situations, it is desireable that QTemporaryFile::rename()
overwrites an existing file, such as when emulating QSaveFile because
one would like more control over the temp file (such as passing it to
a different process). The public API of QTemporaryFile did not allow
it, making the typical Unix mktemp + mv algorithm to avoid symlink
attacks unimplementable with public Qt API.
QSaveFile is not a 100% replacement, because it always follows
symlinks and places the temporary file beside the physical target
file, keeping the symlink intact, instead of placing the tmp file
beside the symlink and clobbering it, if the target happens to be one.
Extract Method QTemporaryFilePrivate::rename() and add a bool
overwrite parameter that causes the existing
QTemporaryFileEngine::renameOverwrite() to be called in lieu of
QTemporaryFileEngine::rename(). The non-atomic path via
QFile::rename() is not affected.
This makes the functionality available as private API, in case we need
it in older branches.
Task-number: QTBUG-132646
Pick-to: 6.8 6.5 5.15
Change-Id: I0d5ca96c0a1a557854582e1a565a3db0d8af2a95
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit a01b14f1de59d378088a949bb21f3536832634c8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QNX 8 moved the inotify API implementation to a separate library,
libfsnotify. Added qt_config_compile_test to verify inotify in libfsnotify
Pick-to: 6.8
Change-Id: I5906d8fd0f146dc9db8d9ae2d8c0053bff21b840
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 2dfbfd5f9a800f40afd2a4e48a208a9f781fb0ae)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This adds an SHOW_INTERNAL option to qt_internal_add_docs that
passes the --showinternal option to qdoc.
The option can also be set for all calls by setting either the CMake
variable QT_QDOC_SHOW_INTERNAL or the environment variable.
Pick-to: 6.8
Fixes: QTBUG-118176
Change-Id: If72c4072e10bc5f12b0431a5f8abea6ee1e2bd69
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 0b7ff3d0a7be7b8df6184cde5ca33bb681790131)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Calls to qt_internal_add_docs now accept the following options:
- QDOC_EXTRA_ARGS: Extra arguments to pass to qdoc
- QDOC_PREPARE_EXTRA_ARGS: Extra arguments to pass to qdoc prepare
phase
- QDOC_GENERATE_EXTRA_ARGS: Extra arguments to pass to qdoc generate
phase
In addition, the following cmake and environment variables can be set
to pass extra arguments to qdoc for all targets:
- QT_QDOC_EXTRA_ARGS
- QT_QDOC_PREPARE_EXTRA_ARGS
- QT_QDOC_GENERATE_EXTRA_ARGS
The cmake variables can also be set at directory-scope, before the
call to qt_internal_add_docs.
Pick-to: 6.8
Task-number: QTBUG-118176
Change-Id: I0e28f3b863d5ca4efd0256432130af1c9c965f9d
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 948b2f601dd9c7f526497680c5c4928d2793c238)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Change the option handling code to be similar to our other internal
functions.
Break too long lines.
Add a doc comment.
Add a message(DEBUG) for the case when qt_internal_add_docs is still
called with one argument.
Rename doc_project variable to qdoc_conf_path.
Pick-to: 6.8
Task-number: QTBUG-118176
Change-Id: I73167f1e72e2abcdb90722ecd6ee00f7636b8a5d
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 2fd16b2acb726e597479bb30f42363075e3de56b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Since 2023, pgBouncer supports prepared statements but only when
prepared/executed/removed at the protocol level.
So to support this, You need to call the appropriate functions
from libpq.
it does not change the behavior otherwise. You can note that to free
statements, libpq only has the function in v17.
Prior versions of postgresql will still use DEALLOCATE.
Fixes: QTBUG-132303
Change-Id: I2456820bbea318e1715ae46617bf4d137815ca54
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
(cherry picked from commit ca09bc8d7a96b95d40bec9638f63467a24dfc0c2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
`INSTALL_PUBLICBINDIR` is only exported if it was defined by the user
when building QtBase. The conditional check aligns with the one used in
`qt_internal_generate_user_facing_tools_info`
Fixes: QTBUG-107016
Pick-to: 6.8
Change-Id: Id5c38555e1d22cb3c16d85261cb052c695b4de03
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit a9964422360c637c7a46f85628a580448bb13bc1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
...that tried to load Qt6Foo instead of Qt6FooPrivate. This might now
load the wrong package, since we've split CMake packages of public and
private Qt modules.
Enough time has passed, and we can assume that all
Qt6*Dependencies.cmake files have the _qt_package_name property set by
now.
Task-number: QTBUG-87776
Change-Id: Icf18872dd49b1e3a82b7327027f7d6e48b656b70
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit ed7bc398d8f8f033a79e1adddf7874e9fdd961af)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This is a compatibility function for `cmake_path(RELATIVE_PATH)`.
For CMake<3.20 it uses `file(RELATIVE_PATH)` instead
Pick-to: 6.8
Change-Id: Ibf9ca221c1753bd99dcc1820bffaea28f9bfe5af
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 334acc2eb3ec0cba702780036c94abdac306864e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The mentioned version is from 2015.
Change-Id: I330bd8ec08ab815a85d3e4e5afc44f314ade2ef6
Reviewed-by: Kristoffer Skau <kristoffer.skau@qt.io>
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
(cherry picked from commit 20b07bfa305153b8d828e133bb7dda838c2166c6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Problem is, this has potential issues down the line. For example,
if one pops up a QQuickWindow afterwards, also with Vulkan, and
wants to do things like enabling the debug layer (QSG_RHI_DEBUG_LAYER
and similar), that will not work since the instance is already up.
In absence of better solutions, drop a warning as well and keep this
undocumented for now.
On the plus side, this allows applications to implement things like
enumerating adapters with Vulkan and then launching a QQuickWindow
with the selected adapter. With other APIs (D3D) this is a breeze,
but is impossible here due to the very unfortunate concept of Vulkan
instances, and handles such as a VkPhysicalDevice being tied to the
instance.
An application has no way of knowing what VkInstance Qt Quick will
create/use, unless the developer does the extra boilerplate to
provide their own, which is an overkill in this case. So offer some
way to make this work, even if there are some pitfalls.
Change-Id: I1fc11f90cd1bf3fdac945ed5a7221f596368d30e
Reviewed-by: Kristoffer Skau <kristoffer.skau@qt.io>
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
(cherry picked from commit 3c338def89a4e03e3b47e624d83d83785c52037b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Include each of an entry's truncations right after the entry if its
script (or, where absent, the one implied via likely subtag rules)
matches and there is no later entry that it should appear after. This
is a compromise between prefering strictly equivalent matches to
potentially incompatible ones and prefering candidates derived from
earlier entries in the original list. Defer to QLocaleSelector (see
QTBUG-112765) the addition of options to give the caller control over
how to make that compromise.
On picking to 6.9 (by hand, since initial pick failed for want of a
precursor I've now picked) I've decided to pick to 6.8, which shall
surely get conflicts, since we want to fix the same issue there.
Pick-to: 6.8
Fixes: QTBUG-131894
Change-Id: I8750f4f40530c94638853388f47fcae1008db8d5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit cbf49f735e3cca85922a85d6548666816686db78)
We were including, for each entry we got from CLDR or the system,
minimal and maximal additions from CLDR's likely-subtag rules, plus
versions with script omitted and possibly also territory added, when
likely-equivalent to the original. Include also the converse, with
territory omitted and possibly also script added when
likely-equivalent, so as to control order when these entries also show
up by truncation of others.
On picking to 6.9 (by hand, since initial pick failed for want of a
precursor I've now picked) I've decided to pick to 6.8, which shall
probably get conflicts, since we want to fix the same issue there.
Pick-to: 6.8
Task-number: QTBUG-131894
Change-Id: I363bfe31867be43807fe3b4942dafa186b8d2e94
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 7f9ee43de783105d8de0a0b614751eec639131f8)
Skip duplicates as a separate step, to save some complications. Other
than that, achieve the same results by post-processing the list,
instead of trying to integrate the finding of fallbacks into the main
iteration. This makes the code easier to think about and cope with
further complications as we come to them.
Change-Id: If06eae5fd1e91e88b52b3d32ccaba8cbb8e3c8af
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 2c39365aad957aea7ca9c9c861665391edf7ef23)
We can test whether the candidate is already in the list by exploiting
the comparison of QLatin1StringView with QString (and related
QStringList::compare() overload), so we don't need to convert the
QByteArray to QString unless we're actually going to add it.
(This does lead to the prior name being converted twice, but the
second of these is about to go away.)
Picked by hand since some later changes turn out to need it.
Change-Id: I8e47cbb4c9e44ad8ef13d04e930a4619845418ef
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit f8128f280999e21ba291c899ce669d77803b976c)
The unconstrained implementation was removed, so qdoc was not able to
find a proper function. Provide a fake definition that matches what
qdoc expects. In this case the users shouldn't really care about the
constraints that the actual implementation has.
Amends 0c707c6ebece18677deaccccdfec5d48c587106f.
Found in Qt 6.9 API review.
Change-Id: I6207b491fa94cc62d217af7dc7687923dc6971a4
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit b1509550436400ec9be608b5c760501d9b86912a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
So that it allows overloading.
Also move the type T declaration into the function scope, as it
could never be used as a constraint anyway, and we do not want
users to pass custom type there.
Amends 0c707c6ebece18677deaccccdfec5d48c587106f.
Found in 6.9 API review.
Change-Id: I086d65bdef7be2f9e0e67e96cc8a9ac76eaa5b0f
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit f1d2d47f609cfb3c4cf9b2a86072613b3c9e0642)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Also add a comment to publicsuffix-list's entry that the update is
done by a script that should be updated whenever this file's contents
change.
Amends 36dca3c04f759449f74008a3e79021a179b0f35e.
Pick-to: 6.8 6.5
Change-Id: I1a0e51568e6d4300197c09f759ad3d82277a74d1
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit b9f74f9a0b97588fc07d75fa6a427f5c8d6a2c6c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QAbstractFileIconEngine stores the generated pixmap in a QPixmapCache
with the size as key. This is wrong as the size is multiplied by the
current devicePixelRatio so this has to be done also for the key.
Pick-to: 6.8
Change-Id: I6d8ceedc950d23abf9c4d79d92e86848b9508c9b
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 83ff179f85559af880d28d7832d44f95c5ce9616)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
We changed the default in 6.8. It was documented in the changelog but
not in docs. Amends 09ea47f8113bdce437253b19a91f739aeef7a333
Pick-to: 6.8
Fixes: QTBUG-132173
Change-Id: I1b6bf69931ba12025cf95e80c12a5073a94af598
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
(cherry picked from commit 622133ace2533617f294b8d875b5eb749a78571b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
So the array itself is also const.
Amends a94731c2ad85f9dd40050a780f67c911bf12668e.
Change-Id: Ic4d78d3d059dd47f776ffffdd0971b1aa35a69e9
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 8500e730406cf592d9eeffadab3c4f7e6a51da96)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The previous attempt to escape invalid characters for username/password
did not work for e.g. '}' or '{'. The msdn documentation is somewhat
inconsitent here but after testing it looks like putting the
username/password inside '{' and '}' no matter if needed or not is the
easiest way. We have to escape '}' by doubling it though.
No need to escape the DSN - testing on windows revealed that ';' is not
allowed in there and '\'' and '"' at the start of the DSN is perfectly
fine without any escaping.
Pick-to: 6.8
Fixes: QTBUG-122642
Change-Id: I04d007d343dd65eb0dbc0252518843eb43cd9ab8
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 38277a88f1dd69de6e031bc8313c8d5beadf6bd0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
There is no need to set a minimum width for QAbstractSpinBox in
QWindows11Style::polish() as this might override the user preferences.
Also the minimum size handling is now properly done within
sizeFromContents().
Pick-to: 6.8
Change-Id: Ibc1fd7a6f862fc85e3739025b9de581aa235d74c
Reviewed-by: Wladimir Leuschner <wladimir.leuschner@qt.io>
(cherry picked from commit 2ec4c28470de115c16944653a5d4f6209452d56c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Add two new enum values:
IsDecoratedRootColumn: notifies the style that the current cell also
contains place for the tree column branch indicator so it can e.g.
properly draw rounded edges in a cell or complete row.
IsDecorationForRootColumn: the item contains the information to draw
the tree column branch indicator.
Task-number: QTBUG-131585
Change-Id: Iee2823fe3a227630f926d0448095a10fad2b0ba7
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit c917d16f4b9982425b51dfc4947792e36defde35)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Nothing has changed in the headers we use, aside from the version
number, since v3.23.0, so we may as well declare ourselves up to
date.
[ChangeLog][Third-Party Code][QtTest] Valgrind headers are up to date
with Valgrind v3.24.0.
Pick-to: 6.8
Task-number: QTBUG-132871
Change-Id: Ib2ad8d73e662535a014d241b46cc50214b45f50b
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit 549bab4150b4652bb8b6577c737e49ae03f6348f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
If the objcopy call parameter is in quotations marks it fails the call
and prevents separate debug info builds for QNX.
Fixes: QTBUG-132801
Pick-to: 6.8
Change-Id: Ifadf57f80eb5c354aedeb8985bc7a0c9b79dc62e
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 9261b68395df75dbb01539c547832d9cc35521d9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This avoids the need to run qt-cmake-standalone-test and then import
the test, as described in QTCREATORBUG-25389.
Pick-to: 6.8
Change-Id: I010d6613debb2e34ef3809d2da78ca33ade4d602
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 742a0ed72f5264b0198d87df6c4e0657eaf48172)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
When even some values I haven't seen may need to be left for later,
but values I have seen are definitely to be discarded, I need to know
if I've already processed them before doing the fiddly check for
whether to defer; but if I decide to defer, I haven't yet processed
and need the later check, to which I've deferred, to see the value as
still new, even though I did once ask about it before. So I need a way
to query without adding to the set.
Pick-to: 6.8 6.5
Change-Id: I712f1c400147210c149aeec6de1d15d2e095d6a9
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 09b77a8d07276e0b5e5fec596f957f8fc4a78869)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Pruning the part of a locale name after the first '_' should now be
redundant, as QLocale::uiLanguages() now includes the resulting
truncations. It may do so later in the sequence than the pruning used
here, where the pruned version either might be a bad choice (due to
being in a script incompatible with what we started on, e.g. pruning
pa_PK to pa, which uses a different script) or would also arise from
some later, more specific, entry (as when uiLanguages() is expanded
from {en_NL, en_150}, where checking en immediately after en_NL would
bypass the more specific en_150 when present).
Change-Id: I4c7c199ca16a8e4803843547c5a689cea11af1f2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 9574e8cbef06b3b55d1f651b09d134aef7150aba)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
We intentionally include <version> in the most low-level Qt
header, so that all other headers could just assume that it
is always available.
In this case it is already available from qtconfiginclude.h,
which is included from qtconfigmacros.h.
Amends 20b6ebea84997ecd70d37640f68232c60cc7231f.
Found in Qt 6.9 API review.
Change-Id: I430c7392b5237ec582708e3ae1170eabc7c3a402
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 9a3199fec2673e591811a4775ec8a00073c9f433)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Url passed from the QFileDialogArgs will never be invalid, it will
always be the value that user passed into or the lastVisited or the
working directory. And because of this, the fixes code of QTBUG-70798
will never be invoked, and the `lastVisited` will never be initialize if
nativedialog is in use.
I wrote an init function to initialize the `lastVisited` global
variable, to make sure the value will be loaded correctly
Fixes: QTBUG-70798
Pick-to: 6.8
Change-Id: Id05f63db7b4738e6317721741111882a565437e3
Reviewed-by: Xu Shitong <xushitong@uniontech.com>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit 34f1b6b6d1dd7c37f2d71c0032ddc0c83360c11c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The implementation follows XDG Desktop Portal mostly, and is for
desktop, not generic unix.
Task-number: QTBUG-130884
Change-Id: I88456abb37b8b23cfec00ee8eac8ffee9a65ed9f
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 3e29267df0e2f332290caad69e5bd5cfd61cf3da)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Including bsdfb/directfb/eglfs/integrity/linuxfb/vkkhrdisplay.
QGenericUnixServices is mainly for desktop usages which uses dbus
and xdg things.
Task-number: QTBUG-130884
Change-Id: I003ec780aa039610cb5c36cd67cabbf173d8f642
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit f8d0e4798c0d2985dbe5f8515a8281c9109ef6c4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
In order to optimize the footprint of QPA plugins, we avoid to
create QPlatformServices object in QPlatformIntegration constructor.
It benefits embedded platforms and others.
Task-number: QTBUG-130884
Pick-to: 6.8 6.5
Change-Id: I5c0d2616ace9fbc0e077eece32d8836b40fc83dd
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit ff51ea5418d131248b07e327513b41dad1231f37)
Reviewed-by: Liang Qi <liang.qi@qt.io>
We have weaned ourselves off of qExchange(), which, however, has C++23
semantics (is constexpr and noexcept), while we only require C++17 atm.
At the same time, we have more and more uses of a constexpr exchange(),
iow: the C++20 extension.
We have the qNN namespaces for this, so let's use it: Add
q20::exchange(), with C++20 semantics (constexpr, not noexcept), and
use it to port the only remaining qExchange() user (since ported to
2×std::move() to make the header compatible with QT_NO_QEXCHANGE),
QScopedValueRollback.
No user requires the C++23 noexcept on the function (compilers will
figure it out, because the std::exchange is fully inline), and we
can't provide a q23::exchange() even if we needed to, because the
author of P2401 forgot to ask to update the value of
__cpp_lib_exchange_function...
Fixes: QTBUG-133038
Pick-to: 6.8
Change-Id: I003df445001d1c5ab02402119c5e5106aa156263
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit b5ed7fb203335cef7b7b4f70f4130b07166cecf2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Amends commit ff9da1db0b0963f967f45ab430ec40a3051b70b4.
QDeadlineTimer's Forever constructor is constexpr inline, while the one
taking an integer is neither. In an LTO build, the compiler might have
realized that it's constant, but let's be sure.
Pick-to: 6.8
Change-Id: I2c07caec660e05efe695fffd6ac8ec3120258a96
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit ef73a5f175f8d51a0bacbdd30cacbd3b6d151d36)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This says better what it is and I'll use the trait for the unlock
operation.
Change-Id: I46752ca2ee71297d77e5fffdddaa193b6c86dbbc
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 85ebb9d52a413f205046f864a2823e3f0819ed9e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Right now, the DLLMain in qaxserverdll.cpp calls GetModuleFileName() on
the hInstance for the DLL and passes the path to QCoreApplication to
override the path. This adds a way for it to simply pass the hInstance
handle, which will automatically cause qAppFileName() &
QCoreApplication::applicationFilePath() return the DLL's path, which in
turn influences the default QCoreApplication::libraryPaths().
Change-Id: I3cc172288c54c3938566fffdfb62985000ce2e9c
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit 507024317fec0c1deeb62c8c2ba5a43af7d65f21)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The messages said "This test crashes on Android" bu tit appears the
problem is not a crash, but that the executable can't be executed. The
file appears to be present and yet execve() is producing ENOENT (No such
file or directory). That probably means it's the interpreter stored in
the ELF header's dynamic section that is not found.
Fixing that is SEP[1].
[1] https://en.wikipedia.org/wiki/Somebody_else%27s_problem
Change-Id: I3025825c5e00f47a5a40fffd53c47131db3676dc
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 40ad963e1a22dbf3eea96f6a17bf6cbb28294649)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Created a list and added Android to the existing mention of iOS.
Fixes: QTBUG-132742
Pick-to: 6.8
Change-Id: I6e906980d28b54daf18c019eb9299a9d67daef3d
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit afa34d5f3773dec4fb2a7d524100a6f7a307e3e6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The serialization code did stream out a function pointer as an integer,
and then tried to set it back -- effectively, it has *never* worked
since the beginning of public history, unless
serialization/deserialization were done within the same process.
While we cannot support streaming custom easing functions, we can
recover the non-custom functions from the type, which was also streamed
out; setType will take care of that, and we'll just ignore the
subsequent field in the stream.
If one tries to stream out a QEasingCurve with a custom curve, what do
we do? I've decided to just print a warning and stream _something_ out,
so I can keep some degree of behavioral compatibility and aggressively
cherrypick this patch.
AFAIK, there's no support for such a scenario in QDataStream: all
out-stream operators have a wide contract, and there's no Status flag
that meaningfully represents this case (and I doubt anyone checks QDS'
status while writing into it).
Change-Id: Ifa80cf3a9003cab074ddf112022c09b364497007
Fixes: QTBUG-132575
Pick-to: 6.8 6.5 6.2 5.15
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 78a46bf16b7061bfd77b7b3bcf392c28ee788bfc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
If qtbase is configured with -debug-and-release -force-debug-info,
which maps to '-GNinja Multi-Config'
'-DCMAKE_CONFIGURATION_TYPES=RelWIthDebInfo;Debug'
and then qtopcua is configured with -GNinja -DCMAKE_BUILD_TYPE=Release
building the 'all' target would not build executables or tools.
That's because the targets have their EXCLUDE_FROM_ALL property set to
exclude any non-first multi-config, and Release doesn't match
RelWithDebInfo.
Such a scenario can happen for our multi-config windows builds, when
someone tries to build a repo not with qt-configure-module but rather
with cmake directly. They would then not specify the same build types
or generator, which can happen when opening in an IDE like Qt Creator.
Make sure to also check if the current generator is a multi-config
one, in addition to whether QT_FEATURE_debug_and_release is ON, before
adding the genex to the EXCLUDE_FROM_ALL property.
This allows building and installing executables and tools in such a
scenario, because in a single config build, the genex would not be
added, even if QT_FEATURE_debug_and_release is ON.
Pick-to: 6.8
Fixes: QTBUG-132609
Task-number: QTBUG-132338
Change-Id: Iaee1a0afb19df97ee1263dbaf27c8e29fc127831
Reviewed-by: Jannis Völker <jannis.voelker@basyskom.com>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit baddc0a1958c8ea9cb946465c93ecdd62bde9d3d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
- Use auto * when initializing with new
- Initialize variables
- Fix static invocations
- Use per-class includes
- Minor cleanups
Pick-to: 6.8
Change-Id: I137bc7dfad63bc55a1b1bbc3f42d758bbfdb86ba
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
(cherry picked from commit f388ca8841ad25cf79e5fdf8fa3e9d2f4de48ebc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
If you drag-and-drop a OpenGLWidget in Designer, the main window gets
re-created when the OpenGLWidget is instantiated. So in general (in
rare cases), at the end of QWidgetWindow::handleMouseEvent() we might
have a different window, and therefore can't reliably call
QWindowPrivate::maybeSynthesizeContextMenuEvent() without checking for
a valid pointer.
Amends 84a5f50c7766c99f62b22bb4388137e0aa8dd13d
Fixes: QTBUG-132912
Change-Id: I7b220b4daceab988aadabf9427ef6b2d5624e00d
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
(cherry picked from commit 1accd2421686b387daa115b3a46974fce0fdb118)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The documentation for QPaintDevice::PdmDevicePixelRatioF_EncodedA
refers to encodeMetricF() which was nowhere to be found in the
documentation because it was marked as internal.
Pick-to: 6.8
Change-Id: I37707bc641d359f367f77c958043b6dfa33d4dcb
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 3ff989acaf84405a472605140e4035b993380bce)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
According to the discussion in QTBUG-132398, the script stopped
working in newer Xcode versions, and also didn't cover new
Objective-C language features.
Remove the script to avoid confusion.
Pick-to: 6.8
Fixes: QTBUG-132398
Change-Id: I37b96ac6a77af1fcc4221591cb1f6320fa9a024b
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 6404714183b3fcf93ac27482c5a3193a4f93767d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
qt_register_target_dependencies does the same thing as
qt_record_extra_qt_package_dependency but in more convenient way.
Update the qt_register_target_dependencies signature and adjust naming,
it now accepts PUBLIC and PRIVATE multi-value arguments and called
qt_internal_register_target_dependencies.
Use it and deprecate qt_record_extra_qt_package_dependency.
Pick-to: 6.8 6.5
Change-Id: I0594cf699ec1e3af7210dd7450fa3f81c1f565ae
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 8272b747d3b91e15fda2b76326221a26fb2245d2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
To avoid the following error:
The custom command generating
.rcc/qrc_editabletreemodel.cpp
is attached to multiple targets:
editabletreemodel
editabletreemodel_tester
but none of these is a common dependency of the other(s). This is
not allowed by the Xcode "new build system".
Pick-to: 6.8
Fixes: QTBUG-131631
Change-Id: I1c5d0702596a4f8f723d9080bc5304d6ad06853b
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 9f593791988da197dbe956669b8a4647dc50124a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The generic copy-and-remove fallback will first open the original file
with a different case, truncate it, and then remove the original file.
Leaving us with no file at all.
Task-number: QTBUG-132785
Pick-to: 6.8 6.5
Change-Id: Ia5a41d26c1d6d6bdc231c71acf15bd2ea496c715
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 2defca418788ab167fa1ce70e518c9250cb0909f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
When we're trying to resolve a font for color emojis, we will
prefer any color font over the selected font (since a normal
font may have monochrome glyphs for emoji characters and that's
not what we are after).
If there are no color fonts on the system at all, we need to do
a final match where we ignore whether the font is in color or
not and just return it anyway.
In this final pass we would find the first best match among the
fallbacks (typically the first one), but never actually check
the font that was requested in the first place. This was a
mistake. Unless it does not exist, we should just return the
requested font family.
Task-number: QTBUG-132377
Change-Id: Ie53a6bd665ebdaaca92bf0c33fabf5195e1aa5fe
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
(cherry picked from commit b154af082c8679fa09f325735025d98df9a8dcff)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Construct the arguments list explicilty to QStringList to avoid calling
QProcess::splitCommand() and potentially splitting a path with spaces
that shouldn't, this also saves from having to deal with shell quotes.
Fixes: QTBUG-132891
Pick-to: 6.8
Change-Id: I48f6c219830269c507f146b654bcfa025f0e3203
Reviewed-by: Olli Vuolteenaho <olli.vuolteenaho@qt.io>
Reviewed-by: Petri Virkkunen <petri.virkkunen@qt.io>
Reviewed-by: Soheil Armin <soheil.armin@qt.io>
(cherry picked from commit a8d8fb83ccfed09dd35dbab22caceaff963a3415)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
There were two mistakes in the code that intended to detect
if a specific font was a color font in the FontConfig database.
1. The "int n" parameter in FcPatternGet*() is not an array size,
but an index, so it should be 0 and not 1.
2. We need to add FC_COLOR to the list of properties in our pattern
when populating the database, otherwise we will just fail to match
it and none of the system fonts will be listed as color.
Fixes: QTBUG-132377
Change-Id: Ib3c112e8a354abacd05679c62283a1f1abfb40ee
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
(cherry picked from commit 2e1db6541777ee076195ff9e793e4e83afd81539)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QT_MOC_CPP is not the same as Q_MOC_RUN, which moc's preprocessor still
sets. It appears Qt 3's qmake set it when ALLMOC_HEADER was set... a
feature that doesn't appear in Qt 4 (but exists with cmake_automoc).
MOC_SKIP_{BEGIN,END} appears in Qt 3's moc, but not in Qt 4's. But they
weren't in qthreadstorage.h at the time, so I guess they were added in
the 4.0 development cycle when QThreadStorage changed, but before moc
was rewritten (which deleted the Qt historic repository's oldest file,
moc.l).
Change-Id: Ibfff778c9f4d17af006dfffd8545fb24b495ecdd
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit bec49144f809ef8c5c61099ce46241c16b20b180)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QHeaderView has no resizeMode property, only a ResizeMode enum type that
is then used in the sectionResizeMode API.
Fix that reference, reflow the paragraph, and apply some light editing.
Amends 9e3a96189d9db8a458e65cd5078509afe7a160db
Change-Id: I240c3f64fd45c96f4d3ba95c2086a638468e137f
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
(cherry picked from commit 988a3cd95da4b5875c7116141f2b22acf3e20502)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Added the missing function declarations to the #if Q_QDOC part of the
header. Also fixed a typo in the std::unordered_map docs.
Amends 850d4895be565931d18c92e5e2f9a33b7f26de6d,
0c96528e8d43ad4309bdca14b179a5045984655a,
a9fe57fefaac0cb047e4c02e0b8c8f8327e0a58c,
and a8c9a5617c72ad2e55bf497df6ff2c2e141cbdef.
Found in Qt 6.9 API review.
Change-Id: I792023b506e2afdbdca4bca3197887e50c98a788
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 256b56f581a66acde829a2f47b3d0f6ed464fb44)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
And remove NOLINT(clang-diagnostic-self-move), silencing the warning for
Clang seems to work for clang-tidy too (tested locally).
Amends 03bd9491491881529ad28cd6d672edfdda9a0065.
Pick-to: 6.8
Change-Id: Ibdf982a728f2c6150f2911173dc3c9246f3662b8
Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 6f0f39673f5ae9debd9ab59be60c32f00f40c41a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
With LTO, I'm seeing GCC conclude that it's best to inline the
lockInternal() and unlockInternal() methods into the public ones and
then emit out-of-line copies for those. That's actually sub-optimal, so
force GCC not to do it.
Pick-to: 6.8
Change-Id: I88c29098757ea6e70c00fffde56989ec05b136bd
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit cc4abefb1db3bdfee0d57ea528d55073a4498b4d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
There's no need for it to be a global, if the data isn't either. I have
a vague recollection of the data also being globals back in the
day... (they used to be plain QStringList pointers).
Change-Id: Ie5f1a71d0b20a0195822fffd992101c94824a07f
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
(cherry picked from commit a314e4b98513d4b5cd89d05e74f93c2b16ebc168)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Those aren't GUI tests. I suppose they've been in tst_QApplication since
Qt 2 or 3, when there was no QCore/GuiApplication yet, and were never
moved.
Change-Id: I30b3c1a309ba2c720210fffd045ebd0bcfa803fe
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 9fe44e4779cf421de7f33f867be8e55d291c16ea)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
moc (and thus the bootstrap library) has needed JSON output since Qt
5.15 (commit da284ef10e0ef80776b9fc9b7bb0e6dc8d71ba63 "Add support for
machine-readable JSON output to the MOC").
Change-Id: I4b8cf51c092eb35cc383fffd48d120f0cb2c56b0
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Johannes Grunenberg <nerixdev@outlook.de>
(cherry picked from commit 029bb47e12d63e186663714c3776d3654285496b)
The idea of b2ed29b8d9b33dcece83000aee28073dd27f1cd9 was to have the
contents of <version> (if it exists) available in all Qt headers.
Since we broke up qglobal.h into smaller pieces, qcompilerdetection.h
is no longer necessarily included by any given Qt header, which
thwards the original idea.
Try with qtconfiginclude.h, which exists since
61935786c30b0209811fa32f7a02f138da8570b2 (Qt 6.6).
For Qt 6.5, we'll need to add it separately to qtversionchecks.h and
qtconfigmacros.h, whence qtconfiginclude.h was extracted, as well as
keeping it in qcompilerdetection.h, which includes qtconfiginclude.h
only since 22029a76c37d8d670479d523684a84f7966ed434.
Amends the breaking of qglobal.h into smaller headers, without being
attributable to any one of the individual commits that made up the
change, or else amends b2ed29b8d9b33dcece83000aee28073dd27f1cd9.
Pick-to: 6.8 6.5
Task-number: QTBUG-108228
Change-Id: I909196bd767e8d9e016069f1a59994d40e646e59
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 4771dc308785ed132198b2c9a3200b7eb26d683e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
GCC 8.x does not treat __builtin_unreachable() as constexpr and
disallows using the Q_UNREACHABLE_RETURN macro. Guard the statements
with the respective checks.
Amends b0b34c56a99130bfc9c82cb006653ce6b8f0516e
Pick-to: 6.8
Task-number: QTBUG-125285
Fixes: QTBUG-132804
Change-Id: I88cdbe3bae1a336edc255e3e93e8d948bde253da
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit a57d5b1fd60b6b6848ef8ad9db237941229d7a23)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
As we produce crash reporting via Swift on macOS 15 now.
Pick-to: 6.8
Change-Id: Iab4777b29bcaa66eff9d2f1de63072f5744d56df
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit dbfc3c9c381aa1cc0ab3cf5b758b38fb4499cb39)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
A QML module can have URI that include dot character.
In this change, we refactor the code generator to create
the same hierarchies as a Java package structure. Each
QML module URI will be appended to the base application
package name to form a package that represents the QML
module as a Java package. Then the generated code of each
QML component will be placed in a single file.
This change, also refactor how to generated code should
be written in the file, by buffering the generated code
to a QByteArray first, and then flushing it into the
target file. We also create a marker file inside the
directories of each module, so that we can entirely
remove the directory and all its files before generating
new code during the next build.
Fixes: QTBUG-125891
Fixes: QTBUG-125970
Fixes: QTBUG-125971
Pick-to: 6.8
Change-Id: Iebce6495d9d29af32c3f1f97274c252444d2864e
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 68785b3e59c8a8f4a383051123b87af3d930ff18)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Recursively find all qml modules, built by this project.
Later, the qmldir of these modules will be used to
generated to code.
The command line argument -i of qmldom tool had
to be replaced with -I. The -i was incorrect as it
expects the qmldir file while -I accepts a QML directory
to be included.
Fixes: QTBUG-125892
Fixes: QTBUG-125970
Pick-to: 6.8
Change-Id: I4099e488d3d7f4b79566e6ea19eca95f57f7c2fd
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 7ed88eb565d40b195aa868e67777872ef07a5ea2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
We want to test if QT_BUILDING_QT is defined, so use the right
construct.
Pick-to: 6.8
Task-number: QTBUG-132900
Change-Id: Iac26f70021a337a2c476618979b4b8eb180ffd3b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit fc4aff1249ffbb7a1b34df8a3b06c17aacb22308)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Use ifdef, not if, otherwise we trigger -Wundef if the feature
is unsupported.
Pick-to: 6.8
Task-number: QTBUG-132900
Change-Id: I8a779da59bf2c7add14ace6405faf19b7ca48c28
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit f04dfa8666662ddefa52a0bd1c8a60be361e4c00)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Call QCoreApplication::forwardEvent() rather than sendEvent() to ensure
the QContextMenuEvent is spontaneous if the mouse event is.
Fixes: QTBUG-132873
Change-Id: I6198c2105210d2841f43ef81a9be0f917272846f
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 97605760aec7bfe48a8642ba8677204efd9c46a5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Emit a warning if the string we get is too large for Java, and cast
the size to jsize before calling JNI.
For consistency, replace the Q_ASSERT in QJniArray's size check to use
the same logic.
Addresses header review comment; code was not handling this case before
it got moved into the inline helper either.
Change-Id: I00d68509be8b5f7304dda2e824fa0ced0f8f8d48
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 9d35561f6f6be125369e6020ce95a73b4aa6b51f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Older devices may have lower screen resolution. In this case, the
hardcoded width may not work as expected. For example, all text may
not fit in QLineEdit.
This was the reason why the tst_qlineedit::textMargin test failed on
some Android devices (especially x86 emulator with Android API 29).
When the left and right margins were set to 20, all tested text did
not fit in QLineEdit. When we clicked at the beginning of QLineEdit,
we clicked on the second character of the text. The cursor was moved
to position 1, which caused the test to fail.
This commit updates textMargin test to make sure that tested text will
fit in to the QLineEdit.
Task-number: QTBUG-87417
Fixes: QTQAINFRA-6897
Pick-to: 6.8
Change-Id: I35352ac1e6f975e72d5c9638f8520f8ddd1d56ae
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
(cherry picked from commit 0a017308cca154b6f906c6e143fb33fe109316bc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Using the left/right keyboard key will deselect the text but also
move the cursor. In this case, to be consistent with the test, the
cursor must return to the previous position. This allows to
unblacklist tests:
- undo_keypressevents
- leftKeyOnSelectedText
Task-number: QTBUG-87417
Fixes: QTQAINFRA-6890
Fixes: QTQAINFRA-6895
Pick-to: 6.8
Change-Id: I8a6d7cca332fe365ca820a67c23d9cd3fc36fc43
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 43f2fdc25cfd356292636ea1f8160cf62bab4018)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The font matching process consists of multiple passes, so to help
us keep them apart, this adds some informative output to explain
where we are in the process.
Change-Id: I54f0712cc8600d2b1e1bf4b8688e2ae198e0453b
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
(cherry picked from commit d2c8c12183a7f085643ee2d1fa7cd1677256b148)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This amends 16850709306589a2433c0038605d365a6b6bedad. The patch
aimed to pass false for the color font parameter, but got it in
the wrong position, so it passed false for the pixel size instead.
The registerFont() function is a real mess, and it should be cleaned
up, but this at least fixes the immediate bug.
Task-number: QTBUG-132821
Change-Id: Id54989960aa5f86d3c79423d004530bb6a4fa475
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
(cherry picked from commit 0107e05e50761dd29a3d968baa9f502ade41e064)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
For populating the freetype font database on Windows, we're using
GDI, which does not support color fonts. Therefore we were
registering all system fonts as monochrome, which was okay, because
our Freetype backend did not actually support the color font format
used on Windows.
Since 29a1c57183958b3951db4e7ba9504918a3caa761 we now support COLR
fonts, so they should be added with the correct properties.
Since GDI does not provide this information, we create a temporary
freetype face from the font file when resolving the family during
matching.
Fixes: QTBUG-132255
Change-Id: Ib62632de7fe8d9dc533abe4ae2368090a382cca7
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 81e596c24fc106439ce4135478a2d18d23fdbaac)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The return type of the QtAbstractItemModel.sibling() method is
a QtModelIndex Java type.
The JNI call from QAndroidItemModelProxy::sibling() is using
<jobject> as return type of QJniObject::callMethod(). This will
result in a non-matching JVM function signature.
This change replaces jobject with JQtModelIndex as the QtJniType.
Pick-to: 6.8
Fixes: QTBUG-132841
Change-Id: If157858f1ed49e25c8fbdfb9bb5c1fc2b7052826
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 190c85b706ee80bc92d6419676dca0dbfa60587b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
All modern compilers implement divisions and modulus via multiplications
and shift, so the codegen is practically the same (three multiplications
in total). But the new code allows more than 136 years of uptime (49710
days).
Drive-by fix indentation in nearby line.
Change-Id: Iea806bd7dfac1f852c66fffd41c2ac6660e7cc65
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit 61924c622acc5afd1e01dd65702e09a063928c5f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
There's nothing wrong with those two, but we don't need the middle men
to the monotonic clock. This also reduces the sizeof QMessagePattern by
one quint64 (QElapsedTimer is 16 bytes in Qt 6).
Change-Id: I0eb171f03ee8f3a7148bfffd5534a7f3daba3a01
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit 9dc294143d8fab498268f88c176b1af16de9b2ee)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This way they aren't in the middle of a block of booleans.
Change-Id: Iba067f6f23db7c059cddfffdc27231dd09b6898e
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 4daed2877251b861ce9f7ee5a09dc035518e1d9e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Amends commit e04f109456bbcb184963b8ed71944b958b35c201.
This function does not free the pointers stored in literals, so add a
couple of assertions to indicate that it's only safe to call from the
constructor. And that being the case, we can update the tokens
unique_ptr in two steps, which makes the compiler not attempt to call
delete[] on the previous pointer.
Change-Id: Ibe76a7df795e9c6d6191fffdf45e3b3ef6f0f344
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit b86bcf5c25d0072300a8b0a4b5cfe942cabf53ad)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
So it packs better with the booleans around it.
Change-Id: I330164b99fcbbf9e9629fffd52bcbb38bec4ac0e
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit ede95ef7e916ffb946878477938c304a5dc206d3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
When quitting Qt, only quit the hosting Activity or Service if it's
primarily a Qt app, i.e. Qt is in the driver's seat. When using QtQuick
for Android, i.e. Qt is just a View, we do not want to forcefully quit
Activities, that is up to the app code.
Task-number: QTBUG-123711
Pick-to: 6.8
Change-Id: Ib98700be8693c3d30a296998b863b0f224c9bf69
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 3bcf55daa597888fcf0997e7ce2edd1d4c730a2a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Call startQtApplication() in QtView even if the Qt libs
have already been loaded, to make sure the app gets started
also when the Activity is recreated. Check whether Qt app
is already running inside the method itself to avoid hanging up
because of trying to start it twice.
Task-number: QTBUG-123711
Pick-to: 6.8
Change-Id: I3b009e4c2f40af9f258ce32b7e181c3faa21c194
Reviewed-by: Petri Virkkunen <petri.virkkunen@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit be33f2d3233fb787d5251ba7d0876962efe49075)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
When we quit Qt in an Android app, we also quit the Java thread created
to act as the Qt main thread. This works well for normal Qt for Android
apps, where the lifetime of the Qt part and the whole Android app is
essentially the same. However, in QtQuick for Android Qt can be just
a part of the entire app, and the lifecycles are not directly tied.
Hence, we might want to quit Qt when the part of the app that has it
is not active, and restart it when the Qt part of the app comes
active again, and for this we need to create a new QtThread.
Set the QtThread variable to null when it has been terminated,
and if it's required again, create a new instance.
Task-number: QTBUG-130610
Pick-to: 6.8
Change-Id: I430e195fd319a20c9627ed98d6f30858cebc49c4
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 7c7b63f3e85436125baf2211bc5e10556736241b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Currently, we create references to Java classes and objects
in JNI_OnLoad. However, that is done only once, when the
Android QPA plugin is loaded, and in case we would like to stop
Qt entirely and then start it again, we want
to reinitialize all these things. Move these initializations to
a separate method, and call it before starting the Qt runtime and
app.
Remove the synchronization block guarder by m_mainActivityMutex
in QtNative.startApplication(), as it calls startQtAndroidPlugin()
which now will call activity() if the JNI needs to be
reinitialized, leading to a deadlock as that method is guarded
with the same object.
Task-number: QTBUG-130610
Pick-to: 6.8
Change-Id: I826dfb9b032a6c615f2408d484d1f4f0ea528d02
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Petri Virkkunen <petri.virkkunen@qt.io>
(cherry picked from commit 9f8e49360c33d5fb8e39322f3abe9544d38baae6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Q6Hash::remove() returns a bool, not an integer, like Q5Hash::remove() did.
Pick-to: 6.8 6.5
Change-Id: Ia2907c7a2a4177f9b5ad05ca1ef3b9a5baa8137a
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 441a96ba16794dc8621219be705800480654e9e8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
which follows the behavior in QWidgetPrivate::setGeometry_sys().
Pick-to: 6.8
Fixes: QTBUG-129698
Change-Id: Ia85e9470111eea9e3392cdf38c3da2db232ef065
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit def4f827da98d3027c86a8dae27811729767d36a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This removes the need for #if in the initialization list and the ugly
whitespace-before-punctuation syntax.
Change-Id: Id33ec83e574360f65c9bfffd22b8cb450156477b
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit f68df05a77afd58d60a80b16bd062d0e9e6d42a3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The logging category macro already puts the logging category into the
QtPrivate namespace. There is no need to wrap it into another QtPrivate
namespace.
Fixes: QTBUG-132111
Change-Id: I99a7aa16662e3515c5f96d6736d47c1d0e45034c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 4f05eac0a88959ff0faa4d6b194d9dd8eeb3f4b6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QWindows11Style inherits the stylehint policy for
SH_Menu_AllowActiveAndDisabled from QWindowsVistaStyle, although the
inactive selection is not visible. This patch makes disabled menu items
non-selectable.
Pick-to: 6.8
Change-Id: Ib59988cfad444f9f8203628d4b3e1f72d6775b46
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 3f42d2baacf3d227a001e49d74ea97f7ab551ae1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
COLRv1 fonts are not automatically rendered by Freetype, but
is currently gaining traction and the default emoji font on
Android 15 is in this format.
What we get from Freetype is a scene graph that we can render
ourselves. This patch implements a recursive renderer for the
graph.
One current limitations is that conical gradients are not fully
compliant with the spec. I have so far not been able to find
any fonts where conical gradients are used, so this is left
as a semi-supported feature for now. It's certainly not
needed for the Android emoji font.
Pick-to: 6.8
Fixes: QTBUG-130909
Fixes: QTBUG-131116
Change-Id: I2484743602ad16f01318ecd6de2b245b38a8f566
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 9e5887a5d4f2344aa5f62325be9d63ff3d8f18db)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Fix drawing the link overlay icon - we must not set the device pixel
ratio here as we don't know the exact value.
Also fix some styling issues introduced with the previous commit.
This amends fd7bc16e9fbdc63bd22ba90d0c20b36ccffd2bae.
Pick-to: 6.8
Task-number: QTBUG-131843
Change-Id: I382527d17e8187bfae7cf40f352e6f87965671a1
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit f4b64f9c12a6351008a08bfeb4540481edf9f1d0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The function is used in semi-public API and should in
QtPublicAndroidHelpers.cmake.
Amends de40931eba2cf09a8c97c9a75c6d23c77748f44c
Change-Id: I3946ecb091584ac5406b3eb4d2024210398f26a3
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit b0dc47aa447beaf4ab4bad39edeae06275c48f74)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
As a drive-by replace QList::append and operator<< with emplace_back,
to avoid repeating value_type.
Task-number: QTBUG-115841
Pick-to: 6.8
Change-Id: I6fb790f959b41b0feb49e3a0f0b6b3631e24a232
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 71d114588d9312e89195a32357ec402fc22b062e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QDoc markup following the \tabcontent macro should start a new
paragraph. As HTML-specific macros are injected directly into
the output, QDoc's doc parser is not aware that the macro should
start a new paragraph.
Turn the macros into generic, non-format-specific macros,
expanding to \div and \enddiv commands that wrap the tab
content.
Pick-to: 6.8 6.5
Change-Id: Ie8313af391b1a38ef74592acac3198fef5b7b310
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
(cherry picked from commit 5c0b08a20dd14f7fd8632495aa911fe427f58f7f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Set __qt_${target}_find_package_args once per the
_qt_internal_find_tool_dependencies call. It doesn't make sense to call
set it in loop, since variable doesn't depend on loop parameters.
Pick-to: 6.8 6.5
Change-Id: Ia1024625b870364a1db8e07f61bf7ea6ab4e9f84
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 80932ed80b5ec809b42be63c8f719290da56f288)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Some classes have circular dependencies:
* RuntimeIteration depends on RuntimeTask
* RuntimeContainer depends on RuntimeIteration
* RuntimeTask depends on RuntimeContainer
* TaskTreePrivate depends on RuntimeTask
* RuntimeContainer depends on TaskTreePrivate
Although there are a few std::unique_ptr deployed, the code at the
moment does not fully solve the problem: the classes have an inline
destructor, and the dependency has only been forward declared, resulting
in a build error.
Make some destructors out-of-line, and define them (as defaulted) late
enough so that all the graph of classes has been seen, in order to fix
the build.
Pick-to: 6.8
Change-Id: If150b92154061e915ebac920806717d2288c0638
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
(cherry picked from commit 71e53405a309684e4adcb8669a5f3d04319ad767)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
- `PARSE_ARGV` should have been 1.
- `module_includes` target needs to be unique
See gerrit comment of previous change, and
https://gitlab.kitware.com/cmake/cmake/-/issues/26580
Amends: 8f2f4ad4688df4963982c489c80b84e115cda29d
Pick-to: 6.8
Task-number: QTBUG-98640
Change-Id: I82b85813f282ba1d5b4c938e59558e32647d4d86
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 9f805b5bf7dc61a032a7ec79fd514c932103f1de)
Similar `*_check` targets are created in `qt_internal_add_test`.
This change extends that implementation to auto cmake tests.
Note: These generated targets do not have additional dependencies, on
the build targets, unlike those generated by `qt_internal_add_test`.
You would need to (re-)run the build first separately and then run the
`*_check` target.
Fixes: QTBUG-98640
Pick-to: 6.8
Change-Id: I387f09570b6a4a345756133870c2eb9ef1cf3cf8
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 8f2f4ad4688df4963982c489c80b84e115cda29d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Use the correct variable name when restoring the environment.
Amends e388c1caeb1ccdb88b9a9801be9cd6328d8a7987
Task-number: QTBUG-128420
Pick-to: 6.8 6.5
Change-Id: I03ee3481a4638969edd75ce6ad233e8a94d5c563
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit ccbec262c220cbe990a68611e39dca9662b71777)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
qdebug.h includes many Qt and STL headers, so if you include a Qt header
you get all those transitive includes, which may affect build time.
- Where appropriate use the printf-like syntax of qDebug() and co.,
these don't need the QDebug streaming operators
- qfloat16 is used in an inline member function, so include it
explicitly
[ChangeLog][Potentially Source Incompatible Changes] Various Qt public
headers don't include QDebug any more; if you need QDebug's streaming
you'll have to include it in your code.
Task-number: QTBUG-132439
Change-Id: I750587e17a3b38fa226cd3af8eaccc8da580f436
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 185cba6e95a006d2548f20599f84390e5a3ad653)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
COIN is using patched std::optional header for VxWorks, which is based
on 23.09 version of this system, and fixes few compilation and runtime
issues, unfortunately it introduced runtime error as well. This error
causes std::optional to not destroy contained object in destructor,
which is a source of fail in tst_QResourceEngine::cleanupTestCase().
This fail was quieted down using QEXPECT_FAIL for VxWorks, due to exact
reason being unknown at the time.
It was found out that unpatched version of std::optional header in
VxWorks 24.03 fixes most of issues found in 23.09, so there is no need
to use old header. Additionally it cleans contained object in destructor
properly, so this is the one that should be used. In order to use it,
COIN will need to refresh VxWorks images, but this in turn will fail
this test with XFAIL.
Replace QEXPECT_FAIL with QSKIP in tst_QResourceEngine::cleanupTestCase
for VxWorks, update comment accordngly.
Once unpatched optional version from VxWorks 24.03 will be used on COIN,
skip will be removed entirely.
Task-number: QTBUG-130069
Change-Id: Ib446d04b2fabb027dad7af909ac00b7b30e76b53
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit a10acaca0887541207ad5607680d7864d317cf4b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
It's possible that the first ABI from Build.SUPPORTED_ABIS would return
an ABI that's not packaged in the APK, for example if an armeabi-v7a APK
is run under the device supporting arm64-v8a, in that case the returned
path would be that of an arm64-v8a while it's not actually packaged
inside the APK.
Fixes: QTBUG-132155
Change-Id: I0f311accee246fa2d1d0b8aaf424d034b4b2d04c
Reviewed-by: André Klitzing <aklitzing@gmail.com>
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
(cherry picked from commit a5f80b4732d33dd36414a6ffbd49a9efc7c87a0a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QShortcut has a constructor that takes a _parent_ object and a
function to invoke, and it will internally connect its activated()
signal to that function. This connection will not provide a
context object (the parent is not used to this purpose).
Given it's not clear what the context should be if any (the parent?
`this`?), I'm not at ease at just supplying "something" as the context.
Instead, hide the constructor if we're under QT_NO_CONTEXTLESS_CONNECT.
There's another constructor where the caller can supply a context.
Change-Id: I21befcc86eeb07e65eadee1222757ecc5bab1d2c
Pick-to: 6.8
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit ade3bb1c5224a9155a2a2f965fa70740aa9ec8a7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
COLRv0 fonts are both scalable and in color, which was not
previously handled in the Freetype backend because it only
supported color fonts with embedded bitmaps. This patch
simply correctly detects the scalable color fonts and
render them through the same mechanism as other color
fonts.
[ChangeLog][Freetype] Added support for COLRv0 format color
fonts.
Pick-to: 6.8
Task-number: QTBUG-131116
Change-Id: I290e7525c24b4cf2ec872a366e5193f54712a3a4
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 39df9e1858a4115bc19b6a4dee5d687c5ee00d21)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The class declares a protected destructor, which interferes with the
RO5. The only subclass in qtbase is move-only; QTextCodec (in
Core5Compat) is not even movable.
Make QStringConverterBase move-only as well.
Pick-to: 6.8
Change-Id: I20d16df79f7ad8e7e7a8af339954cfa2d1482e96
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit eb533c81b8aa55f89605bb1d091afe4df4db763c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Running Chrome in headless mode helps to circumvent
a lot of issues with GPU driver/Wayland interactions
that we encounter in CI.
Run Chrome in headless mode if corresponding environment
variable is set.
Change-Id: I1cf290f484054766e2b99d99045e7b39d5662210
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Even Oscar Andersen <even.oscar.andersen@qt.io>
(cherry picked from commit 213a2610d821b93429d6519dda11ab0e7b5cae84)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Since the removed API uses QDebug. Requested in code review.
This is needed for a subsequent commit (removing qdebug.h from public
headers when possible), but I split out to its own commit to ease
backporting.
Pick-to: 6.8
Change-Id: I76980634b9ebbae7cf010d99f5095aa94a825824
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit c0fcb2db242a40cdcc2bbfd00332390b64cab439)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This fixes an issue where comparing pointers to object is only defined
if both pointers point into the same array.
Task-number: QTBUG-132507
Pick-to: 6.8
Change-Id: Ib7ccb30001add38ad25b62c848a01cd53566d8bf
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 5dcdeeebbc08be8845cdb5a0e586b7a864b7f16f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The data for the CLDR update was generated from an incorrect xnr.xml
that has contained an extra < and hence the generated
qtimezonelocale_data_p.h is also incorrect.
Update qtimezonelocale_data_p.h with the correct CLDR v46 data.
Task-number: QTBUG-130877
Change-Id: Ibc87e137b1519be470704ed519c0988333625af5
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit 95abc38ba6e586c8e491593ebe4c4b4ee32a79e7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This looks like another case of a base class with a protected, defaulted
destructor, which interferes with RO5. Explicitly redeclare the other
special member functions in order to suppress the warnings coming from
the deprecated copies.
Pick-to: 6.8
Change-Id: Icf8c8817ef001d0503683d071c4f004db64caa2d
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit f6e99f347d243749af8d9beacd7c68852f0ff636)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
I'm not entirely sure why function_ref_base declares its destructor. I
guess it's declared in order to make it protected, because the class is
non-polymorphic and inherited by function_ref, and one may want to avoid
slicing. On the other hand, function_ref_base is an implementation
detail, living in a `detail` namespace; so that sounds very unlikely.
In any case, the class is clearly meant to be copiable, so add back
(as protected) the missing special members.
Pick-to: 6.8 6.5
Change-Id: Ibf909e1746e65eecf8b8990839a6e4c9eb56ca13
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 74b875641f40b15a4a59a0c55cd79c251b49c05e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Flat buttons were larger than normal buttons - therefore also add
marginsRemove(QMargins(2,2,2,2) for the flat case too.
Pick-to: 6.8
Task-number: QTBUG-132433
Change-Id: Id010d45bf85c5d7d09ff8db8bda44b1be7d85297
Reviewed-by: Wladimir Leuschner <wladimir.leuschner@qt.io>
(cherry picked from commit a930fb758d71ef6bf353e8fd8078de2335c32085)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
As that will steal focus from tst_QApplication, which is needed for
subsequent tests.
Pick-to: 6.8
Change-Id: I5720c4a2bb45f98894616e01da10b9c40a2b6735
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 8de8800670d2881c6dfe957d6a1c5d925417b85c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Dynamic linking on WebAssembly involves preloading .so libraries
during startup of application. Normally, those plugin preload
lists are generating manually by user, which can be tedious.
Add a bash script which demonstrates how to call python
programs to generate preload lists.
Change-Id: I0a9869ad0d26606f8b33af2c38248cec3088dd0d
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 010ed1788402bf98d9b98500fdb1f61c333cebe5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
... instead of Q_NORETURN, as the attribute should be unconditionally
available since C++11.
Amends bad618606d64e943e3fa78e7d1dbc8e1fab55480.
Found in Qt 6.9 API review.
Change-Id: Ia008acf0777867f551c7e1cc3423f29f8ed6fbed
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 8472004a895fa98e68f6f3ff134720904a00c150)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The call to q_assert() isn't constexpr, so can't happen in a constexpr
function. Most compilers shrug this off as they can see the code
actually is unreachable, but apparently debug builds on QNX can't work
that out. Since nothing actually needs the function to be constexpr,
remove that qualifier. In the process, move the offset-case, which is
also unreachable, to the end of the switch, closer to the unreachable
end of the function (since I failed to spot that there were two
unreachable parts at first).
Pick-to: 6.8
Fixes: QTBUG-132698
Change-Id: Ibdde7abd91d284e1c1af53e2b5e142fc234400a8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 2578d72a7cb9b784a00efb04df6a31496d92dcdc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Was missing from this new value type, and is quite useful for this type.
Addresses API review comment.
Change-Id: I07ea7ded7f963b2032c377f024bb88e9d54a4d5c
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit b562c36a9a7be5f62a8e79b93c9728381775f460)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Java methods of QtAbstractItemModel may get called from Qt GUI thread or
Java main thread. Situation is the same with internal proxy methods,
where they may directly or indirectly called from these two thread.
At the same time, a chain of calls may happen from these threads, so
some functions may get called indirectly from a single caller thread.
In this change, we are adding a map of QObject* to QRecursiveMutux
where the QObject is a QAbstractItemModel, either the proxy instance
or a reference to an underlaying QAbstractItemModel when the model
is implemented in C++.
Each call to any function locks the QRecursiveMutux instance associated
with the QAbstractItemModel instance. A connection from
QObject::destroyed to a lamda, helps to remove the map entry when
the model is destroyed.
Pick-to: 6.8
Fixes: QTBUG-127467
Change-Id: I18dcdc207e201b3883526648b4e672e5868ed8ab
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit bf76387507dde71063ebe484bce1e7d1b8e09bc2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The qthreadstorage.h header contains two implementations controlled by
the QT_CONFIG(thread) definition.
Commit 8553ffd8d147ecf6a713d12a360027b477dd59c8 changed the positions
of the namespace macros in the header, but didn't consider the fact
that we now include std and Qt headers inside QT_NAMESPACE in the
!QT_CONFIG(thread) case.
Fix it by moving all the includes to the top, and wrapping them in
the needed QT_CONFIG() checks. As a drive-by, drop the unused
type_traits include.
Found in Qt 6.9 API review, but picking down to 6.5, as that's what
the original commit did.
Note that 6.5 cherry-pick will require to replace <memory> with
QtCore/qscopedpointer.h because
6da1f72311b844b2232da3067ad6e1e24614e67c was never picked to that
branch.
Pick-to: 6.8 6.5
Change-Id: Ic9c5fe82df38a3bd64829c016de8dcbd9f060315
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 4a6ef7fc6881c7b5ab0b9f6d51a2738ce86cca93)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This is a non-polymorphic class, so explicitly export only the
out-of-line methods.
Amends cc128d802c6d9c87a1e00a8a88d5e6590a7195f4.
Found in Qt 6.9 API review.
Change-Id: I30af1121bce1ba9c57cb326cffb1375ac3b22195
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
(cherry picked from commit 5f7149e3590e3c2e829f5a843feebe357c42ca67)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Increase the size of QComboBoxSize and align the subline for editable
QComboBoxes with the begin end end of the rounded corners.
Task-number: QTBUG-132261
Pick-to: 6.8
Change-Id: I235ec1ceb94a5e87f373b007ac31d0d8a83cf600
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
(cherry picked from commit 23c16c611cfeee55ce38e928989b346c697270b0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Decrease the bottom line frame thickness for QToolButton by using
fractional coordinates.
Task-number: QTBUG-132261
Pick-to: 6.8
Change-Id: I77a3acdd20c694dce38d809db9c3051949a98fa3
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
(cherry picked from commit 3e9baca7d2197bfc10d20de6f326e2749a8f781e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
In preparation of adding QT_NO_SCOPED_POINTER, which would be rather
pointless for users if public headers continued to mention the type.
Pick-to: 6.8
Task-number: QTBUG-132213
Change-Id: Ib5a40a1b8defe1cfe858218bb25c422f900dfe6b
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit c5a4e3f790eb4157e33eac2402110f71a76a5418)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
When converting an implicitly-shared Qt container to QSpan, the QSpan
ctor would call .data(), which detaches said Qt container (if it's not
const). This is what must happen for mutable spans (QSpan<int>), but
is not necessary for non-mutable spans (QSpan<const int>).
Fix by copying the potential const from QSpan::element_type to the
Range object in the resp. QSpan ctor. This makes a QSpan over a const
element_type mark the range const before passing it to adl_data() (=
member-data()). For a non-const element_type, nothing changes.
[ChangeLog][QtCore][QSpan] No longer detaches implicitly-shared Qt
containers converted to QSpan<const T, N>. Note that std::span<const
T, N> will, however, detach such containers, so we recommend to use
std::as_const() with implcitly-shared Qt containers, as always.
Fixes: QTBUG-132133
Change-Id: I9fdae20994d2c900bc5b45b44db3901d10f8838a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 287234704b57e171c786ba8df0b93c49edb903c5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QException has an out-of-line destructor in order to pin its vtable.
But like any std::exception subclass it's meant to be (and effectively
is) copy-constructible and copy-assignable (cf. [exception]/2).
Add the missing copy operations, and the default constructor.
One may argue that this class should use some other approach since it
also has a polymorphic clone() -- for instance disable assignments and
make copy constructions protected -- but that ship has sailed.
This prevents a Clang warning about the deprecated copies in the
presence of a user-declared destructor.
Change-Id: I4d8613ade265ea85a5a7e97255b75b7fcf3e5a27
Pick-to: 6.8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 793309693aac24e7f88fc225408d92def638996e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
So that the pthread_key is destroyed much later than now, at QtCore
unload time instead of a bit earlier in exit(). That's important so it
runs later than the Q_DESTRUCTOR_FUNCTION for QLibraryStore
(qlibrary.cpp), which is what unloads plugins, whose unload-time
destructors may be attempting to quit() & wait() for their worker
threads.
I had to keep the destruction of the exiting thread's adopted thread
where it was: a function-local static's destructor. As noted in the
comment added by 1da7558bfd7626bcc40a214a90ae5027f32f6c7f, we need
QThreadData::cleanup() to run before the libraries start to unload
because we need to delete the event dispatcher.
Init priority 10 will place it after the QHash random seed and qsimd
initialization, on ELF systems and on Windows. On other systems (incl.
Apple ones), the order probably depends on the order of the files in the
CMakeLists.txt. I thought that would mean the destructor for thread/
would run before plugin/ but that apparently is not the case. But that's
fragile.
Amends 1da7558bfd7626bcc40a214a90ae5027f32f6c7f, which amended other
things...
Fixes: QTBUG-132697
Task-number: QTBUG-102984
Task-number: QTBUG-132381
Pick-to: 6.8
Change-Id: Id7263d6ffe7a5949cd84e35d942ad0e02df1b455
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 2f69a05bd0cd7ce63890f709ff3ed7a4f78acd70)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit adds one unusual creation and three more unusual exits:
* creation of the Q*Application in a thread (QTBUG-130895)
* exits using ::exit() instead of returning from main():
* from the main thread's event loop
* from an auxiliary thread
* from inside an auxiliary thread's event loop
All of these exercise the moment the QAdoptedThread & QThreadData for
the main thread is destroyed, which are, respectively:
* thread exit time, running thread-specific destructors
* inside exit(), running atexit()-like callbacks (qthread_*.cpp)
* [tst_static_q*application] inside exit(), running static destructors
(added in commit 1da7558bfd7626bcc40a214a90ae5027f32f6c7f)
Unlike the tst_static_q*application tests, the calls to ::exit() cannot
be a regular QtTest because that would cause the log output to be
incomplete. The threaded Q*Application could be a test of its own, but
since I needed to add the helper anyway, I chose to add the test there.
For the majority of the tests, the failure mode is going to be a crash
on exit.
Task-number: QTBUG-12673
Task-number: QTBUG-132429
Pick-to: 6.8
Change-Id: I1062ef500356bd97dd0cfffda4aeeda9afa138e8
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit bfbd1a281dd00c47df315c06e895bf5d53cd8764)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
There is no need to search for high-res svg icons - a svg scalable by
design. Also the QSvgIconEngine does not support it.
Pick-to: 6.8
Change-Id: Ib76c887900ce77268e9c0253cb697b8de9e7f10e
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit c64774eef72411029f7c2fb611328f25b83ff8ca)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
If COIN_CTEST_IGNORE_EXIT_CODE is in effect and ctest aborts for some
reason (for example due to the workitem being cancelled) the ctest exit
code will be ignored, as expected, but we will not have a LastTest.log
to copy, which will fail the workitem unexpectedly.
We now match the ignoreExitCode of the LastTest.log copy with the ctest
run.
Change-Id: I9df0f863a42dd4cf25cee1694e85cb32058a4e5b
Reviewed-by: Toni Saario <toni.saario@qt.io>
(cherry picked from commit 0e2067334d58787464a3554730042dba37413c6d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The docs said only the first placeholder would be considered; in fact,
it considers only the last.
Fix the docs and add a test (also for QTemporaryDir).
Amends b4bb4449aea7592afdb9b9134bb90c40fe29735a.
While 6.6 and earlier are unaffected by the incorrect documentation,
pick this to all active branches in order to verify the behavior is
the same everywhere.
Pick-to: 6.8 6.5 6.2 5.15
Fixes: QTBUG-132597
Change-Id: Ia7a37f714f834191b07420d31ca9024702b537cc
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit e7abbc7bf3ab06359b2847b1e1a46c38d8bc6581)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Initially the git vars were assigned to the parent scope of the
_qt_internal_sbom_begin_project function, with the intent to set them
in the global scope. But the function was later wrapped in other
functions, so the variables stopped being accessible.
Instead of playing with recursive PARENT_SCOPEs, save the variables in
global properties like we do for other info, and use a new
_qt_internal_sbom_get_git_version_vars() function to query the vars in
the code that needs them.
This fixes generated purls to contain the git version and hashes.
Also add a new internal API wrapper macro called
qt_internal_sbom_get_git_version_vars to allow calling it
in other repos.
Pick-to: 6.8
Task-number: QTBUG-122899
Change-Id: I061b34f418c1ecc1c66c8c01ef758d2f40611ede
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 41a92bf6f1486259ef25db775520cba647e1cc15)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The SBOM implementation got somewhat large. Split the code into
several new QtPublicSbomFooHelpers.cmake files, to make it more
manageable.
No code or behavior was changed.
Pick-to: 6.8
Task-number: QTBUG-122899
Change-Id: Ia0ca1792eec21d12c4bb4cabe63279e1f5c07e3d
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 27d2b54b5d2bc5a69edc2de703b2ca34cb2637dc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
When calling insertRows(), the model of the child items was not
correctly updated. insertRow() is behaving correctly.
Pick-to: 6.8
Fixes: QTBUG-131372
Change-Id: I8b6aef7ab97887c6eb46eb21b992d76e4d59b3a0
Reviewed-by: David Faure <david.faure@kdab.com>
(cherry picked from commit 5bab8448feb2661f871e71d71a95afaffcb1656a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
It's kinda is important to verify that commit() worked; all the
follow-up tests assume it, so wrap the calls in QVERIFY().
Amends 7e5e7eeaa1418d959906cdf9d717c984c9fc7a7e.
Pick-to: 6.8 6.5 5.15
Change-Id: I01185d65a5ec06ed122e59c43d9cdcc3a7157259
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 97fe38ff0d1e60f92c0bfa6fb3571a0433e60352)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
To ensure we don't overwrite it in this quite long function.
Amends 7e5e7eeaa1418d959906cdf9d717c984c9fc7a7e.
Pick-to: 6.8 6.5 5.15
Change-Id: Ie5f81b50d2d66ba9e064810f8cbc1a7af298cc2b
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 67a906b5564a1ccf03e547aa78fc6fd910d9cd15)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
There was a typo in the link_libraries variable name, where an upper
case 'L' was used instead of a lower case 'l'.
Pick-to: 6.8
Task-number: QTBUG-122899
Change-Id: I206a161107cf7510856ad8740dada88e12341e94
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 2affe46b2543f7d2de1939e049a0d783b5a7dcfb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
They result in lldb hanging, which was previously only a case when SIP
was enabled, but can now be reproduced on macOS 15 even with SIP disabled.
https://github.com/llvm/llvm-project/issues/53254
Pick-to: 6.8
Change-Id: Ifa09f8cf22522b5a1028db1f250ebe9e1543cf9d
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit 50d5914f28b535790f8eca6210adad24fe76940b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Swift 5.9 includes built in crash reporting, printing stack traces,
libraries, and registers to stdout/err.
https://www.swift.org/blog/swift-5.9-backtraces/
As (Core)Foundation is written in Swift nowadays, we get this feature
for free even in our "C++" apps, as we always link to CoreFoundation.
To enable the feature the binary needs the com.apple.security.get-task-allow
entitlement, so we add it for all our tests automatically.
The final piece is to run the tests with SWIFT_BACKTRACE=enable=yes,
but we'll do this in our CI provisioning, as setting it from within
testlib doesn't seem to work.
Pick-to: 6.8
Change-Id: I31090efee06460f45522093e17f900e76590b282
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 9bebdc97f161cc58461530fa0171e0defc6cc1ee)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Should be 6.9. The entries in removed_api.cpp are already added to the
correct place, just the macro in the public header used wrong version.
Amends d41b87e06742b491c4e36aeae32e03f85b078d69.
Change-Id: I88749dbeb070206c42feb4ffc504f260f8857823
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit da799c20d763b5534152dca52fef12fda875acc2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
That prevented qdoc from generating the docs for the fromPrimaries()
function.
Amends bde2292247bf4849852355c0dcc71f97c9daace9.
Found in Qt 6.9 API review.
Change-Id: I2f5c57a4dc4a437798907c64fb657c9fda61e0df
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit e2756158dcf87fea757475d711ac9cda20f42152)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Don't try to update the left and right boundaries when no valid idxRect
was found.
Also fix the early exit check - we can exit when the idxRect is
completely below *or* completely above the current viewport.
This amends 2f9c72028d2481f587f378a256654d0a362e3d44.
Pick-to: 6.8
Fixes: QTBUG-132670
Task-number: QTBUG-124173
Change-Id: I51f9e12c66268318e597facfbe4df74367d1089a
Reviewed-by: David Faure <david.faure@kdab.com>
(cherry picked from commit 9d4b5fa017199627a42477a842a4e1ef349bb1ae)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
For all CPE and PURL fields where it makes sense, to avoid
duplication.
Pick-to: 6.8
Task-number: QTBUG-132181
Change-Id: Icd1c5267e4e9b582eea28150ebd1b2cca3852229
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 82dc92cb1b94de12761f23ad6ec27feb2aca43cd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Replace instances of $<VERSION> in CPE and PURL strings read from
qt_attribution.json files with the version of the package being
processed.
This avoids duplicating the version in qt_attribution.json files in 3
different fields Version, CPE, and PURL.
Pick-to: 6.8
Task-number: QTBUG-132181
Change-Id: I91af17c82dbb936739f4811bf86043e00ee49a78
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit bc3bbb51b7b48d3c4a44a432441938863582242c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Add a new qt_internal_sbom_generate_tag_value_spdx_document function
that takes an input SPDX JSON file and generates a tag/value SPDX
file. This is needed by WebEngine to convert the Chromium JSON file to
a tag/value SPDX file so we can reference it as an external document.
To ensure the external document is found, we now always add the
current sbom build directories as install prefixes. This was
previously done only for top-level builds.
To ensure the converted external document is referenced only after it
is converted, it needs to be converted before any targets mention
packages from within it.
A sample usage might be:
qt_internal_sbom_generate_tag_value_spdx_document(
OPERATION_ID qt5compat
INPUT_JSON_FILE_PATH "${external_sbom_file_path}"
OUT_VAR_OUTPUT_FILE_NAME external_output_file_name
OUT_VAR_OUTPUT_ABSOLUTE_FILE_PATH external_output_file_path
)
Pick-to: 6.8
Task-number: QTBUG-122899
Task-number: QTBUG-129901
Task-number: QTBUG-131377
Change-Id: I5d5397f788c8c7960b6fc233c2868244e5816e0b
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit b8f5e5f554c0c8b340b532b998fed5ef2a87eefd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
We shouldn't be using the direct project name in spdx relationships,
but rather the sanitized name which is prefixed with
'SPDXRef-Package-', to ensure sbom validation succeeds.
Also we should default PROJECT_FOR_SPDX_ID to
"Package-${arg_PROJECT}" if it's not set.
Pick-to: 6.8
Task-number: QTBUG-122899
Task-number: QTBUG-129901
Task-number: QTBUG-131377
Change-Id: I354babcf4fea5f6efd9b32422dd8d3835ef50f15
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit f086e72b7e6332412a7c87bc435398a0e3dee305)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This change modifies the existing implementation of the
external references API to have better named options and better
behavior.
It also adds comments and exposes an internal API wrapper around the
existing implementation.
It's meant to be used by qtwebengine to reference the
Chromium-generated SBOM.
As a drive-by, it removes the previously unused RENAME option.
A sample usage could be:
qt_internal_sbom_get_external_document_ref_spdx_id(
"qt5compat" document_ref_spdx_id)
qt_internal_sbom_add_external_reference(
EXTERNAL_DOCUMENT_FILE_PATH "/path/to/qt5compat-6.8.1.spdx.json"
EXTERNAL_DOCUMENT_SPDX_ID "${document_ref_spdx_id}"
)
Pick-to: 6.8
Task-number: QTBUG-122899
Task-number: QTBUG-129901
Task-number: QTBUG-131377
Change-Id: I13d0fe4d803449bec42f8b454c8131e4d727669a
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Moss Heim <moss.heim@qt.io>
(cherry picked from commit 9a3998692c10964a919942147d8d8035e878b167)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Allow including custom cmake files at predefined steps of the sbom
generation using the new internal
qt_internal_sbom_add_cmake_include_step API.
This covers pre-existing steps like BEGIN, END, POST_GENERATION, and
VERIFY, as well as two new steps, BEFORE_CHECKSUM and AFTER_CHECKSUM.
A sample usage of the new API could be:
set(step_path "${CMAKE_CURRENT_BINARY_DIR}/run_some_cmake.cmake")
file(WRITE "${step_path}"
"
# This is a CMake script to run some CMake code.
message(STATUS \"Running some CMake code...\")
message(STATUS \"Done running some CMake code.\")
"
)
foreach(step IN ITEMS BEGIN END BEFORE_CHECKSUM
AFTER_CHECKSUM POST_GENERATION VERIFY)
qt_internal_sbom_add_cmake_include_step(
STEP "${step}"
INCLUDE_PATH "${step_path}"
)
endforeach()
Pick-to: 6.8
Task-number: QTBUG-122899
Task-number: QTBUG-129901
Task-number: QTBUG-131377
Change-Id: I6f9512bf3a3bc3ebeb7d21426e5a3833280e42a5
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 8c754dcbb139ba83f033b3b3fc1d9edb8a909811)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This change introduces a new SBOM API to add info about various kinds
of files to a target SBOM package. The new function name is called
qt_internal_sbom_add_files().
The motivating case is including SBOM information for qt translation
files, resources (e.g. webengine data files) and any other kind of
custom files.
A sample call might look like:
qt_internal_sbom_add_files(Translations
FILES "${qm_files}"
SOURCE_FILES_ONE_PER_INPUT_FILE "${ts_files}"
FILE_TYPE "QT_TRANSLATION"
INSTALL_PATH "${INSTALL_TRANSLATIONSDIR}"
)
While the motivating case is Qt-specific, the function implementation
is being somewhat future proofed for the not-yet created public SBOM
API.
The new API supports adding files to any target that is backed by an
SBOM package, so all targets created by qt_internal_add_module()
and friends, as well as ones created by qt_internal_add_sbom().
It can be called multiple times for the same target, with a different
set of files, to e.g. assign a different license, or file type per
file set. Note that the file set doesn't have anything to do with
CMake's concept of file sets.
The function is also multi-config aware, and allows specifying
different install paths per config, as well as generator expressions
in file names. But the multi-config support is a bit wonky, and might
need some rethinking in the future.
Note that the custom files must be installed and available in the
specified qt install path, because the file contents will be
checksummed at install time and embedded into the sbom document.
Calling the new API does not do installation itself.
Implementation wise, the function call flow is
- project calls qt_internal_sbom_add_files() one or more times
- at finalization time, the _qt_internal_sbom_add_target finalizer is
called for a target, which then calls
_qt_internal_sbom_handle_target_custom_files()
- the latter calls _qt_internal_sbom_handle_target_custom_file_set()
for each file set that was added to the target
- the latter calls _qt_internal_sbom_handle_multi_config_custom_file()
for each input file in the file set, which ultimately calls
_qt_internal_sbom_add_custom_file()
Pick-to: 6.8
Task-number: QTBUG-122899
Task-number: QTBUG-128320
Change-Id: Iafde26ebd68f4168b49e55fbc8ad1c251e98d4b0
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit b085fe6ad9eee69791bc3c15bfeb7cc41245519a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Previously Python and other sbom tooling was looked up at SBOM
project end time.
This was fine for the use cases we had so far, but it prevents
introducing new API that wants call the spdx tools before the end of
the project. Such API will be introduced in a follow up change.
Move the python interpreter, python dependency lookup and other sbom
tooling setup to happen at project begin time.
Pick-to: 6.8
Task-number: QTBUG-122899
Task-number: QTBUG-129901
Task-number: QTBUG-131377
Change-Id: Ic8884e378c0ffd9720ede26b0c61f4122f3bb9d9
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 2fa815341c68148ff00c6d16be017f80e4032ef1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Tool dependencies that are added using the
qt_record_extra_package_dependency function now are considered as
the third party dependencies. This allows using two different
approaches when looking for the dependencies of Qt tools.
All dependencies that are Qt tools now go to the path invented in
035fbd068b5a3fbc18b7868ecac9a6a6a2f6602c and use the
_qt_internal_find_tool_dependencies function which is designed to
look for Qt packages and uses CONFIG signature of find_package.
To look for the non-Qt modules we should use more generic find_package
signature and _qt_internal_find_third_party_dependencies fits perfecly
for these purpose.
Note that it's known issue that the
_qt_internal_find_third_party_dependencies command also may find
"target" tools when crosscompiling, but this commmit doesn't reinvent
it. We already have various places which make the scoped "host"
dependencies lookups to ensure that "host" tools look for the "host"
dependencies in build systems like yocto.
Ammends 035fbd068b5a3fbc18b7868ecac9a6a6a2f6602c
Task-number: QTBUG-132340
Fixes: QTBUG-132622
Fixes: QTBUG-132616
Pick-to: 6.8 6.5
Change-Id: I9effba3d405ceec720a8a2a332250619cd56f598
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit f881e06dd44c377772dd3b99793ab7552c7cd64e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
It seems that findChildren does not return every window if called
at an inconvenient time.
This causes not all windows to be returned, and later the
QWasmCompositor will not detect a valid window to compose,
and therefor goes to disabled.
Fixes: QTBUG-132414
Change-Id: I6c872071751d5a2fbdeea36fb8f4c7e9677fd7d0
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
(cherry picked from commit 5c5844cedb938c38ea595957b172c48a67c502fc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This amends commit fbbf4ace0188b9718b6d7808021c0b887fd52d9f.
Remove the EXTRA_PACKAGE_DEPENDENCIES argument that was added in
mentioned commit, and use the qt_register_target_dependencies function
instead to add the package dependency Qt6FooPrivate -> Qt6Foo.
Task-number: QTBUG-87776
Change-Id: I08a48954576dc3c0b6fde809f90d2022201d7eb0
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 2d38af3125d18255007f7451f31e26e9c16af45a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Some icon glyphs might not be square, and actualSize needs to return a
size that fits into, and maintains the aspect ratio of, the requested
size.
Compute the bounding rect of the text/glyph that would be rendered, and
scale it to fit into the requested size.
Use that to return a pixmap of the correct size.
As a drive-by, fix the cache-testing by comparing the
deviceIndependentSize of the stored pixmap with the size we want.
Change-Id: Ic6fd0f0e260b3e3946d032941d9b677463d5c145
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit be9682d372e0021ff112817dc146f5768ac6f28c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QString::data on a non-const string will needlessly try to detach.
Avoid that by accessing the raw data pointer.
Addresses header review comment.
Change-Id: I89b4d3451cda517e5c5ca08173510b3529ce73aa
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit bf2491acc74528004af8d5f4caf50e88fcb86f89)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
...of private modules in public modules. This isn't necessary anymore
since the Qt6FooPrivateDependencies.cmake files contain these 3rdparty
dependencies proper.
This reverts commit dae078e521c3932c66436cbdbfaf5294a1842901.
This amends commit fbbf4ace0188b9718b6d7808021c0b887fd52d9f.
Task-number: QTBUG-87776
Change-Id: I2c425d49fe7beb790abf9a94f089d43fde8b047e
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit e7816586b612050adf0cd872b81d04b606ec2b54)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
As per the standard at [1], the second parameter has to be int, while
difference_type is jint (which is also int, so no difference in
practice, esp for the already released QJniArrayIterator).
https://eel.is/c++draft/over.oper#over.inc-1.sentence-3
Addresses API review comment.
Change-Id: Idea11f83048b9b65548ec1ac8abc2586c6e61a27
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 291c5ec433131d43921e77f3b6565e89cc0b3420)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Each 3rd party license attribution is identified by a
unique Id key, which should be all lower case and without
spaces. See QUIP-7 for more info. about the
qt_attribution.json file format:
https://contribute.qt-project.org/quips/7.
Pick-to: 6.8
Change-Id: Iaa233a0e6180945e014b9a407bbd61df591f1dea
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
(cherry picked from commit 1926df8d57c2b6c600a5486b1939d96b21f7f812)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
When using qmake to build a user project on macOS, the Qt headers are
included with the -I option, rather than the -isystem option. This
means that the compiler will not silence warnings that are generated
while parsing Qt headers.
If the user project compiles their code with the
-Wzero-as-null-pointer-constant compiler option, this leads to
warnings like:
/QtCore.framework/Headers/qcompare.h:226:78:
warning: zero as null pointer constant
[-Wzero-as-null-pointer-constant]
friend constexpr bool is_eq (partial_ordering o) noexcept
{ return o == 0; }
^
nullptr
Fixing qmake to use -isystem instead of -I is not trivial.
We already silence these warnings for gcc in the header file.
Do it for clang as well.
Amends bdd41f491c0f85ae0897a1c7372c5ecda62a5aab
Pick-to: 6.8
Fixes: QTBUG-132581
Change-Id: I7883248b7be548580a03333e76620ac10f57733a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 0711eb60716b53dc86cacb2fc19b72aa4ffee3d0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Android 15 (at least) seems to have changed how float arguments are
passed to native functions, breaking our (conceptually correct) code for
processing the va_arg list into a list of static argument types of the
function implementation.
To fix this, we have to move away from using a va_arg function, and
register a function with statically typed arguments instead.
Use a template function that we instantiate with variadic arguments
deduced from the actual function, using a factory-helper that generates
a JNINativeMethod struct with that template instantiation as the
function pointer. Move all of that into a struct where we can also
declare the signature string as compile-time constant without cluttering
the namespace with static objects.
We can now remove the helpers that took care of type promotion in va_arg
functions, and of the tuple-construction from a va_list.
As a drive-by, don't cast function pointers to void *; it's strictly
speaking undefined behavior in C and should have generated a compiler
warning, if not a hard error [1]. We must initialize the
JNINativeMethod::fnPtr member with the address of the function pointer
instead.
[1] https://port70.net/~nsz/c/c11/n1570.html#6.3.2.3p8
Also, declare the native method as the JNICALL calling convention. That
is only defined on Windows, so makes no difference in practice, but it's
the correct thing to do anyway.
Fixes: QTBUG-132410
Pick-to: 6.8
Change-Id: I190b95fcbcd07cf99c6765fa426c3c351f91994a
Reviewed-by: Volker Krause <vkrause@kde.org>
(cherry picked from commit e91a17873ee4ae58d369b8eb70029cf895b31d03)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Cleanup CE_ItemViewItem branch in drawControl():
- use local rect instead rect, vopt->rect or option->rect for
consistency
- move out viewItemPosition comparisons into local booleans
- fix coding style
- merge two QPainter::drawLine() calls into one
Pick-to: 6.8
Task-number: QTBUG-131585
Change-Id: I7cd2f96a2a733a55d5e7fb5956c59bd043317cb2
Reviewed-by: Wladimir Leuschner <wladimir.leuschner@qt.io>
(cherry picked from commit 44edab7c84be101025dc6f9a74f87944ea3a22e9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
There is no reason why the QBitmap(int w,int h) constructor is not
deprecated, and the one taking a QSize is. Since there's no deprecation
marker in the source code, I'm assuming this is just a documentation
issue.
Amends 111115bf8862b7cd1197c2ef8a4b475c882776d4.
Change-Id: I700de1821ab23ce85e793734c7048d1b2031ce9d
Pick-to: 6.8 6.5
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 7f7605c22f0e1847612e9e283eead75a1ace409e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Demonstrates the problem described in the bug report on Android
15/x86_64. QEXPECT_FAIL the relevant test cases until the next
commit fixes the problem.
Task-number: QTBUG-132410
Pick-to: 6.8
Change-Id: I065fd29282ef42ed75a2ed8177ded183c92aa6e3
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 749367da8c3309c98b3285836c2bd8abcd7274b1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
When making an object array, we use a LocalFrame to get access to the
conversion routine, but manage the frame of local references manually in
chunks of 100 objects. If any of the conversion routines uses the
LocalFrame's implicit frame management, then we push and pop frames out
of order.
Disable the frame's implicit frame management, and only use our chunk
management.
Amends 37638c84efaf2810ad49da0b987f19287d8c4ad6.
Pick-to: 6.8
Change-Id: I93be77ffc8750bb90fd7daed8c273169b03a29e4
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit fe6222b7561faa52f12a961d7c5417e364cf0236)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This is not the same as the 'directory' test below, which tests that we
can't open() a QSaveFile on something that already is a directory. For
this one, the target file did not exist when we open()ed, but has become
a directory since then.
Change-Id: I92d13f103693d375e742fffdd74053dd1b86d81f
Reviewed-by: David Faure <david.faure@kdab.com>
(cherry picked from commit f4ff7c40588a4515504e22266d15816ca8616cba)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
So we don't have to parse it on first use if it isn't set. This should
be a small performance gain for everyone who uses the default, which is
usually the majority of people.
Change-Id: I10c471715457dcfa3a1dfffd2768ce605e4f7e30
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit e04f109456bbcb184963b8ed71944b958b35c201)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This somewhat duplicates some other tests, namely the QHttp2Connection
one, but tst_http2 is our only coverage of the HTTP/2 code prior to 6.8.
This change adds a test where the server sets the
SETTINGS_HEADER_TABLE_SIZE to 0, effectively disabling the dynamic
table. We, in an earlier patch, makes the HPack table error out if
a new header entry is about to be added if the table has not been
resized below a changed 'max'. So, we take advantage of that here and
set the new 'max' capacity without resizing the table, or updating
dynamic capacity causing it to fail if the client doesn't send the
expected Dynamic Table Size Update.
Task-number: QTBUG-132277
Pick-to: 6.8 6.5
Change-Id: I1ca8ca7828d5b83606e7adbcfc13c154fa1e3cab
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit f7c3acd27ff48b24f99086be206acbe7e00e3208)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This removes boilerplate and the extra complication of std::addressof.
Task-number: QTBUG-132507
Pick-to: 6.8
Change-Id: I07091ec0ac526975cf55361a9811fad77eb152c2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 30ae70a110ee2460744e4fb78bae29b75effbf72)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Instead of passing the safe area margins to all windows
or top windows, we can instead call the listener for
setOnApplyWindowInsetsListener() on specific QtWindow
and have it pass the windowId with the callback to C++.
What was missing before was that the listner was not reset
after removing the window and also, we don't need to
necessarily require a window matching the id to be found,
so that if no window is found we can assume that the callback
is not valid.
Task-number: QTBUG-131519
Change-Id: Idd411e407ac8f5992aa6684ece70329198de1bc2
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit d7860d445d462dae853358c8b956fa6b1b6a2fc7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QUniqueHandle is intended for handle types or opaque pointers that are
no-throw constructible, copyable, and assignable, and has nothrow
comparison and relation operators. This patch ensures that this holds
true, and makes most of the QUniqueHandle noexcept specifiers valid.
This will make it easier to implement the comparison and relation
operators in terms of the Qt comparison framework.
Task-number: QTBUG-132507
Pick-to: 6.8
Change-Id: Id9fc3fac72a2337541e49c3b4613b8fd082796af
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 49f1877bbbb8f96d81144861558bdcc81e758a58)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
We need to, following the RFC, send a Dynamic Table Size Update using
HPack once we have acknowledged the setting as long as the new size is
smaller, or if we decide to use the new, larger size.
It's further complicated by the fact that we need to send this update on
the next 'field block' (anything with headers in it), and we may have
multiple SETTING frames come in, and we need to then acknowledge the
_smallest_ one as well as the _final_ one. This is so the decoder on the
peer's side can know that we have set the smallest size, and trimmed our
tables thusly, before going to the larger size.
This could, for example, be used to clear the table.
Task-number: QTBUG-132277
Pick-to: 6.8
Change-Id: I2b886e125f2c197bc3d42aa0b2bbd308ed2a687c
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit 57f44d6d882e09f1560f86816fac6ca8d06264fc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
In the update from 6.7.2 to 6.7.3, commit `ea0f00d5d` changed how linker
flags like `ws2_32` are treated when generating pri/prl files.
Specifically, before the commit a flag like `ws2_32` was left
untouched. The above commit changed it such that such flags are
converted to `-lws2_32` (seemingly in order to better support FFmpeg,
according to the commit message). However, this change also affects
absolute paths if the file has no extension. That is, after the above
mentioned commit, an absolute path linker flag to, say, a dylib on macOS
without a suffix will result in prepending the `-l` flag. This will
result in errors during link time.
An example where this caused problems can be found in the nixpkgs PR
draft #367206 (https://github.com/NixOS/nixpkgs/pull/367206).
This adds a small check to ensure that `-l` is not prepended if the
linker flag is an absolute path without a suffix.
Change-Id: I2c7ce3aac6624e1a27c59af233e3da2c1ae7ba60
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 714ae22b84553271a2809c393dd1a5a90089cc19)
On some platforms the capabilities of a device can change at runtime,
and we don't want to model this as a "new device" appearing in place
of the old one.
We already made the capabilities property non-CONSTANT, but let's add
a NOTIFY as well for completeness.
I considered making the capabilities member protected, but
QXcbConnection's xi2 handling relies on modifying the caps
as part of creating the device.
Fixes: QTBUG-132281
Change-Id: Ic345475b179f4562cdd39ecf51c7d6738ad47a74
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
(cherry picked from commit d74079873bbbff8701ec9b254647624775ced27a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
A lambda creates a struct with a function-call operator. So use of
'this' in a lambda body is always a bit ambiguous (the outer object?
Or the lambda itself? even though C++ defines it unabiguously to the
former).
Use a named capture variable instead of 'this' to make it obvious what
is being deleted.
Amends 699162c6fa6121cc496338f1d8d6e1b4287f7760.
Change-Id: I48d82d788d495bac43c6adb114dfdd95a8dd0d1f
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 21811161c9109c28da70b7bb9b28df33fa9b7766)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Because it can be.
Helps readers understand that the type of a continuation doesn't
change once constructed.
Amends 699162c6fa6121cc496338f1d8d6e1b4287f7760.
Change-Id: I43848204cfd8584e6e55d7fbca1b22d30b391e50
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 9dadca4d4e6058299f9d50ae28fd734717d7fdc5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The progressbar content calculation assumes that
subElementRect(SE_ProgressBarContents) returns a rect at 0/0 which is
not the case for progressbars in rtl mode. Fix it by moving the topLeft
edge to 0/0 and translating the painter accordingly
Pick-to: 6.8
Task-number: QTBUG-132459
Change-Id: I614589c9094b0da3c02867b45570d4dfdca61a18
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit 314a5b972646a4f2ef9c1f49ddfd335f546336ab)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Mouse tracking is needed for windows 11 style since it is using
QStyle::State_MouseOver to draw the cells.
Pick-to: 6.8
Fixes: QTBUG-129242
Change-Id: Ib79ac5a8c14ac8c70365e87120f80b4e4ee4c5b9
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit 85333b3d8cb89bf58c6c6c0db7c3db5c95b4cbfc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
When Java calls a native function that expects a QString with a null
String object, then we get a nullptr jstring. We must not try to convert
that to a QString.
Add the necessary checks at the call-site of the toQString helper, and
an assert to the helper itself. Add test case.
Change-Id: If5c55c702bdb3f89ac45fdf3912af2ac295f5e5c
Reviewed-by: Volker Krause <vkrause@kde.org>
(cherry picked from commit db6a9834d2b109e81cc73ef3c64d0c420237e9dc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Amends 65093a84c2b94b1543fd4593bc45d491951d28d4, which changed how we
destroyed the main thread's QThreadData. This merges the call to
destroy_current_thread_data() for both types of Unix systems: those with
broken thread_local destructors and those with working ones. It turns
out that the function got called too early for us in those working
systems (see updated comment).
The clean up of the QThreadData is split into two different mechanisms:
* for any auxiliary thread, when it exits, PThread will call back to
destroy_current_thread_data()
* for the thread that called ::exit(), PThread won't, but ::exit() will
invoke set_thread_data()::TlsKey's destructor
This is different from the situation that existed prior to commit
65093a84c2b94b1543fd4593bc45d491951d28d4: first, there's no code in
qcoreapplication.cpp for this (all in qthread_unix.cpp). Second one may
call ::exit() from any thread, whether that is the thread that called
main(), the thread Qt thinks is theMainThread, or any other.
This commit moves the tst_QCoreApplication check for no extant objects
to a new test. I've chosen to add a new test instead of running a helper
binary via QProcess because we do have a couple of !QT_CONFIG(process)
platforms in the CI, and this is too important.
Credit to OSS-Fuzz for finding this, though it is not itself a fuzzying
problem (all tests of a given structure were crashing on exit).
Fixes: QTBUG-132381
Task-number: QTBUG-130895
Task-number: QTBUG-129927
Task-number: QTBUG-129846
Task-number: QTBUG-130341
Task-number: QTBUG-117996
Pick-to: 6.8
Change-Id: Ie294dce7263b4189f89ffffd9155ec71d31b89d9
Reviewed-by: Robert Löhning <robert.loehning@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 1da7558bfd7626bcc40a214a90ae5027f32f6c7f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This reverts commit c3a2b9f35a9a12ff3c6f5f0d11844de161b47c2a.
Unfortunately, some of the log messages happen WAY too late at process
exit time, when QtCore is unloading. In particular, the worst offender
is the one in QThreadPrivate::finish(), which is called after the last
QObject in the thread that called ::exit() was getting destroyed. This
implies we have Static (De)Initialization Order Fiascos happening (the
logging recurses into qlocale.cpp and the defaultLocalePrivate global
static has already been destroyed).
I need to revert this commit in order to fix QThreadData destruction.
The functionality is welcome back in QtCore once the fixes are in, so
long as whoever does it fixes the issues we're seeing in the CI (and I
can't reproduce on my development machine). I've created QTBUG-132429 to
track the reversal and see if the functionality can be brought back in.
Task-number: QTBUG-120124
Task-number: QTBUG-132429
Pick-to: 6.8
Change-Id: Iecf8f14529c7a2bb2185fffdfd328066098826b1
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 357351b7ab8ab2eee865d2449ffcca9c9f502fd3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
New languages added with v46
- Kara-Kalpak
- Swampy Cree
Several new Chinese-language locales have been added, including one
using Latin script, which invalidated some prior QLocale tests, which
have been adjusted to fit.
Some obsolete time-zone identifiers are now treated as deprecated
aliases. These have lost their AnyTerritory association, implying
changes to QTimeZone tests.
Many redundant likely sub-tag rules for unspecified language have been
dropped, in favor of simpler rules.
[ChangeLog][Third-Party Code] Updated CLDR data, used by QLocale, to
v46.
Task-number: QTBUG-130877
Pick-to: 6.8
Change-Id: I92cf210422c7759dd829a7ca2f845d20e263d25b
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit e316276b76b9c3768ca4e19a04d03308ef21fe12)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Expose some new API to make it easier to test too.
Will be used in follow-up patches for a http2 bugfix.
The setMaxDynamicTableSize() method no longer sets capacity or evicts
entries. This can then be used to set the new maximum size which we will
accept later when we receive a Dynamic Table Size Update.
This flow makes sense with both encoder and decoder. The decoder would
usually be set by us when we send our SETTINGS frame, and then the
Dynamic Table Size Update would be sent by the peer.
For the encoder we would set the maximum size when we receive the
SETTINGS frame, and then we must defer the actual resizing until we
can send the Dynamic Table Size Update ourselves, usually along with the
next HEADERS frame.
Pick-to: 6.8 6.5
Task-number: QTBUG-132277
Change-Id: I959f5006eb09427d130735efe136da8c04453fa2
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit be477819ac17850632bca6ce59ee2c8ef11191cd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
To avoid illegal access, the change ensures that the QAccessibleInterface
is non-null and valid before accessing its QAccessibleActionInterface.
The check for the validity was also added to existing code which
previously only checked for the QAccessibleInterface not being null.
Fixes: QTBUG-132059
Pick-to: 6.8
Change-Id: I69fc4f9bb052ded8f188032d324666d0c00b9c3c
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Reviewed-by: Lars Schmertmann <lars.schmertmann@governikus.de>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 279c891ddf0ad10dd86c8fc836ce385df57593c4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Even with SHGSI_LINKOVERLAY flag set, loaded Icon with
SHDefExtractIcon doesn't have any overlay, so we draw
it manually.
Pick-to: 6.8
Fixes: QTBUG-131843
Change-Id: Iae4c2da12104a361b9a8cf05c78adcdb698f1f82
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
(cherry picked from commit fd7bc16e9fbdc63bd22ba90d0c20b36ccffd2bae)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QIOSTextResponder add actions to its own NSUndoManager. But
we need to remove those actions again when the responder is
deallocated, otherwise it can lead to a crash in UIKit when
swiping between apps.
Fixes: QTBUG-123843
Pick-to: 6.8 6.5 6.2
Change-Id: I404751bc50692a960e568ff2eb0f1754da0cec31
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 42f29da7a5b6c6969c169e9a868696a968ca930d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
In windows Backtab key event always comes as "Shift+Backtab".
So in order for Backtab key to be recognized as a shortcut sequence,
we also consider Backtab without shift modifier a possibility.
Fixes: QTBUG-94890
Change-Id: I20a7b404b57d8df5bea23765257a178f2e098ed0
Pick-to: 6.8
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit 4d9f99c4ea70cdae58c80e1bfdbabefe3abb455f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Handle traits should be simple, and not require exceptions. Note that
we should not make calls to fclose() or close() noexcept, because these
are POSIX cancellation points.
Pick-to: 6.8
Change-Id: I8bbf573b1346eafd52c6080dbb024f8b3bc89359
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit a80d1bf2716b1ba404799d6a09003b145b73b079)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The message displayed to the user says they need "at least Visual Studio
2019", but in reality the minimum is now 2022.
Amends 9a409295c7cfe74b4fb6b1892f4ff86d4f3c23f3
Pick-to: 6.8
Change-Id: Idaedd72d114b994fddd2ba7574fb7a45ca0a3e85
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 652250295c7f9812b49c522ab2fbe518ac9690e4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
When installing a top-level build using the DESTDIR env var mechanism,
the SBOM generation process could not find the qtbase sbom document,
while generating the qtshadertools document.
Make sure to prepend the DESTDIR env var to the install-time install
prefix, when looking for external SBOM documents.
Pick-to: 6.8
Fixes: QTBUG-132188
Change-Id: I1cdb75842fc552b43d982f05444b5ddc1fe58595
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit f2ce68d8f31f4c90471183d66075bd6fd5955d6a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Commit 6ebe3d0f0806069f906522dfe9b81baa3f3478de introduced extra
SFINAE checks on the template conditions.
However, it broke the case of using callables with deduced return
type, because SFINAE does not work for such conditions and treated
as a hard error instead.
Fix by explicitly providing all template parameters, so that compiler
could figure a better overload on its own.
Only QtConcurrent::blockingMapped() seems to be affected, but add
unit-tests to check all other methods as well.
Fixes: QTBUG-130766
Pick-to: 6.8 6.5
Change-Id: I1ddbe712d8ce04ac96ba13841cb569d728cfb943
Reviewed-by: Tatiana Borisova <tatiana.borisova@qt.io>
(cherry picked from commit f73765682e7c8f1e0e78b7464deec57c7f2669ba)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Calling reset() with the owned handle should maintain ownership and not
leak resources. Move assignment should also handle self-assignment
without leaks. The new tests verifies that this holds true.
Task-number: QTBUG-132507
Pick-to: 6.8
Change-Id: Icdfa4d67b06b71a74e810593e57449b51982c98c
Reviewed-by: Tim Blechmann <tim.blechmann@qt.io>
(cherry picked from commit 03bd9491491881529ad28cd6d672edfdda9a0065)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
qopengl.h pulls in headers from the OpenGL framework on macos when
opengl is enabled. We should therefore also link the OpenGL framework.
fixes linker error in libqcocoa:
Undefined symbols for architecture x86_64:
"_glGetIntegerv", referenced from:
QCocoaGLContext::updateSurfaceFormat() in
libqcocoa.a(qcocoaglcontext.mm.o)
"_glGetString", referenced from:
QCocoaGLContext::updateSurfaceFormat() in
libqcocoa.a(qcocoaglcontext.mm.o)
Change-Id: I02d2c80e2652da0cf16eaca7ab161cf711599dc2
Pick-to: 6.8 6.5
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 6f41c1652f73e1d79d6a4a91d009671a1e285b15)
Handle traits should be simple, and not require exceptions. This patch
will allow us to improve the noexcept correctness of QUniqueHandle.
Pick-to: 6.8
Change-Id: I84d92818a2fcea5b98e09c0b7dc08b251751396c
Reviewed-by: Tim Blechmann <tim.blechmann@qt.io>
(cherry picked from commit 3c57c7357422bdfda60f56901a7590b258915b6b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This makes it more clear which 'factor' the function is about.
The function internally calls a pre-existing 'factor()' function,
but since that is a static method of QHighDpiScaling, there the
meaning of 'factor' is more clear from the call context:
QHighDpiScaling::factor(window).
Resulted from API review.
Amends: 5ac4f04325a56d47812f528fe31ceb0d4932f664
Task-number: QTBUG-132090
Change-Id: I869bc05116d334b53b23a46aa2bb788432f250de
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit f9376703c92e957c7334a2ff42a801237f53c8bf)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This can be tested by enabling "Don't keep activities" in the developer
options. With this option Android will immediately destroy the activity
when it is moved to the background. In this case registerBackends will
be called the first time before the BackendRegister was created. Because
m_backendsRegistered was set to true even if it failed, the final call has
no effect. So we need to ensure to set m_backendsRegistered only if a
BackendRegister is available.
Fixes: QTBUG-132085
Pick-to: 6.8
Change-Id: I2ea1c0e0737c982594ceb06cbaf540399c45e3f4
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 9903242ecab82c1ed72dcaf90e90a171c942a84a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This does not change the behavior of release() but gives more
compact code.
Task-number: QTBUG-132507
Pick-to: 6.8
Change-Id: I5b34c80409ca0e9e9a5e9aee9ef7bc80017610af
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit ec0c62385e0df00f42bc9fb5e117cb8b994cfc96)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Starting with Qt 6.8+ we should error out if the minimum sdk / Xcode
version requirements are not met.
An opt out is added for cmake build tests, otherwise all the tests
that use private cmake api will fail to configure when run on older
Xcode or SDK versions in the CI.
We do this by checking for a new QT_INTERNAL_IS_CMAKE_BUILD_TEST
variable.
We do the check inside
_qt_internal_check_apple_sdk_and_xcode_versions
instead of passing
a QT_FORCE_WARN_APPLE_SDK_AND_XCODE_CHECK variable to the test
configuration, because not all cmake build tests use private api, so
this way the list of projects that get the opt out is more
constrained.
Pick-to: 6.8
Task-number: QTBUG-119490
Change-Id: I1284616c91341848a9cf6406fbf35750707d1227
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit a13bfec63df2cf206e354ab56fc017a1f0eb8f6d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Having a defaulted argument to QUniqueHandle::reset() gives a convenient
way of releasing ownership without assigning a new handle, and makes
the QUniqueHandle API more similar to std::unique_ptr.
Task-number: QTBUG-132507
Pick-to: 6.8
Change-Id: I842d4545d7cc2da8fe2df08280d0d816ed4be7fd
Reviewed-by: Tim Blechmann <tim.blechmann@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 248ac4128fe86150532ff7146d0459abb5260946)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Set the <package>_FOUND variable to TRUE by default, so the follow
logic that need to change the flag only need to take care about
setting it to FALSE if something exceptional occurred.
Amends 8d0283ad2cae3d8fbd4b1b7ee5c6454f7fcc079c
Pick-to: 6.8 6.5
Change-Id: Idd4407ea77e81703b5fa8cc5efa8c52b53d401ae
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 13608241793f6671500868c9ce96468f604f651e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The existing lookup mechanism doesn't consider Qt path when looking for
the Qt Tool package dependencies. In good scenario this leads to the
missing Qt Tool package, in worst case scenario the Tool package could
be found by alternative search path and attempt using the invalid
tools.
Use the lookup functionality we have for Qt modules when looking for
dependencies of the Qt tools. This will look the tools in Qt search
paths first and only then attempt looking elsewhere, considering the
QT_HOST_PATH.
Pick-to: 6.8 6.5
Fixes: QTBUG-132340
Change-Id: I570c03037f2a92922d2546a4f5fde1bc17a7f812
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 035fbd068b5a3fbc18b7868ecac9a6a6a2f6602c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
cmd.exe has a huge problem when running the batch scripts locating
by paths contaning spaces and more the one set of quotes in arguments.
This can be worked around by using the 'call' command as the test
command runner.
Fixes: QTBUG-132258
Pick-to: 6.8 6.5
Change-Id: I9b6fb0f8bccf44456e4cb9b79f3c6bd3f9fe4678
Reviewed-by: Even Oscar Andersen <even.oscar.andersen@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 10a3859809fc0b6e1edd6cbb93e409f0513a9bbe)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
It's more efficient (doesn't need to allocate the QSignalSpies on the
heap) and makes the header fit for the upcoming QT_NO_SCOPED_POINTER.
VxWorks seems to have a problem with its std::optional implementation,
though:
QWARN : tst_QAbstractAnimation::stateBinding() Trying to construct an instance of an invalid type, type id: -2125884168
QWARN : tst_QAbstractAnimation::stateBinding() Trying to construct an instance of an invalid type, type id: -2125884172
QWARN : tst_QAbstractAnimation::stateBinding() Trying to construct an instance of an invalid type, type id: -2125884024
Received signal 11 (SIGSEGV), code 2, for address 0x0000000d
So write a small optional-like wrapper around std::unique_ptr for that
platform.
Amends 930e59b798d9e3d08e17440980d33a08fb411cbe.
Pick-to: 6.8 6.5
Task-number: QTBUG-132213
Change-Id: Icf85678d616bc96c7d74b982d0b919ea3f13265a
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit 7bd47fb70881e7240c027cd2844866c99f8f096d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
A typical usage for mapping a 4-point polygon to a rectangle might be
QTransform transform;
bool ok = QTransform::quadToQuad(polygon, polygon->boundingRect(),
transform);
It works because the QPolygonF(QRectF) ctor is implicitly called on
the second argument; but that ctor turns it into a 5-point polygon.
So it should be legal for QTransform functions to work with 5-point
closed paths.
Fixes: QTBUG-21329
Change-Id: Iae249012e14b8a3e8d3b0dfa35da8f9759359832
Pick-to: 6.8 6.5 5.15
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
(cherry picked from commit 48b1af941c50ab28cc92f9ea65a8a74a32eaf2bc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
We updated the minimum CMake version used in CI for Qt 6.9+ to 3.22.
Enforce the minimum CMake version in CI to avoid regressions.
This reverts commit 5803af38aab09b7e47230a494e14654031d024e7.
Task-number: QTBUG-131169
Change-Id: Ifc91644dd26e465be44bfa7cfe6f99e295a174a9
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit dcd057a31b54de637a5ca8bb8a5d46e753d3066a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
When requesting a readback every frame, the readback activeFrameSlot
alternates between 0 and 1. Suppose we are in currentFrame 1, and
process a list of readbacks of slots [1, 0]. First, we skip the readback
of slot 0 since it does not match the currentFrame 1. The list thus
remains [1, 0]. Then, we process the readback of slot 1, and call
activeTextureReadbacks.removeLast(). This removes the readback of slot
0, while in reality we processed the readback of slot 1. The
activeTextureReadbacks is now [1], containing a readback for which we
called vmaDestroyBuffer(), leading to a crash ("double-free" attempt) in
Vulkan on the next function call.
To fix this, remove the readback that is actually processed (index i)
instead of the last one. Since we iterate backwards, indices remain
valid.
Pick-to: 6.8
Change-Id: Idd4296de45167edd0a9da345dcc1c3b6ac71a6d6
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
(cherry picked from commit 73405890b8911dd1a58120665ce63a38281c6ce4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This only affects the !QT_CONFIG(thread) case and requires the rewrite
of the old-style static cleanup() deleter protocol into the modern
operator()() one.
As a drive-by, mark the deleter noexcept, like destructors are
supposed to be.
Pick-to: 6.8
Task-number: QTBUG-132213
Change-Id: I8839865880647d76b77eb9a3f2858067db86234e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 6da1f72311b844b2232da3067ad6e1e24614e67c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QT_NO_CAST_FROM_ASCII is a policy setting, not a strictness
setting. The other components of QT_ENABLE_STRICT_MODE_UP_TO all deal
with clearly undesirable APIs, which QString(const char*) cannot be
said to be.
Keeping it in QT_ENABLE_STRICT_MODE_UP_TO would seriously impede the
use of strict mode in Qt itself (cf. QTBUG-132327).
Amends 3a6c8e02b6d1b0574da52b0087092d0c74aa92c1.
[ChangeLog][QtCore][QT_ENABLE_STRICT_MODE_UP_TO] No longer includes
QT_NO_CAST_FROM_ASCII. If you wish to continue using
QT_NO_CAST_FROM_ASCII, you need to define it in addition to
QT_ENABLE_STRICT_MODE_UP_TO. The reason for this change is that, while
everything else in strict mode should eventually become the default,
we're not proposing to remove the ability to construct a QString from
a const char*. QT_NO_CAST_FROM_BYTEARRAY and QT_NO_CAST_TO_ASCII
remain enabled in strict mode, though.
Task-number: QTBUG-132327
Pick-to: 6.8
Change-Id: I36b850833b1de79a47de975ca28d3591a0a0e089
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit f9163ae7a8167daded0798654d99a2e3a5aaa2b5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Both whenAll() and whenAny() have two overloads:
* an overload taking two input iterators, e.g.
whenAll(IntpuIt begin, InputIt end)
* an overload taking an arbitrary number of future objects, e.g.
whenAll(Futures &&... futures)
The public APIs are properly constrained, but internally they call
QtPrivate::when*Impl() template functions, that have the same two
overloads, but do not have any constraints.
As a result, passing exactly two QFuture<T>{} objects was leading to
the compiler picking the Impl overload that takes a pair of iterators.
Fix it by applying a subset of constraints from the public API to
the private implementation as well.
Amends 102f7d31c469a546f52c930a047bd294fb198186 which was introduced
for Qt 6.3, so picking down to Qt 6.5.
Fixes: QTBUG-131959
Pick-to: 6.8 6.5
Change-Id: Ide29ac9a494d07870e92957c40c1f614e56825f8
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 8aef5b0d8fd57684abe39c88af8c14d8882ef07b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The enum already exists in QJsonDocument, so there is no reason to
introduce a new one in QJsonValue.
Instead, use the fact that we only need to forward-declare QJsonValue
in QJsonDocument's header, include the latter into qjsonvalue.h, and
use a type alias.
For Qt 7, pre-program moving of the enum into QJsonValue and using
an alias in QJsonDocument.
Amends ac73079dee5f0260528a5c217a82cb0beafb0a56.
Found in Qt 6.9 API review.
[ChangeLog][QtCore][Potentially Source-Incompatible Changes] The
QJsonDocument header no longer includes QJsonValue.
The backward-compatible fix is to include all needed headers
explicitly and to not rely on the transitive includes.
Change-Id: I7c5219a239149e4a87d4780c4277d111983ad0f4
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 3cb87d891bb040f73fb68b6c5e7e82518f603c59)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
...and vcpkg usage was requested.
The user got no further feedback why vcpkg wasn't used despite passing
the -vcpkg configure argument.
Pick-to: 6.8
Change-Id: Ib43c2045f093c3887a63406e37f37bdd681341cd
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit fecae6ab1b1aa36f43b5cd87b229de4df37e44ab)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
When a layout is used to arrange the children of a non-top-level
custom widget, the layout's contentsMargins need to be manually set to
zero to avoid extra empty space around the widgets, misaligning it
w.r.t. its siblings.
Add the necessary call.
Amends 2690822428deec4f0c08f4d118d69a7c6036369e, which, however,
inherited the missing margin adjustment from older code.
Pick-to: 6.8
Change-Id: Icd1945a4f2b1635f031e50758ec2f1ec9313ae27
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 15524d1623a1400e4de15e57408e37020d394986)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Examples should show idiomatic use of Qt and C++, so mark the custom
widget constructors in this example as explicit and their destructors
are override.
Amends 2690822428deec4f0c08f4d118d69a7c6036369e, which, however,
inherited the missing explicit from older code.
Pick-to: 6.8
Change-Id: I5b5b49f69330c6f139345bed7264c85a36c36e9b
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit e0e9a5627376e04aba1b2ca2591554851d7de240)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The old code used manual memory mangement (raw new/delete) to
(de)allocate the Ui struct. This is so 80s.
Use an owning smart pointer to manage the memory. Ordinarily, this
would have been QScopedPointer, but seeing as that doesn't have a
create() method to hide the raw new, use std::unique_ptr and
std::make_unique() instead.
Amends 2690822428deec4f0c08f4d118d69a7c6036369e.
Pick-to: 6.8
Change-Id: Icabb9154eb38630855e14094b958af0214516f6b
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 0da2c2c4ef2219967db87021eece2a60b6e207af)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The old code used a grid layout inside the QGroupBox, but the design
with labels in the first and edit-widgets in the second column lends
itself to a QFormLayout, which adapts the alignment of the widgets to
the platform style, so use that.
Amends 2690822428deec4f0c08f4d118d69a7c6036369e, which, however,
inherited all of the above from even older code.
Pick-to: 6.8
Change-Id: I528f0ce9d8cb7a997fbfabcdca887c059f571b38
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 9c099ef942216d01261c26b60e3727a2a467f12a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
- The old code used two QPushButtons in a QHBoxLayout to provide
Ok/Cancel buttons. This hard-codes the positions and text (and
icons) of these buttons, instead of adapting to the platform style.
The new code simply uses QDialogButtonBox, which is designed for
this purpose.
- Also, the old code connected the Ok button's clicked() signal to a
custom slot that then called QDialog::accept(). This means that the
code in the custom slot is not executed when the dialog is accepted
by other means (e.g. return press in one of the line edits
("auto-default"), though I'm not sure here).
The new code uses the idiomatic Qt way of overriding
QDialog::accept() instead, and connects the button-box's accepted()
signal to it. This is done in the .ui file, so it already works in
Designer preview.
- Finally, the old code made a manual connection from the Cancel
button to QDialog::reject().
The new code uses the Qt idiom of connecting in the .ui file
directly, using QDialogButtonBox::rejected() as the signal.
Amends 2690822428deec4f0c08f4d118d69a7c6036369e, which, however,
inherited all of the above from even older code.
Pick-to: 6.8
Change-Id: I83afd6156a0811e0c0f99f2480625ea6b69ff78b
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 3419c299369ac1da94ba5710aaf5f5f65c38c33c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The old code connected to the wrong signal and therefore had to write
a custom slot to perform the disabling of the group-box.
The new code simply connects the QCheckBox::toggled(bool) signal to
the directly-compatible QWidget::setDisabled(bool) slot, removing the
need for a custom slot.
Also move the connection into the .ui file, so it works already when
checking the form in QtDesigner.
Amends 2690822428deec4f0c08f4d118d69a7c6036369e, which, however, only
inherited the issues from older code.
Pick-to: 6.8
Change-Id: Ia834f92de270bb7b18981273188f6e5b6cd457a2
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 53826d1cde26f825d1983476c6697f72130e351f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Because we don't need one. I guess I was just lazy.
Amends b12fd1fa9d0b64e3cb66fa68c85392dbde8e175b ("Long live
qEnvironmentVariable()").
Pick-to: 6.8
Change-Id: I5b9141c5a32f9d784e0bfffdc3e4d742790aebdd
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit ce95c26034cc5b3ae8094c1521221e5b2f13ecfa)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
As pointed out by Thiago the QT_DECLARE_METATYPE calls are redundant, so
remove them.
Task-number: QTBUG-132101
Pick-to: 6.8
Change-Id: I73800e70d3f270fb87941d4e053aa7ac5ed1841c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 3bb4c4949fed9ccf8653151c78d5130b8db00716)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
We can use hashLengthInternal() to check if the buffer is big enough.
This matches what the QCH::hash() method does, it also has an assert
that `result.size() == ba.size()`, so we can assume this works with
OpenSSL's EVP_MD_get_size() in EVP::finalizeUnchecked().
Amends c70c81b371993ca865d523bb5f37eac4eb8a972b.
Pick-to: 6.8
Change-Id: I64935f3d590ab243b361a0b764f011c388820e32
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit b83e825fab16f83f86149ead78efb6ec3d2fa16d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Wrap them in QVERIFY(), as usual.
Found by QFile::open()-turned-nodiscard-come-6.10.
Amends e673e5a257569eaa816c6acd31dd754efd9f8c75 and
25c96d547b4563cbfedcec6093d68116148d8599.
Pick-to: 6.8
Change-Id: Id39e5d9e500b524af8443cb57916a12f98bd7c23
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit cf6ae9a90106a3557a8df1e0d2567b02a4ef6ded)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The tests peek into QEventLoopPrivate, which means that a UBSan build
needs access to QEventLoopPrivate's type_info, for which we need to
export the class.
Amends 3af20bd8eb8c75017c5d6d138d7c42914ee5bee3, which fixed the weak
vtable that, presumably, made this test work before.
Pick-to: 6.8
Change-Id: I4104ba95093fa240c5ef7d9d5bf287c1652333f0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 8bf54385319df958ea88f9998e7690d4c35e354d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This patch series is in preparation of enabling QT_NO_SCOPED_POINTER
when building QtCore, a prerequisite for enabling this opt-out in leaf
modules.
This first part of the patch series ports objects whose use cannot
"leak" into other modules, e.g. because they are in .cpp files or are
private members and is thus SC (and, as demonstrated by various static
assertions we put into the source code over the years, BC).
The second patch will deal with objects in protected and public APIs,
and thus might be QUIP-6 SiC Type A.
Task-number: QTBUG-132213
Change-Id: If4967f6e563a4e7d74550fad4c6d354fad1beef5
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit 63f1c6fcbab5f36809ffc96ac5ff6cb9e01e70bb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The local appDir variable was only used to hold the return value of
another function call. But hardly any compiler will be able to look
through the QString atomic ref-counting to turn the non-Darwin code
paths into the tail-calls that they ought to be.
Remove the variable and return the result immediately. This removes
the move-assignment and dtor calls in the two changed lines and lets
RVO kick in, turning these calls into tail-calls on non-Darwin
platforms.
Amends 4ac872639ed0dd3ae6627e05bdda821f7d128500.
Pick-to: 6.8 6.5
Change-Id: Ieeefbd52fc983ab7aebcff6419965b206f374935
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit e57113feac183abd1f5bfcfb633a33e1387b2d3e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Add crash handling to avoid waiting until 10min timeout on each crash.
Force restart on each crash by killing emulator.
Make health check more robust to allow it to work even when emulator is
down. This is done via wait in separate process which cannot be done
with normal timeout command, as input to pipe that is not being read
by emulator will block forever.
Change-Id: I86c3c86f936cc96d57b38983da48d1d73162399d
Reviewed-by: Simo Fält <simo.falt@qt.io>
(cherry picked from commit 918cbe7601b07fa6db7973ff9a4f76208dae8f22)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The backend-provided DRM device might not be the right one,
so allow kms config to override it.
Pick-to: 6.8
Task-number: QTBUG-131887
Change-Id: Ied744ae7015eae64f4556f1528e0dbe8ae69d206
Reviewed-by: Pasi Petäjäjärvi <pasi.petajajarvi@qt.io>
(cherry picked from commit c3bbbb22b8bc920e4937cf640fd1d2df3b0f9205)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
With those tests split, tst_QCryptographicHash takes about 4ms.
When FEATURE_openssl_hash is enabled those tests take about 15s on
their own, but when openssl_hash is disabled they take about 2 minutes.
That makes running the tests locally a bit of a hassle when hacking
code ... test ... hack ... test.
This is with a debug build, GCC, `-O0 -g` flags.
Change-Id: I8b8f5d1954feb1f9eb8115e27635610a41b42f47
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit fff217824b532da7306af1ac755581e76e098a27)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QCommandLinkButton was using QIcon::pixmap() without specifying the
current device pixel ratio. Switch to QIcon::paint() to not have to
fiddle around with the dpr at all here.
As a drive-by remove a useless QPainter::save/restore call.
Pick-to: 6.8
Change-Id: I7e2492a09b28cb8a4f4cc60454733e0054fe1e9b
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 785fb89e0aafc25a435d28ff05bf0dc05385b372)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This could cause conflicts with other users of these algorithms, notably
libb2 itself. Though if you're using libb2, you shouldn't be using the
un-optimized copy inside QtCore...
I've updated the SHA1 of the last commit in the repository, but there
were no changes to our sources.
[ChangeLog][Third-Party Code] Fixed a bug that caused the BLAKE2 symbols
to be visible from QtCore in a static build. If you need to use the
BLAKE2 hashing algorithm in your own code, either use QCryptographicHash
or import libb2 into your build environment. Using libb2 remains the
recommended solution for all systems, especially those for which it has
optimized (vectorized) implementations.
Fixes: QTBUG-132347
Pick-to: 6.8
Change-Id: I48003b58cef0d8bcc720fffdd89b0f151fd102e3
Reviewed-by: Linus Jahn <lnj@kaidan.im>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit b884fbf10237547e809745f528978942faf0e5f6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
It's safer and clearer.
Also standardize on unique_ptr instead of QScopedPointer, because the
latter is not supposed to be movable, so the assignment in
QLibrarySettings::load() would not compile.
As a drive-by, scope a variable tighter (in an if condition).
Task-number: QTBUG-132213
Pick-to: 6.8
Change-Id: Iecdd910af4d06dbd03d2daf3ccf99dd4822f04ac
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit aa1f2064801b39a26a718703817e197a3e31447e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The previous patch to not modify the CT_SpinBox by QStyleSheet when
nothing was added for QStylesheet also removed the additional margins &
paddings handling for the size calculation. This patch re-adds this.
This amends 96adebed606cdbc73c73778917d777dc04c6e93e.
Pick-to: 6.8
Task-number: QTBUG-130642
Fixes: QTBUG-132431
Change-Id: Iff1f0febeca90d3154e61fd80e4b359bc7766b84
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit b2cc8824ec2cdeb6e053a2ff92d7d5b71f8d0ee5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Different styles provide different icons for SP_CommandLink so reload
the icon on every style change.
Pick-to: 6.8
Change-Id: I2d8bd706d4c1bca89b91c90f1bb90a796b38e0d3
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit d4c518b210ad56cb51c17e6e1b4a81b0deb7253c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
And definitely not by non-const reference.
Discovered during upcoming fixes for native function registration.
Task-number: QTBUG-132410
Pick-to: 6.8
Change-Id: I0ce8519f5a1f9f3caffefc53e6d93b52509bc439
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 1b84970b90c36771bf266f8612dba9585341795a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This is more robust and lessens the impedance mismatch as seen by the
old code using std::unique_ptr<char[]>(expr).get().
The new code isn't impedance-mismatch-free, either
(UP{qstrdup(qba.data())}), but short of writing a small string class
whose internal buffer can be release()ed to comply with the archaic
QTest::toString() new[]'ed const char* return value, there's not much
we can do about it atm.
Also separate the internal from the "public" stuff in
QCborValueFormatter by adding private: and public: sections.
Pick-to: 6.8
Change-Id: I09a2ad1a75bb9eab3d01f2b5b60afc2d762da384
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit d9264ee65d6f24e1008b08494b1472a54ac01940)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
It was used by the QT_TERMINATE_ON_EXCEPTION macro, introduced in 2012,
to support pre-C++11 noexcept semantics. That macro was removed for Qt
6.8 in commit 9b2ae564a59656d9cf49b141e70f5958b4fb79a4. This commit
amends that removing the definition of qTerminate() immediately in Qt
6.9 (it was an \internal function).
Change-Id: I9682121c04fafb3676b0fffd9f5ac999e7603c84
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit b8f84fd1e2af38ece89d60619bf93e7af34433ab)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QSaveFile records past write errors in writeData(), but often the
QFileDevice::writeData() calls it places will succeed because the data
is only being buffered. Instead, the failures are noticed only by
flush(), whose actions do not affect QSaveFilePrivate::writeError.
[ChangeLog][QtCore][QSaveFile] Fixed a bug that caused commit() to
return true and overwrite its intended target file even though it failed
to flush buffered data to the storage, which could cause data loss. This
issue can be worked around by calling flush() first and only calling
commit() if that returns success.
[ChangeLog][QtCore][QSaveFile] Fixed a bug that caused commit() to
return true even after a cancelWriting() call had been placed, if
writing directly to the target file (that is, only with
setDirectWriteFallback() set to true). Note that the state of the file
does not change under those conditions, only the value returned by the
function.
Drive-by clarify a comment from 6bf1674f1e51fd8b08783035cda7493ecd63b44
(Qt 4.6 "Don't drop errors from flush on QFile::close") which had me
chasing the wrong lead.
Fixes: QTBUG-132332
Pick-to: 6.8 6.5 5.15
Change-Id: I427df6fd02132d02be91fffd175579c35b9c06cc
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
(cherry picked from commit 92373d353cf090faa03cbc8aca505d1784b10b54)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Commit e176dd78fd2f253eb2625585b2bd90b5713e5984 replaced a `new
char[n]` with a std::make_unique<char[]>(n), probably on this author's
insistence.
But the two are not equivalent: make_unique() value-initializes, even
arrays, even of built-in type, which means that each buffer resize
writes each byte twice: first nulling out the whole buffer as part of
value-initialization, then in the memcpy() and any following read()s.
For buffers of several MiB, or even GiB in size, this is very costly.
Fix by adding and using a backport of C++20
make_unique_for_overwrite(), which performs the equivalent of the old
code (ie. default-, not value-initialization).
Also add q20::is_(un)bounded_array, which are needed for the
implementation of q20::make_unique_for_overwrite().
Amends e176dd78fd2f253eb2625585b2bd90b5713e5984.
Pick-to: 6.8 6.5
Change-Id: I8865c7369e522ec475df122e3d00d6aba3b24561
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 1a9f8cc0df33195df959cee2e355dde4cbacd754)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
It does.
While std::span, does, too, and so users should be using
std::as_const(), it's quite simple to avoid for QSpan, so we'll fix it
in QSpan. This patch adds the reproducer.
Task-number: QTBUG-132133
Pick-to: 6.8
Change-Id: I2e416fb7344830cd5e0d945cce61491cd6f4a7a5
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 05b9a4b2deefd586356e1f36d84372b06e74cfe3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Since `QT_QPA_PLATFORM_PLUGIN_PATH` or `-platformpluginpath`
specifies the path to platform plugins, `extraSearchPath`
should be loaded first.
Pick-to: 6.8
Change-Id: I2e62fbf2021250ca864c669a7bbd7d56acd67d1e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 457580936ddebc73e8a24fc8af0d342084b3a0b5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
GCC 9 doesn't accept [[unlikely]] between the (condition) and the
compound-statement of an if, in both C++17 and C++20 modes:
qdecompresshelper.cpp: In member function ‘qsizetype QDecompressHelper::readZLib(char*, qsizetype)’:
qcompilerdetection.h:1048:31: error: attributes at the beginning of statement are ignored [-Werror=attributes]
1048 | # define Q_UNLIKELY_BRANCH [[unlikely]]
| ^~~~~~~~~~~~
qdecompresshelper.cpp:597:54: note: in expansion of macro ‘Q_UNLIKELY_BRANCH’
597 | if (ret == Z_DATA_ERROR && !triedRawDeflate) Q_UNLIKELY_BRANCH {
| ^~~~~~~~~~~~~~~~~
See also https://stackoverflow.com/questions/51797959/how-to-use-c20s-likely-unlikely-attribute-in-if-else-statement
Put it into the compound-statement instead, then GCC 9 accepts it. The
two are equivalent, because [[likely]] marks a path, and there is no
selection statement between the two positions.
Amends 5ae84d0afbd3690a2c003d06d920566a5d56dc8c.
Change-Id: Iac1970219c98a1c26e450dfe6bad6583e4d32c29
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 7a7804d4b454021d68d1d5138d134ef62abfcdb3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
We don't like surprises in qNN, so use the real is_scoped_enum_v from
std instead of adding the _v version outselves, even in C++20.
Amends 03a7be37806a32e9a8ac963b309812d6b8f125f6 and
63a8f657c2236829f16016602d9c0098b089d35e.
Change-Id: I7f9149678b95f7a59643152abf5a627e226cc058
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 40501ffbb441ce48733b3733b7ab781c7db8cca8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Replace the internal PainterStateGuard class with the now public
QPainterStateGuard.
Change-Id: I9c072ce6e45ddfe2d0a8aba789311193788dee5a
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 204df603ef43be921e0eecae4d4af0ae6026787f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Replace the internal QPainterStateSaver class with the now public
QPainterStateGuard.
Change-Id: I56285cb469cec43071320e87ac378674fd99c06b
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 7690b6260eac12958c97d642421e27680ca57496)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Reduce the size of the subline for QLineEdit to fit the begin and end of
the rounded frame corner.
Task-number: QTBUG-132261
Pick-to: 6.8
Change-Id: I879f30c2bdc6601fef4738aeec71d7ab7bcee22c
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
(cherry picked from commit 5e656b9ea3c192f389b7e4f7aa2ae6b010cec306)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The content rects for QSpinBoxes were smaller than QLineEdits rects for
UI elements that should have the same size. This patch increases the
content rect for QSpinBoxes.
Task-number: QTBUG-132261
Pick-to: 6.8
Change-Id: I59e752b719399c5845ab3ef81c6e271deda16273
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
(cherry picked from commit a53e095882551caf3684a1f6a205b6c7d76a8913)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The plugin lookup mechanism doesn't handle the situation, when the
plugin is available but it's private dependency(static plugin case)
is missing. In this case we currently silently bypass the dependency
lookup and create targets. So users see the confusing message about
missing linked target, like:
Qt6QSQLiteDriverPluginTargets.cmake:61 (set_target_properties):
The link interface of target "Qt6::QSQLiteDriverPlugin" contains:
SQLite::SQLite3
but the target was not found. Possible reasons include:
* There is a typo in the target name.
* A find_package call is missing for an IMPORTED target.
* An ALIAS target is missing.
This indeed should be handled properly and we should omit creating
targets especially if users don't really use the plugin directly.
Also if dependencies are not satisfied it looks logically to set
the <plugin>_FOUND to false as this will be yet another indicator
for user that the plugin is not found.
Task-number: QTBUG-132244
Pick-to: 6.8 6.5
Change-Id: I8685163df0dee3a728c724901f69780569ffcad5
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 8d0283ad2cae3d8fbd4b1b7ee5c6454f7fcc079c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
When calculating the maximum width of a text layout, we
would add the text width of each substring *after* we had
added the negative right bearing of the last character to it.
But the bearing of the last character in a wrapped substring
does not actually add to the maximum width unless it is the
last character of the *whole* string.
Prior to 250117086ff15bba79df8f0e15ee66192edc9ea9 this was
not noticed, because the last glyph in the substring would
typically be a space and the space does not have any
bearings (when doing wrapping on individual characters it
could still happen). After the change, the previous glyph
for which we get the right bearing will be the last
non-whitespace glyph. If this happened to have a negative
right bearing, we would add this to the max width and
end up with a larger max width than we should.
This caused a test failure in tst_qquicktext.
This test prefers the text width without the bearing (i.e.
the *advance* of the substring) unless the line is manually
wrapped or it is the last line of the layout.
Pick-to: 6.8
Change-Id: Iba1a5ad48d575683672400f0572dfa683a0f2d9c
Reviewed-by: Lars Knoll <lars@knoll.priv.no>
(cherry picked from commit c08a92307d6d9fa9d9d9a1f301e3f2a65374e99a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
When requesting symbol icons the OS automatically chooses a rendering
mode per icon. Most icons use the monochrome rendering mode by default,
but some of them use the hierarchical.
We don't want to override this choice by always using hierarchical,
as that doesn't match the look of most icons in the system and may
be surprising to the user.
We still want to support tinted icons, based on the QPalette. For
iOS this is easy via [UIImage withTintColor:] but for macOS we
have to do an extra render pass. Unfortunately we can't use
configurationWithPaletteColors with a single color, as for the
hierarchical icons this will produce a different looking icon
than if we tint the entire icon.
[ChangeLog][macOS/iOS] The Apple icon engine, used for theme
icons on macOS and iOS, will now use the default rendering
mode for icons, typically monochrome, instead of always
using hierarchical icons.
Pick-to: 6.8
Change-Id: I9e66d848222e8ed0f7f20897454f27446bf0fd81
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 9f392c09a1d30e48494b4df0e2f5f531c7e4ec4b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Is needed when sending more SETTINGS frames during the test later
Task-number: QTBUG-132277
Pick-to: 6.8
Change-Id: I24b2a5d1b2e7aecd8687db5b24f37233df3b91dd
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit 6e7a15f5c50a94216bcf35241ec008e6c419ba18)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Increases to around 16MB with the format change.
Required by some tests.
Change-Id: Ia41436b4269220f84271b614ea6f2b96ca605c32
Reviewed-by: Simo Fält <simo.falt@qt.io>
(cherry picked from commit 75d87caef70ff79b4db04834d28daa1905f0d5a0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The deprecations aren't urgent, and allowing more time for users to
adapt is appropriate. In addition, also suppress the deprecation
warnings when compiling the related autotest.
Resulted from API-review.
Amends: 577946c1f05aaaa2a3f9682001aeb4144386b26b
Task-number: QTBUG-132090
Change-Id: Ia0c07ab510a9a9c8722892fcd94f58f6ec287059
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 0aa07ce77237dacc58de5939d5a239fb8997da7a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The y position for the MDI subwindow icon was not calculated correctly
so the icon was not painted vertically centered.
Pick-to: 6.8
Task-number: QTBUG-130673
Change-Id: I5f9023820a4e4b4288017869ac4088fe2669ce50
Reviewed-by: Wladimir Leuschner <wladimir.leuschner@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 6e29a94b547fbafa69e97ac02aeb33edad63f2ae)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
... instead of QScopedArrayPointer.
Less Qt code (which we're supposed to test with this library) and more
consistent with the tuple implementation.
Also makes the header clean w.r.t. upcoming QT_NO_SCOPED_POINTER.
Pick-to: 6.8
Task-number: QTBUG-132213
Change-Id: I3705b8db89e909e3f1e37ad6a31aaba6f9af899a
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit f405925829ca37af47ecbb291bdb8a95a606e024)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The adjustment for the textrect was wrong - the bottomRight point must
be moved by -1/-1, not 1/1.
Pick-to: 6.8
Task-number: QTBUG-130673
Change-Id: I6c099fdd9a03188e7a5c7852b1912ed9b2801f7a
Reviewed-by: Wladimir Leuschner <wladimir.leuschner@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 2c85e5d22215f24bd46d07a1183393e52702493f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Fix the style and use PainterStateGuard instead own save/restore
functionality because PainterStateGuard is already available and used in
those functions.
Pick-to: 6.8
Task-number: QTBUG-132187
Change-Id: Ie454b6cffe03444d88f13d15adb19a7e7783a493
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 1fb86f1f84bb56dab60bc15604c09a14157d6f10)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The lcQtGuiTest category is only used in qtestsupport_gui.cpp, so
declare it there as a static logging category.
Addresses header-review comment, amends
5ac4f04325a56d47812f528fe31ceb0d4932f664.
Task-number: QTBUG-132090
Change-Id: I5b2a93822a698f55c52c1be87ebf8a689f49e2a3
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
(cherry picked from commit b957dfc6e06deed64e20e8eee5d2164250b28b95)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
So they be SFINAE-ruled out when either the key or (for associative
containers) value types don't provide their debug-streaming operators
either.
Amends 850d4895be565931d18c92e5e2f9a33b7f26de6d,
0c96528e8d43ad4309bdca14b179a5045984655a,
a9fe57fefaac0cb047e4c02e0b8c8f8327e0a58c.
Fixes: QTBUG-132104
Task-number: QTBUG-130290
Change-Id: I1d6703b1fdf6cfd03799fffd33191d8028ecc123
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 8f958a6e2dcff5bb9b01442a19f5605f357c6e7e)
This function re-executes the query used by QSqlQueryModel and refreshes
the data from the database. The query must not use bound values as these
values are not preserved.
[ChangeLog][QtSql][QSqlQueryModel] Added refresh() to refresh the model
data from the database.
Task-number: QTBUG-123603
Change-Id: I3f1d779e07b88565abe825c31cfc4d7d1b2312c4
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 1bd883dbc15c4016f78d421afac2ac9f31ec4874)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
A QSqlDriver instance is directly bound to a QSqlDatabase object. But
there was no way to get the QSqlDatabase out of a QSqlQuery/QSqlDriver.
Fix it by storing the connection name also in the driver during
creation and add a getter for it.
[ChangeLog][QtSql][QSqlDriver] Added connectionName() which returns the
connection name of the associated QSqlDatabase instance.
Task-number: QTBUG-123603
Change-Id: If78b85413cf6ca965ff6bf9f3600cb54169b5569
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 5b07e3de3fe5335d9338c65ca40cfe656a389167)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
When we're calculating the width of the layout, we include the
right bearing of the last character in the text line if it is
negative (i.e. it exceeds the advance width). We do this by
storing the last glyph that has been verified to fit in the
line, so that we can retrieve its right bearing when we find
a break.
However, when we were wrapping on spaces this previous glyph
would always be a space, and the right bearing would
subsequently be 0. But then the trailing spaces would be
trimmed and the right bearing of the actual last glyph
would not be recorded and never added to the text width.
This caused a failure in tst_qquicktext on Windows with both
DirectWrite and Freetype: This was purely unlucky, because
the metrics of the Tahoma font happened to be such that the
right bearing on the 'k' was enough to cause a line to
overflow. Since we didn't account for it when setting the
width, we ended up with unexpected line breaks, causing the
test to fail.
This did not happen with GDI, since it rounded the right
bearing of the character down to 0 (which was actually
visible in the layout, in that the k was painted a fraction
of a pixel outside the text layout's width).
In addition, QTBUG-130313 was causing us to pick a different
font when resolving the non-existent font requested by the test,
so therefore the bug was not found immediately when moving to
DirectWrite as the default but only when QTBUG-130313 was fixed.
We fix this by
1. When adding a chunk of whitespace, we record the previous
non-whitespace glyph that has been verified to fit.
2. When adding a chunk of non-whitespace, we only record the
previous glyph verified to fit *if* it is not whitespace.
Otherwise we keep whatever we recorded before adding the
spaces.
Pick-to: 6.8
Fixes: QTBUG-132075
Change-Id: I8d9a2f3197068f5f93520d217a6bb89633644e95
Reviewed-by: Lars Knoll <lars@knoll.priv.no>
(cherry picked from commit 250117086ff15bba79df8f0e15ee66192edc9ea9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
A common source of issues is that people do not consider that
fonts can have fractional metrics and use QFontMetrics for UI
purposes, causing bounds and eliding to be inaccurate.
This is not very surprising, since the class name sounds very
much like what you should prefer by default and the docs
didn't even contain links to the QFontMetricsF class.
It might make sense to deprecate the class, since it really
does not serve any useful purpose, but for now we at least
document the issue up-front so that users can easily find
the alternative.
Pick-to: 6.8 6.5
Task-number: QTBUG-132102
Change-Id: I69756c561e5dee448a9d0a7d85af1a9b15ff1ae3
Reviewed-by: Nodir Temirkhodjaev <nodir.temir@gmail.com>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 9a6036dea2cfe0cec555a503445aed93fed3d985)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Refreshing the global theme may be expensive for large scale applications, and even if Windows sent corresponding message,
it may be triggered by many reasons, not just the system theme,
so no matter what we'd better add an extra check.
Change-Id: I70847aa54fb4af37c81855a62330a4bce31ff104
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit 9b924a4907a4a2b27ee52e807fd419caf219f655)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Use structs derived from std::false_type and std::true_type instead
of boolean constants. This allows us to make use of std::conjunction_v
and std::disjunciton_v in the conditions, thus making use of
short-circuit evaluation and saving unnecessary template
instantiations.
Still keep the constexpr bool *_v constant for the cases when we need
a signle check only.
Amends 678e9f614bc5a05d2ff16cf916397998e7cdfca1.
Pick-to: 6.8
Change-Id: If2ab48ef910e97f241f5922d4108a271bc532f3a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 8784ea16a6bc66ac481d5cbf2dd1ece2d57a836b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QCocoaScreen uses removed APIs, which cause the code no fail compilation
with CMAKE_OSX_DEPLOYMENT_TARGET=15.0.
Adding a compile-time check to detect this early.
Task-number: QTBUG-128900
Pick-to: 6.8 6.5
Change-Id: I7eeb60f5769af6b1622efd1e0637e85a038b7930
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit b6f3695a80f5abfbcfb0ebb5b03358b8e7bbbaf9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The new \tm command appends a trademark symbol and links to the
trademark documentation page if `navigation.trademarkspage` variable
is set. As we have such a page in qtdoc repository, set the variable
in the global configuration. This works as all Qt module docs have a
dependency to the `qtdoc` documentation set.
Pick-to: 6.8
Task-number: QTBUG-124393
Change-Id: Iabc6e7e5afe5114eac79947f0feb512458f1c4da
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
(cherry picked from commit 429f565017f7213a91eb0cf43966b2148e0bb651)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
There's no real reason not to be able to move a state guard.
Since a moved-from QPainterStateGuard must not have a restore-
level count, we have to implement the move-constructor explicily.
Add a test case, which verifies that we don't end up with an
un-balanced save/restore count, and that verifies that we would
trigger the Q_ASSERT if we do.
Address comment from header review,
amends 9ecf47a8a8d11227ecf192246d7df7c2c4dc9105.
Task-number: QTBUG-132090
Change-Id: I1db135bf48c0fa0a7bac4fdae7b7263c356b5eb6
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
(cherry picked from commit ec3a5f4994a2bafc65fa8e01fb0861219580f622)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
We were mostly ignoring them because it looks like most people's options
were longer than their positional arguments. The rest must have just
accepted the enforced wrapping.
But if you have very short options like single-letter only ones or none
at all, the positional argument wrapping is unnecessarily short.
[ChangeLog][QtCore][QCommandLineParser] Made it so the positional
argument descriptions are taken into account in the aligning of text for
helpText().
Pick-to: 6.8
Fixes: QTBUG-131716
Change-Id: Ib1eee62c7cf4462f6a26fffdec233ba849ebf158
Reviewed-by: David Faure <david.faure@kdab.com>
(cherry picked from commit 8928b0fbb9ca4caf9b63a32b3d2a73a6da096755)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
It only contains qdoc blocks and wasn't even listed in SOURCES.
Also changed the license to be in line with QUIP-18.
Pick-to: 6.8 6.5
Change-Id: I2c90300ddfd47c3f693dc84cb86f326fa185dd84
Reviewed-by: Lucie Gerard <lucie.gerard@qt.io>
(cherry picked from commit 1cdf813e221b5aa133bc85cb928e329ef1dea896)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
[ChangeLog][CMake] Private Qt modules have been split off into separate
Qt6FooPrivate CMake config packages. A call to find_package(Qt6Foo) will
now implicitly find_package(Qt6FooPrivate). It's not an error if
Qt6FooPrivate isn't available as it may be the case on certain Linux
distros that split their Qt module packages into private and public
parts.
For every public module Qt6Foo that has an associated Qt6FooPrivate
module, create a separate Qt6FooPrivate CMake config package.
Let Qt6FooPrivate find Qt6Foo. This is a required dependency.
Let Qt6Foo find Qt6FooPrivate if it's available. A message of log level
VERBOSE is issued if Qt6FooPrivate is not found.
Implementation notes: In QtModuleConfig.cmake.in, we pull in the private
module. This is not part of the *Dependencies.cmake file, because
1. The Qt6FooPrivate package references the Qt6::Foo target, therefore
it must be available. And Qt6FooDependencies.cmake is loaded before
creating targets.
2. The dependency needs to be optional, and we don't have facilities for
optional dependencies in Qt6FooDependencies yet.
3. We'd have to avoid recursion, because of the Qt6FooPrivate -> Qt6Foo
dependency.
Fixes: QTBUG-87776
Change-Id: I8f23f07da7ca76486f87b759e197174c11e13534
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit fbbf4ace0188b9718b6d7808021c0b887fd52d9f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This auto-computes the string's length without a NUL-byte scan, and
also fixes a GCC 14 unity-build C++23 warning:
In function ‘constexpr qsizetype QtPrivate::lengthHelperPointer(const Char*) [with Char = char]’,
inlined from ‘constexpr qsizetype QtPrivate::lengthHelperPointer(const Char*) [with Char = char]’ at qbytearrayview.h:69:28,
inlined from ‘constexpr QLatin1String::QLatin1String(const char*)’ at qlatin1stringview.h:52:62,
inlined from ‘constexpr QLatin1StringView contextString(QXmlStreamReaderPrivate::XmlContext)’ at qxmlstream.cpp:814:90,
inlined from ‘void QXmlStreamReaderPrivate::checkToken()’ at qxmlstream.cpp:4018:85:
qbytearrayview.h:77:16: warning: ‘strlen’ argument missing terminating nul [-Wstringop-overread]
77 | while (data[i] != Char(0))
| ~~~~^
In file included from unity_0_cxx.cxx:412:
qxmlstream.cpp: In member function ‘void QXmlStreamReaderPrivate::checkToken()’:
qxmlstream.cpp:769:23: note: referenced argument declared here
769 | static constexpr auto QXmlStreamReader_XmlContextString = qOffsetStringArray(
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Amends c4301be7d5f94852e1b17f2c2989d5ca807855d4, which was picked to
5.15, but didn't use QOffsetStringArray there (and unity-builds exist
only since 6.5), so only picking to 6.5.
Pick-to: 6.8 6.5
Change-Id: Ib50369aed6e8248fb88f43c7569c8a435c2b152e
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 44366d07dca047f096d1366c43ba549c97150074)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Since some of the Qt opt-outs are defined project-wide by the
buildsystem these days (e.g. QT_NO_QSNPRINF, ...), a module that
attempts to use QT_ENABLE_STRICT_MODE_UP_TO will hit warnings
regarding re-definition of these macros (definition on the compiler
command line, redefinition by qtconfigmacros.h).
To fix, guard the #define QT_NO_FOO's with #ifndef QT_NO_FOO.
Amends bd7d54249e3f2b6a9dd6b759c892d7c97d26c0aa (which was also picked
to 6.8).
Pick-to: 6.8
Change-Id: I88276c9ed01edde1495105cf5bd1e07b1fd244f4
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 752de4a0aabc305af16251a55edf247e043b1b18)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Since some of the Qt opt-outs are defined project-wide by the
buildsystem these days (e.g. QT_NO_FOREACH, QT_NO_JAVA_STYLE_ITERATOR,
...), a module that attempts to use QT_ENABLE_STRICT_MODE_UP_TO will
hit warnings regarding re-definition of these macros (definition on
the compiler command line, redefinition by qtconfigmacros.h).
To fix, guard the #define QT_NO_FOO's with #ifndef QT_NO_FOO.
Amends 3a6c8e02b6d1b0574da52b0087092d0c74aa92c1.
Pick-to: 6.8
Change-Id: I457457d1e60dbd9362b987157ba089adc67d1d6b
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 0f416cbaaba46ddb039bbf33e1d70dbe80821d57)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
In preparation of adding QT_NO_SCOPED_PONTER, which would be rather
pointless for users if public headers continued to mention the type.
Pick-to: 6.8
Task-number: QTBUG-132213
Change-Id: I6539e83158ab34e4fa4bd22b6d0ac5629a3b6db9
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit b815c6f7fd71086c97fe6e9aa9472154be5fcc57)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Passing an invalid index gives an assertion in debug mode and crashes in
release mode due to an out-of-bounds access. Fix it by appending the
given widget (same as passing a negative index which is documented).
Pick-to: 6.8 6.5 6.2
Fixes: QTBUG-130275
Change-Id: Id0c245e185acc36e5d07cea1d22619bb0e9eee07
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit 0f9062ec71021c256dba7ee8498f036d7aac0821)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The arrows for horizontal scrollbars must be swapped in rtl mode.
Pick-to: 6.8
Change-Id: I517fcea19837a6438edc261e066930218b71ce28
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 02920ef05a980d9bb670e1f8a4b84e0b6cef13c1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Because they would break communication (or loop infinitely) otherwise
since we use the presence of bytes in the returned buffer to know if
there is still something we need to transmit.
Amends 4e60a6b556d91ab797aebb7422666a685a726755
Change-Id: If72c1a142d4567f69d78177250b0218c5ca999fd
Reviewed-by: Even Oscar Andersen <even.oscar.andersen@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit 1efcc0df6adab11e7239f5f12a13766a58e2c1ea)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The example configuration included a space character that caused a
syntax error parsing the .qdocconf.
Replace the hardcoded qhp `QtDoc` project name with a placeholder.
Pick-to: 6.8
Change-Id: Iadf3a50e030f02182016ed9832f4f59d29f82c57
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
(cherry picked from commit 4051ec3356bded10cd7ac66dc1149259bc48d36b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Both widgets and Qt Quick Controls are unable to avoid accepting the
right-click events (press and/or release) in at least some cases.
In the Windows UI pattern of allowing the user to select something by
pressing (and maybe dragging) with the right button and then getting
a QContextMenuEvent afterwards, it's sensible for the code that does
the selection to accept the mouse events, because that code is only
concerned with selection, not the context menu. And in Controls,
Pane is accepting all mouse events just to prevent propagation to
other controls underneath. (That might not be so great, but we don't
have a better way yet.) In legacy Qt Quick, accepting the event results
in an exclusive grab; so in fact, Pane gets the grab, so we can't use
that either, as a way to distinguish "stop propagation" from "this item
is handling it completely, nothing more needs to be done". So it
doesn't make sense for QWindowPrivate::maybeSynthesizeContextMenuEvent
to check the grabber either.
Amends 357c64a99607456133bfabf86d6b67162717cb29 and
84a5f50c7766c99f62b22bb4388137e0aa8dd13d
Task-number: QTBUG-67331
Task-number: QTBUG-93486
Task-number: QTBUG-132066
Fixes: QTBUG-132073
Change-Id: I822cada05cfef27afe6a44faf170585f027061f7
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 70c61b12efe9d1faf24063b63cf5a69414d45cea)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This is a Qt dependency that the user cannot influence.
We did this in cfefce57a4ff446305cd1f839e7c5203bac7a6c5
with "GradleDependency" before. It is a Qt dependency
that the user cannot influence.
Pick-to: 6.8 6.5
Change-Id: I01ef84eab7ab743d5ea9eb15208ef9c567dd2a43
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit ab2a0438ef8b6cc2c73ab0f33d353d00c6599cd9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Clean up the dead code according to TODO statement.
Pick-to: 6.8
Change-Id: I9bdf10067d3a1324d584cebc51cf4555f00f717a
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 64435289027d53c9dace16eaa38087369fee6c4c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QThreadPool's functions already links to the QThread ones, but they didn't
link back.
From the API review.
Change-Id: I02853d8110806f735b748d022a1cfaea5a72d603
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit bbcf47a07d3ec138016d4f997c9b4849598c2f10)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Some http servers like to send RST frames whenever they send their response.
The stream is already closed at that point so it's a little weird, but the
RFC doesn't disallow it, so we'll just ignore the frames.
Fixes: QTBUG-132124
Change-Id: Ic26e249437b739830935e2f3feec572687579b21
Reviewed-by: Øystein Heskestad <oystein.heskestad@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit 2c71fdf043ca94d1c567f169d51245e2702bec19)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Piggy-back on the recently-added, type-erased, std::tuple stream
operator to handle std::optional the same way.
While std::optional doesn't support the Tuple Protocol, and we
therefore can't use putTuple() directly, we can still use
putTupleImplImpl() if we set up its arguments manually.
[ChangeLog][Potentially Source-Incompatible Changes][QDebug] The
std::optional streaming operator is now a member of QDebug, not a free
function. This breaks users that rely on the exact definition of the
operator (e.g. `operator<<(d, opt)`). A backwards-compatible fix is to
call the operator with infix notation (d << opt) only, and to avoid
const QDebug objects.
Change-Id: Ib040d65953ca9d3892aee5bdb597d6d30a9694b1
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 08320bfe2b7387d6f488d405dddf9d3aba6434ec)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This appears to not have worked, ever, so add it as a new feature, for
view API symmetry, not as a bug-fix.
The new constructor is available for all compatible byte types,
because it is more like the (ptr) constructor (which is available for
all compatible byte types) than the known-size-array constructor
(which is only available for char).
This does not affect QB/QBV overload sets, since they could exist
ambiguity-free only if one of them is a Q_WEAK_OVERLOAD.
The GHS compiler doesn't like the CanConvert static_asserts, so
comment them out for it. The functionality itself is tested by
the fromArrayWithUnknownSize test.
[ChangeLog][QtCore][QByteArrayView] Made construction from arrays of
unknown size compile. Such arrays will use the const Byte*
constructor, determining the size of the array at runtime.
Task-number: QTBUG-112746
Change-Id: I201033656f123b09644e5de447cd5d7b038e5154
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 54d47f8390cb85c5b0f0ac050b5aa5a934d798b0)
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
When a compound widget is styled with a font through a property and the
default styling has no font settings, the font was not reset to the
parent font but left it the styled state.
Fix it by not resolving the current font when the style rule has no font
settings - use the parent font directly instead.
Fixes: QTBUG-131685
Pick-to: 6.8
Change-Id: I8e79423cfeff24143cd051b282503c4565125b4d
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 5731fe051e48e7a256ef31ae93cfb89ce8d871cc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
- Draw custom titlebars that are requested by setting the
Qt::ExpandedClientAreaHint with QPainter instead of GdiPlus.
- Draw the application icon, in case it was set, for the custom titlebar
- Add DPI awareness to the custom titlebar
Change-Id: I276e7d8948e5a436f1835d96b59756b7237f63d2
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 438aa1524ee99fd636dc02a7181857ade71bb101)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This reverts commit 4332cb313469de1525afe3cddd792d7bc7e08a14.
The original idea of distinguishing between context (outside/within application)
is not working anymore - it's always outside (except the moment when
a mouse pressed inside the window, which is immediately followed by
'outside application' context). So in fact we never ignore key
modifiers.
Fixes: QTBUG-132091
Pick-to: 6.8
Change-Id: I560a48ccf8f8ee1a55f812be6af18b1dd7e25c78
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 7740ac36d27740ff9204cc2626f58620b7e214cb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Looking at other similar Qt APIs, the type argument usually comes first.
The typical related examples can be QMessageBox() constructor taking
QIcon as a first parameter, and qFormatLogMessage() function, taking
message type as a first parameter.
This patch changes the order of arguments, so that MessageType enum
comes as a first argument.
Amends bad618606d64e943e3fa78e7d1dbc8e1fab55480.
Found in Qt 6.9 API review.
Change-Id: Ibbdef755a8676a2c556fe7f1c95009ad51320b98
Reviewed-by: David Faure <david.faure@kdab.com>
(cherry picked from commit 56114f4d1ed6ec26ff59a596caf09f5b4e0f5d68)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
As a drive-by: move the \since command in the showMessageAndExit() docs
to the right place.
Amends bad618606d64e943e3fa78e7d1dbc8e1fab55480.
Change-Id: I4e6e6d63929029879867624e4007941edfca9cd9
Reviewed-by: David Faure <david.faure@kdab.com>
(cherry picked from commit 6692beace9bb5f461d71935e500e1c6ccfa97fd1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
7499fd0229d63f969bf6ca58d3b764b96395bed2 commit cleans up the localLibs
to not add dependencies to the libs.xml file as they will not be
satisfied.
Mentioned change created a regression with multi-ABI build. It happens
because in qtDependencies[ARCH] container, some libs just have different
atchitecture prefix.
This commit remove architecture prefix when checking libs in
qtDependencies container.
Fixes: QTBUG-131707
Pick-to: 6.8
Change-Id: Iae54779bfa4bd143ec35353604724d8ec4e35ef2
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit e59308c5119caac5d4f1024c7d8147e9887cb246)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
And also add a trailing comma to the last element of the enum to
minimize future diffs.
Amends bad618606d64e943e3fa78e7d1dbc8e1fab55480.
Found in Qt 6.9 API review.
Change-Id: I1a30c344967005c9abc73e59980e56626e09cd7c
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 14cc2591ac06dbcee01c2b110e014db2993d7a1e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The underlying QObjCWeakPointer used to track the view requires
a bit of bookkeeping, so avoid updating its value unless the
view actually changes.
Pick-to: 6.8
Change-Id: I6a1aeaf0e6e0eb221d55de00c8f30259832e58fa
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 2e80e74f37980f62bb915983e61d6734fb416bcd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
If the existing m_object is the same as the incoming object the
call to objc_setAssociatedObject in trackObjectLifetime will
release the existing WeakPointerLifetimeTracker after assigning
a new one, which means we'd clear the QObjCWeakPointer's object.
We now reset the state up front.
Fixes: QTBUG-132256
Pick-to: 6.8
Change-Id: If2c08840d465ae6d190c87a4720a537fe9caa8dc
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit 92012333d112dbdf2926117ec3bb123bd30ed9fc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
... to sync it with the rest of the api.
This amends ff339819925ab550c48b53d9baaba43e5adebfaa.
Task-number: QTBUG-124173
Change-Id: I0ed4681bf7d3717f84a7e888affb0c8cae877c35
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 15a1ae90f5b6da3ffd50acda63ddd33ca14227f4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The file contains two implementations of the class template, one for
QT_CONFIG(thread) and one for without. Both are in the QT_NAMESPACE,
but each provided their own QT_{BEGIN,END}_NAMESPACE macro pair.
This is unneeded and may throw off scripts which use the macros as
insertion positions (like includemocs, which, however, operates on
.cpp files, not headers).
To fix, move the namespace macro pair to be around the #if
QT_CONFIG(thread) block.
Pick-to: 6.8 6.5
Change-Id: I56c1f9a4ef7df0fba54c72d8a213fa92573b826c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 8553ffd8d147ecf6a713d12a360027b477dd59c8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The title bar calculation is terribly wrong and was
missed during review.
Change-Id: I0c7a860e747465e6a5e4d8aa5415a9701cf170fd
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit f6af3a581642170f0f4fe0d0563851715e045391)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
When QStringRef was moved out of QtCore, it was also incorrectly
removed from the if_compatible_container constraint, causing
QStringView{sr} to still match the general container QStringView ctor
overload, which doesn't preserve null'ness if data() doesn't return
null. By refusing to provide a constructor from QStringRef, we force
the compiler to use QStringRef's implicit conversion operators
instead.
This transitively affects QAnyStringView in the same way.
The tests can, naturally, only be in qt5compat, so define a macro to
communicate to tst_QStringRef whether it compiles against a fixed
QtCore or not.
Fixes: QTBUG-122797
Fixes: QTBUG-122798
Pick-to: 6.8 6.5
Change-Id: I64b75a8e421d2b6185615e3288ce3ad7fd8f15f9
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit a0e65398483729259cf58781949133c6055fdc7c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Move the query into the model, and use a local scope to make sure that
we don't use the moved-from query later.
Change-Id: I9d216e770733af8b0771280276dba0775209a802
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
Reviewed-by: Dheerendra Purohit <dheerendra@pthinks.com>
(cherry picked from commit af760da54190d96b315ea8edeec00c86871af0d8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This reverts 59bbfb17db563d7e62b9f3158dab3cc6e7e68acd and
c853054910552f5fef04797222dde0d29a0c340d, as that approach
was causing issues for QCommonStyle::iconFromWindowsTheme,
for example in situations where the system has a 1x and 2.5x
screen, and the user requests a 16x16 pixmap or icon via
QStyle::standardPixmap or QStyle::standardIcon. In that
situation our smallest pixmap is 40x40, and we need to
downscale, causing blurred results on a 1x screen.
Change-Id: Ifa6e15d37d15954df689253c32eaa779885c567b
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit d884abaf8bdc1be74ee52306948c0be1986d738d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The color of the subline in editable widgets was black in light and dark
mode. Fix it to use white in dark mode to make it visible. Move it out
into own helper function since it's used in at least three places.
Pick-to: 6.8
Task-nubmer: QTBUG-131585
Fixes: QTBUG-131586
Change-Id: Icca2b142a1ce0c3d7f722baa6d3635bae5950e1c
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 66d42b62b6f01205cf1db72e56ecb5166554e373)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
These two members were added during Qt4 times but never documented.
Pick-to: 6.8 6.5
Change-Id: Ife4abfc6d8883f4c26ce5b95d5c0cfd3adcbd6bf
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Wladimir Leuschner <wladimir.leuschner@qt.io>
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
(cherry picked from commit a90d9f4823bd6baf4cb660a942c2b1695441dbbd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
On monitors where the subpixel arrangement is blue, green, red,
our DirectWrite rendering would give the wrong subppixel
antialiasing, causing color fringes on text.
Like we do with Freetype, we determine subpixel arrangement of the
primary screen and use this as the default.
Pick-to: 6.8
Change-Id: I9ce7025449106a2376bd0ed02ce07b59c79438bd
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
(cherry picked from commit d5cef74d8d71458500f979c0d31a7241b3fef9db)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This amends cb2633468413d8c2a9e28d4c4a10b25e90dd3116.
The patch excluded the ad hoc parsing of variation selector
except when Qt was built without the emoji segmenter. The
reasoning being that the emoji parsing handles this correctly
now.
However, when setting the QT_DISABLE_EMOJI_SEGMENTER variable
in the environment, this is supposed to work as a fail safe
which gives you the original behavior, in case there are
regressions. Therefore, the variation selector handling needs
to be run also when this environment variable is set.
Change-Id: I2669d29016a552775461aad13e50459baecdc26f
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit aaf7437db3a520ab14220a46cf9427cb9a8d915c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
In b8612eaa2a17e12e31ee28141cff1fb43e54c00e, we added a fail safe
where failure to find the font name through DirectWrite would
try loading it through GDI instead and if that was successful we
would register the family with the database after all.
However, the code assumed that CreateFontIndirect() would return
NULL if the font did not exist. It does not do this, but instead
selecting the HFONT on the HDC will give us a suitable alternative
instead. The result would be that any missing font family would
be registered with the font database through this mechanism, even
if it really didn't exist.
This code was added in an early version of the patch, however,
and it should not actually be needed anymore, since we in later
versions of the same patch also added logic to populate the
GDI-compatible family names
(DWRITE_INFORMATIONAL_STRING_WIN32_FAMILY_NAMES etc.). This should
take care of backwards compatibility with the GDI names for fonts.
Since the code has been reported to cause problems on some systems,
it's safest to just remove this hack.
Pick-to: 6.8
Task-number: QTBUG-130313
Change-Id: I7eca893d17796d9cac07391b7b947d28dd7cd920
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 355f54f7d5dd300c73bf203f12e24305d0e227c1)
Remove quotes from the namespace values if they're set
directly to build.gradle.
Fixes: QTBUG-132150
Pick-to: 6.8
Change-Id: I7f5e132c2600bf5079850c99dc500b1dff7e6a96
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 60f78212379ba2b4a7a9bfadc5088a60309e923c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Modified QPlainTestLogger::printBenchmarkResultsHeader() to
concatenate and display both global and local data tags, in
the benchmark result header, in the format `global:local`.
If only one tag is available, it is printed alone.
Pick-to: 6.8 6.5
Fixes: QTBUG-127522
Change-Id: Ic9f3c712ef3f6858aad2546b80d8867ce860b644
Reviewed-by: Matthias Rauter <matthias.rauter@qt.io>
(cherry picked from commit 95f02adf756d1ae485f39a060c6f23a5af3f64ee)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Add Qt::KeypadModifier (and the combination with Qt::AltModifier) to the
modifiers that may be set in a key event in order to trigger a menu
action via its accelerator.
Otherwise, an action that has a number set as the accelerator (e.g.
using text "&1 Exit"), cannot be triggered by typing the corresponding
number on the keypad.
Fixes: QTBUG-73390
Pick-to: 6.8
Change-Id: I0fa63b0c5f23823c61e159fcc72f7245215f8aae
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit ca4334bc966c7e5f9997f98b83afe37eb8b1d3ba)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QStyle::styleHint() take the QWidget as optional third parameter. Add
this to calls to styleHint() where appropriate.
Fixes: QTBUG-2501
Pick-to: 6.8
Change-Id: Id4e4158cc889236064f2f618495608736607d457
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit aa341ecca816e3503a834ffde0ec6cb817139427)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
External tools might rely on the output of "moc --version" to identify
moc, and, depending on how robust their parsing is, could break if the
reported name does not equal "moc".
Explicitly set the application name to moc, so that even if the moc
binary gets renamed and invoked via a symlink, it will still correctly
identify itself.
This might help with both binaries from the Qt Company's installer, as
well as with distros which rename moc to moc6.
Pick-to: 6.8 6.5
Task-number: QLS-1605
Change-Id: Id85e2ffa17d445213da0b37e7bd038d7b68e2c2a
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
(cherry picked from commit 47be32b761ea6e1f2c1bfa9dd9eb38846ce2fd45)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Document that QSpan exists because we cannot use std::span, and
explicitly point to the differences between QSpan and std::span.
Task-number: QTBUG-128837
Pick-to: 6.8
Change-Id: I54f406e3306ee1da136107323887f0c87f94ff9b
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit 083ebfa1a5cb16b0b62ae5b5855a602b2f9ba818)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
In the copying/transcription of the generic converter to the generic
in-place converter, a test for Format_RGB32 destination format was
mistakenly replaced with test of source format. The result was that a
suboptimal pixel store function was selected, and the resulting image
data could end up with non-0xff in the unused alpha field.
Task-number: QTBUG-132051
Pick-to: 6.8
Change-Id: If3ebf5fdd7ab6e377c8ad479ea38ce665f922b7c
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 0ace5ba0357b1614b47cb38a16f4afb2fe8e62db)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
If there's no way to resolve an actual date with the data parsed, then
the date-text given is invalid, so don't try to fix it up.
Pick-to: 6.8 6.5
Fixes: QTBUG-132115
Change-Id: Ic6821bd01394d4dba1be1d25806c372800f8176b
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit 72519aeb237a4085aeb6290b0b4088c690fad106)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
There are two QHashPrivate::Data constructors (and two overloads of
::detached()). Initially the Data ctor that takes a new size always
assumed a resize was happening, and any place where there _may_ be a
resize we would usually detach then rehash.
In an effort to avoid the detach+rehash and instead call detach(d, size)
without the performance overhead of rehashing the call to
reallocationHelper() in this overload of the ctor was changed to verify
that a rehash was actually needed. This had the unfortunate side-effect
of making the compiler no longer inline the reallocationHelper()
function, and it no longer expanded the if-expression with the constant
so it was doing a tight copy-loop with a potential branch in the middle.
In this patch we revert that and make the bool a template argument to
highlight that it should be a constant for better performance (but also
leaving a comment.) Also mark it Q_ALWAYS_INLINE, it has two uses and
they both take advantage of the inlining + expanding the expression.
In theory this might have had an impact on QHash::reserve() calls,
though this code is only relevant when reserve() would cause growth so
the performance regression would hopefully be small compared to all the
other work that would also be needed.
Reverts 45c137d797a85c694897e8b1c5099abacc16e2f5
Pick-to: 6.8
Change-Id: I0d2076a9ded8ca816c54d6ce42d472a23bcbc9fd
Reviewed-by: Lars Knoll <lars@knoll.priv.no>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 6c8b6acc894e47a37c4fb443316d9c40d35a144c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Instead of using just the detached() overload taking a new size, call
the two un-sized one when not resizing. The unsized overload is faster
because it is inlining the reallocationHelper() function and expanding
a branch by way of a constant.
And drop the call to rehash in the !isDetached case, if we enter this
branch we willfully 'attach' the detach guard to keep the key and values
alive.
Follow-up change will fix the sized detach() to use a constant again.
Amends d9ad2251d9fff85a18ce5afc62bcb1230cd2820d
Change-Id: Ia1640766b898610d12b5df20d83cefe5ca2d4c36
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit ac2b0b958e97c41b38c42c0789d91de724d567ce)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Like QStringView's, these classes' documentation promised
is_constructible<View,Char[]>, but failed to deliver, because neither
the (const Pointer&) nor the (const Container &) compile for arrays of
unkonwn bounds, and the (const Char*) one is just a QDoc fake.
Apply the same fix as for QStringView: Add a ctor specifically for
arrays of unknown bound, delegating to the (ptr) overload.
The GHS compiler doesn't like the CanConvert static_asserts, so
comment them out for it. The functionality itself is tested by
the from*ArrayWithUnknownSize tests.
[ChangeLog][QtCore][QUtf8StringView/QAnyStringView] Made construction
from arrays of unknown size compile. Such arrays will use the const
Char* constructor, determining the size of the array at runtime.
Pick-to: 6.8 6.5
Fixes: QTBUG-112746
Change-Id: I7acdcae3c5bdf80a0bed673e621d53ef34a92a1e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 734bd05d0a6d37d6488cf8d1b2b9f79b9329d966)
Less duplication, matches what we do for q_no_char8_t namespaces, too.
Amends 94addad4dd1c89df9c6820d34b9a90424456c492.
Pick-to: 6.8 6.5
Change-Id: I5d98babcb66d1196d3aed31c33289a1b11212a3d
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 2d2ee569421338dbc07a479a7df2531bd37f0ebe)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
... instead of fwd-declaring a bunch of stuff manually.
Also move the fake QDoc decalaration of a "class QUtf8StringView"
over.
Pick-to: 6.8 6.5
Change-Id: I80bc3240d69f69602c127fc0e8fe694dd46765f1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 8404c21152ed3e28f8e00d683a494a8e1e25a69a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Use a static logging category where possible, and check the return value
of QFile::open.
Change-Id: Ieda9f7874d1b88d9bfeb593243eb867d0c274e9f
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit e0ef713a2c6a74fe574481e98f0a582819418ed0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
qstringfwd.h is supposed to be a lean header, dragging in all of
qglobal.h perverts the purpose.
This also helps with certain circular-dependency issues that
appeared when attempting to use this header in other low-level
headers.
Amends abe3b4c9b947de5e55085b37840e0d1d6f3aae42.
[ChangeLog][Potentially Source-Incompatible Changes][QtCore] The
qstringfwd.h header no longer includes qglobal.h. A
backwards-compatible fix is to include qglobal.h yourself instead of
relying on the transitive include.
Pick-to: 6.8 6.5
Change-Id: I1726fccfd13b3a058abaf800c1bbf02c320143a4
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit 5def8ff180c67f288bdc6e3c05b96940aeae37c0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Explain the behavior of open() in detail, including the edge
cases (reopening a file). Fix links to QIODeviceBase::OpenMode
flags. Use explicit links to make linking more robust. Use
the same parameter name 'mode' as in the base class.
Pick-to: 6.8
Task-number: QTBUG-131484
Change-Id: I5d01b3bb48a7a439b93c144e6d38482607de8d33
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit adaf1fb107ceb7003313ceb67605f986b74763b1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Fix links to OpenMode flags. While at it, make links explicit so
that future changes breaking implicit linking will cause errors.
Pick-to: 6.8
Task-number: QTBUG-131484
Change-Id: I20b80014eadcbcba6ebebab1ff4db4c345dd434a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 4e85a4f401118f2f7330b673e45b4a0399825ef3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Explain the method, instead of just linking to the base method.
Call the argument 'mode' instead of 'flags', like it is done in
the base class.
Force the mentioned QIODeviceBase flags to be links. Use fully
qualified name for the first flag mentioned, but use the short form
for the rest to improve readability.
Pick-to: 6.8
Task-number: QTBUG-131484
Change-Id: I8e9668ffc095ec261e2be54a2dcf16a32e4cb441
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 334460407b7cde1cdab5cfe5abe00175893749c3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Force the mentioned QIODeviceBase flags to be links. Use fully
qualified name for the first flag mentioned, but use the short form for
the rest to improve readability.
Mark true and false to be written in code style.
Task-number: QTBUG-131484
Pick-to: 6.8
Change-Id: Iebb0f9c6df382327bc5980e9e06c11deb6658291
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 647bee67150dedbd2a9fd2ddcd265d535e8fd8cf)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
qsocketnotifier.cpp is using a #define to activate a second overload
of QSocketNotifier's activated() signal.
In unity-builds, this overload becomes visible to other TUs and breaks
new-style connect()s¹. In PCH builds, the define comes too late (the
qsocketnotifier.h header was already included by the pch header,
without the define).
Fix by adding qsocketnotifier.cpp to NO_PCH_SOURCES (thereby to
NO_UNITY_BUILD_SOURCES, too).
¹ and the signal's use of QPrivateSignal makes disambiguation by
qOverload(), or assignment to a function pointer, impossible.
Amends 487dd80bce9c6006f349ccb09222e1c308200f0a(!).
Pick-to: 6.8 6.5 5.15
Change-Id: I40ca3b90f7ecc3116ae78dc952583efa299bcedb
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
(cherry picked from commit a38cebfe23674bb459eed6bbbcac965ebf2b6075)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The QtDeclarative code causing QTBUG-131906 hits UB, because it tries
to store -666 in an enum {A, B}, which has a valid range of [0,1],
therefore its underlying_type is uint, yet, as per [conv.prom]/3¹,
integer-promotes to _int_ instead, so in Qt 6.8 would cause the
arg(int) overload to be called, outputting -666, while in Qt 6.9, it's
treated (correctly) as an unsigned value, outputting -666's two's
complement, a positive value.
Add a version of the scenario that does not cause UB.
¹ Thanks to Ahmad Samir for digging up the pertinent legalese.
Task-number: QTBUG-131906
Pick-to: 6.8 6.5
Change-Id: Iba1a04de523a0b4cd1c87deea40c643cf16df14f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit e64fd05fecae291c9d7358d2e47d7170995af256)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
They are now the same, but the name UTF-32 is preferred over UCS-4.
The original ISO-10646 UCS-4 encoding was allowed to use all 31-bit code
units, from 0 to 0x7FFFFFFF[1] including those above 0x10FFFF, which
correspond to UTF-8's five- and six-byte sequences. Unicode doesn't
allow that and restricts the UTF to the range possible in UTF-16.
Renaming the functions is left as an exercise for the reader.
[1] https://en.wikipedia.org/wiki/UTF-32#History
Pick-to: 6.8
Change-Id: I2f29db62b974cb689585fffd9a6434ae252a7651
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit 973d0c4c5160200c188f81da5df064510315f22d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
... when the user passes size = -1. std::char_traits<char32_t>::length()
doesn't appear to be an any better implementation than our simple loop,
but maybe some compiler will optimize it.
wcslen() is usually optimized in the C libraries, even for Unix
platforms that hardly ever use it (it's used as a fallback in qustrlen()
for non-x86 Windows systems).
Pick-to: 6.8
Change-Id: Ia143270869a3a7cf5754fffdc17e500fc454397b
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit b98cf4fc4afaf55145c34ba06d61fec38fadc25d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The original idea (8b5aa7b6c40d70a7ec15b3ea485f28a142fb247c) of the
separation of array and pointer ctors was to determine string literal
sizes at compile-time in C++11's limited constexpr semantics.
But when the scanning for NUL characters was added to the array ctor
in 107ff4c1d6b5da2cb11c65b2bd9106817f7fdb02, the distinction between
the two ctors became meaningless, because we were able to assume
post-C++11 constexpr to make the Char(0) scan a compile-time action.
Finally, 9e1dc1e8a9fda1a7576cc6377c8a36decff631eb removed the array
ctor in favor of the generic Container ctor. I didn't check whether
the old code handled arrays of unknown size, as in
extern const char16_t str[];
QStringView sv = str;
~~~
const char16_t str[] = "str";
but std::size() (and therefore if_compatible_container) surely bails
on such arrays, and if_compatible_pointer also SFINAEs out. As a
consequence, such arrays cannot be used to construct QStringViews atm.
Fix by adding a new constructor for arrays of unknown size, delegating
to the existing pointer overload.
The GHS compiler doesn't like the CanConvert static_asserts, so
comment them out for it. The functionality itself is tested by
the from*ArrayWithUnknownSize tests.
[ChangeLog][QtCore][QStringView] Made construction from arrays of
unknown size compile. Such arrays will use the const Char*
constructor, determining the size of the array at runtime.
Pick-to: 6.8 6.5
Task-number: QTBUG-112746
Change-Id: Ifdb217350d93d38f081c99f14661975491d32076
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 56faffd92bf0ac459a921ec043a6f3b3dba51acc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Other view tests test Char[N] and const Char[N] separately. Do the
same here.
For many Char types, the array CanConvert test was missing
completely. Add them.
Pick-to: 6.8 6.5
Change-Id: I1d0b6de394d548554a547f190e74cb8cead6ecd4
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 0bbbbfc78beb2393ceea0de0fa85942f71d0a2ed)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Adding it here since this test case already has all the infrastructure
for the overload test.
Pick-to: 6.8 6.5
Change-Id: I2d7fff9d2d82fed3db2446690a354f939c9a37fc
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 140dac92f2a8ee1f54843f69be4026900a049ee7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This is supposed to work, so check it.
Pick-to: 6.8
Change-Id: I201033656f123b09644e5de447cd5d7b038e5155
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 8a3ffe7044249bcfb5185bd87a9713685d48de7b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Use QTextLayout to layout and shape the text, which will respect
ligatures. Many icon fonts might not name their icons, but have a
replacement ligature for the actual icon name replacing the text with
the respective glyph.
So if for the name of the icon we get a single glyph run with a single
glyph in it, use that to render the icon.
Change-Id: If0e5c528c3ac4cccdbb7df5fb7fd32ca232f2a66
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
(cherry picked from commit d10e9174fecb91b5c366d57aeb19e6410522a807)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The icon engine needs to be able to rely on glyph indices belonging to
the correct font, and we generally don't want the overhead of iterating
through potential fallbacks if a named glyph or unicode code point
wasn't found in the font.
Assert in the QFontIconEngine constructor that the font we get has the
NoFontMerging strategy bit set.
Amends 2af58490b3d33aab8d08610939fe2b7cab4c469c.
Change-Id: Ib38324aebbeda956c8dd053969d6cf08f7ef3c35
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
(cherry picked from commit 9d47233d2cbbae1aa32240688fcc7a8c08c585d3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
- prev pointer never can be null here, so the check can be deleted.
Ammends 948599e7b71f59fd9c9c0f7f3d1987ec93a23490
Pick-to: 6.8
Change-Id: Ie194f5f0432f6da5f6471328193112c970f623b6
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit d991572a45b2bbdcd43e59586f88487837a2927c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
These functions iterate through the parent hierarchy until the widget
given as argument is found. If never found, the code would assert (in
debug mode) or just silently crash (in release mode).
No need to bring down the entire application just because some widget
coordinate calculation is off. Instead, just emit a qWarning and
return cleanly.
Task-number: QTBUG-132072
Pick-to: 6.8
Change-Id: I4d13f46037cdcf855f76e040f941a8a7050ab12b
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit 73221d263823d50e525858d613ce93769698454a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
For dynamic linking only the main module should
link with libraries like "FETCH".
When side modules are linking to libraries as well,
it leads to linking errors.
Change-Id: I83e37add867f1ce2cbcab4801f49266a288a9ceb
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
(cherry picked from commit b7419557b1b0cc1a87aa91131329b65aee44ec34)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Many subclasses of QAccessibleInterface implement window(), but
some don't, and the documentation states that the backend (us)
will traverse ancestors until it finds one with a window.
We were not doing that for iOS, which caused a crash for
QAccessibleTabButton, which doesn't have a window.
In case we ever hit the code path where we can't find a
window we also skip adding the nil element to the array
in createAccessibleElement, as that causes an exception.
Amends 7a512d1267442e646bb7942291197b2b03f4d1cd
Pick-to: 6.8 6.5
Change-Id: I9b758423956e845a01b014022f4d3ab6306be94e
Reviewed-by: Doris Verria <doris.verria@qt.io>
(cherry picked from commit 6689921b9da3780676a416324eafcac98ab211a3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
In many places this was already done; but there was some old code
remaining where mousePressEvent() simply returned without ignoring the
unhandled event.
Task-number: QTBUG-93486
Task-number: QTBUG-132066
Change-Id: I4a876980b7ef88ee478fa8cfd9f68b5be5b217a2
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit a1175255150d27d50f9690d5f8685b31269d9fa1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QSpan docs use \target commands together with the section headers, to
simplify linking to certain parts of the docs. This approach has its
own drawbacks, though, because the \target link is rendered as-is.
This patch improves usage of the \target commands, making the links
look better.
It does the following changes:
* Moves the \target commands before the related \section2 commands, so
that the section header is visible when following the \target's link.
* Replaces the \target links with the actual section names in the \sa
and other places of the docs where the links do not have the custom
text, because otherwise the target names are actually visible in the
docs instead of the section headers.
Amends 03e78e5d624d9752d76c7448d58c9d9d15a4dc18,
70dc8d3103fade380caec96f7531432cd8e8adb6, and
ef5ac956c755daa9ea84dabfa1314d104e5c62e4.
Pick-to: 6.8
Change-Id: I045824683f342079e33e89e3ee6f8e2e27a0acf5
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 10c844f0533daf657a1cbbbb96651e20e5d603ec)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
It can (unlike the other views).
Pick-to: 6.8 6.5 5.15
Task-number: QTBUG-112746
Change-Id: Id976429611c53f1c707de1d989c454507b8f4773
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 01f0305dc6f751d3eb4d1681a2f8f9f3165b547c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
It would be more consistent if we could rely on the accepted state of
the original QMouseEvent to decide whether to follow up with a
QContextMenuEvent; but not all Qt widgets call ignore() on unhandled
mouse events, both in Qt and in external libraries and applications
(including some from KDE). So we should at least wait until Qt 7 to
make this a requirement. It seems sensible to move the check into
QWindow::event() rather than trying to distinguish the window type in
maybeSynthesizeContextMenuEvent(). We merely output a categorized log
message to indicate when the legacy behavior is in effect.
Amends 84a5f50c7766c99f62b22bb4388137e0aa8dd13d
[ChangeLog][QtWidgets] If your QWidget subclass depends on receiving
QContextMenuEvent, and also handles mouse events directly, we
recommend that you call ignore() on unhandled mouse events (such as
right-button events). In Qt 7, we plan to stop sending
QContextMenuEvent if the triggering mouse event is accepted.
Fixes: QTBUG-132066
Change-Id: I454813dab4c387112f161fc28a0ee94570013afa
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
(cherry picked from commit 357c64a99607456133bfabf86d6b67162717cb29)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Needed to use a weird combination of \c and \a here, as qdoc on
one hand insists that all parameters be documented, and OTOH doesn't
support \a within \c.
Writing anything else than the equivalent code in \c to appease qdoc
would be childish. Equivalent code is the best-possible documentation,
as it leaves no question unanswered.
Task-number: QTBUG-131672
Change-Id: I512872360b7eb212001723f2ba12d4c6eac0b6b0
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit 0afe31fa51a26d12be21c1b9c6e886abb9775441)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
There is no fromSecondsAfterUtc(), I was thinking of
fromSecondsAheadOfUtc().
Pick-to: 6.8 6.5
Fixes: QTBUG-131913
Change-Id: I6a89a27d678d23043819b93d5e4120d01002da4a
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 2bdce97480ed66f0e8e9528fbc8f4f9c3d8487bf)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
1. Make some global constants constexpr.
2. Make some file-scope global constants static.
3. Use QStringLiteral instead of plain const char*
4. Add "u" to QStringLiteral's content.
Pick-to: 6.8
Change-Id: Icbc105366ba40e970b256fe3da41231a6fb5064b
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
(cherry picked from commit ad06099b93d79a954d133d6822517d4d0a10adbc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The alternate base color in darkmode was wrongly set to the accent color
instead of a lighter color. This patch overrides the alternate base
color for the QWindows11Style.
Fixes: QTBUG-131976
Pick-to: 6.8
Change-Id: Ie8f50b0042ca7bf746224275abc0cd255df7a4ad
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit 79aa4269bcbbedef8206d79318c199df7c8a3c9f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.