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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
It's the same as getProcAddress() in the QEGLPlatformContext class.
Change-Id: I7b66a953f77bde0bf188718e234ba362e055fe4d
Reviewed-by: David Redondo <qt@david-redondo.de>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>