Commit Graph

76010 Commits

Author SHA1 Message Date
Assam Boudjelthia 357580c225 Android: hook into pre draw and attach listener to deliver safe area
Instead of relying only on setOnApplyWindowInsetsListener() and
trying to guess when to try and deliver root decor insets in case
the setOnApplyWindowInsetsListener() doesn't deliver the view's
insets early on, a cleaner way is to hook into
addOnAttachStateChangeListener() and OnPreDrawListener() listeners.
With this approach we guarantee that at least in one of those
cases, especially OnPreDrawListener(), we would be guaranteed
to get the insets when the view is attached. With this approach
we only need to get once such event and from there forward
we rely still on setOnApplyWindowInsetsListener().

Fixes: QTBUG-135808
Pick-to: 6.9 6.10
Change-Id: I05bf3009eb9a33f104d01d29e7f02d780900fc66
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2025-09-06 01:27:38 +03:00
Tor Arne Vestbø 8a969b400e Blacklist tst_QGraphicsProxyWidget::windowOpacity on macOS
It fails consistently on macOS 26, and flakes on all other macOS
versions: http://testresults.qt.io/grafana/goto/raYHTorHg

Task-number: QTBUG-139950
Pick-to: 6.10
Change-Id: I249596ec269743fcd45ab937bf28ea5d8368f53c
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2025-09-05 17:57:22 +02:00
Marc Mutz d812e32bcb QDataStream: fix -Werror,-Wshorten-64-to-32 on 32-bit Clang
On 32-bit platforms qsizetype is int, so assigning a qint64 to it
narrows.

It's benign, because we perform the overflow check in the next line,
but that doesn't help -Werror.

Fix by making the narrowing explicit. As a drive-by, mark `n` const.

Amends fd48ce0b73.

Reported-by: Karim Pinter <karim.pinter@qt.io>
Pick-to: 6.10 6.9 6.8
Change-Id: I14d95c54c501df14a0b76d11262f22605fbb583b
Reviewed-by: Øystein Heskestad <oystein.heskestad@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2025-09-05 08:42:55 +02:00
Marc Mutz e51a3e052e util/unicode: add missing assertions on field counts
Two functions indexed into the split() fields without first checking
whether there are sufficiently many fields to index into.

Add the missing Q_ASSERT()s. Yes, a qFatal() with line-number would be
nicer, but all other functions do it like this, so I'm asking for
forgiveness that I do it here, too.

Amends the start of the public history.

Pick-to: 6.10 6.9 6.8 6.5
Change-Id: Ief054796f2e058a331037540bc2a633ec7f64f2c
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2025-09-05 06:42:44 +00:00
Marc Mutz d03ad0e3da util/unicode: remove replace() calls from remaining read*() functions
Some users of the split()ed value handled intervening whitespace
already:

- the first field is piped through parseHexRange(), which does

- the second field was missing the trimmed() call before lookup.
  Added. All looked-up values are space-free (cf. resp. init*()
  functions), so that's enough, too.

As a consequence, we can accept the lines by reference to const
QByteArray now and, now that all lambdas have the same signature,
change readUnicodeFile() from a template to a regular function
taking qxp::function_ref callbacks.

Amends a794c5e287 (readEmojiData())
and the start of the public history (rest).

Pick-to: 6.10 6.9 6.8 6.5
Change-Id: I442855a183552aa90d24810023793e6464b18162
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2025-09-05 08:42:32 +02:00
Marc Mutz b98aa3983c util/unicode: createNormalizationCorrections(): remove replace() call
Some users of the split()ed value handled intervening whitespace
already:

- fields[0..1] are piped through parseHex(), which does

- fields[2] is unused

- fields[3] needs to be trimmed, so do that.

As a consequence, we can accept the line by reference to const
QByteArray now.

Amends the start of the public history.

Pick-to: 6.10 6.9 6.8 6.5
Change-Id: I60371820cd143b980c81a1077d9c3e34528f1830
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2025-09-05 08:42:26 +02:00
Marc Mutz 2c3c479c20 util/unicode: readEastAsianWidth(): remove simplified() call
All users of the split()ed value handle intervening whitespace
already:

