aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlobjectcreator_p.h
Commit message (Collapse)AuthorAgeFilesLines
...
* [new compiler] Fix for tst_qqmlconnectionsSimon Hausmann2014-03-021-2/+4
| | | | | | | | | | | | | Make sure to pass onFooChanged handlers to QQmlConnection's custom parser by not relying on the signal handler converter to set the IsSignalHandlerExpression flag. That should only be set for real signal handlers, the custom parser gets the raw bindings. Also don't try to initialize bindings at creation time the custom parser covers. Change-Id: Iae22bc886c312843136f073959e59da440f4184c Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* [new compiler] Fix QQmlPropertyMap testsSimon Hausmann2014-03-021-1/+1
| | | | | | | | | QQmlPropertyMap is treated as a type that cannot be cached with QQmlPropertyCache, doesn't allow for accelerated property access and also doesn't allow for declarations of any kind in sub-types. Change-Id: Id8a6811120aa61ffb5037394e758cc62501e0fc3 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* [new compiler] Fix qquickanimation test crashSimon Hausmann2014-03-021-1/+2
| | | | | | | | Share finalization callbacks across all sub-instances of ObjectCreator, by moving into into SharedState. Change-Id: Ibcd679caecd2009b4705d04c859b2fea4c2295fd Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* [new compiler] Match class and file nameSimon Hausmann2014-02-161-5/+5
| | | | | | | QmlObjectCreator -> QQmlObjectCreator Change-Id: I23da2d9c7fa0dcd760f5cc695c1759b44d1e72f0 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* [new compiler] Cleanup object creator membersSimon Hausmann2014-02-161-15/+21
| | | | | | | | Collect variables shared across recursive instances in a SharedData structure, get rid of some other members. Change-Id: I8d52fbb34820ce17d754b91c3fdee9e534a95753 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* [new compiler] Fix component attachment linking across sub object creatorsSimon Hausmann2014-02-071-1/+2
| | | | | | | This brings up the list view in the components gallery. Change-Id: Ib91ca3b30b8093acad0343b47be60cf4b51e4da7 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* [new compiler] Fix tst_qqmlincubator::deleteContextSimon Hausmann2014-02-071-0/+2
| | | | | | | | Protect against QQmlContext deletion during incubation re-using the existing QQmlContextGuard. Change-Id: Ia1c0241029765cc2e00a9b0ffcf484127de20606 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* [new compiler] Allow for interruption during object finalizationSimon Hausmann2014-02-071-1/+2
| | | | | | | | | The object tree construction and binding allocation remains synchronous, but the initial evaluation of the bindings is now cooperatively interruptible again, like in the VME. Change-Id: Idd037dd481782c81ad43e20e93d922eb12ac8b85 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* [new compiler] Fix parser status and created bindings allocationSimon Hausmann2014-02-071-7/+8
| | | | | | | | | | | | | | | Pre-calculate the amount of space we need for binding and parser status callbacks at compile time and therefore use a much simpler data structure (vector) to store the points to the bindings and callbacks. They need to be stored because during object construction and binding enabling phase, it may happen that they get destroyed and thus their m_mePtr pointing into the array gets deleted. The contiguous vector will also make it possible to interrupt the completion phase. Change-Id: Ic7c985bb8325ab355112e30e9d33d6ae4e7476d1 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* [new compiler] Fix propagation of imported scripts for anonymous componentsSimon Hausmann2014-02-051-1/+2
| | | | | | | | We must take the imported scripts from the creation context. Fixes various errors in Qt Quick Controls. Change-Id: I336d8ffa0537cefd4eeac15f98bbf1b0a5c784af Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* [new compiler] Set the rootObjectInCreation flag correctly on the root objectSimon Hausmann2014-02-041-1/+1
| | | | | Change-Id: Iaf96dabb1b3de81aae75953fd261dfc3b562169c Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* [new compiler] Fix refcounting leaks with property cachesSimon Hausmann2014-01-201-1/+1
| | | | | | | | | | | The TypeReference is not copy-safe, as it holds refcounted property cache pointers. For the new compiler code path, don't copy them but keep pointers to TypeReference objects around. Also make sure to ref the root property cache correctly and avoid the unnecessary addref for the property cache when creating new vme meta objects (initial refcount is 1). Change-Id: I0c4b952c8300c2167d926d9c35b8579fd505d596 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* [new compiler] Clean up property cache / meta object builderSimon Hausmann2014-01-171-2/+2
| | | | | | | | Move the outter loop into the builder class itself, use a vector instead of a list (we know that it's a fixed size and we only do indexed access) Change-Id: I933f0496ea47b3bc7c2bebde7f1a14b4f603b4c3 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* [new compiler] Fix scope, binding target and property object for bindings in ↵Simon Hausmann2014-01-141-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | group properties Resolve the confusion about _qobject and _qobjectForBindings, use _qobject for all property related bits and _qobjectForBindings is gone, in favor of _scopeObject. Usually they are the same, but in group properties for example, the _scopeObject remains the outter object but the _qobject becomes the object that's returned by the group property, i.e. anchors.fill: parent For that binding, the scope object is the outter object but the _qobject is the value of the anchors property. Then there's binding target, which is revelant for value type properties, where it remains the outter object. In theory one could nest a value type property in a regular group object, in which case _scopeObject would be outter most, _qobject would be the value type wrapper and _bindingTarget would be the group object. Change-Id: Ie3135d951910bf40ece192ab6260d7a9e6e9cdd6 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* [new compiler] CleanupsSimon Hausmann2014-01-101-71/+0
| | | | | | | | Move all compilation phase related sub-classes (property cache generator, component and alias resolver, etc.) together into qqmltypecompiler.cpp Change-Id: I598c801d9434623fc8e6338dec11e4d4ee6d7232 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* [new compiler] Add support for implicitly defined componentsSimon Hausmann2014-01-101-5/+9
| | | | | | | | | | | | | | | Use-cases like itemDelegate: Item { ... } implicitly define a component without the item-surrounding Component {}, base on the fact that the property itself is of type QQmlComponent (or derived). This means we have to synthesize a Component {} object and insert it into the data structure. Change-Id: I8992451a5a6732c7fd898eaf83c276dc6a8b7d19 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* [new compiler] CleanupsSimon Hausmann2014-01-101-32/+12
| | | | | | | | Tie QQmlCompilePass and QQmlTypeCompiler together, so that we can eliminate the battery of parameters to the individual compiler phases. Change-Id: If2b6cf8416e6c2253c8f054048d1fd5ae12282b6 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* [new compiler] Move component determination and alias resolvingSimon Hausmann2014-01-091-8/+15
| | | | | | | | | Move the code before the JS code generation, as we are going to need the component boundaries for the correct scoping. This requires the component and alias resolver to operate on the pre-compiled-data data structures. Change-Id: I8d2e697d8a05e5a4914db93e785704f6b2434a2e Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* [new compiler] Fix signal handlers for properties declared in the same objectSimon Hausmann2014-01-081-3/+5
| | | | | | | | | | | | We need to generate the property caches before we can try converting the signal handler expressions in the AST to function declarations, as that conversion requires looking up the signal signature / meta-data from the property cache. This in turn requires rewriting the property cache generator code to operate on the data structure we have before creating the QV4::CompiledData. Change-Id: I0d1c59d947f36171b4eb89f47a2e1ff1bc493c6f Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* [new compiler] Initial support for custom parsersSimon Hausmann2014-01-081-1/+3
| | | | | | | | Enough to support the Connections {} element. What's missing are pre-compiled bindings signal handlers. Change-Id: I3ad1413fa636434d899ae8fb380249aaf40363dc Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* [new compiler] Preliminary support for QQmlIncubatorSimon Hausmann2014-01-081-1/+2
| | | | | | | | Just enough to run some unit tests that use QQuickLoader, components are created instantly. Change-Id: I1c827aa946d3e2a60ccc220bb79572aca2ed8c96 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* [new compiler] Fix determination of id objects within component boundariesSimon Hausmann2014-01-061-3/+3
| | | | | | | | | | | Don't draw the boundaries at Component {} level but at the level of the element inside the Component, so that we can still get the id of the Component element itself within the surrounding scope. Also removed unused data structure. Change-Id: I29e086e92f0310a38ba0a71224329f7399b397b2 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* [new compiler] Add support for parser status callbacksSimon Hausmann2014-01-061-0/+2
| | | | | Change-Id: I62ce1fab2537d533d1d2052a7f5edc5061adf75e Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Fix error messages when assigning to non-existent properties in new compilerSimon Hausmann2013-09-301-0/+21
| | | | | | | | | Introduce a simple valdator pass early on to catch those assignments. Also fix storing the correct line/col for default property object bindings and remember the minor/major version of an import in the final type reference. Change-Id: Ib2a93dfe1a30fcd9c09b5443fb8199ad11b19769 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Fix component boundary detectionSimon Hausmann2013-09-251-0/+3
| | | | | | | | | | | For a component boundary, the type in question has to be an actual QQmlComponent. If it's a type that itself is derived from a component (type == 0 && component != 0 in typereference), then it is not a boundary. Fixes tst_qqmllanguage::componentCompositeType Change-Id: I938abe94c2fa4c69788176235ac74d0c6e385c0c Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Fix bindings on properties in grouped value type propertiesSimon Hausmann2013-09-251-1/+4
| | | | | | | | | | | | | ... such as point.x: { someExpression } This requires special handling to install the QQmlBinding not on the value type itself (not possible) but on the point property itself. Fixes tst_qqmllanguage::valueTypes Change-Id: I8f95379e1872dff7cdcc0480c229a5e68f3cf575 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* [new compiler] Initial support for alias propertiesSimon Hausmann2013-09-201-5/+14
| | | | | | | | | Aliases are resolved at "compile time", not rough JS expressions. This is done right after we determined the scope of components in the QML file, which is also where we collect object ids (that aliases use). Change-Id: If5702337f2cca08d17f196c3b2fde3bbdfea5b3c Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* [new compiler] Fix scope object for binding expressions in signal handlers ↵Simon Hausmann2013-09-201-1/+1
| | | | | | | | | | | of attached objects In populateInstance the QObject instance to populate with properties, etc. may not necessarily be the scope object (in qml lookup terms), so it needs to be provided as a separate parameter. Change-Id: I05db123c249e8582469bcfb76f56eb3f7bfbc4a2 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* [new compiler] Initial support for composite typesSimon Hausmann2013-09-201-1/+1
| | | | | Change-Id: I01030814a978d8a52a086b0389fe62af42a4bbba Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* [new compiler] Initial support for componentsSimon Hausmann2013-09-201-8/+30
| | | | | | | | | We use a dedicated pass through the objects in QV4::CompiledData::QmlUnit to determine which objects are QQmlComponents. We remember their object indices as well as to which component other objects belong to (if any). Change-Id: I97929c57e2ccb2fd380d612002d128359c4bc253 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* [new compiler] CleanupsSimon Hausmann2013-09-201-18/+17
| | | | | | | | Collect code for collecting errors and string access for different compile passes (vme creation, qobject creation) in a QQmlCompilePass base class. Change-Id: Ib2119e730ce7d3181599ba29da12273f041f2b70 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* [new compiler] CleanupsSimon Hausmann2013-09-201-3/+4
| | | | | | | | | Make the v4 context to use for binding expressions/functions/signal handlers a member variable instead of a function parameter, as it doesn't change frequently. Change-Id: I8a73bbc3f37c116d29172d5c935c66ecf2f67a38 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* [new compiler] Finish support for initializing list propertiesSimon Hausmann2013-09-201-0/+2
| | | | | | | | | | | | | | | | Setting a value on a list property is always just appending to the list instead of replacing it. Based on that, initializing list properties with multiple items is done with one binding per item to the same list property. So myList: [ Item{}, Item{} ] is mapped to myList: Item {} myList: Item {} Change-Id: Iadc048ab3a8d73ac824aa6b2ae5dec33731fa362 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* [new compiler] Implement setting object propertiesSimon Hausmann2013-09-201-1/+1
| | | | | | | | | This includes assigning to interface properties, variants that hold QObject pointers and regular QObject <> QObject assignments (assuming that they are compatible) Change-Id: Icd82c672e6899c6bfeb7f0ec758a81f8b70275ab Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* [new compiler] Fix timing of binding enablingSimon Hausmann2013-09-201-1/+4
| | | | | | | Enabling bindings right before emitting Component.onComplete Change-Id: I4cc330f5e59b326368c617f16a7d4fd51b6c50db Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* [new compiler] Implement remaining literal binding value assignmentsSimon Hausmann2013-09-201-2/+2
| | | | | | | | | Ported over the code from genLiteralAssignment and testLiteralAssignment to converting the AST type (string, bool, number) to the expected property meta-type. Change-Id: I709b97efdd741dbc4217ee0b9712de58dd32b82d Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* [new compiler] Add support for finalization callbacksSimon Hausmann2013-09-201-0/+5
| | | | | | | | | | | This is needed for Component.onCompleted (the signal emission) as well as the private finalization callback API in QQmlEngine, used by QtQuick. The creator - similar to the VME - tracks the attached properties object of QQmlComponent through a linked list. Change-Id: I8ada94009a7ce2078feefd359485657626c300fb Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* [new compiler] Fix function and binding expression setupSimon Hausmann2013-09-201-2/+2
| | | | | | | | | | | | | | | | | | Binding expressions and QML used to be set up so that they were written as function closure: (function(...) { expression here }) and then evaluated inside qml scope. With the new setup we do that closure setup manually now. For that we have to define a dummy outter "context scope" function in the codegen, that will later be used to look up the context ids. Change-Id: I0656419d67a1728451fcd46f402b03979f118b0b Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Cleanup: Fold CompiledData::Value into CompiledData::BindingSimon Hausmann2013-09-201-4/+0
| | | | | | | Value isn't needed anywhere else Change-Id: Ib12d85332a6096e6232a790a7e6fd63961329e3b Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* [new compiler] Add support for id propertiesSimon Hausmann2013-09-201-1/+3
| | | | | Change-Id: Idb4a0ad06f6cbe5d040da075a8f43d067a27ebc4 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* [new compiler] Initial support for group propertiesSimon Hausmann2013-09-201-0/+2
| | | | | | | | | | | | | | | | | | | This implements support for "font.pixelSize: 24" for example. The representation in the compile data structure is so that font.pixelSize is short-hand for font { pixelSize: 24 } which means that inside the braces is a complete object initializer. For that initializer we create a dedicated CompiledData::Object, which however has its type name empty. When populating the outer instance then, the "font" property is read as QQmlValueType (a QObject) and instead of creating a new QObject we use that value type as instance to run the rest of the QML object initializer (everything in braces). Change-Id: Ic0a37ac77ab88f582546b9c09a3d06a07726420b Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* [new compiler] Implement proper type resolutionSimon Hausmann2013-09-131-4/+6
| | | | | | | | | Collect all references to unknown types after parsing, re-use the existing code in QQmlTypeLoader to resolve them and finally use the resolved references map in the QQmlObjectCreator instead of the type name cache directly. Change-Id: I8b83af4f8852e79c33985457081c024358bb9622 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* [new compiler] Implement name sanity checking for properties, signals and ↵Simon Hausmann2013-09-121-1/+1
| | | | | | | functions Change-Id: I58c442dc56075c449ebd2534ab6b9f90e7da8eae Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Fix error reporting timingSimon Hausmann2013-09-121-20/+31
| | | | | | | | | | | | | Errors for example in signal declarations are usually reported in the loader thread, during property cache construction. This patch separates out the property cache population into QQmlPropertyCacheCreator, runs it from the loader thread and reduces the QQmlObjectCreator to merely set the properties/bindings/ functions on the object. This also enables location tracking for signal declarations and their error reporting. Change-Id: Ief1ffbb3113f8279a50d1a12dab8dbe096702a60 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Fix -Werror buildSimon Hausmann2013-09-111-1/+1
| | | | | Change-Id: Ib184ad5e0c99050df227e2c8413b466fccb69236 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Fix error reporting for wrong signal parameter declarationsSimon Hausmann2013-09-081-2/+8
| | | | | | | | Record the line/column in the signal and report it together with the url if there was an error in declaring the signals. Change-Id: Idbbee9be271b0ca55709ffc1791637595d7ebd89 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Fix error reporting in the new object creatorSimon Hausmann2013-09-081-2/+5
| | | | | | | | | | Propagate error conditions from createVMEMetaObjectAndPropertyCache to the caller and properly clean up refcounts (using QQmlRefPointer) Also fixed qmlscene to report errors if create() failed. Change-Id: I75d984798a197c102078e5d5638ed92f167ab49f Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Beginning of a new qml parserSimon Hausmann2013-09-081-0/+97
The goal is to parse QML and JavaScript binding expressions/functions in one go and generate data structures that allow for the parsing to happen in a thread and the instantiation of the object tree in another thread, just reading from the generated data structures. This will replace qqmlcompiler and the VME. This new way of loading QML is currently hidden behind the QML_NEW_COMPILER=1 environment variable. There's lots of work left to fill in the gaps in object construction, Component support, Component.onComplete, error messages, etc. etc. Change-Id: I5e40643cff169f469f0b6ce151584ffee5ca5e90 Reviewed-by: Lars Knoll <lars.knoll@digia.com>