aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlvmemetaobject_p.h
Commit message (Collapse)AuthorAgeFilesLines
* Make property interceptors work on alias properties againLars Knoll2015-11-261-14/+42
| | | | | | | | | | | | | | | | | | | 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>
* Align QQmlVMEMetaData to int.BogDan Vatra2015-10-151-2/+1
| | | | | | Task-number: QTBUG-48139 Change-Id: I12bec1ec72a99de0c3f5b4b12d22fba2b66c8f49 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* CleanupsLars Knoll2015-09-251-2/+1
| | | | | | | 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-9/+2
| | | | | | | | | 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>
* Get rid of the aConnected bit array in the vmemoLars Knoll2015-09-251-1/+0
| | | | | | | | 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>
* Cleanups to property allocation in the VMEMOLars Knoll2015-09-251-2/+0
| | | | | | | | 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>
* Smaller cleanupsLars Knoll2015-09-251-2/+0
| | | | | Change-Id: I68f7ea476cb00a571908b7ec0a036f8517b091d5 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Cleanup code in the VMEMOLars Knoll2015-08-191-1/+1
| | | | | Change-Id: Idc1da41586161f1c824c608198e232ba52a0d9d7 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Switch to the non compat metacall overloadLars Knoll2015-08-191-1/+1
| | | | | | | | | 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-2/+4
| | | | | | | | | | | | 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>
* Remove special case for var propertiesFrank Meerkoetter2015-08-181-3/+2
| | | | | | | | 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>
* Use QV4::MemberData for property storageFrank Meerkoetter2015-08-181-0/+1
| | | | | | | | 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 array memberFrank Meerkoetter2015-08-181-1/+0
| | | | | | | All properties have been move into the varProperties JS array. Change-Id: Ib39a603d43ab5ef23aad3e6ccbdbc9b981c9da18 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Port QObject* away from QQmlVMEVariantFrank Meerkoetter2015-08-181-1/+3
| | | | | | | | | 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 QDate/QDateTime/QRectF away from QQmlVmeVariantFrank Meerkoetter2015-08-181-0/+6
| | | | | | | | | 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-0/+4
| | | | | | | | | 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-10/+2
| | | | | | | | | 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-0/+20
| | | | | | | | | | 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-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-1/+1
| | | | | | | | | | | | | | Found with GCC's -Wcast-qual. Change-Id: Ia0aac2f09e9245339951ffff13c958364a2e9859 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Get rid of qv4value_inl_p.h and replace it by qv4typedvalue_p.hLars Knoll2015-04-241-1/+1
|/ | | | | | | | This is a cleaner separation and further reduces include dependencies in the definitions of our basic data structured. Change-Id: I18aa86cdea0c0dfbc16075d4d617af97e638811e 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-1/+1
| | | | | 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>
* Changed value type property index encodingSimon Hausmann2014-12-101-5/+7
| | | | | | | | | | | | | | | | | | | | | | We used to encode property index and value type property index in one int with 16 bits each, for example font.pixelSize with index of "font" in the lower 16 bits and "pixelSize" in the upper 16 bits. Detecting if a given encoded index was using value types or not was based on whether the value type index (upper 16 bits) were non-zero. That assumption holds given that all valid property indicies of value types are > 0 because they are all sub-classes of QObject, which provides the first property (objectName). With the introduction of gadgets property index zero will become popular again, and value types are a core use-case for gadgets. Therefore we need to change the encoding to allow for zero to be a valid value type property index. This is implemented by centralizing all decoding call sites to call one function that indicates -1 as non-present value type core index return value. That way we can encode the index with an offset of 1. Change-Id: I266abf140211a4f7204b47b94d07c364f0a8f408 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Update license headers and add new licensesJani Heikkinen2014-08-251-19/+11
| | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 & LICENSE.GPLv2 - Removed LICENSE.GPL Change-Id: I84a565e2e0caa3b76bf291a7d188a57a4b00e1b0 Reviewed-by: Jani Heikkinen <jani.heikkinen@digia.com>
* Fix property caches out of sync with grouped properties that have a VME meta ↵Simon Hausmann2014-03-131-0/+3
| | | | | | | | | | | | | | | | | | | | | | object Because QQmlObjectCreator::populateInstance would take the property cache to install from the outside and also pass it as the cache to use for the VME meta object to install, it could happen that the wrong cache was installed - the one supplied by engine->cache(propType) instead of the cache created together with the VME meta-object at type compilation time. This patch ensures that they're always in sync and correct by removing the responsibility of the caller to supply the cache to use and install. Instead the function will always use the cache calculated at type compile time (and also use that when installing the VME meta object). Installation of the property cache on the declarative data of the instance is now done only at createInstance() time, which fortunately also simplifies the code. Change-Id: Ia722cd57bc48007aaf725f1f59daa2f21569e324 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Rename some filesLars Knoll2014-01-311-1/+1
| | | | | | | | | | | | Rename qv4value_def_p.h -> qv4value_p.h and qv4value_p.h to qv4value_inl_p.h. It makes more sense to have the class definition in the file that is named after the class and move the inline methods into a _inl file. Doing this now, as I expect we'll be needing a few more _inl files soon. Change-Id: Ib59e9380e9e976254c6b4369574157f39b1b5f51 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* fix whitespaceOswald Buddenhagen2014-01-221-1/+1
| | | | | | | remove trailing spaces and expand tabs Change-Id: Ieacb9d096b612c45d1a64700044c114d1f7522bc Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Refactor marking GC'ed objectsLars Knoll2013-11-051-1/+1
| | | | | | | | | | | Don't use recursive function calls anymore. Instead, push marked objects onto the JS stack, and then pop them off when their children are being marked. Should reduce stack memory usage, and improves performance by ~5%. Change-Id: I2d37d97579144fcba87ec8e9fd545dd220c01fbb Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Compile JS functions as part of the QQmlCompiler run in the loader threadSimon Hausmann2013-10-111-3/+3
| | | | | | | | ...instead of extracting the function body as a string and compiling it in the GUI thread. Change-Id: I3c3108f6e35464b5581a2d8b5799e7285858ce4d Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Remove most uses of Value from qml/qmlLars Knoll2013-09-301-2/+2
| | | | | Change-Id: I409a8505a9e01f86d777bc694d24516d1c8f0c4d Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Fix Persistent/WeakValue APILars Knoll2013-09-261-1/+1
| | | | | | | Don't use unprotected Values in the API anymore. Change-Id: I8851628227fca374de24701bc8ee0908b5ae3923 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Convert most remaining return values from Value to ReturnedValueLars Knoll2013-09-181-4/+4
| | | | | Change-Id: If8b0c3b91be50678693868c10fefc3678008834d Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Remove some unused code and forward declarationsLars Knoll2013-06-281-2/+0
| | | | | Change-Id: I2ab2818159c60b199cae4f7573ea47b01a178e7b Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Remove last traces of v8 API and v8 compatibility layerSimon Hausmann2013-06-121-2/+0
| | | | | | | | The debugger and profiler service remain as bigger parts that need to be ported properly to v4. Change-Id: I68e72d6db66fe497eb58ed60df417ffe4662d115 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Implement JS ownership policy for var and variant propertiesSimon Hausmann2013-05-241-5/+6
| | | | | | | | | | | | Instead of a GC callback, let's keep the lifecycle of the var properties and the QObject wrapped variants in sync with the lifecycle of the JS QObject wrapper, through a markObjects re-implementation. handleReferenceManagement test passes now, fixed a few incorrect gc() calls in there. Change-Id: I78e8ca700e41bba788b61d3816a77cfb3a7c5e58 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Get rid of some v8 based codeLars Knoll2013-05-241-6/+6
| | | | | Change-Id: Iee910dcc1d3148922d2f92055eb06cdb0b889502 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Remove the remaining traces of v8::persistentLars Knoll2013-05-081-1/+1
| | | | | Change-Id: Id542914c64558c1eba30a300cb10606fa499e594 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Move qqmlvmemetaobject over to use QV4::PersistentValueLars Knoll2013-05-081-1/+3
| | | | | Change-Id: Ifdf57d6cb266a7b63fec9f1f85bda8070c44036f Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Change some v8::Persistent to QV4::PersistentValueLars Knoll2013-05-071-2/+2
| | | | | Change-Id: I2c4e98cf7e778de9aafabdbd68e6682106343d12 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Update copyright year in Digia's license headersSergio Ahumada2013-01-101-1/+1
| | | | | | Change-Id: I6c3bd7bebe3d62d1cfd0fa6334544c9db8398c76 Reviewed-by: Akseli Salovaara <akseli.salovaara@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* We need to export QQmlVMEMetaObject to support the designerThomas Hartmann2012-10-121-1/+1
| | | | | | | | In the designer we need to access QQmlVMEMetaObject. Change-Id: I36627c6ce1c2c27bef8dd85374b65a542b00d1ef Reviewed-by: Aurindam Jana <aurindam.jana@digia.com> Reviewed-by: Christiaan Janssen <christiaan.janssen@digia.com>
* Fix a crash in QQmlPropertyCache::findPropertyJocelyn Turcotte2012-09-281-1/+1
| | | | | | | | | | | | | | | | | | | | | When the top type of a QML component is a C++ type registered with qmlRegisterExtendedType, its QObjectPrivate::metaObject is already a QQmlProxyMetaObject that gets chained as the parent of the QQmlVMEMetaObject of the component. When QQmlPropertyCache::findProperty iterates over the parents chain of a child item, our QQmlProxyMetaObject eventually gets static_casted to QQmlVMEMetaObject and causes a crash. This patch implements a poor man's dynamic_cast in QQmlVMEMetaObject::parentVMEMetaObject to fix the crash. Other casts of parent.asT1() are changed to use parentVMEMetaObject as well even though in those cases the static_cast is guaranteed by the context. Task-number: QTBUG-27334 Change-Id: I5982fc273ccf466960ce54974cff5662e6ab605a Reviewed-by: Matthew Vogt <mattvogt2@gmail.com> Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-231-24/+24
| | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: Ie7f5d49ed8235d7a7845ab68f99ad1c220e64d5c Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Restrict v8 property lookup to the execution contextMatthew Vogt2012-08-271-0/+17
| | | | | | | | | | | | | When resolving property names, only properties known to the current context of execution should be available. If a property name has been overriden by a component extension, code executing in the context of the base component should resolve the property name to the property available inside the base component or its bases. Task-number: QTBUG-24891 Change-Id: I9687cc28e108226d5a939627a901c8254344b598 Reviewed-by: Michael Brasser <michael.brasser@nokia.com> Reviewed-by: Martin Jones <martin.jones@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>
* Permit value types with metatype IDs >= QMetaType::UserMatthew Vogt2012-08-101-4/+5
| | | | | | | | | Remove the assumption that value types must be types defined by Qt, having metatype IDs below QMetaType::User. Task-number: QTBUG-26352 Change-Id: Ib5a56ff2e7892e82adf17a3a1e7517a0c9fe0534 Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
* Update var property to null on object deletionMatthew Vogt2012-07-201-2/+8
| | | | | | | | | When a var property contains a pointer to a QObject-derived instance, ensure that object deletion causes the property to be updated. Task-number: QTBUG-26542 Change-Id: I67a59ffd7f09063328d45dc84889add55a5428e4 Reviewed-by: Martin Jones <martin.jones@nokia.com>