| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
| |
That's part of the sloppiness. We have no way of retrieving the lookup
metatype here.
Task-number: QTBUG-96144
Change-Id: Ibd1c0d8e9bb66bfe66e59fd1368f3f8ac663d01c
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit fb37577559fe524f010625302cf236609918d445)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
|
|
|
|
|
|
|
|
|
|
|
| |
We want the same init/apply mechanics to also work with setObjectLookup,
and for that we need lookupResultMetaType to do the same thing there.
Task-number: QTBUG-96144
Change-Id: I410101b7f13e60c0c2ed156a8cf5813c490d7bf0
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit eff007aef95bfb71618ad3a7bd00481e5197c0f3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
|
|
|
|
|
|
|
|
|
|
|
|
| |
undefined as value returned from bindings has the special meaning of
resetting the binding. As AOT-compiled functions return the actual type
of the binding rather than a QV4::Value, we cannot always encode
undefined. Therefore, add a flag that tells us whether the result was
supposed to be undefined.
Change-Id: Iac2298869dde80f6d889240dd8200b2ad83e5dc5
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 31ab6b81060abb0db0a68c88c61ea93c7d6bdc60)
|
|
|
|
|
|
|
|
|
|
|
|
| |
We cannot use the lookup metatype before we initialize it, and the
calling code cannot know the result metatype before the lookup is
initialized, either.
Change-Id: I3c691b41dbdb416aa1822c0ea7c4b887398f7908
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
(cherry picked from commit 3d4ceaf5b83d74d0c2f87caa45547237b3e315fb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
|
|
|
|
|
|
|
|
|
|
|
| |
Apparently we can still call bindings and functions on those. In
contrast to the QML engine, we throw a type error here, rather than
silently returning undefined.
Change-Id: I7d7daf1582d891f6acadb705b50dc36e23f8425c
Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io>
(cherry picked from commit 29fccccb402be67f06852005ffcf20250897b13a)
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
|
| |
Otherwise we trigger asserts in various places. We also need to generate
exceptions matching those the interpreter generates, and we need to
decline capturing of nullptr objects.
Change-Id: I65744fa3e440939db28d7b16a044f6968500a67b
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 603ea30924ea925db2830efa2b2c5cef500ee528)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
|
|
|
|
|
|
|
|
| |
Currently internal, as the only user might be qtcharts.
Change-Id: I40fc5295de6375c082d82ebeeb73bf4cd6dc7e4a
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
As long as the lookup isn't initialized, we cannot get its result type.
If the AOT code relies on the result type to be retrieved from the
lookup, allow an invalid type to be passed to the initialization
function.
Change-Id: I36a1dbe316010dc466a28bae65c3ed267588fc29
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
| |
We often use QQmlListProperty<QObject> as generic type for any list
property. This is somewhat dangerous, but unavoidable for now.
Change-Id: I9eba2829eaa84aaffe193365f46f406c30fdbf69
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
| |
The AOT compiled code may be unable to express the true type.
Change-Id: Id6a0b0c107aa5f05f6024817a1fdea5179ddf5ca
Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
| |
The object to be used for the lookup can be different from what the
caller expects. We need to verify that the caller talks about the same
type as the object. If it doesn't, throw an exception.
For the same reason, also throw an exception rather than asserting if
the property caches don't match.
Change-Id: I3b45691bfe2204820d878a624814d412d1358c24
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
| |
If we know that a property is final, we don't have to consider
overrides. Therefore, we can accept a derived class as subject of the
lookup. It doesn't have to be the exact same class.
Change-Id: I831c64b661730d78d12cec5c98e39282fc8742d8
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
| |
Leverage the property cache for efficiency.
Change-Id: I99910d6851aa5c3d58b15094fbc092c157c74368
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
| |
Such lookups are usually caused by repeaters or similar constructs where
many objects look up something in their parent context. As all those
objects have different contexts, we would constantly invalidate the cache.
Change-Id: I06c7d337d859e5e6a81f6e9a8693b155b2af7498
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Each kind of lookup should come with a function that tries to execute
the lookup, taking a minimal number of parameters, and another one that
initializes the lookup, taking whatever is needed for that. No
initialization should be done in the execution step and vice versa.
Rather, the execution step should be repeated if an initialization had
to be done first.
This way, the happy path can be very fast if the lookups have been
initialized before.
Change-Id: Ic435b3dd4906d00144138cb05161a99a0a9c64ed
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
| |
The caller has to make sure the types match. We only check for QVariant.
Change-Id: I17d08cab650f9f4d467fa61e2f285f045b73ba0c
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
| |
Change-Id: I4acfce1571bfb2527d2ede43229957b89230022e
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
We can shortcut some of the lookups if we know what we're looking for.
Also, as the lookups are populated from the same code that calls them
later, we can drop the sanity checks. The calling code should know what
it does.
Change-Id: Iae3a5b0e997aa5a90bea7933e7ce1f2415f5299b
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
| |
Change-Id: Ie06b029850b74e98d6d6e38b480cedef4e481691
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
| |
If we already know the property cache and data we don't have to look
them up again in captureProperty(). Such lookups can be expensive.
Change-Id: I94553260311912c5acee3105295f124721203e01
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
| |
We only ever need it to retrieve the QQmlEngine. However, resolving the
context can involve an allocation.
Change-Id: I064fd528fa7ab9bd37043c5dd1c62d17ea9380e3
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
| |
The method already returns a bool status which tells the caller
"something is wrong". If something is wrong, the caller will try a
different method to retrieve the value, and that will generate the
exception again. We should not shortcut the procedure as generating the
exception requires the instruction pointer to be set, which is
additional overhead on the caller's side.
Change-Id: Ia2d3a90c897b14660a18a5740498a0e5016dc49a
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
| |
Getting a property of an object and getting an object by ID should not
require any type transformations.
Change-Id: I7ba06cf7c09cdf4ce7b0093b670fd7879ecf799a
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
| |
This is useful when we know how to read the property directly.
Change-Id: Ibc314a8e8bf9e51b3a15d934f6a1f17a53ea168a
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
|
|
|
|
|
|
|
|
| |
This is based on QJSValue for now, but can be extended to operate on
QMetaType/void* later.
Change-Id: Ic63d4c9081090998afcca63ff3253963ff5096a2
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
| |
Change-Id: Ie29baf584629193234ab07db63ed97ee656634f5
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
|
|
|
|
|
|
|
|
|
|
|
| |
In certain corner cases there may be no stack frame available. As the
setting of the IP is only used for generating better error messages, we
don't have to care about that too much.
Pick-to: 6.1
Change-Id: If249b96a97a2189ef0b2e83f7a057a001a4307cd
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
| |
It makes no sense to have them qqmlengine.cpp.
Change-Id: I138807c7650ec7aef4c6e8833e8bac8a6f179d1c
Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
|
|
|
|
|
|
|
|
| |
This way we get correct line numbers in error messages.
Change-Id: Ieb642523f74adf73955e78cdfb8cb2faee40b321
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
| |
There is no reason to keep it in qqmlengine.cpp as it is declared in
qqml.h.
Change-Id: I0a0261b943c4a3b4333d7161becbd68ad4f1b21e
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
We need the compilation unit, and a way to retrieve JavaScript metatypes
from it. Also, prepare for cases where we only have a QJSEngine, not a
QQmlEngine, and pass the scope object as part of the AOT context.
Change-Id: Ica81e92c99f3c9b6baffd04db1e0e91603fd2ac7
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
You get to write QML_SEQUENTIAL_CONTAINER(value_type) now, and
qmltyperegistrar will generate a sensible registration call from that.
A registration might look like this:
struct MyStringListForeign
{
Q_GADGET
QML_ANONYMOUS
QML_SEQUENTIAL_CONTAINER(QString)
QML_FOREIGN(MyStringList)
QML_ADDED_IN_VERSION(3, 1)
};
It's unfortunate that we need to use a metaobject to transfer all of
this information, but there is no other sensible way.
Transform the containers defined in qv4sequenceobject.cpp to use the new
style, and move them out of the builtins, into QtQml. Recognize that
only one of them was ever tested, and add tests for the rest.
Task-number: QTBUG-82443
Change-Id: I3a30f9e27266bb575eea26c5daf5dad1ec461cc5
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
| |
Task-number: QTBUG-88156
Change-Id: Ic6127c6128b4c7736cb4b5ab8ce51629388b59ca
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
|
|
|
|
|
|
|
|
|
| |
It seems we never stated that singletons can not be extended in our
documentation. Therefore this is technically a bug fix and doesn't need
separate documentation.
Change-Id: I7877289bd5a52ecf709f80ba1975137981ec65f0
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This way we can access the enums of namespaces as properties of the
primary type. This is achieved by:
1. Making enums of extended types available in the base type
2. Allowing the extension to be specified as plain metaObject rather
than as type name.
3. Refraining from creating the extension if the create function does
not exist.
The goal of this is to declare the Qt namespace in a civilized way, but
will also help with cleaning up the QtQuick value types and their enums.
Change-Id: I13399741d30ce38d1bff753cfa1b11e72ccfbf6a
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
This is useful for modules that select their imports at runtime using
qmlRegisterModuleImport(). We can list all possible variants as optional
imports so that tools can see what types might be available.
Task-number: QTBUG-87130
Change-Id: I8a37bdde79aef3619fd1f05e5ea6781d521afa88
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
As you can extend value types with QML_EXTENDED we may as well allow a
factory function in the extended type. Furthermore, if the original type
allows construction from QJSValue, we may just use that. In turn, we can
get rid of the value type providers now.
Change-Id: I9124ea47537eab6c33d7451080ab2fff942eaa7b
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
This avoids the template explosion and makes the mechanism extendable.
You can now register additional anonymous sequential containers.
Fixes: QTBUG-71574
Task-number: QTBUG-82443
Change-Id: I5b9ed9af1533a3b7df8fc5bb37bbb73b8304e592
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
|
| |
We should not register any revisions larger than the given major version
as that allows importing an incomplete module, as the version-less
import. Typically the offending version is pulled in via some
QML_FOREIGN and only the types derived from that foreign class are
available in the higher major version.
Change-Id: I186fb010d704bea514cefff9f66eb58186df5c91
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
| |
This is needed in order to remove PySide2's qml type limit.
Change-Id: I331d9e31574a744eb9085222d58ea8a8789e0e31
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
You can now import the latest version, a specific version, or, "auto"
which is the same version as the parent module.
[ChangeLog][QtQml] You can now procedurally add module imports to
modules, using qmlRegisterModuleImport(). However, actual import
statements in qmldir files should be preferred wherever possible.
Fixes: QTBUG-84899
Change-Id: I3b32dd8b07a19d31b6538b9a6bb436840862f345
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
| |
There is no point in having that pimpl'd.
Change-Id: I9e3f6671ca178ea3f58fd0488dbb291a38656685
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
| |
We need this for controls2 to select the style at runtime.
Change-Id: I23b6ab962a647b519d5af019eade27f89e1e4e00
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
| |
[ChangeLog][QML][Feature] Add a default message to QML_UNCREATABLE when
proving an empty string as a reason
Fixes: QTBUG-83842
Change-Id: Ifd2044fa6c56c3a382d451ec47d5f92a1ac16b81
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
| |
* reset all structVersions to 0, removing checks for higher versions
* add structVerions where they are missing
* consistently check for compatibility in qqmlmetatype.cpp
* remove unused members
* rename RegisterSingletonFunctor
Fixes: QTBUG-82241
Change-Id: I74f1876b3298dbb60ff7cfab8c13e8ad4f9f8cdc
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
| |
This allows us to save the type IDs and later unregister the types in
qmltyperegistrar-generated code.
Change-Id: Id1bc73e2832c6d76e513ee3ee267b8d52e3851da
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
| |
Fixes: QTBUG-82453
Change-Id: I7e5682945a07c3af183becd3947a69568f139d16
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Conflicts:
src/imports/qtqml/plugin.cpp
src/qml/qml/qqml.h
src/qml/qml/qqmlmetatype.cpp
src/qml/qml/qqmlmetatype_p.h
src/qml/qml/qqmltypeloader.cpp
src/qml/types/qqmlbind.cpp
src/quick/items/qquickitemsmodule.cpp
tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
Change-Id: I52548938a582cb6510271ed4bc3a9aa0c3c11df6
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
That is, register QQmlTypeNotAvailable as foreign type under the name
given as parameter. Also, statically register QQuickAnimatedImage as
unavailable in case of !quick_animatedimage and register it for the
right version.
Task-number: QTBUG-68796
Change-Id: I2ea292d2aeda66d8ce43b3bccbd3d21663330bd6
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| | |
We have global comparison operators now.
Change-Id: I5e7461c8442591f139642379f8889445dfaa8431
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|