Commit Graph

31029 Commits

Author SHA1 Message Date
Qt Submodule Update Bot 9edb471d3a Update dependencies on 'tqtc/lts-6.5-opensource' in qt/tqtc-qtdeclarative
Change-Id: I272ba358e927bc2732e751b80bd9f9c46e247cc6
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-01-06 14:31:52 +00:00
Qt Submodule Update Bot 07e59c3ed3 Update dependencies on 'tqtc/lts-6.5-opensource' in qt/tqtc-qtdeclarative
Change-Id: Ic469da22a838fb201e793d954ebe7d29ed12b25b
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-01-06 09:02:03 +00:00
Tarja Sundqvist eee1fcc18b Revert "Update commercial SPDX-License-Identifier"
This reverts commit da5933f22c.

Revert of commercial SPDX license identifiers is required for the
Qt 6.5.x opensource releases, Qt 6.5.4 onwards.

Change-Id: Ic056fb761f242af0ec4c883ecb35d50804c1c67c
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2025-01-03 19:25:16 +02:00
Tarja Sundqvist 75be97915b Revert "Update commercial SPDX-License-Identifier"
This reverts commit 132fe2df41.

Revert of commercial SPDX license identifiers is required for the
Qt 6.5.x opensource releases, Qt 6.5.4 onwards.

Change-Id: Iadef6ed98a222d75529533fca818ed860ea9d0ac
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2025-01-03 19:25:13 +02:00
Qt Submodule Update Bot 533a9a8afc Update dependencies on 'tqtc/lts-6.5.4' in qt/tqtc-qtdeclarative
Change-Id: Ic34facc8b86d5ed156f9b8c7598454a036585ac9
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2023-12-19 20:05:19 +00:00
Qt Submodule Update Bot 6fdd37b851 Update dependencies on 'tqtc/lts-6.5.4' in qt/tqtc-qtdeclarative
Change-Id: Ie4765815f023551f13ce4157bc220d6c3401efef
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2023-12-14 04:06:49 +00:00
Tarja Sundqvist 132fe2df41 Update commercial SPDX-License-Identifier
Some files in tqtc-qtdeclarative were missing the commercial
SPDX-License-Identifier. Build files, examples, tests, or
documentation are not updated.

Task-number: QTQAINFRA-5900
Pick-to: 6.5
Change-Id: I2cad9a7a271b0b3f3af3074259614b890b266a91
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2023-12-13 11:09:32 +02:00
Qt Submodule Update Bot c77b4e1941 Update dependencies on 'tqtc/lts-6.5.4' in qt/tqtc-qtdeclarative
Change-Id: I05b0f1bf8f9190cd357a374a5de818fec212cad2
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2023-11-28 18:50:27 +00:00
Qt Submodule Update Bot 1287957af0 Update dependencies on 'tqtc/lts-6.5.4' in qt/tqtc-qtdeclarative
Change-Id: Ib21cfc2d630db37317621a7ab27c2444cef98596
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2023-11-27 21:08:07 +00:00
Vladimir Belyavsky 5307eb7b17 TestCase: make failOnWarning() functional on temp objects destruction
We need to be able to handle warnings that may occur when temporary
objects, that were created in a test function, are destroyed.

Now, with 18aa36cf878a52b8fe991392098e9445c3d3bfe3, we need only
to wait before calling finishTestDataCleanup() to ensure that the
objects marked for deletion are completely deleted.

Without this patch, we may not fail on warnings like this:

QWARN  : tst_controls::Basic::ComboBox::test_mouseHighlight() qrc:/qt-project.org/imports/QtTest/SignalSpy.qml:55: TypeError: Property 'disconnect' of object true is not a function

Change-Id: I990d65005ecf88633f25dcd317846804ae9fdfd1
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 488abf9abd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit a796785d7d)
2023-11-24 22:15:27 +00:00
Volker Hilsheimer 2c57f0ba4b Drag'n'drop: fix support for string data that is not a "text/" mime type
Amends 17318c4805, after which mime data
that was provided as a QString, but not of mime type "text/", was
ignored with a warning. This breaks use cases where mime type of e.g.
"application/json" type, which is then provided as a string rather than
a byte array.

