71231 Commits

Author SHA1 Message Date
David Boddie
1b245a8a46 doc: Remove invalid link and tone down language
QLatin1StringView::split() appears to be invalid.

Pick-to: 6.8
Change-Id: I11066b8224cce0a6091c758367f602a63c6136a0
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit 4aff3488b8262ef23f1230b7f530c46ca2d61ac1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-02-10 21:26:21 +00:00
David Boddie
6de04b08c4 doc: Fix broken links, including auto-links
Pick-to: 6.8
Change-Id: I967304c24e1a593b1b555998a718d0a015e12900
Reviewed-by: Jerome Pasion <jerome.pasion@qt.io>
(cherry picked from commit bddfded80e225cbc112b79ccf5ada20a01e62fcf)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-02-10 21:26:21 +00:00
Mårten Nordheim
5985c90d37 Update UCD to Unicode 16.0.0
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>
2025-02-10 21:26:21 +00:00
Tor Arne Vestbø
260276642e macOS: Update window flags when updating content border thickness
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>
2025-02-10 21:26:20 +00:00
Frédéric Lefebvre
ea55328741 Tst_QGestureRecognizer::panGesture set FramelessWindowHint
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>
2025-02-10 13:59:52 +00:00
Edward Welbourne
c38718c846 Add terminal rows to various QtTimeZoneLocale tables
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>
2025-02-10 13:59:50 +00:00
Mårten Nordheim
1aef8b9057 QMultiHash: fix/update class description documentation
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>
2025-02-10 13:59:48 +00:00
David Boddie
a8fe95f0ea doc: Fix broken links and incorrect information
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>
2025-02-10 13:20:27 +00:00
Allan Sandfeld Jensen
33b98002c2 Fix config summary CPU subarch line
Was likely broken by abc888c75bf145bb5da2680b7943f1ea3af83202