- fields[0] is piped through parseHexRange(), which does

- fields[1] has trimmed() called on it before lookup and all
  idnaStatusMap values are space-free (cf. initIdnaStatusMap())

As a consequence, we can accept the line by reference to const
QByteArray now.

Amends 838a7a01f3.

Pick-to: 6.10 6.9 6.8 6.5
Change-Id: I53247332c624a192fcaca6009a3f20cb8c65786a
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2025-09-05 08:42:20 +02:00
Marc Mutz 079b97b7ac util/unicode: readArabicShaping(): remove replace() call
All users of the split()ed value handle intervening whitespace
already:

- fields[0] is piped through parseHexRange(), which does

- fields[1] has trimmed() called on it before lookup and all
  age_map values are space-free (cf. initAgeMap())

As a consequence, we can accept the line by reference to const
QByteArray now.

Amends the start of the public history.

Pick-to: 6.10 6.9 6.8 6.5
Change-Id: I1d371af33bc0b1c1b2bf28bbd3cbaf6820f8b4e8
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
2025-09-05 08:42:14 +02:00
Marc Mutz 0738a0dd5e util/unicode: remove replace('_', "") from readScripts()
For some reason, the code stored the official Unicode script tags
without their intervening underscores, removing underscores from the
input before attempting to match, which works, as long as Unicode
stays consistent in spelling properties "Like_This".

Relying on that is brittle, though, seeing as a tag without intervening
underscore (SignWriting) already slipped into the database, potentially
matching a sought Sign_Writing. It's highly unlikely that Unicode will
start to use property names that differ only by their use of underscore,
but why risk it, and why confuse readers of code by using a different
sought string, compared to what's in the files?

Fix by storing the tags unaltered and leaving the underscores in the
input alone, too.

Amends the start of the public history.

Pick-to: 6.10 6.9 6.8 6.5
Change-Id: I5870a35812cb3fc0b28888cb09e9f42661684a26
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2025-09-05 06:42:07 +00:00
Volker Hilsheimer d183bbe184 QRM: return the section number as header data for array rows
All items in an array have the same type, it's not useful to return the
same type name for the header of each column. Instead, just return the
section number.

Pick-to: 6.10
Change-Id: Ia01e177e363cec55c44fcf3f92b1b3bfc502abe8
Reviewed-by: Artem Dyomin <artem.dyomin@qt.io>
2025-09-05 00:25:18 +03:00
Volker Hilsheimer 9d0eddb70c QRM: document the headerData implementation
Pick-to: 6.10
Change-Id: I59bdceec27fb364b19a7d9d8e1f368d2449ada42
Reviewed-by: Artem Dyomin <artem.dyomin@qt.io>
2025-09-05 00:25:13 +03:00
Michael Weghorn 99a10f4528 a11y: Let buddy widget know its label(s)
If a widget is set as the buddy widget of a QLabel,
that label is reported for the widget's QAccessible::Label
relation.

So far, in order to identify labels for which the
widget is set as the buddy, all sibling widgets
were inspected. There was already a comment mentioning
that all objects should ideally be checked, but that
would be too expensive.

Change the approach altogether: Instead of
traversing the widget tree, store all labels for
which the widget is set as the buddy in the widget
itself.

This is more efficient and ensures the relation
is reported correctly for non-siblings as well.

Fixes: QTBUG-139719
Change-Id: I6d517f8727cdde0de38b11d7c6906ecc55da1927
Reviewed-by: MohammadHossein Qanbari <mohammad.qanbari@qt.io>
2025-09-04 19:12:39 +02:00
Alexandru Croitor f257009870 CMake: Workaround Android CMP0155 issue
If a user:
- targets Android
- sets cmake_minimum_required(3.29) in their project which implies
  policy CMP0155 being set to NEW
- sets CMAKE_CXX_STANDARD >= 20
- uses Qt Creator's maintenance tool provider
- uses Qt Creator's default of ANDROID_USE_LEGACY_TOOLCHAIN_FILE=OFF

then they will hit an issue where the Threads package cannot be found
due to a CMake bug that causes all try_compile calls to fail, which
in turns causes the Qt6 package not being found.