This is then behavior-compatible with pre-6.5 releases. We still warn if
the mime type is "text/" with an encoding we don't know about. Remove
the test data set that now does produce a valid mime data (image/png mime
with data provided as string), and add a test case for application/json
instead.

Fixes: QTBUG-119216
Change-Id: I1c321cd92f45ea479ee9abc838a44828d1300433
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 2ba67fd91d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 19f9c4de29)
2023-11-24 22:15:27 +00:00
Qt Submodule Update Bot b29c1f2f9e Update dependencies on 'tqtc/lts-6.5' in qt/tqtc-qtdeclarative
Change-Id: I7e0a43e005db5b99463ba5e4bd389adc961aff3b
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2023-11-24 17:29:05 +00:00
Tarja Sundqvist 6cdc964114 Remove commercial SPDX-License-Identifier from build files
The build files should not include a commercial SPDX-License-Identifier.
Instead, a BSD-3-Clause license identifier is used.

Task-number: QTQAINFRA-5900
Change-Id: I419c4cea2bc0c836811155eddfe3bca2edb22323
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2023-11-24 13:15:45 +02:00
Volker Hilsheimer fa432f7493 Popup: try to stabilize mousePropagation test
Wait for the popup to be opened before simulating the click.

Change-Id: I3f7b64ecbdd19981e6b74ed03a732c279b0282cf
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
(cherry picked from commit 40f448ad16)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit e81abf9dea)
2023-11-24 05:20:10 +00:00
Vladimir Belyavsky c1884695ab QQuickMaterialTheme: check if default font family is available
Explicitly check if "Roboto" font family is available before using
it as a default font family for Material style. If not - try fallback
to "Noto" font family. If both are unavailable, use default system font.
This prevents us from missing family fallback lookups, which can be slow.

Similar change 86b4f9f583e31f0db171a4320680902d83340468 was made also
for Imagine style.

Fixes: QTBUG-83155
Change-Id: I57b7837175dd2b7d5097fbc648da33bd5443f8d5
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit f8ce5d76a8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 8bcacb3f5b)
2023-11-24 01:21:02 +00:00
Vladimir Belyavsky c488bae64d tst_control: fail on warnings
Enable fail on warnings for all tests in init() method.
Also, as a drive-by change, replace 'var' with 'let'

Task-number: QTBUG-98718
Change-Id: I6680c40097c98de42c266c610f4885a663b76545
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
(cherry picked from commit c152475b5b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 6e3baad4bf)
2023-11-24 01:21:02 +00:00
Vladimir Belyavsky 3460847697 tst_container: fail on warnings
Enable fail on warnings for all tests in init() method.
Also, as a drive-by change, replace 'var' with 'let'

Task-number: QTBUG-98718
Change-Id: Ic5e416aed529118fb7223a2ea567bbee33b13dc7
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
(cherry picked from commit 2b53be6238)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit c9bc8d15b4)
2023-11-24 01:21:02 +00:00
Wladimir Leuschner b3ed348049 Fix resizing in Wearable example
Fixes: QTBUG-118779
Change-Id: I8cc906976eeb390152e3d4ce2bf5493bc8d8f1d9
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
(cherry picked from commit 41eb033fa2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 363dd023db)
2023-11-23 13:51:10 +00:00
Volker Hilsheimer 80fd26ff2f DelegateModel: don't insert items using an invalidated iterator
The code in the while-loop in insert() has to allocate memory, and that
might trigger the garbage collector, which will clear the cache. This
invalidates the "before" iterator passed into insert(), resulting in
asserts when inserting new items into the cache.

To fix this we have to detect that the `before` iterator became invalid,
and then recompute the iterator. Change the return value of the insert()
function to provide more information than true/false, and use the logic
and information at the call-site to retry the insertion.

