aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlvmemetaobject.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Fix value changed logic for ValueTypeProvider typesFrank Meerkoetter2016-01-041-1/+1
| | | | | | | | | | | | | | | Fix broken value changed logic for types implemented through the ValueTypeProvider interface (QtQuick and Qt3d). It affects vector2d, vector3d, ... The signal was not emitted for the cases where the new value was equal to the default value of a given type. Also add a unit test to cover this area. Change-Id: I9491b0462c78fecc4c704ea36921611c1bd6b2ee Task-number: QTBUG-50204 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Make property interceptors work on alias properties againLars Knoll2015-11-261-95/+131
| | | | | | | | | | | | | | | | | | | Fixes a regression introduced by change 01c0c0963794f4dd8c3601e8340cc3dc4dec41bd, where interceptors wouldn't work correctly on alias properties. This required some refactoring and splitting out the interceptor handling from the VMEMO into it's own class, as we are now installing bindings directly on the target property of an alias and not on the alias anymore. We now resolve the target property inside the QML object creator and install a interceptor metaobject on the target if required where we can then register the interceptor. Change-Id: I3ebc8f492ce5dcab7acf901711b47336d5182ffa Task-number: QTBUG-49072 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* qqmlvmemetaobject.cpp: Fix conversion warning by MSVC2015/64.Friedemann Kleint2015-10-051-1/+1
| | | | | | | qml\qqmlvmemetaobject.cpp(620): warning C4312: 'reinterpret_cast': conversion from 'int' to 'quintptr *' of greater size Change-Id: Ic24caf32b82b06bce04f4d4917efdf303be68444 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* CleanupsLars Knoll2015-09-251-18/+3
| | | | | | | Remove some unused code Change-Id: I1d6612649cf279834f9ce92da60a85495389555e Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Get rid of the special handling of list properties in the vmemoLars Knoll2015-09-251-15/+31
| | | | | | | | | There's no need to store the list properties separate from other property data in the vmemo, simply wrap the list in a QVariant as we do with the other more complex types. Change-Id: I7c7946503cb603c401e11a367986c6923dffe68f Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* CleanupLars Knoll2015-09-251-13/+14
| | | | | | | | | Restructure code to make the flow more obvious and avoid executing code that is afterwards being ignored for list properties. Change-Id: I1b21562d48cec34ecb722f9012166926d55e4724 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Get rid of the aConnected bit array in the vmemoLars Knoll2015-09-251-14/+12
| | | | | | | | We can track the state just as easily by simply checking if the endpoints metaobject is already set. Change-Id: I5cea909b2525bf37d404f6d54ead2bdf9538cff4 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Properly refcount the property cacheLars Knoll2015-09-251-0/+4
| | | | | Change-Id: Ia37d4a5e64b653c9af614ed633c3c443190d015a Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Cleanups to property allocation in the VMEMOLars Knoll2015-09-251-29/+24
| | | | | | | | There's no need for a separate propertiesAllocated bool, we can keep that state in the WeakValue itself. Change-Id: Ife0f517bee9bc5830680eec68983767379a3c2cf Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Allocate QML defined properties without extra roomFrank Meerkoetter2015-09-051-1/+1
| | | | | | | | | | | | QV4::MemberData is used to allocate storage for QML defined properties. QV4::MemberData::reallocate() is multiplying each allocation by two as a growth strategy. This is a waste of memory for QML defined properties. This commits extends the QV4::MemberData with an additional method to allow exactly sized allocations. Change-Id: I5c0a3a5a3852d39af9e1afb512380fb1400d2448 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Cleanup code in the VMEMOLars Knoll2015-08-191-44/+41
| | | | | Change-Id: Idc1da41586161f1c824c608198e232ba52a0d9d7 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Hold a pointer to the QV4::ExecutionEngine in the property cacheLars Knoll2015-08-191-1/+0
| | | | | | | This makes more sense than a pointer to the QQmlEngine. Change-Id: Ic6037b0df63b6cf1585539bc3ac78822f0e69d02 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Switch to the non compat metacall overloadLars Knoll2015-08-191-1/+4
| | | | | | | | | This one passes in the qobject that the metacall is being applied to. The long term goal is to make the vme meta object independent of the QObject instance. Change-Id: Ide34b8637b9963bdb5e87e4aa6e9c2ee825293f7 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Get rid of special handling of var propertiesLars Knoll2015-08-181-58/+26
| | | | | | | | | | | | These can be handled in a simple way now by using a special propertyType value indicating that we have a var property. Also remove the additional write calls in the different readProperty implementations. If the stored data doesn't match, we can simply return the default value directly. Change-Id: I3823a971df24bd78f0acdc4c0042776277b3c55f Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Properly initialize the memberdata to undefinedLars Knoll2015-08-181-1/+4
| | | | | | | This avoids running into assertions in other places. Change-Id: Ia7f9dbdccdd6d3a338845754801e881d44efebb7 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Use the proper static ValueTypeProvider as intendedFrank Meerkoetter2015-08-181-1/+1
| | | | | | | | This was triggering an assertion while running the unit tests. Change-Id: I53a0216a6861a7ab7e3ec89a2b8bda0605b38aaa Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Remove special case for var propertiesFrank Meerkoetter2015-08-181-6/+5
| | | | | | | | In the new world order all the properties are QV4::Values. Therefore this special handling can be removed. Change-Id: Ia4d703256db7330936cd16a835d16d140adfe20e Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Allocate a JS wrapper if there are any propertiesFrank Meerkoetter2015-08-181-2/+2
| | | | | | | Properties are now stored as QV4::Values. Change-Id: I586ccacbeb3c131ff4af2e5913c484dc4f4b7462 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Use QV4::MemberData for property storageFrank Meerkoetter2015-08-181-194/+128
| | | | | | | | Unlike the Array type the QV4::MemberData can be sized exactly so no memory is wasted. Change-Id: Ia7b9b846a7b8017787324e5243ccf6233568d41c Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Update copyright notice.Frank Meerkoetter2015-08-181-0/+1
| | | | | | | Update the copyright notice on files containing larger changes from me. Change-Id: I46cb83161331ef2f49a6ec92c078d6dc8019081e Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Remove the QQmlVMEVariant implementationFrank Meerkoetter2015-08-181-363/+0
| | | | | | | This code is now obsolete. Change-Id: Id34e8663d0398286e8ce34db7d83c6957e779c30 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Remove the QQmlVMEVariant array memberFrank Meerkoetter2015-08-181-4/+1
| | | | | | | All properties have been move into the varProperties JS array. Change-Id: Ib39a603d43ab5ef23aad3e6ccbdbc9b981c9da18 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Adapt the ValueTypeProvider interface and port its typesFrank Meerkoetter2015-08-181-5/+30
| | | | | | | | | The ValueTypeProvider system allows non-QML modules to add new basic QML types. It needs to be changed when porting away from QQmlVmeVariant as underlying type of properties. Change-Id: I2b52d7e6f578647a39832896c28553404b9a679f Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Port QVariant away from QQmlVMEVariantFrank Meerkoetter2015-08-181-6/+23
| | | | | | | | QVariants are now stored as QV4::VariantObject inside a javascript array. Change-Id: Idcc65eed6845b561038e224d74e5efdf0c9e1c28 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Port QObject* away from QQmlVMEVariantFrank Meerkoetter2015-08-181-19/+51
| | | | | | | | | QObjects are now stored as QV4::QObjectWrapper in a javascript array. This is part of a series of patches slimming down the memory usage of QML properties. Change-Id: I270831d0f0f7bc17842cd2f8d2eb9661e09a3364 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Port list properties away from QQmlVmeVariantFrank Meerkoetter2015-08-181-2/+2
| | | | | | | | The index into the list of list properties (an int) is now also stored as a QV4::Value. Change-Id: I16809c5027ed3c4264aab6dfed8b4519adf83e2a Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Port QDate/QDateTime/QRectF away from QQmlVmeVariantFrank Meerkoetter2015-08-181-9/+90
| | | | | | | | | Store QDate/QDateTime/QRectF in a javascript array. The values are wrapped inside a QV4::Variant. This is part of a series sliming down the memory usage of properties. Change-Id: I1b5c4e24c1e46d19c5c861941655efb7a972a6a5 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Port QUrl/QSizeF away from QQmlVmeVariantFrank Meerkoetter2015-08-181-6/+61
| | | | | | | | | Store QUrl/QSizeF in a javascript array. The values are wrapped inside a QV4::Variant. This is part of a series sliming down the memory usage of properties. Change-Id: I62338fe7fe101496340a8d89f33030d0df5121b7 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Store all properties in one Javascript arrayFrank Meerkoetter2015-08-181-51/+26
| | | | | | | | | Store both "normal" properties and var properties in the same js array. The second array which is removed by this patch was scaffolding for the initial brinup. Change-Id: I24f72a1d880a54f68f5562e5077dbc26e7db864a Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Store int/bool/double/string and sizef as QV4::Value in a Javascript arrayFrank Meerkoetter2015-08-181-16/+169
| | | | | | | | | | This is the first patch in a series of patches removing the QQmlVMEVariant used for the storage of non-var properties. The overall goal is to reduce the memory usage of QML. The QQmlVMEVariant has a size of 8*sizeof(void*) + sizeof(int) which is quite an overhead for types such as int/bool or double. Change-Id: I301661d134724300942911a3d75258fe45356a7a Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Merge remote-tracking branch 'origin/5.5' into 5.6Ulf Hermann2015-08-181-2/+2
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/qml/debugger/qv4debugservice.cpp src/qml/jsruntime/qv4value_inl_p.h src/qml/jsruntime/qv4value_p.h src/qml/memory/qv4mm.cpp src/qml/memory/qv4mm_p.h src/qml/qml/qqmlnotifier_p.h src/qml/qml/qqmlproperty.cpp src/quick/items/qquickflickable.cpp src/quick/items/qquicktextedit.cpp tests/auto/quick/qquickwindow/BLACKLIST The extra changes in qqmlbinding.cpp are ported from changes to qqmlproperty.cpp that occurred in parallel with writeBinding() being moved to qqmlbinding.cpp. Change-Id: I16d1920abf448c29a01822256f52153651a56356
| * QtQml: Fix const correctness in old style castsThiago Macieira2015-07-091-2/+2
| | | | | | | | | | | | | | Found with GCC's -Wcast-qual. Change-Id: Ia0aac2f09e9245339951ffff13c958364a2e9859 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Remove unused codeFrank Meerkoetter2015-07-251-16/+0
| | | | | | | | | | | | | | The support for QJsValue wasn't used. Change-Id: I5394f449bb82275844b873a74cce3c9c6c91b121 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Remove unused codeFrank Meerkoetter2015-07-111-24/+0
| | | | | | | | | | | | | | These methods weren't used anywhere. Change-Id: I002bcead01fc5818846e5d3ccf06bd0adbed5f51 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Move setting the callback type for the endpoint to the constructorLars Knoll2015-06-181-1/+1
| | | | | | | | | | Change-Id: I1881fc3e79f93e3cfe01a201d60956c460c0d196 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Make bindings refcountedLars Knoll2015-06-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | Refcounting our bindings greatly simplifies our memory management of the objects and ensures we safely clean them all up. In addition, it allows us to remove the m_mePtr and weak reference handling from QQmlAbstractBinding as we can safely handle this through the same mechanism. Change-Id: If23ebc8be276096146952b0008b62018f5d57faf Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Add an assert and simplify the codeHolger Hans Peter Freyther2015-06-101-2/+3
| | | | | | | | | | | | | | | | | | | | QV4::QObjectWrapper::wrap will unconditionally dereference the engine. So simply assert that there is an engine. Fixes Coverity CID 10631. Change-Id: Ia645e32813b351abce1df06cfb63ef8ef956b9a6 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.5' into devSimon Hausmann2015-06-041-6/+7
|\| | | | | | | | | | | | | | | | | | | | | Conflicts: src/qml/jsruntime/qv4engine_p.h src/quick/items/qquickitemsmodule.cpp src/quick/items/qquicktext.cpp src/quick/util/qquickpixmapcache.cpp tests/auto/quick/qquickwindow/tst_qquickwindow.cpp Change-Id: I90ecaad6a4bfaa4f36149a7463f4d7141f4a516a
| * Fix memory corruption when sharing QObjects between different QML enginesSimon Hausmann2015-05-081-6/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When marking the JS wrappers for QObject manually, we cannot use ddata->jsWrapper directly but we must respect the case where the same object is exposed to different engines and then we must mark the wrapper that belongs to the engine that is currently collecting garbage. Change-Id: If82883c762ccaf3431e7074243ff2ff703234d66 Task-number: QTBUG-44895 Reviewed-by: Marco Martin <mart@kde.org> Reviewed-by: Jan Kundrát <jkt@kde.org> Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Aleix Pol Gonzalez <aleixpol@kde.org>
* | Simplify binding setup code furtherLars Knoll2015-04-271-4/+2
| | | | | | | | | | | | | | | | Reduce the number of setBinding/removeBinding overloads and simplify their internal handling. Change-Id: I87174a3b2dc0ecb8380e8fc28f8969fbf475c728 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Make removal of bindings explicitLars Knoll2015-04-251-1/+1
| | | | | | | | | | | | | | This simplifies the code for further refactoring. Change-Id: I6bcb5ce397f642242af80ce37dc8bba1fa9bf3f5 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | More cleanupsLars Knoll2015-04-211-1/+1
| | | | | | | | | | | | | | | | Get rid of Value::asObject(), and pass const Managed pointers into some more vtable methods. Change-Id: Ia4f427d5fd8868f77b4015d1ce5424d32bfc2115 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Reduce dependenciesLars Knoll2015-03-201-1/+1
|/ | | | | Change-Id: I4190c1a6d8a06a130e50cb727feafa7cf11f21cd Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Update copyright headersJani Heikkinen2015-02-121-7/+7
| | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Change-Id: I61120571787870c0ed17066afb31779b1e6e30e9 Reviewed-by: Iikka Eklund <iikka.eklund@theqtcompany.com>
* Remove all remaining usages of ValueRefLars Knoll2015-01-231-2/+2
| | | | | Change-Id: Icd76d3d03fac2e57530e55f8ec15b97109dcdcbc Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Get rid of most uses of ValueRefLars Knoll2015-01-231-2/+2
| | | | | | | | | | | | Instead pass a const Value & into the functions With our new inheritance structure, we can get rid of ValueRef and instead simply pass a pointer to a Value again. Pointers to Values are safe to use again now, as they are now guaranteed to be in a place where the GC knows about them. Change-Id: I44c606fde764db3993b8128fd6fb781d3a298e53 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Make sure we always have an engine when assigning to a PersistentLars Knoll2015-01-131-3/+3
| | | | | | | This prepares things for a rewrite of the internals of Persistent. Change-Id: Ib93ec5911984d1bfce87ffdc3f86bc75f6ecafe9 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Cleanup variant conversion codeLars Knoll2015-01-091-4/+4
| | | | | | | | Make public methods proper members of the ExecutionEngine, and move private methods into the .cpp file only. Change-Id: I3ca49e39bb1c4e559a2c63346e6ae6cfa446147d Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Move the variant conversion methods from qv8engine to qv4::ExecutionEngineLars Knoll2015-01-091-4/+4
| | | | | Change-Id: Ibd529ae5cc3ba06f46152e9daa9119a4e7a2561c Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Use QV4::ScopedFunctionObject typedef instead of actual typeOleg Shparber2015-01-021-1/+1
| | | | | Change-Id: I6b4effaa5bef992b4ae9402eea7fe655bc7b18f0 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>