| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, the assumption was that each object could only have a single
extension object. As proven by the new qqmllanguage test this is not the
case. Each registered object in the type hierarchy can have its own
extension. Therefore, adjust the algorithms that generate qmltypes and
iterate the extension objects when analyzing them.
This leads us to the realization that anonymous types can in fact
meaningfully carry extensions and implement interfaces. Adapt
qmltyperegistrar accordingly.
For the test to compile, however, we need to realize that the class
declaring interfaces needs to befriend all potential subclass's
QmlInterface structs. Fix that, too. The rabbit hole went deep.
Change-Id: Ia451897e927e03b95c3062e829edf1dfcd216613
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
| |
Otherwise various internal indices may be off, in particular the
internal classes.
Change-Id: I3c2a6b8150590fc41ec55bf2dfbc989078ddce42
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
| |
Prefix them with $anonymous$ so that we cannot accidentally find them.
If we don't keep them, they may be deleted when their last strong
reference goes out of scope.
Change-Id: I24ca795f9d9c4ecea074019db41a3ca0618f8e81
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
|
| |
This simply exports the name which are already available in the json
files generated by moc. We do not consider whether the methods are
non-private for now. MEMBER is not supported either, but might be added
if the need actually arises.
Fixes: QTBUG-90711
Change-Id: If3ee18c8ce60499676a7ee22df569cba0912e22f
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|
|
|
|
|
|
|
| |
If we don't return there, the newly imported script is promptly
overwritten by an invalid module.
Change-Id: I788a7275e2c190a20c176da35f5c76ac9f6ad02b
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
|
| |
If the content is not loaded, yet, the data is always null. If it is
loaded, the result might be null. So, in order to know, we have to load.
The same holds for deferred weak pointers, the hash functions, and the
equality operators.
Change-Id: I20eec58efe5da604187c34578ee40f769090c910
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
| |
Change-Id: Ie52ce15b7fa960ce84a6d17a21a0e307a38c726e
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
| |
All those types are properly defined in the qmltypes files now. We just
need to search the enumerations the same way as methods and properties
in order to find everything.
Also, deduplicate the code that resolves properties, methods, and enums
by using a common template for iterating the scopes.
Change-Id: I0bf1423974d0ec8f602ecd0342522b3e981a8586
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
| |
Change-Id: Idb29a7483b813ed00849c13ef1324c7e931400de
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
| |
We want to be able to use these types in hashes.
Change-Id: Iea60bb8dd1ce893a37c4856d153f0f5c77d29fcd
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
| |
Fixes: QTBUG-90448
Change-Id: I5fb6b3d9223ae95ca7e039c5b9139ed086052c29
Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
| |
And do not choke completely on extended.
Task-number: QTBUG-90448
Change-Id: I4ac5742ec70f5ba1ed1403be444d9cc7229830c2
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|
|
|
|
|
|
|
|
| |
Remove all qmake project files, except for examples which are used to
test that qmake continues to work.
Change-Id: Ic4abb72dc2dcd75df7a797c56056b6b3c5fe62ac
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@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>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
| |
All non-C++ scopes are composite. Now that we can return the global
scope, when parsing a script, this matters.
Change-Id: I6c9a17bdd3acf80fce728b1df5c3d9e66035bd33
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
| |
There is no reason to duplicate the code for retrieving method
signatures 3 times over. As an added benefit, the types on those methods
are resolved now.
Change-Id: I2f9681911b938c4a260b6593ab49e9cc5098c546
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
| |
The scope can be different from the object a binding is attached to. In
particular, a group property or an attached property are executed in the
scope of the surrounding object but are attached to the inner object.
Change-Id: I3671c0ba425b791960f3205baaff91471d2e7205
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
| |
Change-Id: Ica3f5c6696542921bc8d399cd46d901ba06f6d83
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|
|
|
|
| |
Change-Id: Ica93a3e3fb0eb99be1498f1fcb94b09c113272d7
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
| |
Change-Id: I2340f4413ae9a44c71000e840a79e904b6a0fec9
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We need to resolve the types for QML elements in two passes because only
after finishing the parsing we have the QML-declared methods and
properties available. We already need the base type before, though.
Also, there can be multiple methods of the same name. We need API to
access them.
It also turns out that the internal name of the "var" type has to be
QVariant in order to match reality. "var" properties and unnamed
arguments to JS functions are implemented as QVariant.
Change-Id: I541f11e96db72d832f4e4443d3a5d31079a56575
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
| |
Otherwise we get lots of "unused" warnings from the compiler.
Change-Id: I7744715c476350dd3bba34500589cb1c62672c9f
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
| |
That's a recurring thing.
Change-Id: I8dc049a559e337c70089dd1f81ff23bf7d2140fe
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
| |
There always has to be an empty last function. Otherwise we might access
invalid memory when loading them.
Change-Id: I5e7a784c14ac8a12450926b895664a98c03f85f1
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When parsing QML files, we need to keep the enum values around as this
is the only place where we can find them (without parsing the same file
again, that is). With C++ types we don't strictly need them as they are
also available from the C++ header, but if the qmltypes file is nice
enough to provide them, we can use them. (Which will be for types that
are not actually C++ types, but rather types produced by registering a
QML file with qmlRegisterType()).
Change-Id: Ibcc93b30e523a00e1eeb80029943c48b83d0e1b5
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
| |
Change-Id: Ibac4dd7641a89b686bee63cf974b2257a35631a2
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
| |
Previously, only bindings were compiled.
Change-Id: I6e76c3f5e628e60538a0ed754fdd915978b88c1d
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>
|
|
|
|
|
|
|
| |
This is in line with what the IR does.
Change-Id: I9808d6e070a19e749e43c4abf612556485eb080b
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
| |
This can contain extra includes and code that should be added before
any functions.
Change-Id: Ida13d38ab7198c3986e134fe6f3786acd821927f
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
| |
Access to non-exported types is necessary in order to implement an
alternative QML runtime environment.
Change-Id: Ia6fd7bbfbf0ec9d6fa06f3741891395a78e468ea
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
| |
This is necessary to identify the available QML and JS scopes for the
binding, and to add any identifiers found there.
Change-Id: Ic966e7817ccd1fdc064dd433d16fa6c42c9110cc
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
| |
This way we can analyze the left hand part of things like
"anchors.fill: parent" in qmllint.
Change-Id: I0f58312566c3d5062e0fb301c2bad908ab8b8cbb
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
| |
The binding code alone is not very helpful.
Change-Id: I74e8884b2345c8b60447375e38a18db65ac22cb4
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
| |
Plain literals don't benefit from AOT compilation.
Change-Id: I8f20991b3e330f688f977d57acbffef36818a76c
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
| |
Amends commit 7feab1fb95317b924fe39c49dd9907ca3df61a40.
Change-Id: I32e22b51501d9c98af74ac00506619cfe33f6b7c
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
| |
This is necessary for include directives specific to the types being
used.
Change-Id: I34e0e5907d795714797fbb99a75b863cc41e9ad3
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
| |
Adressable scopes are the ones with an id.
Change-Id: I4975248aa920f0d567b5b5ccc8ba18a2fdd91e13
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
| |
We need to re-use them. Also, provide a way to insert AOT compiled
functions into the C++ code.
Change-Id: I7b0d13cb307e8f979745f096a9614f087d135f68
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
| |
This enables us to use the same generateloader.cpp for qmlcachegen and
any replacement that actually produces AOT compiled functions.
Change-Id: I12fe81236e4ef16a627729c644d54b6c171b3860
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
| |
We need to be able to generate the loader code from multiple places.
Change-Id: I9e04fd3583b535bc5f7d5fb293cb61309c1e199a
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, we would mix them up on importExportedNames(), which was
also misnamed. Now we keep them in their proper place in the scope
hierarchy, so that we can identify which scope a property came from.
Exceptions are the qmllint-specific treatment of parent properties and
Connections elements.
Change-Id: I7c012388b16c83439d6f2de2e83fac0da4940d30
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
| |
Otherwise types like "int" are not resolved.
Change-Id: I35d0eb05e955822b082d2f6067d1e5b40c510cf1
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
| |
It is expected to return an unsigned value.
Change-Id: Id75c0887de7e9b0eeab378041598621c89507501
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io>
|
|
|
|
|
|
|
| |
So far we've just ignored them.
Change-Id: I2ca522ef825a341a3f4bf1c2a42fb0376180cdda
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
| |
For backwards compatibility, a replacement for qmlcachegen will need to
provide the same functionality.
Change-Id: I22664230ea636d384190122223d15819ebee930c
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
| |
Change-Id: I1257d4efe1813d2b95a37d95a82c21c30fc15591
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|