As a drive-by, skip computations of local values if they are not going
to be used.

Fixes: QTBUG-119181
Change-Id: I71543b8df776dbeaed5a275960ad34df1d12e19f
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit 4c1cee7e11)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 9036e492dd)
2023-11-23 11:26:22 +00:00
Laszlo Agocs 8be479b9d9 Prevent multiple MessageBoxes on Windows on GL context fail
There seems to be a chance of recursion according to real world
reports when on Windows we use MessageBox(). Prevent this.

Task-number: QTBUG-102846
Change-Id: Id0e7c12279b81ff32582e366ae5952f511ca0f98
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
(cherry picked from commit 529ebd3fb0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 0b26626159)
2023-11-23 11:26:22 +00:00
Vladimir Belyavsky c201787599 tst_buttongroup: fail on warnings
Enable fail on warnings for all tests in init() method.
Also, as a drive-by change, replace 'var' with 'let'

Task-number: QTBUG-98718
Change-Id: I4e23722a6c0e9e4afdc723bb11b9c518e764a54c
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
(cherry picked from commit 0e88c3e032)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 5c1e12d6d7)
2023-11-22 06:26:10 +00:00
Vladimir Belyavsky 6c7e1b0737 tst_button: fail on warnings
Enable fail on warnings for all tests in init() method.
Also, as a drive-by change, replace 'var' with 'let'

Task-number: QTBUG-98718
Change-Id: I6a41145cd6cf99c8506cac90f7e6c7ad163e04e5
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
(cherry picked from commit c2fa37c428)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 47228e2ac8)
2023-11-22 06:26:10 +00:00
Vladimir Belyavsky 4448a13f05 tst_busyindicator: fail on warnings
Enable fail on warnings for all tests in init() method.
Also, as a drive-by change, replace 'var' with 'let'

Task-number: QTBUG-98718
Change-Id: I04f16ce3e3cc383ce35cab12b8fdc7e2108587eb
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
(cherry picked from commit 27efcaa345)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit af939b3743)
2023-11-22 06:26:09 +00:00
Ulf Hermann 69257e46ac QmlCompiler: Don't access unavailable input accumulator on 'as'
We only read it if the target type is composite. Therefore, check for
composite first, before looking for the accumulator.

Pick-to: 6.2
Fixes: QTBUG-119122
Change-Id: I2a50214f76ee4ffe2f877dc690704e7475b8bd77
Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 096f3c3097)
(cherry picked from commit 23af49f749)
2023-11-21 13:57:45 +01:00
Vladimir Belyavsky a22a8ed914 tst_actiongroup: fail on warnings
Enable fail on warnings for all tests in init() method.
Also, as a drive-by change, replace 'var' with 'let'

Task-number: QTBUG-98718
Change-Id: Ie07ee1cccfeb22f29d6a27e50dfb810b99a94db5
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
(cherry picked from commit 71b62a4e57)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 0625712e76)
2023-11-21 00:20:07 +00:00
Joerg Bornemann ee05413e7c CMake: Fix the all_qmllint* targets for Visual Studio generators
When using the VS generator, the foo_qmllint targets were run on every
build, which is neither expected nor wanted. The reason for this is a
pecularity in MSBuild and as a reaction to this, special behavior of
CMake: add_dependencies(A B) will enable B in the default build of the
solution - even if B is not triggered by the ALL target. See upstream
CMake issue #16668 for details.

We now work around this problem by building foo_qmllint externally as
PRE_BUILD step of all_qmllint.

Fixes: QTBUG-115166
Change-Id: Ie9c187edf112fc37e8eb7d1c1040fc64479b3034
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit f81945e1d7)
(cherry picked from commit b407e37176)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-11-20 13:00:19 +00:00
Ulf Hermann 51c99ab3ad QmlCompiler: Do not generate lookups for bare meta enums
Such code is necessarily dead or uncompilable.

