aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlpropertycache_p.h
Commit message (Collapse)AuthorAgeFilesLines
* Smaller cleanupsLars Knoll2015-09-251-4/+2
| | | | | Change-Id: Ib75bf9de898975dcbb98b411a1e98524754c0788 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Remove some unused codeLars Knoll2015-09-251-7/+0
| | | | | Change-Id: Iaa89515891624602cf63701364c77e49ea1e1bd9 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Cleanup code in the VMEMOLars Knoll2015-08-191-0/+2
| | | | | 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-3/+3
| | | | | | | This makes more sense than a pointer to the QQmlEngine. Change-Id: Ic6037b0df63b6cf1585539bc3ac78822f0e69d02 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Reorder members to save some bytesLars Knoll2015-04-251-1/+1
| | | | | Change-Id: I075cd56695c8d7fe7e46be2a2c4a575ca53fadaf 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>
* The property() calls in the proeprty cache only require a QJSEngine nowLars Knoll2015-01-081-2/+2
| | | | | Change-Id: Ic4a944b4f1dd02ad2f0284acad5f3135068f66df Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Fix property access and method invocation on value types that use inheritanceSimon Hausmann2015-01-071-0/+4
| | | | | | | | | | For gadgets/value types we use moc's static_metacall, which doesn't call the parent class implementation. Therefore before placing a static metacall we must resolve the indicies and find the right meta-object. Change-Id: I258e3d9ecfc704498c68772dc42b16134a3bfd83 Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* Some minimal changes to make qmlpuppet compile againhjk2015-01-061-0/+2
| | | | | | | | | Access to QJSEnginePrivate::createCache and the previous signature of QQmlPropertyCache::invalidate is used. Change-Id: Ie2578eee33ee4ebb2cdc4574d8d1cb7c8209868e Reviewed-by: Simon Hausmann <simon.hausmann@digia.com> Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
* Make QQmlPropertyCache available in QJSEngineSimon Hausmann2014-12-291-5/+5
| | | | | | | | | The QQmlEngine has two containers for property caches, one for QML types and one for all-purpose meta-objects. The latter is rather useful and now being moved to QJSEngine to be available there. Change-Id: Ieab65c400b8a2e410e5f9eee6d603162dbb864d9 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Prepare for QQmlPropertyCache to become available in QJSEngineSimon Hausmann2014-12-291-14/+9
| | | | | | | | | The cache is seemingly tied to QQmlEngine, but it isn't. A lot of times a QQmlEngine parameter is unnecessarily dragged around and the engine member is option as well as it turns out. Change-Id: Iffd2a5046e9785249689ebfcbc8a0ad509f76aea Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Prepare method invocation in QObject bindings for gadget supportSimon Hausmann2014-12-231-1/+19
| | | | | | | | | | In order to support calling invokable methods in gadgets from JavaScript, the wrapper code needs to be able to operate on gadgets and not only QObject pointers. The minimal abstraction for that - QQmlGadgetOrObject - is passed through the relevant invocation methods in the wrapper for that. Change-Id: I94f939c942241f49dce4d32d05bf24822b2d331b Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Move methodParameterTypes and methodReturnType helper functionsSimon Hausmann2014-12-231-4/+4
| | | | | | | | | | | | | These can extract the type information from either a property cache (through QQmlData from a QObject) or (fallback) from a QMetaObject. The difference between a QMetaObject and a QQmlPropertyCache is what QQmlMetaObject abstracts and therefore we can move the functions there. This is in preparation for gadget support and also avoids the repeated QQmlData::get() dance but allows the re-use of a QQmlMetaObject instance in the future to do that dance only once. Change-Id: Ibff6ce498d09fabc97e0801653edc5b1ff446c6a Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Changed value type property index encodingSimon Hausmann2014-12-101-2/+8
| | | | | | | | | | | | | | | | | | | | | | 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>
* Make QQmlPropertyData::name constAlbert Astals Cid2014-03-031-2/+2
| | | | | Change-Id: Idfa52f625fd116b9fc858bb383a1ee17b3ff3e66 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Fix nasty bug in property cache leading to inaccessible signal parametersSimon Hausmann2014-02-031-1/+1
| | | | | | | | | | | | | | | | | | | | | The property cache among other things caches the parameter types and names of signals (instead of retrieving them from the meta-object each time). When this cache is created through createArgumentsObject(), the parameter names have to be provided, but the signature didn't enforce that because of the parameter names having a default value of an empty list. All call sites however provided the correct list, except for one in QQmlPropertyCache::methodParameterTypes. Consequently tst_qqmlecmascript::threadSignal() would fail occasionally because the first time this cache was "created" was when the "done" signal was emitted, which caused QQmlBoundSignalExpression::evaluate to call methodParameterTypes. If the signal data had not been cached so far, a new cache with an empty parameter name list was created. Later (in the second half of the test) a new signal handler was compiled and the property cache reported that the signal took no parameters. Change-Id: I19230d0fb1ddd54992f3d6251f82c489626662e7 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>
* [new compiler] Initial support for alias propertiesSimon Hausmann2013-09-201-0/+1
| | | | | | | | | 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>
* Fix error reporting timingSimon Hausmann2013-09-121-5/+2
| | | | | | | | | | | | | 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 error reporting for wrong signal parameter declarationsSimon Hausmann2013-09-081-2/+2
| | | | | | | | 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>
* Beginning of a new qml parserSimon Hausmann2013-09-081-0/+5
| | | | | | | | | | | | | | 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>
* Fix compilation with MSVC 2008 (and prospective Windows CE build fix)Simon Hausmann2013-08-221-1/+1
| | | | | | | | | | | | | | | | | * Only 2010 and newer ship stdint.h, so for 2008 we have to provide a little stdint.h compat header, for some of the third-party code we import. Our own Qt code this patch changes to use quint* types instead. * Include math.h and float.h for some math functions. * disable the JIT on Windows CE for now. * Change use of intptr_t to qintptr in Qt code. intptr_t is in inttypes.h, except that with VS 2008 it is indirectly available through stdio.h. Let's avoid the mess and just use the qt type, that's always available. Change-Id: I19055edd89e0a6b147d9edbb3b711798ed3c05a5 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Revert partially "Remove some unused code and forward declarations"Marco Bubke2013-07-181-0/+2
| | | | | | | | | The setParent function was used by the qml designer! This reverts commit 8cb3b016885a861fcd2af24e559e768eabecc3ae. Change-Id: Id6236f5f27d0bf997c5670f3431cfd43721f380b Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Fix regression in tst_qqmlecmascript::signalAssignmentSimon Hausmann2013-07-051-0/+2
| | | | | | | | | | Detect errors in the signal declaration already at compile time, re-introducing the earlier code in qqmlcompiler.cpp that checked that. This also means that the parameter string construction can be done once for each signal and not for each handler. Change-Id: Icf6242a793939466bbc44d43bf041281164ad1b6 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Get rid of the signal expression rewriterSimon Hausmann2013-07-031-1/+0
| | | | | | | | | | | | | This replaces the entire rewriter with more or less: expressionToEval = "(function(<named params here>) { " + expr + " } )" This also fixes crashes at run-time when the signal rewriter was executed from the loader thread and tried to use a v4 identifier hash with the same engine that's also in the main thread. Change-Id: Ib1e4927d330706a593411fbff64ed3da1e23d0e0 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Remove some unused code and forward declarationsLars Knoll2013-06-281-4/+0
| | | | | Change-Id: I2ab2818159c60b199cae4f7573ea47b01a178e7b Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Get rid of QHashedV4StringLars Knoll2013-06-281-1/+1
| | | | | | | | This was required while we were using V8, but now we can simply pass QV4::String pointers. Change-Id: If6338e4a455d6132fe14e5e603e4fe9e477d1ffb Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Merge branch 'dev' of ssh://codereview.qt-project.org/qt/qtdeclarative into ↵Simon Hausmann2013-06-241-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | wip/v4 Conflicts: src/imports/qtquick2/plugins.qmltypes src/qml/debugger/qv8debugservice.cpp src/qml/qml/qml.pri src/qml/qml/qqmlcompiler.cpp src/qml/qml/qqmlcomponent.cpp src/qml/qml/qqmlcontext.cpp src/qml/qml/qqmldata_p.h src/qml/qml/qqmlengine_p.h src/qml/qml/qqmljavascriptexpression.cpp src/qml/qml/qqmlxmlhttprequest.cpp src/qml/qml/v4/qv4bindings.cpp src/qml/qml/v4/qv4irbuilder.cpp src/qml/qml/v4/qv4jsonobject_p.h src/qml/qml/v8/qqmlbuiltinfunctions.cpp src/qml/qml/v8/qv8bindings.cpp src/qml/qml/v8/qv8contextwrapper.cpp src/qml/qml/v8/qv8listwrapper.cpp src/qml/qml/v8/qv8qobjectwrapper.cpp src/qml/qml/v8/qv8qobjectwrapper_p.h src/qml/qml/v8/qv8sequencewrapper_p_p.h src/qml/qml/v8/qv8typewrapper.cpp src/qml/qml/v8/qv8valuetypewrapper.cpp src/qml/types/qqmldelegatemodel.cpp src/quick/items/context2d/qquickcanvasitem.cpp src/quick/items/context2d/qquickcontext2d.cpp sync.profile tests/auto/qml/qjsengine/tst_qjsengine.cpp tests/benchmarks/qml/animation/animation.pro tools/qmlprofiler/qmlprofiler.pro Change-Id: I18a76b8a81d87523247fa03a44ca334b1a2360c9
| * Fix -Wpedantic warningsAlbert Astals Cid2013-06-071-1/+1
| | | | | | | | | | | | | | Don't need these extra ; and give warnings with -Wpedantic Change-Id: I877fee2a6421b151697ca3845a09d70f3b2b302b Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* | Replace QV8QObjectResource with QV4::QObjectWrapperSimon Hausmann2013-05-231-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use a proper sub-class instead of external object resources, as a first step towards porting the QObject bindings away from V8. This also replaces the function template / constructor approach and the faster getter optimization with a plain virtual get in the V4::Object. Property lookup in QObject bindings will be subject to future optimizations that will work very differently once we enable the faster V4 lookup mechanism in QML. Change-Id: Ib7c2eead5323c22290c2924de786d9cfcf308c03 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Cleanup: It's QQmlV4Function and so the flag should also be called ↵Simon Hausmann2013-05-221-2/+2
| | | | | | | | | | | | | | V4Function instead of V8Function Change-Id: I6d4d258e1fcad9097eb898f0b092f564cd4078ad Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Remove v8 dependencies in qhashedstringLars Knoll2013-05-221-1/+1
| | | | | | | | | | | | | | Also remove now unused API in v8::String Change-Id: I2570aedf407c89ad85da01cf0e2153a52b4e562d Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Get rid of v8::LocalLars Knoll2013-05-061-1/+1
| | | | | | | | | | | | | | | | | | The class was doing exactly the same thing as v8::Handle in our implementation. Removing it cleans up quite a bit of code. Change-Id: I37a3dcdef062fc388751e9ef0a158b5926ba2efb Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Convert QQmlPropertyCache to use QV4::persistentValue instead of the v8 versionLars Knoll2013-05-061-1/+3
| | | | | | | | | | | | | | | | The V4 persistent values are safer to use, as the v8 ones never implemented proper semantics when the engine gets deleted. Change-Id: I787f8c01c70828f22ac60f0ac25201cdfa5a617f Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Rename QQmlV8Handle to QQmlV4HandleLars Knoll2013-04-191-3/+3
|/ | | | | | | | | The handle wraps a V4 Value, so this is the better name for it. Also added some accessor methods to convert to and from V4 Values. Change-Id: I327c83feb5bd3be59909001489979e5a3a9d9e67 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>
* QQmlPropertyCache: adding setParent()Thomas Hartmann2012-11-051-0/+1
| | | | | | | | | | | setParent() enables to dynamically set the parent of a QQmlPropertyCache. This is used in the Qt Quick Designer to create dynamic properties on an arbitrary object. Change-Id: I0dafabcacf4222fc1bfe693736cbd23e1e928e8f Reviewed-by: Kai Koehne <kai.koehne@digia.com> Reviewed-by: Christiaan Janssen <christiaan.janssen@digia.com> Reviewed-by: Marco Bubke <marco.bubke@digia.com>
* Adding invalidate function to QQmlPropertyCacheThomas Hartmann2012-10-231-0/+1
| | | | | | | | This is required for tooling to update a QMetaObject inside a running QQmlEngine. Change-Id: I26d3aeed57d39c361c150261c4e1a84094e6f657 Reviewed-by: Christiaan Janssen <christiaan.janssen@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>
* Refactor QQmlPropertyCacheMethodArguments creation.Michael Brasser2012-08-281-0/+3
| | | | | Change-Id: Ic7215741b26ddf0a36181cf7c7daaff095e797da Reviewed-by: Matthew Vogt <matthew.vogt@nokia.com>
* Fix leak introduced in 0853343c33e394f35c31c161b019b2aed17f9256.Michael Brasser2012-08-281-1/+3
| | | | | Change-Id: I7e23f2ba8e7ecbcfaddce1ac4224434aa5fbe69b Reviewed-by: Matthew Vogt <matthew.vogt@nokia.com>
* Restrict v8 property lookup to the execution contextMatthew Vogt2012-08-271-15/+33
| | | | | | | | | | | | | 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>
* Avoid dynamic lookup of signal handler argumentsMichael Brasser2012-08-241-1/+7
| | | | | | | | | | | Rewrite signal handlers to include the parameters in the rewrite. Also check whether parameters are actually used when possible, and if not don't provide them to the expression. Change-Id: I7d65c05f4639979dd61035cf7478119ef7647c25 Reviewed-by: Matthew Vogt <matthew.vogt@nokia.com> Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
* Trim trailing whitespace.Stephen Kelly2012-08-221-4/+4
| | | | | Change-Id: I3d268d3ce8d73c7287f51abe9a28c165cb75acb9 Reviewed-by: Chris Adams <christopher.adams@nokia.com>
* Permit value types with metatype IDs >= QMetaType::UserMatthew Vogt2012-08-101-5/+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>
* Use V4 binding for non-final properties where possibleMatthew Vogt2012-07-091-21/+23
| | | | | | | | | When a property referenced in a binding is not marked as final, do not automatically abort optimization. Instead generate both V4 and V8 binidngs, and only fall back to the V8 binding if necessary at run time. Change-Id: I1bcc7e2b495935c5d519a9a223f640c1972cdb4e Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
* Support enum return types in Q_INVOKABLE functions.Matthew Vogt2012-06-221-0/+2
| | | | | | | | | Handle enums correctly when used as the return type of a Q_INVOKABLE function. Task-number: QTBUG-23543 Change-Id: I14a506ffee08f5ba6aa0fdf27d6104a3ae5c48b3 Reviewed-by: Chris Adams <christopher.adams@nokia.com>
* Adapt to connection-related changes in qtbaseKent Hansen2012-06-121-1/+5
| | | | | | | | | | | | | | | | | | | The QQmlData hooks signalEmitted() and receivers() now receive the index in the signal index range (i.e., excluding non-signal methods). This was done to avoid Q(Meta)Object having to compute the class's method offset; the signal offset should be sufficient for everyone. This required adapting QQmlNotifier, QQmlBoundSignal, QQmlPropertyCache and friends to use the signal index range whenever a property's notify signal is involved in the internal connection lists and property captures. Using the signal index range also reduces the memory used for NotifyList::notifies, since useless entries for non-signal methods will no longer be created. Change-Id: I62872fbea5a1f829b8b03bae3fc1e6acd84cf886 Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>