aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmldata_p.h
Commit message (Collapse)AuthorAgeFilesLines
* Evaluate bindings more intelligently during constructionAaron Kennedy2012-08-291-1/+35
| | | | | | | | | | | | | | | | | Instead of just evaluating bindings in a fixed order, and possibly having to evaluate a single binding multiple times, prior to reading a property, we check if there are any bindings "pending" on it and evaluate them then. A pending binding is one that has been assigned to the property, but not yet evaluated. To minimize side effects we only do this for "safe" bindings. A safe binding is one that has no side effects, which we currently define as not calling functions or otherwise assigning values during its evaluation. This isn't an entirely foolproof way to ensure that the evaluation has no side effects, but it should be good enough. Change-Id: I98aa76a95719e5d182e8941738d64f8d409f404a Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
* Make connectNotify() work with QMLThomas McGuire2012-08-221-0/+1
| | | | | | | | | Call connectNotify() and disconnectNotify() in QQmlNotifierEndPoint, which works for QML signal handlers and for QML bindings. Task-number: QTBUG-11284 Change-Id: Ic9a08ee6687e5c7e606f315c8fb30eec1493cd83 Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
* Reduce memory consumption of source coordinatesMatthew Vogt2012-08-161-2/+2
| | | | | | | | | | Reduce memory consumption by storing source location coordinates as 16-bit variables (in run-time structures). Also modify qmlmin to restrict line lengths so that the column bound is not normally exceeded. Change-Id: I08605626ffbdf081b6da2aea1116bdfe24998572 Reviewed-by: Yann Bodson <yann.bodson@nokia.com>
* Implement QAbstractDeclarativeData::isSignalConnected hookKent Hansen2012-06-271-0/+2
| | | | | | | | | | QQml_isSignalConnected is no longer needed, since QObjectPrivate::isSignalConnected will now call the declarativeData hook. Change-Id: I0685b0fa909d6c6c2d275bfa8d41100d9926a046 Reviewed-by: Michael Brasser <michael.brasser@nokia.com> Reviewed-by: Chris Adams <christopher.adams@nokia.com>
* Disallow parent changes for QML created objectsAaron Kennedy2012-06-061-2/+3
| | | | | | | | | Currently this is protected with a QML_PARENT_TEST environment variable to allow the rest of QtQuick to be updated before it is enforced. Change-Id: I4dd3644cbbce91d67f24c9556637f97eafb00638 Reviewed-by: Kent Hansen <kent.hansen@nokia.com> Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
* Allow the existence of a VME metaobject to be assertedMatthew Vogt2012-05-211-2/+4
| | | | | | | | | Test for the existence of a VME metaobject. Otherwise, assertion of a static cast result is not meaningful. Change-Id: Ic9e9c38e5dce65c41d20e405c33e179334c37b00 Reviewed-by: Michael Brasser <michael.brasser@nokia.com> Reviewed-by: Chris Adams <christopher.adams@nokia.com>
* Remove unnecessary exportsMatthew Vogt2012-05-181-1/+1
| | | | | | | | | Reduce library load time by removing any exports which are not required by existing clients. Task-number: QTBUG-24768 Change-Id: Ia5754d6f97bb2ed46e290820a5b092f85a4bc5b0 Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Add QQmlEngine::trimComponentCache()Matthew Vogt2012-05-171-2/+2
| | | | | | | | | | | | Allow unused data in the engine's component cache to be safely discarded so that the memory can be freed for other purposes. Unloading of scripts that are no longer required after trimming unused components is not yet supported. Task-number: QTBUG-25653 Change-Id: I37bc9d5592eeb5edceeb34d010a555dcffd11cea Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
* Fix edge case in signal emission semanticsChris Adams2012-05-091-12/+1
| | | | | | | | | | | | | | Signal emission triggered by property changes during an onDestruction handler was previously not well tested. This commit adds several unit tests to ensure correct behaviour in that situation. Those unit tests showed a problem in signal emission related to when children objects are cleaned up. This commit also ensures that if such children own their own context, their onDestruction handlers are called prior to marking the child as deleted. Change-Id: Ibf84ae56ba1134e5d6402b742aee1bdc0e5e4e15 Reviewed-by: Matthew Vogt <matthew.vogt@nokia.com>
* Better checking top level root object creation statusCharles Yin2012-05-091-4/+4
| | | | | | | | Add QQmlContextData::isRootObjectInCreation flag, only set it to true in Init qml instruction, once a root ojbect created, set it to false and set QQmlData::rootObjectInCreation to true. Change-Id: Iba7b348ab664a472280d8d7283e93787b3dd0a56 Reviewed-by: Chris Adams <christopher.adams@nokia.com>
* Remove QQmlData::objectNameChanged callback.Michael Brasser2012-05-091-5/+1
| | | | | | | | | The objectName property now has a proper NOTIFY signal. Also remove the objectName accessor, as it is no longer required. Task-number: QTBUG-23526 Change-Id: Ib18ba7335bf62a2fe2a9e489cb4c0f1fb142d74c Reviewed-by: Chris Adams <christopher.adams@nokia.com>
* Ensure binding target has not been deletedMatthew Vogt2012-05-041-1/+16
| | | | | | | | | | | | Prevent the evaluation of bindings if the target has been deleted. Also, mark an item as queued for deletion at the beginning of the destructor call chain, so that bindings triggered by the operation of the destructor itself are not evaluated (after the context is destructed, if necessary). Task-number: QTBUG-25516 Change-Id: I587ef7923eb749eb7980156ad73822c1fb7c1ff3 Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
* Add a static flag to avoid unnecessary QQmlData::init() callsCharles Yin2012-05-031-5/+10
| | | | | Change-Id: I0b38753bfaf2d1e22ab67977001b946a686b0f56 Reviewed-by: Matthew Vogt <matthew.vogt@nokia.com>
* Remove init() call from QQmlData's ctor.Charles Yin2012-05-011-1/+0
| | | | | | | | This static method only needs to be called once and is already called in QQmlEnginePrivate::init() method. Change-Id: If2ea46ed06dca068164116b3f0b04cc404a18fb5 Reviewed-by: Matthew Vogt <matthew.vogt@nokia.com>
* Prevent object being delete by GC before object is fully createdCharles Yin2012-05-011-2/+7
| | | | | | | | | | Add a new flag inCreation to QQmlData. Set it to true when a top-level object begins creation, and back to false when initial creation is finished and the object has been marked indestructible. In the GC callback function, if inCreation is true, skip the GC and make a weak reference for next GC loop. Change-Id: I4ec82864c52f6be0c3e6ef892474dd77d835e152 Reviewed-by: Michael Brasser <michael.brasser@nokia.com> Reviewed-by: Chris Adams <christopher.adams@nokia.com>
* Also check notifier endpoints when checking whether a signal is connected.Michael Brasser2012-04-231-0/+1
| | | | | | | This is required for the QQmlBoundSignal optimizations. Change-Id: I63540b96cd7d4523ec49973a2540054c83d82b12 Reviewed-by: Chris Adams <christopher.adams@nokia.com>
* Provide receivers count from QQmlData.Michael Brasser2012-04-201-0/+3
| | | | | | Change-Id: I70b06507158797df3083dc23a119935497aa19f4 Reviewed-by: Kent Hansen <kent.hansen@nokia.com> Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
* Don't crash if calling a method on a QObject that has been gc()'dAaron Kennedy2012-04-031-0/+14
| | | | | | | | | | As we don't actually delete an object immediately when it is collected, it is possible to get into a situation where a method is called on an object after the collector has marked it to be destroyed. This fixes a crash in this case. Change-Id: I131d4c5d7ed788a91aa52f6af2e5c089d9bf5e08 Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
* Remove QObject parenting from QQmlAbstractBoundSignal.Michael Brasser2012-03-261-1/+3
| | | | | Change-Id: If549cf57bbac18a986a2a0e63fdc76902d2dae43 Reviewed-by: Chris Adams <christopher.adams@nokia.com>
* Fix crash caused by dereferencing collected v8 dataChris Adams2012-03-151-3/+4
| | | | | | | | | | | | | | | | | | If a var property of a QObject is read after the v8 data associated with the qobject has been deleted but prior to the DeferredDelete event being processed, the varProperties array will be null and a crash will occur. This patch ensures that we check for this condition in both the access and set codepaths for var properties, and also ensures that an object which has previously been queued for deletion cannot be referenced in JS. Finally, it adds a unit test to ensure that we don't regress. Task-number: QTBUG-24748 Change-Id: Idde384ca01e18f4dcf9e376e9379f2c5eb410e14 Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
* Rename QDeclarative symbols to QQuick and QQmlMatthew Vogt2012-02-241-0/+207
Symbols beginning with QDeclarative are already exported by the quick1 module. Users can apply the bin/rename-qtdeclarative-symbols.sh script to modify client code using the previous names of the renamed symbols. Task-number: QTBUG-23737 Change-Id: Ifaa482663767634931e8711a8e9bf6e404859e66 Reviewed-by: Martin Jones <martin.jones@nokia.com>