Pick-to: 6.2
Fixes: QTBUG-119090
Change-Id: I7319f7ceeb0b4994d5e974bbe8a9c3ba3bf72fc5
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 73f66c8f94)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 3896fb0dc6)
2023-11-20 10:16:03 +01:00
Qt Submodule Update Bot 9f2174ae61 Update dependencies on 'tqtc/lts-6.5' in qt/tqtc-qtdeclarative
Change-Id: I3f5c88785f2c0dc36eff1585deb69d3f6a461fe8
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2023-11-20 04:27:04 +00:00
Volker Hilsheimer 07e269f62f Popup: resize the dimmer to match the overlay, not the window
The overlay adjusts its size based on the rotation, so it might have
different dimensions than the window. The dimmer should always cover the
entire overlay.

Task-number: QTBUG-115536
Change-Id: Ic9c73dcb3c9bb3e4e2ece281c8437a00961fc9b1
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
(cherry picked from commit eb653882af)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit af30efb07e)
2023-11-19 21:21:51 +00:00
Oliver Eftevaag a4cc75c3bf ListView: position delegate items at zero on the inactive axis
FxListItemSG::setPosition() only cares about a single axis, which is
based on the current orientation. If the orientation is Vertical, then
the y axis will be used with positioning the delegate item, and if the
orientation is Horizontal, then the x axis will be used instead.

This would cause problems when the ListView is changing its orientation.
Because if the ListView's orientation suddently changes from Vertical to
Horizontal, then all the delegate items will keep their old y value,
which FxListItemSG::setPosition() won't do anything about since the new
"active" axis is now the x axis.

This patch fixes the issue by resetting the value for the "inactive"
axis back to zero, in pointForPosition() which is used by
FxListItemSG::setPosition().

The problem wasn't noticeable when using a normal QQmlDelegateModel,
since the delegate items would be created lazily when they needed to
appear inside the viewport, at which point they'd be given the correct x
and y values. (The position is first (0, 0), and then layoutVisibleItems
will updated one of those values based on the orientation).
But if the user decides to use a QQmlObjectModel based model instead,
then the delegate items would all be created immediately with a
persistent lifetime, which would never have their position reset as a
natural result of the item view delegate lifecycle mechanism.

Fixes: QTBUG-115696
Change-Id: I5377aeb556be2f536794f489b8232c5b9675ab78
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit f03a9839b6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 27beeb7ccb)
2023-11-19 06:59:20 +00:00
Axel Spoerl 150eae8cde Fix compiler warning in qqmlprivate.h
Remove ";" after function definition.

Change-Id: I566ecf40633bff53e4413ae183d5e56548bf66de
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
(cherry picked from commit 62c6863554)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 00cea1628e)
2023-11-19 06:59:20 +00:00
Shawn Rutledge 90ccadc890 Disable TapHandler.longPressed signal if longPressThreshold == 0
There needs to be a way to disable the long-press feature, because it's
exclusive: if we emit longPressed(), we do not emit tapped(). But we
should also be able to accommodate slow users who pause for too long
unintentionally, or while simply observing the behavior.

Also clarify that resetting longPressThreshold reverts to the default.
Add more exhaustive test coverage, verify that longPressed
and tapped are mutually exclusive, and verify the effects of
violating the gesturePolicy.

Change longPressThreshold on LauncherList's back button so that it
always triggers, regardless whether the user pauses on it for a while.

[ChangeLog][QtQuick][Event Handlers] TapHandler.longPressThreshold
can now be set to 0 to disable its press-and-hold feature, and can be
reset to undefined to restore the platform default.