Android and ANDROID_USE_LEGACY_TOOLCHAIN_FILE being OFF is relevant,
because in that case CMake fails to find the
CMAKE_CXX_COMPILER_CLANG_SCAN_DEPS tool, which is used during
try_compile builds.

CMP0155 set to NEW and CMAKE_CXX_STANDARD >= 20 is relevant,
because only in that case will CMake try to use the scan deps tool to
scan for modules during try_compile builds.

The maintenance tool provider is relevant in this case, because CMake
records the CMP0155 policy value at function definition time.

Normally without a dependency provider, the policy value at Threads
package lookup time would be OLD because each Qt6Config.cmake file
has a cmake_minimum_required(3.16..3.21) call which overrides any
other policy value.
But because the dependency provider function is defined before any of
Qt's code is loaded, it inherits the CMP0155 NEW from
cmake_minimum_required(3.29) of the user's project. That causes
all find_package lookups to use CMP0155=NEW, ignoring Qt's request.
This works by design from CMake's PoV, but causes unfortunate fallout
in this case.

Because we can't influence the recorded policy value of the provided
function from the outside in any way, the only thing we can do is
disable module scanning via CMAKE_CXX_SCAN_FOR_MODULES.

Work around the issue by setting CMAKE_CXX_SCAN_FOR_MODULES to OFF
inside Qt6Config.cmake, which will set it in the directory scope of
the find_package(Qt6) caller, affecting all try_compile calls there.
Do it only in the specific conditions mentioned above.

Allow opting out of the variable assignment by configuring with
-DQT_NO_SET_CMAKE_CXX_SCAN_FOR_MODULES_TO_OFF=ON

Doing this in Qt6Config.cmake allows working around the issue when
using older Creator versions that don't work around it themselves,

See https://gitlab.kitware.com/cmake/cmake/-/issues/27169

Pick-to: 6.8 6.9 6.10
Fixes: QTBUG-139439
Change-Id: Id171c88566c41b65b24c2f2a3874e3f3c0abc814
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2025-09-04 15:24:03 +02:00
Albert Astals Cid 15553fb621 syncqt.cpp: Include <algorithm> for std::transform
Pick-to: 6.10 6.9 6.8 6.5
Change-Id: Iaa843db962614a131c5cb9a25b206dcab3220309
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2025-09-04 13:24:03 +00:00
Assam Boudjelthia 721e45c98f Android: add dashes to QtQuickView generator warnings
Change-Id: I816863cd3f59a1211561b7989d676dccb360268a
Reviewed-by: Soheil Armin <soheil.armin@qt.io>
2025-09-04 15:12:26 +03:00
Assam Boudjelthia 4d72fc89c8 Android: avoid warning about Class rawtype usage
warning: [rawtypes] found raw type: Class
 return connectSignalListener("onParameterisedFunction", new Class[]{
Integer.class, Double.class, Double.class, String.class, Boolean.class
}, signalListener);
   ^

Change-Id: I40f53048c294903dc2a56346a470ff2b429c50ba
Reviewed-by: Soheil Armin <soheil.armin@qt.io>
2025-09-04 15:12:26 +03:00
Tim Blechmann bc8a649c38 QTaggedPointer: fix integer narrowing warning with clang-cl
qCountTrailingZeroBits returns uint, which cannot be converted to quint8
without narrowing.
clang-cl seems to be pickier than other compilers, as it seems to warn
based on the type, not evaluated constexpr.

Amends 7eff6ace61

Change-Id: I405f6b513a62559b0cd686bbef7ea8107b9e70f2
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2025-09-04 19:14:38 +08:00
Tor Arne Vestbø 6b9768541c QWidgetBaselineTest: Separate OS version and platform (plugin) name
When reporting and disambiguating results.

Change-Id: I1ea0d38b36deb5cb610a9b0da4c17e9b987375dc
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2025-09-04 13:14:38 +02:00
Tor Arne Vestbø 9768a63b01 QWidgetBaselineTest: Remove style name from appearance ID
It has a dedicated metadata field now.

