| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We don't know in advance if a URL is part of the source code and should
be relative to the current element, or if it is part of the application
data and should not be touched.
[ChangeLog][QtQml][Important Behavior Changes] URLs are not resolved or
intercepted anymore when assigning them to a "url" property. Instead
they are resolved and possibly intercepted when used to access an actual
resource.
Fixes: QTBUG-76879
Change-Id: Iaa2385aff2c13aa71a12e57385d9afb5dc60a073
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
| |
Variable got renamed without updating the tracepoint.
Change-Id: Ide61d86c479491c3a6d4ad4acbcb54bec32a17d2
Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
|
|
|
|
|
|
|
|
| |
The latter has the advantage of allowing the use of a real type for the
tag, instead of the generic flag/flag2 boolean accessors.
Change-Id: Icc9e854ce4af3eb5808a4bed45aa22f377e223da
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
| |
Remove unnecessary shadowing of function from base class.
Change-Id: I46539be359ae794e357930ac6f2287f5d14331d6
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
We _can_ provide a default implementation for expressionIdentifier() -
it doesn't have to be located in QQmlBinding as it only uses fields from
QQmlJavaScriptExpression.
Change-Id: Ifcead72c4f3ed4597cde732afca466eba83f5e0d
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This class is not a private detail of QQmlContext. And it is incredibly
hard to see who owns what in there. Let's add some civilization ...
We enforce refcounting for QQmlContextData across the code base, with
two exceptions:
1. QQmlContextPrivate may or may not own its QQmlContextData.
2. We may request a QQmlContextData owned by its parent QQmlContextData.
For these two cases we keep flags in QQmlContextData and when the
respective field (m_parent or m_publicContext) is reset, we release()
once.
Furthermore, QQmlContextData and QQmlGuardedContextData are moved to
their own files, in order to de-spaghettify qqmlcontext_p.h and
qqmlcontext.cpp.
When the QQmlEngine is deleted, any QQmlComponents drop their object
creators now, in order to release any context data held by those.
Before, the context data would be deleted, but the object creators would
retain the dangling pointer.
[ChangeLog][QML][Important Behavior Changes] QQmlContext::baseUrl() does
what the documentation says now: It prefers explicitly set baseUrls over
compilation unit URLs. Only if no baseUrl is set, the CU's URL is
returned. It used to prefer the CU's URL.
Change-Id: Ieeb5dcb07b45d891526191321386d5443b8f5738
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Being careful, we can now save primitive values inline. We use the heap
pointer of QV4::Value as either QString* or QV4::Value* for complex
types. We cannot store persistent managed QV4::Value without the double
indirection as those need to be allocated in a special place.
The generic QVariant case is not supported anymore. The only place where
it was actually needed were the stream operators for QJSValue. Those
were fundamentally broken:
* A managed QJSValue saved and loaded from a stream was converted to a
QVariant-type QJSValue
* QVariant-type QJSValues were not callable, could not be objects or
arrays, or any of the special types.
* Cyclic references were forcibly broken when saving to a data stream.
In general the support for saving and loading of managed types to/from
a data stream was so abysmally bad that we don't lose much by dropping
it.
[ChangeLog][QML][Important Behavior Changes] When saving a QJSValue to a
QDataStream only primitive values or strings will be retained. Support
for objects and arrays was incomplete and unreliable already before. It
cannot work correctly as we don't necessarily have a JavaScript heap
when loading a QJSValue from a stream. Therefore, we don't have a proper
place to keep any managed values. Using QVariant to keep them instead is
a bad idea because QVariant cannot represent everything a QJSValue can
contain.
Fixes: QTBUG-75174
Change-Id: I75697670639bca8d4b1668763d7020c4cf871bda
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Users were asking for having the possibility to see where the translated
text will not fit in the reserved/available space.
This is more a preparation patch to get the right connectors to change the
visualization of findings or maybe log this to a file.
Task-number: QDS-1463
Change-Id: Ic0a7a930141d6eeb79964e51c0a165c69888cf5d
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|
|
|
|
|
|
|
|
|
|
| |
as type is going to be deprecated.
This change was done automatically with the help of clazy.
In addition, ColumnRoleMetadata was changed to take an int instead
of a QVariant::Type
Change-Id: Ibc02d7b52e7d931a56c19fdebc4788b5e6df2a39
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch aligns the trace points more with the existing coverage from
the Qt QML profiler. The following things can now be traced:
- file compilation time
- binding execution
- signal handling
Change-Id: I5b7f1a495f0556482ccd5c07474391b291742ef1
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|\
| |
| |
| | |
Change-Id: I6e69a235f50472b8f7ac19e133a3c071ea8c4d7a
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Also NaN values are casted to an integer which causes illegal
integer values.
Task-number: QTBUG-72442
Change-Id: I3ff3c8e4dc493600360448ea30d949c0017da8c3
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|/
|
|
|
| |
Change-Id: I8314f2a675211fba08b71e74eacc38076c82b1ed
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
|
| |
No one can read this mess.
Change-Id: Icec4f2afc466435c1ae5e4e80fa2c1b5baf7d087
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
|
|
| |
We need a CompilationUnit that only holds the data needed for
compilation and another one that is executable by the runtime.
Change-Id: I704d859ba028576a18460f5e3a59f210f64535d3
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
|
|
| |
Location::line is 20 bits, so assigning it to a 16 unsigned integer
truncates the number unnecessarily.
Change-Id: I50a7ec73d6a88505c7d41b5a2b7ceb726b9dd437
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Conflicts:
src/qml/compiler/qqmltypecompiler.cpp
src/qml/compiler/qv4bytecodehandler.cpp
src/qml/compiler/qv4codegen.cpp
src/qml/compiler/qv4compileddata_p.h
src/qml/compiler/qv4compiler.cpp
src/qml/compiler/qv4instr_moth.cpp
src/qml/compiler/qv4instr_moth_p.h
src/qml/jit/qv4baselinejit.cpp
src/qml/jit/qv4baselinejit_p.h
src/qml/jsruntime/qv4function.cpp
src/qml/jsruntime/qv4vme_moth.cpp
Change-Id: I8fb4d6f19677bcec0a4593b250f2eda5ae85e3d2
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
After enabling lookups in QML files, we can remove all the code that
tries to deal with (type) compile time detection of access to id objects
and properties of the scope/context object. This also allows removing
quite a bit of run-time code paths and even byte code instructions.
Task-number: QTBUG-69898
Change-Id: I7b26d7983393594a3ef56466d3e633f1822b76f4
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|\|
| |
| |
| |
| |
| |
| |
| | |
Conflicts:
.qmake.conf
tests/auto/quick/qquickpathview/tst_qquickpathview.cpp
Change-Id: Ic1f5e219a255d0613f7654368a5ce3eccb8f0ee9
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
For some bindings (qsTr) no actual javascript function exists and the
debug output causes a null pointer access.
Fixes: QTBUG-73009
Change-Id: I896fd2afd680dc5dee544a0c46ade6746f6727d8
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|/
|
|
|
|
|
|
|
| |
QMetaType exposes the type id it holds, so QQmlValueType do not have to
keep a duplicate.
Change-Id: I4491744b9f7c1e447cd21466f9d71b4007fdfa06
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
| |
Change-Id: I36f642e8db7f88698b25eed9e8a64ac2c5896b10
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
Store doubles in bindings in the constant table of the compilation unit
instead of each binding. This removes one of the two 8 byte members of
the value union and also allows for sharing of constants throughout a
.qml file.
Change-Id: I1d7daafdb7f24e34c14cd160d2dcb2c5aaac1c50
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
|
|
|
|
|
|
|
| |
This allows updating the constants table when the unit data is set /
changes and removes the tie to the engine.
Change-Id: Ice553650390589e30e18421c4e55422a55d0df89
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
After the initial enabling of a binding we can quickly determine if
there is a chance whether this binding will be re-evaluated again in the
future as a consequence of dependency changes (properties or
translations). If that is not the case, then we can save memory by
removing that binding again.
One implementation consequence of this change is that such constant
bindings used with the "when" property of states require a proper
reference count increase, which was previously implicit through the
binding association with the target object.
In tst_qqmlecmascript a test that verifies that we don't create run-time
bindings for assignments of literal "null" to QObject pointer properties
now also covers the more complex case where we don't know the property
at parse time. We still evaluate the binding once though and perform one
property assignment.
Similarly on the QtQuick Designer Support API test side a binding such
as
x: Math.max(0, 200)
will not create a persistent binding anymore and needs a tweak to
remain.
On a large scale application this optimization saved up to 5% of all
bindings on start-up (~9000 of ~180000). On Linux x86-64 one binding is
approximately 144 bytes, so the savings are in the range of ~1.2 MB of
heap, as well as reduced fragmentation.
Task-number: QTBUG-64541
Change-Id: Id3653008346fdf36611f5b4c4e82f5f78b5319aa
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We have a few places in the type loader where we do adventurous manual
reference counting, where getType() returns a raw pointer that has been
addref()'ed and then sometimes somehow we call release() later. Commit
0b394e30bba4f6bb7e6f7dbe5585a2e15aa0f21d is an example of where this can
easily go wrong. As a consequence and also in preparation for future
work on the type loader, this patch starts replacing the manual
reference counting there.
Changing the return type from QQmlTypeData *getType() to a
QQmlRefPointer<> itself is not sufficient though, as the implicit
operator T*() will still allow the caller to store the result as a raw
pointer. Therefore this patch removes the "unsafe" implicit extraction
operator.
As a result of that change, other types that are sometimes stored in
QQmlRefPointer are also affected and their usage needs to be adapted
to QQmlRefPointer usage or manual raw pointer extraction with .data().
Change-Id: I18fd40634047f13196a237f4e6766cbef3bfbea2
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Calling Qt.binding() on a bound function object is a valid use
case and used to work until Qt 5.8.
The problem was that we optimized the code in QQmlBinding and
QQmlJavascriptExpression to directly work on a QV4::Function,
so this wouldn't work anymore.
To fix this make sure recursive calls to Function.bind() are
unrolled (so that the BoundFunction's target is never a bound
function itself), then add the bound function as an optional
member to the QQmlBinding and use it's bound arguments if
present.
Task-number: QTBUG-61927
Change-Id: I472214ddd82fc2a1212efd9b769861fc43d2ddaf
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When an alias points to a child object which has not yet been
initialized, it's id won't have been registered yet, so setting up a
binding to it will result in a crash.
The fix is: when setting a binding target fails, and its target property
is an alias, queue them until all bindings have been set up, and try
again.
Task-number: QTBUG-57041
Change-Id: I4dc5a6d25c0a32fed9fd952c955e2006c76be45a
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Given two simple bindings in this order
property int firstVar: secondVar
property int secondVar: ...
then the binding expression for "secondVar" ends up being evaluated
twice at run-time. The first time happens when enabling the binding
expression for "firstVar", which results in the engine detecting that
there is a dependency onto another binding that has not been enabled
yet. This is when QQmlData::flushPendingBinding(Impl) enables the
expression for secondVar and does an initial evaluation. Afterwards the
QQmlObjectCreator continues enabling the next binding in ::finalize(),
which will end up evaluating secondVar a second time, unnecessarily.
We can detect this case inside setEnabled and only call update() if we
transition from disabled to enabled state. This should also cover the
case of bindings created and assigned dynamically through QtQuick
PropertyChanges / States, as those call setEnabled(false) before
removing the binding (to replace it with something else) and
setEnabled(true) when reverting the state (in
QQmlPropertyPrivate::setBinding).
Change-Id: I447432891eabff2c4393f5abfee1092992746fa0
Task-number: QTBUG-66945
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
From now on we prefer nullptr instead of 0 to clarify cases where
we are assigning or testing a pointer rather than a numeric zero.
Also, replaced cases where 0 was passed as Qt::KeyboardModifiers
with Qt::NoModifier (clang-tidy replaced them with nullptr, which
waas wrong, so it was just as well to make the tests more readable
rather than to revert those lines).
Change-Id: I4735d35e4d9f42db5216862ce091429eadc6e65d
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
|
|
| |
As QJSEngine's handle() method is internal, we can redefine it to return
a pointer to an ExecutionEngine. That makes many things easier.
Change-Id: Ie3df99e0bad5f00ad4fe73182896cd135fa82994
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
|\
| |
| |
| |
| |
| |
| |
| |
| | |
Conflicts:
.qmake.conf
src/qml/memory/qv4mm.cpp
src/qml/qml/qqmlbinding.cpp
Change-Id: I98e51ef5af12691196da5772a07d3d53d213efcc
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Commit 61887379b0c823953b61120532055fcbd881aadd introduced an
optimization to avoid lengthy JS evaluation for simple qsTr("constant
string") bindings. Unfortunately it missed the case that the binding is
_not_ to a QString "native" property, resulting in memory corruption:
property var str: qsTr("sometimes")
... where QQmlVMEMetaObject's metacall would expect the void *arg to be
a QVariant and the translation binding would "deliver" a QString
pointer.
[ChangeLog[Qt][Qml] Fix crash with simple qsTr() bindings on var
properties.
Change-Id: I8d35eecbf6697fb3e3ad184389deb81890b08e29
Task-number: QTBUG-65624
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
|\ \
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Conflicts:
src/qml/compiler/qv4codegen.cpp
src/qml/compiler/qv4compileddata.cpp
src/qml/compiler/qv4compileddata_p.h
src/qml/compiler/qv4isel_moth_p.h
src/qml/compiler/qv4ssa.cpp
src/qml/jit/qv4assembler_p.h
src/qml/jit/qv4isel_masm_p.h
src/qml/jit/qv4regalloc.cpp
src/qml/jsruntime/qv4engine.cpp
src/qml/jsruntime/qv4qmlcontext_p.h
src/qml/jsruntime/qv4regexp.cpp
src/qml/jsruntime/qv4regexp_p.h
src/qml/jsruntime/qv4regexpobject.cpp
src/qml/jsruntime/qv4runtime.cpp
src/qml/jsruntime/qv4vme_moth.cpp
src/qml/qml/v8/qqmlbuiltinfunctions.cpp
tests/auto/qml/qml.pro
tests/auto/qml/qmlplugindump/tst_qmlplugindump.cpp
tools/qmlcachegen/qmlcachegen.cpp
Change-Id: I1577e195c736f3414089036b957a01cb91a3ca23
|
| | |
| | |
| | |
| | |
| | | |
Change-Id: I4268b15226b9b597a4a2486a094701db17aa1440
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
| |/
| |
| |
| |
| | |
Change-Id: I176f91a8c51e81a2df3fe91733118261491223ee
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
|\|
| |
| |
| | |
Change-Id: Iff06429f948ac6cdec77a9e5bb8c5375c56fe705
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Adds a method `dependencies()` to QQmlBinding, that returns a
QVector<QQmlProperty> of all properties the binding depends on. The API is
meant to be used in debugging tools (e.g. in GammaRay).
Also adds a public method subBindings() to QQmlValueTypeProxyBinding in
order to be able to access their dependencies.
Change-Id: Ib833703ec9e632661626c4532b8d73997f38e62b
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
| |\
| | |
| | |
| | | |
Change-Id: I7d092cce33cb009d63e7b0df7c71183089dea53f
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
QQmlData is shared between engines, but the relevant QObjectWrapper is
not. Since 749a7212e903d8e8c6f256edb1836b9449cc7fe1 when a
QObjectWrapper is deleted it resets the shared QQmlData propertyCache.
In most cases the propertyCache except when a property updated in an
existing binding in the first engine, where it currently asserts.
Task-number: QTBUG-61681
Change-Id: I6efdc506e5c7e30b95cda1be282afa9feb781cd2
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
| |/
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Respond to the language change event by refreshing all binding
expressions. For constant string translation bindings we must now create
special QQmlBinding instances instead of a one-time property write
meta-call upon instantiation. Those however are more lightweight than an
entire JavaScript expression.
In addition this provides a slot to explicitly trigger a re-evaluation
of bindings, to make it a little easier to discover for the developer.
[ChangeLog][QtQml][QQmlEngine] Added retranslate() slot and
QEvent::LanguageChange support to refresh bindings when changing the
language at run-time.
Task-number: QTBUG-15602
Change-Id: Ide174648e1d8a5738acb88e15495018d0869d7bc
Reviewed-by: Michael Brasser <michael.brasser@live.com>
|
|/
|
|
|
|
|
|
| |
Change those back again to return a value. This will be required
to avoid creation of Scope objects between JS function calls.
Change-Id: I05cb5cf8fd0c13dcefa60d213ccd5983fab57ea3
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
|
|\
| |
| |
| |
| |
| |
| | |
Conflicts:
tools/qmlimportscanner/main.cpp
Change-Id: I01e17581f6691a03f83788773364d0cf96319514
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
We want the IDs to reflect the location and the type of event that is
happening. Thus all instances of a particular component should share
the same IDs for their bindings. Otherwise the aggregated views of the
QML profiler list the same locations again and again for each object.
Change-Id: I3f8a7531589b42f785e40c7c5b04b229f639d696
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|\|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Conflicts:
src/plugins/qmltooling/qmldbg_debugger/qv4debugjob.cpp
src/plugins/qmltooling/qmldbg_inspector/globalinspector.cpp
src/plugins/qmltooling/qmldbg_nativedebugger/qqmlnativedebugservice.cpp
src/qml/qml/qqmlimport.cpp
src/quick/items/context2d/qquickcontext2dtexture_p.h
tools/qmleasing/splineeditor.h
Change-Id: I8f6630fcac243824350986c8e9f4bd6483bf20b5
|
| |
| |
| |
| |
| |
| |
| |
| | |
Like this we can remove the QQmlBinding::create() overload
that takes a FunctionObject.
Change-Id: Ib6c37395ded325e68cf0fbf3afd08fb6dd6efa3b
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| | |
Instead, simply create a QmlContext, and setup the bindings with
the QV4::Function itself.
Change-Id: I9db93b15112e43a6d5e275d126fb20f9c8833e8f
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
| |
| |
| |
| |
| | |
Change-Id: Ia62d380945250015009d9c2b6ed65f6d830277ef
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
| |
| |
| |
| |
| | |
Change-Id: I070f73f106440667fce2c7fe33310369a6aa1376
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
| |
| |
| |
| |
| |
| |
| | |
This is what's in the Value in all cases anyway.
Change-Id: I212c4c4076050e8d0ea4cf6f72a1683e132cd51b
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|