Fixes: QTBUG-119132
Task-number: QTBUG-105810
Change-Id: Id5fd7e51c70fdb0cb6c4beb5615717a222aec871
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit 8f6809681e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 29fc139acc)
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2023-11-18 21:46:49 -07:00
Shawn Rutledge 974430777c Make TapHandler longPressed/tapped exclusive and reliable; fix example
The back button in the examples' LauncherList.qml has been flaky.
As described in the docs, a TapHandler used to implement a Button
should have `gesturePolicy: TapHandler.ReleaseWithinBounds` to get
the common behavior that you can drag out of the button to cancel
the click, and you can also drag back into the button to change your
mind and let it click after all. But when trying to test this behavior,
another problem became evident: if you spend a longer time than
longPressThreshold for the whole gesture, then at the time of release
you could see the debug output "long press threshold exceeded" and the
tapped signal was not emitted. Our intention was that if you are
dragging around, the TapHandler is not eligible to emit the longPressed
signal; it follows that it should not become ineligible to emit tapped,
either (tapped can be emitted if other constraints are satisfied).
The intention of the ReleaseWithinBounds policy is that it doesn't
matter how much you drag, as long as the point is within the bounds
of the parent at the time of release.

So we begin keeping track of whether we have actually emitted the
longPressed signal, rather than merely looking at the time difference.

This changed behavior in tst_qquickdeliveryagent::passiveGrabberOrder:
1 second is more than enough time for long press with the default
longPressThreshold, and now the tapped signals are no longer emitted
after longPressed. So we just wait for pressed state rather than
waiting so long. qWaits in tests are best avoided anyway (although
I think the intention in 152e12dc22
might have been to wait long enough to ensure that nothing undesired
would occur, rather than waiting for something specific to occur).

Task-number: QTBUG-65012
Task-number: QTBUG-105810
Change-Id: If6a86d955e19810cb06de659f5e39b50a72fa762
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit 1b166c87d0)
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
(cherry picked from commit 6e3c25f944)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-11-18 21:46:40 -07:00
Shawn Rutledge 66610bcb57 Update cursor if frame-synchronous hover update discovers hover change
Also mark cursor as dirty and force update after shape change.

Done-with: Matthias Rauter <matthias.rauter@qt.io>
Fixes: QTBUG-53987
Fixes: QTBUG-90457
Task-number: QTBUG-54019
Change-Id: I64d9f5d0a39dbf141a8e82bee824b47a8884139b
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit cd7c5f94a0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 4271d4586b)
2023-11-19 01:43:09 +00:00
Vladimir Belyavsky 821aa3dcc2 tst_abstractbutton: fail on warnings
Enable fail on warnings for all tests in init() method.

Also fix the last warning "tst_controls::Basic::AbstractButton::test_rightMouseButton() tst_abstractbutton.qml:24:9: QML AbstractButton: List didn't append all objects"

And finally, as a drive-by change, replace 'var' with 'let'

Task-number: QTBUG-98718
Change-Id: I3e74a55b108b75cfe30a7d907c8f702b8a4b07dc
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
(cherry picked from commit 80b7d0cfbc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 264fe7d68f)
2023-11-19 01:42:55 +00:00
Ulf Hermann e8470c0b3a QmlCompiler: When rejecting empty constants, don't crash afterwards
Fixes: QTBUG-119091
Change-Id: I1e24583aa998976c96bf3ddd6865f33cc4d5e94c
Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 8190f5bd68)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 6049b22c97)
2023-11-18 20:25:48 +00:00
Shawn Rutledge 98ab3cef46 Fix SelectionRectangle tests
- Press-and-hold needs a release after the press.
- Doing press-and-hold at 1,1 selects the top-left cell; at that time if
  we click at 1,1 again in an effort to get rid of the selection, we're
  actually clicking on a selection handle. Let's click outside instead.

Amends c52710c10c

Change-Id: If5d459c063d2e2e1aa27a3bf0e13e8515607e701
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit 5b63e2a426)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 1bc4315eaf)
2023-11-18 10:36:09 -07:00
Shawn Rutledge f7c656af68 Localize Flickable delayed release to scene, not to grabber
When pressDelay > 0, if Flickable receives mouse or touch release before
it has sent the delayed press, it needs to send the delayed press before
allowing the release to be seen, in some sense.

Further back in d02131e743 the
continuation of release event delivery after the delayed press seems to
have been more limited in scope, to say the least.