Change-Id: Ia48b5114f33bfb96a3eae909af07656e979a3941
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2025-09-04 13:14:38 +02:00
Julian Greilich 9f2fbc962b a11y macOS: Implement accessibilityMinValue and accessibilityMaxValue
Use the ValueInterface to provide accessibilityMinValue and
accessibilityMaxValue.

Task-number: QTBUG-139712
Pick-to: 6.8 6.9 6.10
Change-Id: I774997fe90d457ac67604ec89187a20befee6570
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2025-09-04 12:08:31 +02:00
Andre Hartmann c887a780fd QTimer: Doc: Distribute existing note to useful places
Amends 146749f9b7

Pick-to: 6.8 6.10
Change-Id: Id4e861faaf1d268692ec496fdcb2e69c8acd694f
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2025-09-04 08:58:35 +00:00
Tim Blechmann 959866f198 CMake: add QT_NAMESPACE property to Qt::Core
User projects sometimes may want to query the namespace of namespaced
Qt.
We therefore attach a new property QT_NAMESPACE that can be read by user
projects.

Pick-to: 6.10
Change-Id: I541bd3eba41f1f5371faebf99f3cdb12698a9f25
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2025-09-04 02:01:22 +00:00
Toni Saario 729f339720 Coin: Add update repo instructions
These tell Coin the repos that the commands will require. Otherwise
there is possibility that those repositories are out of date.

Pick-to: 6.10 6.9 6.8
Change-Id: Ie61b5faa6f321b666f3f6a829ba4d333cb3eb6f1
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2025-09-03 23:23:58 +00:00
Christian Ehrlicher b25366d754 Windows11Style: rework text color handling for Button
Rework the text color handling for Buttons and the checkmark in the
QCheckBox to match the WinUI3 style.

Task-number: QTBUG-139202
Task-number: QTBUG-138094
Pick-to: 6.10
Change-Id: I47d4cab110c53319149dc8e275f2d3334ee2ea80
Reviewed-by: Wladimir Leuschner <wladimir.leuschner@qt.io>
2025-09-04 01:14:35 +02:00
Christian Ehrlicher 95d784cca4 Windows11Style: rework color handling for Checkbox/Radiobutton/Button
Rework the color handling for CheckBox/Radiobutton and Buttons to match
the WinUI3 style.

Fixes: QTBUG-139202
Fixes: QTBUG-138094
Pick-to: 6.10
Change-Id: I874e096a78fcf4f92eeac586517b0b987bdd4e38
Reviewed-by: Wladimir Leuschner <wladimir.leuschner@qt.io>
2025-09-04 01:14:35 +02:00
Dimitrios Apostolou ef76739c81 Revert "tst_qabstractitemview: add debug code for crash in testDialogAsEditor()"
This reverts commit 58215a1821.

It will never trigger after the recent commit that overrides
destroyEditor().

The needed stacktrace is in the linked bug report.

Task-number: QTBUG-136653
Change-Id: Icb800bf4164ca43e239d84258736b64861a1f67e
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
2025-09-03 21:45:15 +00:00
Ahmad Samir b617d11765 QMetaObjectPrivate: assert empty out-param container in decodeMetodSignature()
Some code in QObject reuses the same QArgumentTypeArray, so the assert
is there to ensure we don't forget to clear() the container before
reuse.

Change-Id: I103b4a6cde3eee73d164a078a194d57ae357079d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2025-09-03 23:01:27 +03:00
Edward Welbourne b13e1880ab Remove a spurious forward-declaration of QLocaleData
Amends commit e330a9bb44 (Qt 6.0.0) in
which I replaced fallbackUiLocaleData() with fallbackUiLocaleIndex(),
thereby making the forward declaration redundant.

Pick-to: 6.10 6.9 6.8 6.5
Change-Id: Iac519c1433826e91838b0707d1ae2d986e0478d5
Reviewed-by: Mate Barany <mate.barany@qt.io>
2025-09-03 19:32:54 +02:00
Vlad Zahorodnii c15c67ed2f wayland: Drop QWaylandGLContext::getProcAddress()
It's the same as getProcAddress() in the QEGLPlatformContext class.