Change-Id: Ic9ed27255f105272ef60c3a91f3d934c70b91b8b
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit a522a0595bc3e908efc7ec70c9d7120c4d5c599b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-02-10 11:41:13 +00:00
Bartlomiej Moskal
941434e81f Android: Fix cursorHandle and EditPopup positions
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>
2025-02-10 11:41:11 +00:00
Matthias Rauter
6869341dce Make QDomNodeList::It bidirectional only
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>
2025-02-10 10:13:56 +00:00
Even Oscar Andersen
43eb0dbd38 wasm: Truncate input field length to 1px, fix object selection
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>
2025-02-09 06:56:56 +00:00
Wladimir Leuschner
9f7437fb85 QWindows11Style: Add left margins to Radio/Checkbox indicator
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>
2025-02-08 19:39:19 +00:00
Christian Strømme
5296136496 rhi: Always check and mark the extra buffers for reuse on metal
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>
2025-02-08 18:22:09 +00:00
Edward Welbourne
055b5a83b4 Modernise tst_QTextStream::manipulators() and add two new data rows
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>
2025-02-08 18:22:09 +00:00
Frédéric Lefebvre
69738c76b4 tst_QGestureRecognizer::touchReplay give fix position
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>
2025-02-08 18:22:09 +00:00
Tor Arne Vestbø
5127aef0bb cmake: Add option to pass additional arguments to _qt_internal_plist_buddy
Pick-to: 6.8 6.5
Change-Id: Icbbfcb7fffa97370c3cdf7440e801eea60de84f0
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit ab4aac7bf137083a401186029fe70ff00137f279)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-02-08 12:45:27 +00:00
Tor Arne Vestbø
8f837f6e6f cmake: Find Apple ID via IDEProvisioningTeamByIdentifier for Xcode 16.2
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>
2025-02-08 12:45:25 +00:00
Tor Arne Vestbø
0ff3a84bc3 Document QSurfaceFormat::ColorSpace deprecation
Pick-to: 6.8 6.5
Change-Id: I894316d0b3df703e5fd07a1c18f579992215e621
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit ca250a637297042d39c3e799a1e25ec3168d6f15)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-02-08 12:45:23 +00:00
Tor Arne Vestbø
761d516fd4 qmake: Find Apple ID via IDEProvisioningTeamByIdentifier for Xcode 16.2
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>
2025-02-08 12:45:21 +00:00
Tor Arne Vestbø
6a23dfba36 cmake: Rename _qt_internal_find_ios_development_team_id
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>
2025-02-08 12:45:19 +00:00
Alexei Cazacov
639f5bf5db Docs: fix minor issues with topic naming
Change-Id: Iaf8d12743a5f43c355f6960f1da0c6764e622bf8
Reviewed-by: Andreas Eliasson <andreas.eliasson@qt.io>
(cherry picked from commit 32890793caae08c2dc05ce1f68e659f219536ed7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-02-08 12:45:17 +00:00
Ahmad Samir
db1ed43050 QString: add {setUtf16,setUnicode}(const char16_t*) overloads
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>
2025-02-08 12:45:16 +00:00
David Boddie
ae6b9c0c63 Fix or remove broken and outdated external links in qtbase documentation
Change-Id: Ia78b3b16b89ab3f80d990b6e338b4a0f294ab1ed
Pick-to: 6.8
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
(cherry picked from commit 787d1db34745fec2e89cd99f62767079213bb8fa)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-02-08 12:40:43 +00:00
Topi Reinio
f490b4de05 Doc: Clean up output for tabbed content macro
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>
2025-02-08 08:08:41 +00:00
Liang Qi
4be258fd13 ibus: use logging category for im debug
Pick-to: 6.8 6.5
Change-Id: I5397f1fb14273b77833979d3e66056a7110fd2b0
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Inho Lee <inho.lee@qt.io>
(cherry picked from commit 5c9fd486ae82056614bdb9e685c825b586bb9809)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-02-08 03:14:36 +00:00
Pavel Dubsky
775d56f01d Move UUID definitions out of Qt namespace
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>
2025-02-08 02:34:30 +00:00
Matthias Rauter
1d067db128 Extend testing of QDomListIterator
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>
2025-02-08 02:34:30 +00:00
Laszlo Agocs
6446d865be rhi: d3d12: Fix finish() when called outside a frame
Pick-to: 6.8
Fixes: QTBUG-133454
Change-Id: I447610917966a9dcd4b80dc8b84156ce985f9ca9
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
(cherry picked from commit 01308ff18e74860dd32472bbff31ca1fabd8339f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-02-08 02:34:29 +00:00
Laszlo Agocs
987ff07a85 rhi: d3d12: Fix crash in readbacks
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>
2025-02-08 02:34:29 +00:00
Thiago Macieira
01010851cb QProcess/Unix: don't close the childStartedPipe too soon
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)
2025-02-07 15:27:41 -08:00
Christian Ehrlicher
b2191e4450 SQLite: Update SQLite to v3.49.0
[ChangeLog][Third-Party Code] Updated SQLite to v3.49.0

Pick-to: 6.8 6.5 5.15
Task-number: QTBUG-132862
Change-Id: I0978f2d3bd6aab71cded77668912dec4cb569a68
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
(cherry picked from commit eb03784510c037a377c576b298b9b2fccd16759f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-02-07 20:39:06 +00:00
Jan Arve Sæther
df1786d777 doc: QKeySequence cannot be cast to a QString any longer
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>
2025-02-07 20:38:59 +00:00
Eskil Abrahamsen Blomfeldt
e593626788 Improve hinted rendering quality on Windows
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>
2025-02-07 20:37:02 +00:00
Marc Mutz
0e5e850691 QStringBuilder: remove an unneeded cast
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>
2025-02-07 20:37:02 +00:00
Marc Mutz
267acbc534 tst_QTextStream::stillOpenWhenAtEnd(): use QTRY_VERIFY()
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>
2025-02-07 17:01:04 +00:00
Mitch Curtis
56c39a2622 iOS: send context menu event rather than instantly showing edit menu
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>
2025-02-06 01:21:07 +00:00
Giuseppe D'Angelo
ef42c65ab1 Fix typo in QT_DECLARE_RO5_SMF_AS_DEFAULTED docs
Change-Id: I1f2acc02939171464e05671afcaf3df7ca2b3b8a
Pick-to: 6.8 6.5
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 828cfd5d23b3024b0000cab7d2d20eb54971b858)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-02-06 01:15:30 +00:00
Marc Mutz
97a1b5ffa4 QFlags: make base class SMFs protected
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>
2025-02-06 00:52:52 +00:00
Ivan Solovev
c0d39fd2ed Move qtformat_impl.h into corelib/text
... 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>
2025-02-06 00:52:50 +00:00
Marc Mutz
51bbe63d05 Port qcompare.h to qstdlibdetection.h's Q_STL_ macros
... 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>
2025-02-06 00:02:44 +00:00
Andrew Forrest
65e9eca63b Android: Fix mouse button processing
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>
2025-02-05 18:29:25 +00:00
David Redondo
281c45452b QScreen: Add a note to use QWindow::devicePixelRatio if possible
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>
2025-02-05 17:14:06 +00:00
Giuseppe D'Angelo
5ca7ad268a QVLA*: honor the RO5
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>
2025-02-05 15:57:31 +00:00
Ivan Solovev
624784a729 [docs] Add three-way comparison overview
Task-number: QTBUG-128837
Pick-to: 6.8
Change-Id: I64ae12994f8a48ee5f4e48ca6ed7f5980476f2aa
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 737c87b2b21e30abf5e51126fd8ff4e45521144e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-02-05 15:57:31 +00:00
David Faure
7328f90e64 Linux: autodetect gdb (to add -nograb) even in release mode
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>
2025-02-05 15:57:30 +00:00
Giuseppe D'Angelo
711b86fa24 QtGlobal: introduce a helper macro for declaring the RO5 SMFs as defaulted
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>
2025-02-05 15:57:30 +00:00
David Boddie
40dc33a9d3 Fix broken auto-links in QAtomic docs
- 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>
2025-02-05 12:08:40 +00:00
Marc Mutz
eb13efc4a6 Unbreak QSet::intersect()
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>
2025-02-05 13:08:40 +01:00
Marc Mutz
3dff1a3f7b Revert "Optimize QSet::unite"
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>
2025-02-05 12:08:40 +00:00