| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
Change-Id: I6f83fc61c72993c04c99ff16c31c10b20ada5db8
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
You should declare functions with formal parameters if you want to use
parameters passed by the signal. We need to generate two different
warnings because there are two code paths by which such parameters are
injected. If we compile with qmlcachegen, it simply inserts a lookup
instruction in to the byte code. This lookup then triggers our special
hack expressly made for signal parameters. If we don't compile using
qmlcachegen, a function declaration with formal parameters is
synthesized. We mark those formal parameters as injected and warn if
we see one of them used.
[ChangeLog][QML][Important Behavior Changes] The automatic injection of
signal parameters into signal handlers is deprecated. This is because we
cannot determine the names of the signal parameters at compile time.
Furthermore, also for human readers it is difficult to discern between
arguments, context properties, properties of the current object, and
properties of the root object of the component. Requiring the signal
parameters to be explicitly named resolves some of this confusion. You
can turn the deprecation warning off using the "qt.qml.compiler" and
"qt.qml.context" logging categories.
Task-number: QTBUG-89943
Pick-to: 6.1
Change-Id: If0a5082adb735a73efd793868b3a55bc7d694cbe
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
|
|
|
|
|
|
|
|
|
|
|
| |
Add execution function that can evaluate runtime functions available
in the compilation unit. Private API for now as it's unclear what would
be a comprehensive solution to support all existing use cases
Task-number: QTBUG-84368
Task-number: QTBUG-91039
Change-Id: Icf755b53484587d7983eaae4821c1aa0111d5c05
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|
|
|
|
|
| |
Change-Id: I4154a0b5c7115375292794e0564d2f3657e6b4dd
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
| |
Move the value type registry into QQmlMetaTypeData. This way we can
conveniently drop the relevant entries when unregistering a type.
Fixes: QTBUG-86946
Change-Id: Id024a34a8b2b622fd9417fc0e52864b43c66cc01
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We cannot store a QStringView internally, as that would increase the
size of our objects (QHashedString(Ref) does not support strings with
sizes that do not fit into 32bit, thus it can store the hash and the
size in one 64 bit block). What we can however do is to construct a
QStringView on demand (which is cheap), and use its methods.
The benefits are twofold: We get rid of some accidental complexity in
qtdeclarative; and the code in QStringView is actually SIMD optimized.
Change-Id: I2445a2d5a16b253f4971d7f3be0e1b274326eacb
Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|
|
|
|
|
|
| |
The parameter is gone since 3bc239a0f16fb93f84def55a5980ef8561e7a7b4
Change-Id: Iae411b61f27efd60b489dbc219ef0ad07ad19938
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|
|
|
|
|
|
| |
Pick-to: 6.1 6.0 5.15
Fixes: QTBUG-86482
Change-Id: If938fad22f51b08fe3cb20b94634efe46a1eed47
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
The 2 is meaningless.
Task-number: QTBUG-85064
Change-Id: I9f140155d274c691b5eab1285d9b7153f9f93a87
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
| |
The "2" is meaningless and there is a better name available now.
Task-number: QTBUG-85064
Change-Id: I65d26b06712ed7dcf2825f16dffaa6060dd86985
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
|
|
|
|
|
|
|
|
| |
Use noquote() for qqmlengine warnings.
Fixes: QTBUG-86595
Change-Id: Ibe161cb164b9fa2511e4bc02237de5d81172e114
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|
|
|
|
|
|
| |
Pick-to: 6.0 6.1
Fixes: QTBUG-90038
Change-Id: Ic01b5d097e0b9e6720bcec7ccb18c22abb5418f4
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
There is no need to extract the metatype id to know whether the type is
valid (aka != UnknownType). Moreover, as we already have a metatype,
there is no need to do the typeid -> metatype lookup.
Task-number: QTBUG-88766
Change-Id: I5f9512aa6e06b0d89be8d3cad970f12319dab156
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|
|
|
|
|
|
| |
Previously this just failed silently and returned garbage data.
Change-Id: Ia8b72836aa0ccfd50fd18b0f813c2bf3a00801c5
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
This way it's fundamentally impossible to add the same animation job to
two different group jobs. The pointers are not exposed anymore and no
one can re-order the jobs.
Task-number: QTBUG-90401
Change-Id: Iebff4b64960c853915dd32714acd144fc5cdc00d
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If a QML component wants to mark properties of its "parent" component as
required, it can do so via
required propertyName
The information about those properties is stored in a
RequiredPropertyExtraData data structure. This structure is already
serialized to disk in the QQmlIRWriter. However, we neglected to restore
it so far in the loader.
Fixes: QTBUG-90538
Pick-to: 5.15 6.0
Change-Id: I789daff9bc881e4f35c942c77f5116b5284de81b
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
| |
Without this, the properties of those types are invisible to tooling.
Change-Id: Iffd05643a650d03993d9fe1a3783fe3db8c33f0b
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
| |
amends: c0b59369ab45a78e4407633365a52c1a9255512c
Change-Id: If068443257baa0eaee31a43b94b2e0d0f7f554fe
Reviewed-by: Ulf Hermann <ulf.hermann@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>
|
|
|
|
|
|
|
|
|
|
| |
We need to be able to resolve any QML type from its C++ name using
QMetaType::fromName(). qmltyperegistrar can generate the missing
metatypes, either by creating synthetic ones (for namespaces), or by
making sure the existing ones are registered (for others).
Change-Id: If775af56d891f2c2a5bb94589b3cb05a199c7c35
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
As we already have the metatype of the property, we can use the more
efficient QMetaObjectBuilder::addProperty method which avoids a
name to metatype lookup.
Task-number: QTBUG-88766
Change-Id: Iab8c22556cb15d35337f266e533cb0d907232421
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|
|
|
|
|
|
|
| |
If the original type's ID is not valid, then QQmlMetaTypePrivate's ID is
also not valid.
Change-Id: Ia727e7dc99b1954b4c6fa9b599e8edc0ef9b3212
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This change ensures that bindings created in QML between new-style
properties contain information about which property caused the loop. To
do this, we store additional information about the property involved to
retrieve its name and position at a later point. We print the warning in
case we detect a binding loop in evaluate, and also set the error
reporting callback correctly, so that the condition can be reported when
the loop is detected in another part of the binding evaluation.
In addition, we do not only set the QPropertyBinding's error member when
JS evaluation results in an error, but also print the warning with
qmlWarning.
Fixes: QTBUG-87733
Change-Id: Idb25237d1f57355ca31189e6bf2a918430b3a810
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|
|
|
|
|
|
| |
They need to be accessible from C++.
Change-Id: I60f2213bdbe6b8b64856e13f1e0cc798f8a51086
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
| |
Change-Id: I5f4334e8b55511c33eab52262239d5d2da2329ba
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|
|
|
|
|
|
|
| |
Previously only the foreign type was searched for a create method.
Now the wrapping type can also contain it.
Change-Id: I05fb9e0c0a54c14530eb9adcae5a44df5c208be3
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|
|
|
|
|
|
| |
Instead, log them with qmlWarning.
Change-Id: Icde7397085841a84aca8a81c716d552c4cd4485a
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>
|
|
|
|
|
|
|
|
| |
This way we don't have to specially prefix the foreign namespace.
Change-Id: I0daa2fe3b8faa205c2c9dfb0f6b1984b2c8e7437
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
In a JS module, we lack a qml context. Thus, we have to check whether
qmlContext is null. In that case we use the engine's scriptContext('s
ExecutionContext) instead.
Fixes: QTBUG-90245
Change-Id: I337e9c7cade472f52fc81c93d1152ff59f8018a5
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|
|
|
|
|
|
|
|
| |
After freezing a QQmlPropertyMap you cannot add any more properties, but
in turn the property access is cached, and therefore faster.
Task-number: QTBUG-57792
Change-Id: I2c6d768039c3b59eb2411194e463ee0de55f8bed
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The only place where it was still used is QQmlOpenMetaObjecType. The
only effect of QQmlCleanup is that clear() is eventually called by the
engine. In the case of QQmlOpenMetaObjectType the only effect of that
was that the "engine" member was reset. However, the only place where
that member was used was in setCached(), and in that place it was
irrelevant. There is no reason why setCached() should be prohibited when
there is no engine. We may be worried that the property cache assigned
to the open metaobject might go away somehow if there is no engine, but
the cleanup mechanism clearly demonstrates that checking for the engine
on setCached() does not protect against this.
Fixes: QTBUG-90004
Change-Id: I05445eaeb53a64c70de366090ea2ee4aecf2bad8
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
| |
This avoid re-building the metaobject for every property added. As
rebuilding the metaobject is an effort linear in the number of
properties, the runtime when adding multiple properties via singular
insert() is quadratic in the number of properties. The plural insert()
rebuilds the metaobject only once.
Task-number: QTBUG-57792
Change-Id: I9513c4de047724e4141dab72aacfbdd840a3e465
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently there is no public API to transform a QVariant holding a
QQmlListProperty into a QQmlListReference. We cannot pass
QQmlListProperty itself as that is templated. The metatype-based casting
is somewhat evil, but not more so than what we already have in the other
ctor.
Change-Id: I2d56499b1fd188613bc71016cb00ec23081d3cea
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Consistently never unload plugins on macOS, also remove half-broken
plugins from the map, and always unregister any types in them.
Unloading plugins on macOS is ill-advised as it will actually unmap the
memory, making string data (among other things) inaccessible. We've
already done the same change to qmlClearEnginePlugins().
Change-Id: I8fa40db5c3cd83f12e6d85d0efc3b9679dd4381e
Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
| |
It prevents the compilation unit held by QQmlScriptData from being
released on clearComponentCache(). The comment justifying the
QQmlCleanup has been wrong since we moved away from V8.
Task-number: QTBUG-89659
Pick-to: 5.15
Change-Id: I220561d90f707540e47c76d60a51468ee231ce9a
Reviewed-by: Lars Knoll <lars.knoll@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>
|
|
|
|
|
|
|
|
|
| |
Previously errors occurring when parsing QML singletons would just be ignored resulting in a crash.
The errors are now properly printed and the execution is aborted in time.
Fixes: QTBUG-85932
Change-Id: I61cef5f97546ce2e0753bc46c548838a21b1f506
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
| |
Aliases are seriously broken and need a larger overhaul.
This patch at least prevents the application from crashing.
Task-number: QTBUG-89822
Change-Id: Ib6acc5b6f621a902f7f5ce370043986486f3c0d0
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Q_MOVABLE_TYPE was conceived before C++ had move semantics. Now, with
move semantics, its name is misleading. Q_RELOCATABLE_TYPE was
introduced as a synonym to Q_MOVABLE_TYPE. Usage of Q_MOVABLE_TYPE
is discouraged now. This patch replaces all usages of Q_MOVABLE_TYPE
by Q_RELOCATABLE_TYPE in QtDeclarative. As the two are synonymous, this
patch should have no impact on users.
Task-number: QTBUG-86829
Change-Id: I5bb418483a3b06619abb4ff62cf0290a7b3bcd4f
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Assume an application which uses a QML singleton (so needs qmldir), and
wants to use declarative type registration. This currently breaks
because we find the qmldir, see that there is no plugin to load, and
thus never search for registration functions.
Requiring the creation of a plugin is rather pointless for an
application which doesn't reuse the QML types; so instead enable this
usecase to work. Note that qmldir + imperative registration did always
work, as the imperative registration code did always run.
Change-Id: Iac40020eb97d602d10eb8c4eecac5195ffeabe14
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
The information can be found in the metatype.
Task-number: QTBUG-88766
Change-Id: I6c460e3100057498b17d9ed74d2e85b609a6ab4c
Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|
|
|
|
|
|
|
|
|
|
| |
Use the information from the metatype instead.
Task-number: QTBUG-88765
Task-number: QTBUG-88766
Change-Id: Ie0a748861388e8c36f5f607ccd5aba4d6049b930
Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
All the necessary information is contained in the QVariant's metatype,
so we can use that. This removes the need to acquire the data pointer
lock. The method in QQmlEnginePrivate now simply forwards to
QQmlMetaType; in a later commit, all usages of the forwarding functions
from QQmlEnginePrivate will be replaced with the equivalents from
QQmlMetaType, so that they can be removed from QQmlEnginePrivate.
Task-number: QTBUG-88766
Change-Id: Iebcda9b18b4952fff2c7c1aeae210c677c6869b8
Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|
|
|
|
|
|
|
| |
Previously it would only disable loading of separate cache files.
Change-Id: Iae92fc03d2e5566ef7dc44a6730b788b7512fd3d
Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
| |
Fixes: QTBUG-87266
Change-Id: Iad8c7765b339c5498f541702bbf7df64164f5358
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|
|
|
|
|
|
|
|
|
|
| |
Also fixes typename and metatype registration for inline components.
Done-with: Fabian Kosmale <fabian.kosmale@qt.io>
Pick-to: 5.15
Fixes: QTBUG-89173
Change-Id: I97d65d5539b577a8828d5711e5f2e79c8568b441
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|