Change-Id: I7b66a953f77bde0bf188718e234ba362e055fe4d
Reviewed-by: David Redondo <qt@david-redondo.de>
2025-09-03 20:30:26 +03:00
Nicholas Bennett a895b929d2 Docs: Add link targets to public Java class docs defined in qtbase
Created a qdoc file for this, so it's easier to find, and not
confused with "externally" created content.

Task-number: QTBUG-127747
Pick-to: 6.10 6.9 6.8
Change-Id: I3c13d4a300b59e650da84ef0e8f259021888ef10
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2025-09-03 15:54:24 +00:00
Tor Arne Vestbø 8391c01f38 Deprecate and remove traces of RasterGLSurface
We no longer use this hybrid surface type approach for Qt Widget's
composition mode. Nowadays we use RHI to compose the widget texture
and the native textures, and the window surface type depends on the
RHI API in use, e.g. QSurface::MetalSurface, or QSurface::OpenGLSurface.

Change-Id: I85001100f681a1cf524b8b7dc50f680a9579b447
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2025-09-03 16:43:57 +02:00
Tor Arne Vestbø e97cb95572 Add QFilePrivate::writeToDebugStream
It's useful to see the file name of a file based QIODevice
when debug logging it.

Change-Id: Iaaa1639f4940024e9030b27da6219c959224bd3f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2025-09-03 16:43:57 +02:00
Timur Pocheptsov 80ff44e243 QMacStyle: fix radio button width (size 'Mini')
With the previously hardcoded value of 10, the radio button was clipped
horizontally.

Pick-to: 6.10 6.9 6.8 6.5
Task-number: QTBUG-138948
Change-Id: I4b5766cc5bf301bb936a8b3373ce19e6c2e5df20
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2025-09-03 16:29:21 +02:00
Mitch Curtis 4802ee3c6c xcb: mark parameters as unused with QT_NO_CLIPBOARD in QXcbDrag::setActionList
The build was failing with this error:

[...]/qxcbdrag.cpp: In member function ‘void QXcbDrag::setActionList(Qt::DropAction, Qt::DropActions)’:
[...]/qxcbdrag.cpp:575:45: error: unused parameter ‘requestedAction’ [-Werror=unused-parameter]
  575 | void QXcbDrag::setActionList(Qt::DropAction requestedAction, Qt::DropActions supportedActions)
      |                              ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~
[...]/qxcbdrag.cpp:575:78: error: unused parameter ‘supportedActions’ [-Werror=unused-parameter]
  575 | void QXcbDrag::setActionList(Qt::DropAction requestedAction, Qt::DropActions supportedActions)
      |                                                              ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
cc1plus: all warnings being treated as errors

Amends cc1d891b8e.

Pick-to: 6.5 6.8 6.9 6.10
Change-Id: Ie4c8b425a1f07d062db242f962be3055a0e9db61
Reviewed-by: Liang Qi <liang.qi@qt.io>
2025-09-03 12:40:59 +00:00
Frédéric Lefebvre 10b5ce432a Redundant calls tst_QWindow::modalWindowEnterEventOnHide_QTBUG35109
tst_QWindow::modalWindowEnterEventOnHide_QTBUG35109 include multiple
calls to requestActivate() after a window is shown. These calls are
redundant as show() already activates the windows.

Remove the unnecessary requestActivate() calls to simplify the code.

Task-number: QTBUG-139705
Pick-to: 6.10 6.9 6.8 6.5
Change-Id: I5b05b22c0c389ed68496360de53dbe0ecccfd7c6
Reviewed-by: Błażej Szczygieł <mumei6102@gmail.com>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2025-09-03 10:42:54 +00:00
Marc Mutz 587adc2217 util/unicode: use new parseHexList() in readIdnaMappingTable()
This one is straight-forward.

As a drive-by, use QString::append(QStringView) instead of iterating
over the result of QChar::fromUcs4(). It may not be faster, in fact, I
expect it to be slower, but it's much nicer to read, and this tool
doesn't need to be optimized.

Since every field is now clearly handled by functions that can handle
extra whitespace (the values looked up unsurprisingly are space-free,
too), we can drop the simplified() call and take the QByteArray 'line'
by cref.

Amends 2afe1a3c19.

