The qmltime should be a tool, not a normal executable or an app.
Pick-to: 6.0 5.15 5.12
Change-Id: I64c76877907297a6a817ba5903786bcc7fba8fdd
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
If the opengl feature is disabled, t is not used. This caused build
failures due to -Werror=unused-parameter
Change-Id: Ic39703dfb540d15295811484ad3793b639dc6b9c
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
The QJSValue to QVariant conversion is traditionally messy. The recent
addition of a special case for FunctionObject did not make that better.
Rather, we now add a way of specifying that the conversion should be
lossless, which avoids all conversions of JS objects and arrays.
Amends commit 6b08c24297.
Change-Id: I6d4506b52d3175ed2f2984f8a26d560cf6311ab6
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
As you can manually throw an error, you should be able to catch it
again, too.
Change-Id: I82475df1969a1fd76f4cf5fc0a8d921dfafaef89
Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Wheel momentum is great on old "clicky" mouse wheels: they feel really
clunky without this feature. But it's also terrible on most laptop
touchpads. We still aren't generating QWheelEvents with pixel deltas
and ScrollPhase on most platforms (still only on macOS); but eventually
we should. However, those laptop touchpads tend to generate angleDeltas
that are not multiples of 120.
Added logging categories qt.quick.flickable qt.quick.flickable.wheel
and qt.quick.flickable.velocity.
[ChangeLog][QtQuick][Flickable] Flickable now tries to detect whether
you're using a "clicky" wheel on a desktop mouse. A laptop trackpad can
generate QWheelEvent::angleDelta values that are not multiples of 120;
in that case, smooth scrolling with momentum is disabled, to avoid
losing control of scrolling. Set the environment variable
QT_QUICK_FLICKABLE_WHEEL_MOMENTUM_ENABLED=0 to opt out of the old
behavior entirely, or set it to 1 to opt in unconditionally.
Pick-to: 6.0
Task-number: QTBUG-38570
Task-number: QTBUG-56075
Task-number: QTBUG-80720
Task-number: QTBUG-82565
Change-Id: I0da2d31259fa1c79ab217a3fa9e888893fc7b235
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
That is wrong. The context does not contain such objects. Instead, mark
the names as namespaces in the imports by giving them an empty type.
Change-Id: Ie9d0bba592863878d2220cee59be369ba2534f17
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
It was one Flickable before, with stuff in it; now it's two of the same,
side-by-side, so as to test flicking the two in parallel on a touchscreen.
Change-Id: Iec1ef935ee1c0a97bed49959b117b85d65fa84af
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
This is necessary if you want to parse the same byte code in multiple
passes.
Change-Id: I8d3e9739b7cb3682d0f1d26e675ead8b7ce66a93
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
We set QProperty bindings up in the wrong way: Parent components would
overwrite their child component's binding. This patch reverses the
order, fixing the bug.
Task-number: QTBUG-87153
Pick-to: 6.0
Change-Id: I3e90d1d14a41a7c5c337745f1453484d360a3979
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Assigning objects to signal handlers can be convenient, as seen in the
examples which use it together with ListView.onRemove.
However, that convenience makes it hard to reason about what actually
happens. Moreover, the only user of that functionality are the Animation
classes, and the usage of DefaultMethod is not documented anywhere.
[ChangeLog][QtQml] Assigning an object to a signal handler is deprecated.
Instead, create the object, give it an id, and call the desired slot
from the signal handler. For instance, instead of of
ListView.onRemove: SequentialAnimation {...}
use
SequentialAnimation {id: removeAnimation; ...}
ListView.onRemove: removeAnimation.start()
A warning will be printed whenever an assignment of an object to a
signal handler occurs. The warning can be controlled via the
qt.qml.defaultmethod logging category.
Change-Id: I001ddf4d7933871977f84a5e012d020fb043cc64
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
This commit adds the main API of the Dom model:
The idea of the Dom Model is to expose a simplified an uniform model,
while keeping typed objects (as one is used in C++, and ideally using
the modern C++ approach with containers, and avoiding manual memory
management).
In particular this approach avoids reducing everything to an untyped
model.
The central object in this is the DomItem, it is a value type that
keeps a pointer to the actual element.
A non empty DomItem always keeps some context (a canonicalPath)
and one can explore its containers and its contents.
Non existing or missing values simply translate to empty DomItems
and one does not need to check at each step for invalid things.
See the DomItem documentation for more information.
The as() ad ownerAs() templates let one cast back the DomItem to
the underlying elements.
To expose an element with minimal effort one has to mainly implement
the method iterateDirectSubpaths(), and iterate through all elements
contained in that element (see the documentation of DomBase for more
details).
Containers, simple data and references can be wrapped in DomItem
elements just when accessed, so the underlying C++ object can use the
usual containers/datatypes.
A good model should not just be easy to browse, reference and extend
with new elements, it should also have a clear parallelizazion/
multithreading policy.
This is less relevant for a single pass compiler, but for is relevannt
for a code model.
The fact that the current code model now somehow works only from the
GUI thread show the importance of a clear policy when multiple people
can contribute.
In the Dom model there is the following idea:
- During build time pointers to the elements can change (MutableDomItem
should be used)
- Access to sub elements normally has no locks, they should be either
accessed by a single thread or immutable.
- OwningItem are the unit of multithread safe updates, the have a
mutex and protect the parts that need protection
- A DomEnvironment can refer to a parent Environment, perform several
changes (in a separate thread), and commit them all at once (in a
sparate commit).
This commit contains all the main API, and tests for it.
The bulk of the concrete element will be in followup patches.
Task-number: QTBUG-74840
Change-Id: I9e14e8560e3b4aa3268a733fed37e9090c18e3ab
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
You should not be able to retrieve a non-const parent or child scope
from a const scope. That defeats the whole point of keeping the scopes
const after loading.
Change-Id: If3734c65ee902c32939a54a67193d5f6276cd016
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
This is a more complex example that is also not that visually appealing.
Change-Id: Ia5ebfa407c6bcbd3d701068384bfd660833a867c
Reviewed-by: Tuukka Turunen <tuukka.turunen@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
(cherry picked from commit 86b9ae4da1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Follow up on change in qtbase; QPMI casting to QModelIndex returns a
value, not a reference.
Change-Id: I227cd8ef64450986069837edee25512d9538286d
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
(cherry picked from commit 039c2801cf)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QQmlValueTypeFactory contained an array of size QMetaType::User, to
avoid locking for accessing user types.
In Qt 6, User is however significantly larger, causing the array to take
roughly 500 KByte of memory. We therefore unify the handling of user
types and Qt built-in types, by storing all of them in a QHash. We
replace the mutex with a read-write lock to still allow concurrent
read access to the mapping (now for all types and not only Qt builtin
types).
Change-Id: Ie22786b0f33cf27157b151c75d5bb21579a566f6
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
This time, the ValueTypeFactory gets converted. As a consequence, many
callers get touched again.
Task-number: QTBUG-88766
Change-Id: I3a8b7d5cfeb7fac85daf1702febba205971d4256
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Also, allow conversion from UrlObject and String. We allow the string
conversion because we treat string and url as interchangeable in various
places.
Change-Id: Ib229c6d190e1c5d849ea18798925965b8dbeef7e
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
The Professional CMake book suggests always using explicit linkage with
target_link_libraries, so let's use that.
Whether to use PUBLIC or PRIVATE depends on the context. But let's
be conservative and advise on using PRIVATE by default.
Also prefer the versioned target name over the unversioned one.
Task-number: QTBUG-88935
Change-Id: I29a6b07803d7aab10eb93a5348d12b9d1620d132
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Craig Scott <craig.scott@qt.io>
qmlInfo, qmlDebug, and qmlWarning are not in the QtQml namespace any
more. This patch adapts the documentation.
Task-number: QTBUG-88533
Pick-to: 6.0
Change-Id: I7fafd3fc2769c5ffad515cacaacdc7ccbe07db46
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Documentation links to qtshadertools. This patch adds qtshadertools
to the dependencies so these links can work.
Pick-to: 6.0
Change-Id: Icb059fd681e7456f3452aeba60287bfa1cc3539e
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
There was wrong usage of \begincode and similar commands.
This patch fixes it.
Task-number: QTBUG-88533
Pick-to: 6.0
Change-Id: I70b3d0104ba1dc8eb44556f35fc552e259317f88
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
It allows for more natural looking generated code and there is no
downside. The arguments are specially prepared for the call anyway.
Change-Id: I8437e93adb1c67db1b53fbdb29cbea10f6ef278f
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
If the qApp we have is in fact not a QGuiApplication we cannot
connect those signals. The "if (qApp)" was probably supposed to check
for this but actually doesn't because qApp is a static_cast.
Pick-to: 6.0
Change-Id: Iaa30e3d56768e97601d51d30500fc3b12d0626a3
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
metaTypeFromJS expects to assign the value using regular operator=. That
destructs the old value and therefore the old value has to exist.
Change-Id: Ife443b184c30d658f42b65c6717e80685f6635d5
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Instead operate directly on the meta object.
We could maybe have an optimization, where we have a global map
from id to QQmlPropertyData for each value type.
Task-number: QTBUG-88765
Change-Id: I259a06ba116a536b56380c2636737c6c016665d9
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
It's not being used anymore.
Original-patch-by: Lars Knoll <lars.knoll@qt.io>
Task-number: QTBUG-88765
Change-Id: Ieab1cba6c664c65d123d8f1ffd6db5878010f965
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
With this approach we can also avoid passing the property cache around.
Original-patch-by: Lars Knoll <lars.knoll@qt.io>
Task-number: QTBUG-82931
Change-Id: I88f770d5d9a31b2f5071ad457d9a830900130a85
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Instead of returning the id. Callers still use the id.
Change-Id: Ia075c3bbfa2421048483e427d9e6e6f1a20c3b61
Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
This signals qmlcachegenplus to not paste the whole JavaScript type
system into each generated file. In turn, user projects need to add a
dependency in order to build against the JS runtime.
qmlcachegen ignores the option.
Change-Id: I0f87dedb969e99e94fbb712b7faa23d84f76dfbe
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>