8673ae8bb6 added
localPos = window()->mouseGrabberItem()->mapFromScene(...)
QQuickWindowPrivate::cloneMouseEvent(event, localPos)
window()->sendEvent(window()->mouseGrabberItem(), mouseEvent)

where QQuickWindow::sendEvent() was _not_ the same as sending the event
to the whole window (the grabber is the intended recipient, but
sendEvent() was taking care of child event filtering back then).
But over time we became convinced that sendEvent() should not exist,
because it was used for non-standard forms of event delivery, could be
hacked over time to do arbitrary things, and bypassed any old-school
QObject event filters that users might expect to work.

In bfde65a818 though, it was assumed
that since the delayed press got delivered to the whole scene, the
release should be too. Now it looks a bit redundant: one can see
in the debugger that the release gets an extra nested delivery to
the whole scene again, after being partially delivered before the
delayed press is sent. But that might be risky to change right now.

So at the time of writing d7623d79ef,
QQuickFlickable::mouseReleaseEvent() used an item-localized position
(leftover code from 8673ae8bb6)
and it seemed reasonable to follow that precedent to handle delivery of
a delayed touch press and then the release; but in retrospect,
1) we're sending the event to a window, so we don't expect the
   grabber-localized position to be retained;
2) in fact, QQuickDeliveryAgentPrivate::translateTouchEvent()
   treats the local position as scene position. QTBUG-118069
   occurred because of this assumption being violated.
3) Even for mouse release, it no longer makes sense to localize to
   the grabber, now that we are sending the event to the window rather
   than just to the grabber (for quite a number of years already).
   It will get relocalized during delivery to each item and handler
   visited.
4) Maybe it doesn't even matter whether there is a grabber or not:
   we could resend the release to the whole scene regardless.
   But this patch is conservative; and now we optimize slightly
   by using QObject::isQuickItemType() rather than qmlobject_cast.

tst_qquickflickable::pressDelay() tests the same old scenarios as
before, but now with both mouse and touch, and gets a general revamping
while we're at it.

Fixes: QTBUG-118069
Change-Id: I0f33d23ac1eae9fd697f2eca315107169619706c
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Reviewed-by: Santhosh Kumar <santhosh.kumar.selvaraj@qt.io>
(cherry picked from commit 45d4ccc765)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit ca9e3ee30f)
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2023-11-17 21:01:01 -07:00
Axel Spoerl 107cb70b6d Fix compiler warning in tst_QQmlDebugTranslationClient
Remove unused int debugCounter.

Change-Id: Ic986ae75c545b5e4bb8c4a387ec66ebfbef7d751
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
(cherry picked from commit ec9612768f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 187d7afb4e)
2023-11-18 01:24:15 +00:00
Qt Submodule Update Bot 3aa816c2ae Update dependencies on 'tqtc/lts-6.5' in qt/tqtc-qtdeclarative
Change-Id: Iefdc9820ffae7ca6064b471aa169bca386f76384
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2023-11-17 18:46:19 +00:00
MohammadHossein Qanbari 933ef03332 Menu: fix contentItem's interactive
The interactive property of the Menu's contentItem depends on its Menu
(control) when Window.window is valid. In the case of a fixed-height
menu, even if the contentItem's height is smaller than
Window.window.height, the interactive property of the contentItem would
be false if the menu's height is smaller than the window's height and
also smaller than its contentItem's height.

Fixes: QTBUG-93856
Pick-to: 6.2
Change-Id: If95080250c3953d4293a9e1dbcc6225d21ee034f
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
(cherry picked from commit d0a83e3330)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit e6478662c1)
2023-11-17 07:33:39 +00:00
Richard Moe Gustavsen c6f88a807c QQuickFlickable: release drag if receiving QEvent::TouchCancel
If a TouchCancel event is sent to a Flickable, it should abort
any current dragging operation done by the user. This patch will
ensure that we do so.