Pick-to: 6.10 6.9 6.8 6.5
Change-Id: Id8900367d774ec4a6dccb89f6be73984caac2701
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
2025-09-03 12:31:50 +02:00
Volker Hilsheimer e3d5dc3fc7 QRM: make implementation of resetRoleNames out of line
No reason to be inline, so avoid that we pay the compile-time and code
generation cost at each call site.

Address header review.

Pick-to: 6.10
Change-Id: I2f21b26519f8b8b1ce390533031dee95db205a20
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2025-09-03 05:58:17 +00:00
Volker Hilsheimer eac892dea9 QRM: move implementation of constructors into class declaration
Possible after moving the Impl classes into a separate header, and
avoids issues with e.g. MinGW.

Addresses header review comment.

Pick-to: 6.10
Change-Id: I5ed4339905abcba12c9e06960bd8fec08b08f822
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2025-09-03 08:58:14 +03:00
Fabian Kosmale 1df5b5d53a QBindingStatus/QThread: Add missing synchronization
As the comment in qthread_p.h indicates, setStatusAndClearList requires
external synchronization, otherwise we get data races.
That was missinsg 2d92ea0250, and gets
fixed by this commit.

Pick-to: 6.10 6.9 6.8 6.5
Change-Id: I63ca246964a85d5045b459cc17c8883dfa0ff914
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2025-09-02 23:31:21 +02:00
Edward Welbourne 2e69afbc31 Add tests for QLocaleData::NumericData
Verify that it behaves as expected, particularly its digitValue.
This requires Q_AUTOTEST_EXPORT on various functions called by tests.
In passing, mark NumericData::groupSizes() [[nodiscard]] and comment
on why NumericData's constructor checks pointer equality rather than
language for C.

Change-Id: I6527feaf0ad3f7343e4fe00f76106b644758c5b2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2025-09-02 23:31:16 +02:00
Edward Welbourne 679de45a4a Give QLocaleData a dataForLocaleIndex(qsizetype)
Adding so that internal tests can use it in combination with
findLocaleIndex() to get locale data by the same parameters as we use
for locale. It incidentally packages an assertions used in most places
we were doing lookups in the locale_data[] array, so deploy it there.
Adapt one place which was accessing the array without that assertion
to condition its iteration on the bounds.

Change-Id: Ib3159184c7d84af9b194731c152549410acfdd6d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2025-09-02 23:31:16 +02:00
Edward Welbourne 8a1f480651 Break out QLocale's testing of private and internal parts
There's a fair bit of it already and I intend to add more. Since most
(albeit not all) of it depends on QLocaleData, name it for that.

Change-Id: Ie80d2c78f0e746148bd3f3a4c5e069a4924fdbf4
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2025-09-02 23:31:16 +02:00
Edward Welbourne b55b91a4a5 Add a missing assertion to QLocaleData::NumericData::setZero()
Pick-to: 6.10 6.9 6.8
Change-Id: Icc25051a8c4e2069211d56191d6e70b2bb1d935a
Reviewed-by: Mate Barany <mate.barany@qt.io>
2025-09-02 23:31:16 +02:00
Marc Mutz 5d357dfea9 util/unicode: assert no mirrored pairs exist outside BMP
QTextEngine implicitly assumes this (it's looking up mirrored
characters in UTF-16 space, without first decoding surrogates).

Add a comment there, too.

Amends 7f504283ef.

Fixes: QTBUG-139456
Pick-to: 6.10 6.9 6.8 6.5
Change-Id: Ie79b33907e71cc455434127c1752898c40b128f9
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2025-09-02 21:31:16 +00:00
Marc Mutz c4d8e58f1d util/unicode: error out with a meaningful message if Qt is too old
The Qt version against which this tool is build need not be the same
as the Qt version for which this tool generates code. The advantage is
that we can use the latest Qt features in this tool without having to
worry about compat with older Qt versions. We might also use C++20
here in the future.

Instead of greeting prospective users of the tool with random compile
errors, check the Qt version and #error out with a descritive message
instead.

