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>
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>
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>
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)
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)
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>
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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>
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)
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)
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>
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>
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)
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)
- 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)
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>
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)
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)
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)
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)
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)
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>
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)