Fixes: QTBUG-117160
Change-Id: Iff332e597a0502396c2fd0e4988f01ab2119314d
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
Reviewed-by: Seokha Ko <seokha.ko@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
(cherry picked from commit 5093e4c243)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 3544aae728)
2023-11-16 11:49:32 +00:00
Ulf Hermann d0ab1d4a92 Fix tst_qmltyperegistrar::singletonVersions
We don't want to leak memory there and it had a typo.

Amends commit ad01abe1a6.

Change-Id: Id2ca7d1c11df54221aef95015d023cbcab0454b9
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
(cherry picked from commit 8dc1b08a5a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit d77a350d78)
2023-11-16 07:18:46 +00:00
Fabian Kosmale 83cc248141 resolveQmlContextPropertyLookupGetter: Use ScopedPropertyKey
We already have a scope, and there is no guarantee that the
various calls we do won't cause an allocation, and conseqently
trigger the garbage collector

Change-Id: I31db85e74b986c7d9f9d97b5d409e2030cd5f583
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
(cherry picked from commit 85941a1014)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit ea9bc31986)
2023-11-16 07:18:46 +00:00
Qt Submodule Update Bot 9a3ae2c1f9 Update dependencies on 'tqtc/lts-6.5' in qt/tqtc-qtdeclarative
Change-Id: I4ef340b27d59b6d545f3966e291b51eeb0148189
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2023-11-15 21:34:42 +00:00
Hatem ElKharashy 5ccf82b366 Material: respect horizontalAlignment in placeholder text
This allows placeholder text to follow the Alignment set to
the TextField or TextArea components when using Material style.
The placeholder text will float to the left, right, or center
depending on the alignment set, and the arc will be drawn properly
in case of Material.Outline container style.

Fixes: QTBUG-118856
Change-Id: Ic9cede806dc2f6109e7e2c4b2b2fc960d9c6a1b6
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
(cherry picked from commit 7e678acbb6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit c8a95333eb)
2023-11-15 11:42:50 +00:00
Ulf Hermann 11045230c3 QML: Before processing deep aliases, remove pending bindings
We may have additional bindings scheduled for the deep alias, but those
are to be overridden by the alias. They should therefore be removed like
bindings to target properties of shallow aliases.

For QProperty bindings we have to apply a separate trick and set and
clear the binding bit in the right places. We don't have access to the
actual binding when writing the value, after all.

Pick-to: 6.2
Fixes: QTBUG-115579
Change-Id: Ia915e59905d7e3185a17c5b6613926264ad9bc6b
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 0fdf9042ce)
(cherry picked from commit c07f63d064)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-11-15 12:42:50 +01:00
Ulf Hermann dc4bd4fb3f QtQml: Fix some problems with deep aliases
We cannot get the property cache for an inline component the usual way
during type compilation. We have to ask the compilation unit for it.
This will usually not work in 6.6 or earlier since the compilation unit
does not know the IC's metatypes. However, it shouldn't crash.

Guard against still not being able to retrieve the property cache for
any reason. Abort the compilation rather than crashing.

Also, unify the setting of property attributes. Those should really work
the same way everywhere.

Finally, disallow writing aliases to value type properties where the
property holding the value type itself is not writable.

Pick-to: 6.2
Task-number: QTBUG-115579
Change-Id: I029eb56a9a390085d0c696a787a64c48acf0d620
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 3ea55bf398)
(cherry picked from commit 7326d41bef)
2023-11-15 12:42:50 +01:00
Kai Köhne cebfaea1d8 Doc: Move some examples to User Interface Components category
Task-number: QTBUG-117243
Change-Id: Id13a0d8e02e6fea7ae84dbee524d60fe2f3ad3b7
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit dac7706e61)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit aaf5a1f8bd)
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2023-11-15 08:20:26 +01:00
Kai Köhne 919fdd38dc Doc: Highlight some examples for the "User Interface Components" category
Task-number: QTBUG-117243
Change-Id: I339bf6ba6998091f57bd40c2296c62d329ac8d48
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
(cherry picked from commit 34c8e9b3ad)
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 0e3be9c943)
2023-11-14 09:23:23 +01:00