The new overload avoids the unconditional deep copy inside
QMetaProperty::write()'s lvalue overload.
Task-number: QTBUG-112762
Change-Id: Ic224faf72288e73bb6ad9049f1e0dc585e04ca19
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
A mouseClick will cause the RangeSlider handle to move to the click
position and we should expect the same for a touch press.
We update the position of the handle in handleRelease if keepMouse/
TouchGrab is set to true. However, we don't grab the touch on a
touch press in case eg.: a flickable wants to steal the event.
So we can remove the check as we shouldn't update the position
only if grabbed. This makes the behavior similar to the slider
too.
Fixes: QTBUG-112945
Pick-to: 6.5 6.2 5.15
Change-Id: Id2cf99416a52b5e42989a4adda1532e3ac550a93
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
It already happens as part of Renderer::map. So, if we set size = 0
before we call uploadBatch then it will implicitly set the size needed.
One of the loops was also grabbing the sizes before the final size
was determined.
Pick-to: 6.5
Change-Id: I610d9850a66011c3d17eea131c063c42fe149962
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
resize(0) only sets the size and doesn't deallocate anything.
Conversely, shrink(0), which was used before it was changed
to resize(0) doesn't change the size and only deallocates.
Use a mix of both for now.
Pick-to: 6.5
Change-Id: I3e36a766ef7483158a5a300351b0d7864d24e184
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Use e.g. Qt6::Core instead of Qt::Core. This is better matching the
find_package(Qt6 ...) call, and also avoids issues that the versionless
targets have.
Pick-to: 6.5
Task-number: QTBUG-113277
Change-Id: Ib80f885e9f73fb9ad54b9e9b22cae2318877dc07
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Remove the listeners of the indicator upon the button's destruction.
Task-number: QTBUG-98790
Pick-to: 6.2 6.5
Change-Id: I76509ebec601b8f6d004c90cdfbda46e390463a3
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Remove the listeners of the contentItem upon the PageIndicator's
destruction.
Task-number: QTBUG-98790
Pick-to: 6.2 6.5
Change-Id: Ic03a0ea149806de524567b4115255e308df90105
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Remove the listeners of the contentItem upon the Menu's destruction.
Task-number: QTBUG-98790
Pick-to: 6.2 6.5
Change-Id: Ic1aa842f003c9ced40e88b195021d085e86540eb
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
If Flickable has an exclusive grab (e.g if it's being dragged), and
at the same time, a child has a passive grab (e.g a TapHandler inside
a child of the content item), Flickable ends up getting the same pointer
events twice.
The reason this happens is because Flickable has a childMouseEventFilter.
So the flickable will first get all the pointer events since it has an
exclusive grab, just to see that the filter will receive the same
events once more, as they next are delivered to the passive grabbers.
The result is that Flickable will handle all pointer events
(move, release etc) twice when it has en exclusive grab, which will
even cause the flickable from stop flicking prematurely if the mouse
release ends up outside the bounds of the flickable (because of a double
call to handleReleaseEvent(), which will set stealMouse to false too
early).
To fix this, this patch will make sure that we don't handle any pointer
events in the childMouseEventFilter if we already have an exclusive grab.
After all, having an exclusive grab means that we're already getting the
events the "normal" way, and shouldn't handle the same events once more.
Fixes: QTBUG-104987
Pick-to: 6.5 6.4 6.2
Change-Id: Iaed49cb860cf50ea38a70a6e546d9dcf25cce444
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
In qgfxsourceproxy_p.h, we can use the modern Q_ENUM. In
QQuickStyleOption, he usage of Q_ENUMS did not make sense to begin with,
as the class is neither a QObject nor a Q_GADGET (nor a Q_NAMESPACE).
Change-Id: I5b85a46f57033442504a27bf2e1a05d7b0aaac48
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Implement and test the DOM representation of a JS return statement.
Task-number: QTBUG-100084
Task-number: QTBUG-111415
Change-Id: I2c11c0b9be3c93cf5be2bd9db5575335d4be19c1
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Rename the getter from {setQ,q}QmlJSScope() to {setS,s}emanticScope().
Set the semantic scope in the script elements where needed.
Test that BlockStatements contain their semantic scope.
Task-number: QTBUG-100084
Task-number: QTBUG-111415
Change-Id: If8b34c7edaac6aaf42a1cb2c47b12820358709e5
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Add a benchmark for DomConstruction using the scriptexpressions.
Task-number: QTBUG-92876
Change-Id: Ieab942a194d82933601424247d6ab71bce0540e2
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Implement the Dom representation for some constructs, like:
* Literals (string and numbers)
* IdentifierExpressions (variableNames appearing in expressions)
* VariableDeclarations and VariableDeclarationEntries
* ForStatements
* BlockStatements
* IfStatements
Introduce the namespace QQmlJS::Dom::ScriptElements that will contain
the Dom representation of javascript statements and expressions.
To incorporate the new DomItem wrappers in the Dom, extend the
qqmldomastcreator to also visit the corresponding javascript AST parts.
Like this, it can create the new Dom script elements using its stack:
visit() pushes new elements on the stack while endVisit() collects the
children of the current element from the stack (note: in the reverse
order they were pushed on the stack). The implementation uses two stacks
to avoid having to check every time if the top of the stack is a
QmlStackElement or a ScriptStackElement, but logically both stacks work
as one stack, containing first all QmlStackElements and then all
ScriptStackElements.
In case non-implemented script elements are encountered by
QQmlDomAstCreator, it will disable the script expression
construction and print a warning, instead of asserting and making a lot
of unrelated tests fail. This mechanism can be removed once all script
elements are implemented in the DOM.
Wrap script element pointers into a ScriptElementVariant variant that
can be used to contain any script element.
Added a flag to enable script element construction during DOM
construction.
Task-number: QTBUG-92876
Change-Id: I24b070ca3ff6ce916036842280cf91a21d049f30
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
This prepares qqmldomastcreator for the introduction of
ScriptStackElements in a later commit.
Task-number: QTBUG-92876
Change-Id: Ice74f05129c2935aa13bf68189cee211eaa72c7a
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
This prevents unnecessary CPU and GPU usage with the iOS and Fusion
styles.
It's not currently possible to test this without adding objectNames to
each animation, which relies on us remembering to do so. Even then, not
all styles use QML animations in their BusyIndicator implementations -
some use e.g. QQuickAnimatedNode). Also, there is no QML API to find
QObject children of a given type (animations) - I've created
QTBUG-113264 to propose such an API.
Task-number: QTBUG-50161
Pick-to: 6.5
Change-Id: Ieafb5f2f1a9703d4dc26e4f934dbcc86e2709445
Reviewed-by: Doris Verria <doris.verria@qt.io>
If there are multiple moves between touch down and release,
but they are merged, or if there is only one move,
flick occurs but no movement signal is generated.
So, send movementStarted if the view is moving in
handleReleaseEvent
Fixes: QTBUG-112924
Pick-to: 6.2 6.4 6.5
Change-Id: I774799bac2a00296a72005dcfa9ade6683836d08
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
So far we can only deal with methods that don't change the source array
and don't use iterators or functions as parameters. We also omit
concat() for now. However, indexOf(), lastIndexOf(), includes(),
join(), slice() and toString() are possible already now.
Task-number: QTBUG-112722
Change-Id: Id19c74e8ad25af876bc954c040c767823b7e3259
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
It was a stop-gap solution on the way to actual list type support. It
creates problems because it's a sequence type but doesn't have a value
type.
Add an assert to catch related problems earlier in the future.
Fixes: QTBUG-113265
Change-Id: Iae955ab6c5ca41113095b523a5d6b9bcfd4d2396
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
The function sets the required CMake variables and policies.
Pick-to: 6.5
Task-number: QTBUG-112685
Change-Id: Idae8f19eca28bac764480130dc679df1c1273598
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
The signal allows to track when a dial is wrapped around (jumping from end to
start or vice verse) and count the full rotations of the dial.
[ChangeLog][Controls] The dial element emits the wrapped() signal when it is
wrapped around.
Change-Id: I6e4cb29b0ddf96a7819b51cff3b21e1755edf765
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
The start and end angle of the Dial element were hard coded before. Now
they can be set by the application developer using the new properties
startAngle and endAngle. The angle property is set to an angle between
those values, even if it is >360 or <0. The setter functions make sure
that the relation between angle and value is unique. Further, values for
start and endAngle are limited to [-360, 720]. Wrap works as before.
Tests have been updated.
All styles have been updated to the new functionality except the Imagine
style (see task QTBUG-112387).
[ChangeLog][Controls] The start and end angle of the dial element are
made customizabe.
Fixes: QTBUG-57822
Change-Id: I941837008d4f9b4dde1979e91db5adb624bcbe41
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
While a normal QML scene should not feature extremely deep object trees,
one can still encounter them in some test cases.
Those test cases might then run out of (C++) stack space with the
previous recursive version of markAsDeleted.
Thus, we change the implementation to use an explicit workqueue instead
of relying on recursion. This changes the visitation order, but code is
not supposed to rely on the order of Component.onDestroyed calls anyway
(and we keep at least the order in so far that the parent emits the
"signal" before it's children.
Pick-to: 6.5
Change-Id: I93b30cc26b984d1a21cff92df1dd68cd45e67477
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
pinchHandlerOnFlickable fail with QTBUG-112924.
Blacklist it for now.
It will be handled in QTBUG-113226
Fixes: QTBUG-113226
Fixes: QTBUG-112924
Pick-to: 6.2 6.4 6.5
Change-Id: I58c646f957fb6f397405dc477d00eee770602e80
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
saveWindowPosition() uses QSettings which uses
the special file engine, which does not exist
at destructor time anymore.
This resulted in a crash.
QQmlPreviewPosition idea is that saveWindowPosition()
is called when there was a move event.
Also saving it at the constructor was just a nice to
have.
Pick-to: 6.5
Change-Id: I650176691acf8ad1ef9ae46b76f61dafee82a56d
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
This includes various kinds of objects in lists of various kinds. We
just dynamically create a metaobject that includes all keys we've seen
so far.
For example, you can now pass an array of JavaScript objects as model
to a ComboBox and it will retrieve the correct textRole:
ComboBox {
model: [
{ name: "Apple", color: "red" },
{ name: "Orange", color: "orange" },
{ name: "Banana", color: "yellow" }
]
textRole: "color"
}
This will create the entries "red", "orange", and "yellow".
Amends commit 86794e82ea.
Change-Id: I3df1f0b43ca1496f7eaed1165731d871c354ac1a
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Combined with qt.gui.shortcutmap, this makes it possible to see why a
Shortcut isn't activated, as you can now see which popup blocked it.
Change-Id: Ieadcfd47300bd41d8ca42116650d94ab711f59d4
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Using qt_internal_add_test for a benchmark gives it a _check target, not
a _benchmark target. Use qt_internal_add_benchmark instead, link against
QuickTest, and set the QUICK_TEST_SOURCE_DIR variable explicitly.
Pick-to: 6.5
Change-Id: Id72f2623b7edaa538ef3ff2cb3f505506652ee5a
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Otherwise we leak a lot of memory if any of the exit() calls is
triggered.
Change-Id: I338abe2ef63217e6b80ffc2f8fe65d9cac03d994
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Semih Yavuz <semih.yavuz@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
As shown in the ComboBox test, it is possible for a context object to
coexist with required properties. We have to check if the context object
is the same as the model object.
Amends commit e9f650cad8
Task-number: QTBUG-111176
Task-number: QTBUG-110980
Task-number: QTBUG-104752
Change-Id: Idfee277b5c3b78c514b2d239d73fcb6809577678
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
Now that the type is available from qmltypes we can just use it.
Task-number: QTBUG-112180
Change-Id: I315372da0925f19c209f676226f450863b0d3ea5
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
The text role data can be retrieved with model[textRole] in all cases
these days. The delegate components should be bound and the model and
index properties should be required.
Also adapt the documentation to not explain the isArray() hack anymore.
Task-number: QTBUG-112291
Change-Id: Ife323b4de1b081168bb02e2564a67203741818e0
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
If an item is inserted or deleted at an index less than or equal to the
current index, StackLayout.currentIndex will be updated in order to
reflect which is the current visible item. This is consistent with
QStackedLayout, QStackedWidget and TabBar
[ChangeLog][QtQuick][Layouts] StackLayout will now update currentIndex
if an Item is inserted or removed at an index less than or equal to the
current index.
Task-number: QTBUG-112691
Pick-to: 6.5
Change-Id: Id1d687e309c8f199a4f68698b53ca7c169f17dcd
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Pick-to: 6.5
Change-Id: Ieacfa716b657ac221a75cd5a0dd75d5099962e91
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Janne Koskinen <janne.p.koskinen@qt.io>
Some tests link to Qt::QuickTestUtilsPrivate which depends on Qt::Quick
target. In case qtdeclarative is built without qtshadertools, qtquick is
not build and cmake fails for those tests. Add Qt::QuickTestUtilsPrivate
check and also remove the duplicate dependency.
Change-Id: Ifafe567a8d61fe4174d31fc0ab7a6a3148fdd4c9
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
The idea being that setting QSG_RHI_PROFILE=1 will not just enable
debug markers (which is only actively used in Quick 3D right now),
but also timestamps, and then we can start showing GPU frame times
from the GPU side with Vulkan, Metal, and D3D11 atm.
(the only catch is that the value is heavily asynchronous and is
always referring to a previous frame, usually current - 2, but may
be up to current - 4 etc.)
In addition to the env.var., the setter/getter API is added to
QQuickGraphicsConfiguration. In the end they all maps to the
QRhi::Timestamps flag.
Once enabled, the renderloop timing log, both with threaded and
basic, will start including a new line, as long as the underlying
3D API supports timestamp queries or similar. (in practice this is
implemented for Metal, Vulkan, and D3D11 for now)
[ChangeLog][QtQuick][Scenegraph] The scenegraph render loop timing
logs can now show GPU-side times as well, as long as the application
is launched with the env.var. QSG_RHI_PROFILE=1 or the feature is
enabled via the new APIs in QQuickGraphicsConfiguration.
Change-Id: I42202882b418e12028d6a287c19352a8fb893365
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
The properties modified by this condition are booleans, that have been
set, so there is no need to && true them to ensure they are boolean.
Change-Id: I94f166c91549a5c212de5f694901896657cd04e0
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>