Pick-to: 6.10 6.9 6.8 6.5
Change-Id: I2a153ee4eb6ca1a1ea7ece39c9872f3f6d746fcd
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
2025-09-02 23:31:16 +02:00
Marc Mutz 6e526bf92c util/unicode: Extract Method parseHexRange()
Wrapping parseHexList(), which gets extended to support
QLatin1StringView separators, add parseHexRange() and use it around
the code to parse HHHHH[..HHHHH] hex ranges.

Amends the start of the public history.

Pick-to: 6.10 6.9 6.8 6.5
Change-Id: I0372e5c239642988f0e920d95108657e276b19dd
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
2025-09-02 23:31:15 +02:00
Marc Mutz 714969e8a1 util/unicode: Extract Method parseHexList() from readSpecialCasing()
This function, too, is duplicated all over the place, so centralize
it. Also use modern parsing techniques, like QStringTokenizer instead
of split() and QVarLengthArray instead of QList, that make the
function much more efficient.

Use it in readCaseFolding(), too, which is straight-forward.

There are many more potential users of this function; I'll port
them one by one in follow-up patches, though most are reading hex
ranges, so I'll add a function for that next.

Amends the start of the public history.

Pick-to: 6.10 6.9 6.8 6.5
Change-Id: I545a22d65a3baeaa850a7d658dcf466d2284b0fa
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
2025-09-02 23:31:15 +02:00
Marc Mutz 7602054ac2 util/unicode: Extract Method parseHex()
This code is used all over the place, so put it into a convenience
function where we can arguably put in a bit of effort to optimize
things, to wit: use QByteArrayView, and provide a better error message
than inline code could afford. E.g. the LastValidCodePoint check was
previously only in readUnicodeData().

For use in readUnicodeData(), add lineNo tracking.

In readBidiLine(), we can now drop the replace(' ', ""), because
parseHex() already trims. As a consequence, the lambda can take the
QByteArray by cref now.

There are many more places where this could be used, but they
represent higher-level constructs for which I'll add higher-level
helper functions.

Amends the start of the public history.

Pick-to: 6.10 6.9 6.8 6.5
Change-Id: Ic8f59f6509da1a0deb47a46cfaf160abb20c067e
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
2025-09-02 21:31:15 +00:00
Marc Mutz 98878bd873 util/unicode: port appendToSpecialCaseMap() from QList to QSpan
This makes the function independent of the actual input container
being passed, allowing us to port from QList to QVarLengthArray
step-by-step.

In readUnicodeData(), this allows to pass the single-element case
using initializer_list instead of a temporary QList.

Amends the start of the public history (but, to be fair, QSpan wasn't
available then).

As with readLineInto() in a previous patch, QSpan is not available in
Qt 6.5, but that's not a problem because this tool doesn't need to
compile with the Qt version it is generating code for, so we can use
Qt-latest.

Pick-to: 6.10 6.9 6.8 6.5
Change-Id: I10039af9d5b82a3d23fec451bf051a868db4c343
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
2025-09-02 23:31:15 +02:00
Timur Pocheptsov 22f6c12142 QMacStyle: fix QSlider's issues on macOS 26 with Liquid Glass
These issues include:

0. Clipped shadow around a slider's thumb. Attempts to rescue this by manipulating
   the current clip are failing (extending a clip results in a shadow cast
   over area outside of QSlider and this area is not repainted then moving a slider,
   thus is left with shadow residuals). We draw this knob manually (and
   its shadow) within the current clip.

1. Slider's knob for a 'tick slider' does not have the shape it had prior to Tahoe
   - we have to manually draw it, but in a new style - it has the same shape as a slider
   without ticks.

2. Incorrect thumb positioning (visible only in the baseline lancelot testing,
   seems to be a result of our old trick in painting 'pressed' state). In a native
   app only reproducible if using 'startTracking'. Seems to be a result of some
   stale geometry in our cached slider which is never updated - to fix this,
   recreate a cell.

3. Missing tickmarks - cell's drawTickMarks is a noop with Liquid Glass enabled,
   we draw them manually (and they have a different shape - tiny dots/circles).

Pick-to: 6.10 6.9 6.8 6.5
Fixes: QTBUG-138946
Change-Id: Ide38f4d4c5fb30870e5f72e453db37e991525851
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2025-09-02 22:32:41 +02:00