aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/v4
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'stable' into devGunnar Sletta2013-01-1712-12/+12
|\ | | | | | | | | | | | | | | Conflicts: src/qml/doc/qtqml.qdocconf src/quick/doc/qtquick.qdocconf Change-Id: I087fa14720995a5e53c43567dc4a3c29eb9992a9
| * Update copyright year in Digia's license headersSergio Ahumada2013-01-1012-12/+12
| | | | | | | | | | | | Change-Id: I6c3bd7bebe3d62d1cfd0fa6334544c9db8398c76 Reviewed-by: Akseli Salovaara <akseli.salovaara@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* | Merge branch 'stable' into devFrederik Gladhorn2013-01-043-6/+0
|\| | | | | | | | | | | | | | | | | Conflicts: src/qml/qml/parser/qqmljskeywords_p.h sync.profile tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp Change-Id: I9bc6659e1bab924009167bec567354d40a77a8cb
| * Declare QJSValue as a metatype where it is defined.Stephen Kelly2012-12-043-6/+0
| | | | | | | | | | | | | | Instead of in multiple different TUs, therefore causing ODR violations. Change-Id: I08d3624d3ed5a995e96488361665afa197fb9fc9 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
* | Added parsing for getter/setter definitions in property assignments.Erik Verbruggen2012-12-172-2/+16
|/ | | | | | | Specified in ecma 5.1, 11.1.5. Change-Id: I93d12593534ed8a987922c8aa329124940e77c6f Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Fixed missing virtual destructors in qtdeclarative.Samuel Rødal2012-09-241-1/+1
| | | | | | Change-Id: I0b0e63b572617a56874e27361479de2690644aa3 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Windows CE buildfixAndreas Holzammer2012-09-241-0/+4
| | | | | | | | | Windows CE has a define for CONST, so undef it. Change-Id: I13d363657e91956c611dee4cf90cd17f6a0fa234 Reviewed-by: Thomas McGuire <thomas.mcguire@kdab.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-2312-288/+288
| | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: Ie7f5d49ed8235d7a7845ab68f99ad1c220e64d5c Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Evaluate bindings more intelligently during constructionAaron Kennedy2012-08-295-40/+59
| | | | | | | | | | | | | | | | | 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>
* Fix compiler warnings from MSVC2010Kai Koehne2012-08-281-0/+5
| | | | | Change-Id: I44eb0113374c221a166609c4fd29b5dad05ecc94 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* Reduce memory usage of QV4Bindings::Subscription by 8 bytes.Thomas McGuire2012-08-282-18/+50
| | | | | | | | | | There is no need to store the method, as it can be calculated via pointer arithmetic. That leaves the active flag, which now is the last bit of the bindings pointer. Change-Id: I17b443e63be2d950aa80ad15cc76372b415c3dd6 Reviewed-by: Matthew Vogt <matthew.vogt@nokia.com>
* Refactor singleton type registration codeChris Adams2012-08-287-38/+34
| | | | | | | | | | | Previously each singleton type was registered as an implicit separate import. This commit changes the code so that these types are treated just like any other type in the registration sense. It also ensures that singleton types are instantiated per-engine. Change-Id: I5c81c4ca5bf65210f7125d74a62a282a21838068 Reviewed-by: Matthew Vogt <matthew.vogt@nokia.com>
* Restrict v8 property lookup to the execution contextMatthew Vogt2012-08-272-7/+7
| | | | | | | | | | | | | 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>
* Fix warnings in QtQmlMatthew Vogt2012-08-241-1/+2
| | | | | Change-Id: Ibba3b8e878257f7019bdc90a1344462b77f95a21 Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Increase test coverage for V4Matthew Vogt2012-08-231-4/+26
| | | | | | | | Add test for integer operations, Math functions and exercise some previously uncovered code. Change-Id: Idff3f3672498775ac117ca98bf34b0fe96cbf760 Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
* Make connectNotify() work with QMLThomas McGuire2012-08-222-26/+59
| | | | | | | | | 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>
* Trim trailing whitespace.Stephen Kelly2012-08-222-44/+44
| | | | | Change-Id: I3d268d3ce8d73c7287f51abe9a28c165cb75acb9 Reviewed-by: Chris Adams <christopher.adams@nokia.com>
* Fix V4 calculations that vary from V8 resultsMatthew Vogt2012-08-222-8/+100
| | | | | | Task-number: QTBUG-24706 Change-Id: I4475a772c5cd92776f2cb73dab9bc06ae4c019fa Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Reduce memory consumption in QV4Bindings::BindingMatthew Vogt2012-08-172-56/+53
| | | | | | | | As with QV8Bindings::Binding, access details from the QML IR instruction object rather than storing a copy of the values. Change-Id: I2b629ee1b06ed74c7b38e6d047ef6a98acd45086 Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Reduce memory consumption of source coordinatesMatthew Vogt2012-08-168-47/+47
| | | | | | | | | | 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-102-23/+22
| | | | | | | | | 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>
* Add type name to singleton (module api) implementations.Glenn Watson2012-08-083-16/+16
| | | | | | | | | | | | | This change renames the previous module api implementation to singleton types. When a singleton type is registered, a type name must be provided that is used when accessing the API from QML. This makes the implementation more consistent with the rest of QML. Task-number: QTBUG-26549 Change-Id: Iab0bb1ccf516bd3ae20aee562a64d22976e0aecd Reviewed-by: Chris Adams <christopher.adams@nokia.com>
* Use V4 binding for non-final properties where possibleMatthew Vogt2012-07-097-42/+78
| | | | | | | | | 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>
* Consistent use of syntax in V4 Register classMatthew Vogt2012-06-271-16/+16
| | | | | | | | | Use the construction/destruction wrapper functions consistently. These are required for template types because the syntax to invoke the destructor directly confuses GCC. Change-Id: I4a6c9239972a96f84a601b4f4a8aeebfd75044a9 Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
* Decode directory separators in source URLsMatthew Vogt2012-06-251-2/+4
| | | | | | | | | URLs with encoded directory-separator characters are not correctly processed by QUrl. Task-number: QTBUG-25981 Change-Id: I78173ef44c4850774b56753335bea34db04c0735 Reviewed-by: Chris Adams <christopher.adams@nokia.com>
* Delay conversion of v8 exceptions to QQmlErrors.Michael Brasser2012-06-051-8/+5
| | | | | | | | | This conversion in relatively expensive, and not required for transient exceptions that occur during startup due to the order of binding evaluation. Change-Id: I29a16c075890c8966c0bad0a77412ad232c791bb Reviewed-by: Matthew Vogt <matthew.vogt@nokia.com>
* Store QQmlMetaObject in V4Aaron Kennedy2012-05-251-4/+4
| | | | | | | | | d2e557c2c2d7fcf3bf7c1676df3902e115986dc2 caused a regression where V4 would not handle bindings as the meta object wasn't correctly stored in the IR. Change-Id: Id0af2175c15db69de9108060ff4901d0003de67b Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
* Use static dispatch tables for QQmlAbstractBindingAaron Kennedy2012-05-242-31/+53
| | | | | | | | | This saves us the space of the virtual table pointer, but does somewhat limit us to the 4 QQmlAbstractBinding types that we have today. Change-Id: I03d06ef2ec0c51271c28e7a5aab6dc689d369da4 Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
* Reduce size of QQmlNotifierEndpointAaron Kennedy2012-05-242-5/+10
| | | | | Change-Id: I4d4a22f5f3d88d4ad2fcd738753fd8da2d8a9263 Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
* Lazily create QMetaObjectsAaron Kennedy2012-05-245-41/+49
| | | | | | | | | | For internal QML built types, creating a metaobject each time is just wasteful. Additionally, as the property caches were always created from the intermediate QMetaObject, it was difficult to pass information directly from the compiler to the property cache. Change-Id: I769526b0edaaf16a86883f3065b75618b94e4077 Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
* Enable binding to properties of type QJSValue.Andrew den Exter2012-05-248-1/+261
| | | | | | | | | This allows javascript objects of all types to be bound to properties declared in c++. Compared to a QVariant the primary benefit this offers is a type which functions and objects with functions can be bound to. Change-Id: Idb3313e7ff1d616ab12d44f616083c8296201f3a Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
* Simplify QVariant::convert and QVariant::canConvert calls.Jędrzej Nowacki2012-05-211-2/+2
| | | | | | | QVariant::Type casts are not necessary in Qt5. Change-Id: Ia2e7d8fa367a59c23bd06993db36d96a0a46a229 Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
* Allow the existence of a VME metaobject to be assertedMatthew Vogt2012-05-211-1/+2
| | | | | | | | | 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>
* Add QQmlEngine::trimComponentCache()Matthew Vogt2012-05-172-13/+5
| | | | | | | | | | | | 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>
* QtQuick: Fix string related warnings, single character strings.Friedemann Kleint2012-05-145-138/+138
| | | | | | | | | - Fix warnings about truncation from size_t to int (MSVC 2010, 64bit). - Remove single character strings. Change-Id: Iaf4406e4e04d55d2d8b762f3433269868842a6f9 Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
* Permit signals to be emitted in a different threadAaron Kennedy2012-05-112-5/+5
| | | | | | | | | | | | The QQmlNotifier approach to connecting to signals did not support the cross-thread signal/slot model used elsewhere in Qt. This change allows one specific case of that - emitting a signal in a different thread than the one the QObject lives - to work. Task-number: QTBUG-25647 Change-Id: Ia8fdaf4c7d7e2ccd7ff7657bb1d8e26277eb60aa Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
* Allow V4 bindings to be assigned to aliasesMichael Brasser2012-05-102-10/+25
| | | | | | | | V4 bindings must be able to be retargetted for them to be assignable to aliases. Change-Id: I4d3addd0fdc90b9bf472c781d316f7f406eaf1d7 Reviewed-by: Chris Adams <christopher.adams@nokia.com>
* Fix MSVC warning C4200 (zero-sized array in struct/union).Friedemann Kleint2012-05-081-0/+5
| | | | | | | | | Warning C4200: nonstandard extension used : zero-sized array in struct/union. Cannot generate copy-ctor or copy-assignment operator when UDT contains a zero-sized array. Change-Id: Icf23b367b88a4a4f9549cc714af2a30287027da8 Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
* QmlProfiler: storing binding typeChristiaan Janssen2012-05-041-1/+1
| | | | | Change-Id: If1f02e1e6f6ce6aba9874a63d01a08d57571f991 Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
* Ensure binding target has not been deletedMatthew Vogt2012-05-041-0/+4
| | | | | | | | | | | | 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 support for var properties in V4Matthew Vogt2012-04-246-13/+258
| | | | | | | | | | | | Support initialization of var properties in V4. Var properties, which can only be manipulated by V8, are constructed directly into the form in which they will be stored. Task-number: QTBUG-25022 Change-Id: I27c6af9f8a310e7baec91bef2593c8518ec1e462 Reviewed-by: Chris Adams <christopher.adams@nokia.com> Reviewed-by: Michael Brasser <michael.brasser@nokia.com> Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
* Support and use parameters in QQmlNotifierEndpoint.Michael Brasser2012-04-232-2/+2
| | | | | | | | | Allow QQmlNotifierEndpoint to support signals with parameters. Update QQmlBoundSignal to use this support. Change-Id: Ie2a245b39283b0b66d66bd2350e8bc85fe519bb5 Reviewed-by: Chris Adams <christopher.adams@nokia.com>
* Fix warnings about non-virtual destructorsTobias Hunger2012-04-201-1/+1
| | | | | Change-Id: Ief63ebe0ab3622b8858e23fdfb773c6b283a9c14 Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
* Use QUrl constructor directly.Michael Brasser2012-04-201-3/+1
| | | | | | | | | setEncodedUrl is deprecated, and no longer required as the new QUrl makes this behavior default. This is a partial revert of 3aa53b8bc383ebcdf8dc922b2670170ec012949f. Change-Id: I14f29cbe2a2e2cd9c41f7afc92b1cb66b53996bb Reviewed-by: Matthew Vogt <matthew.vogt@nokia.com>
* Merge remote-tracking branch 'origin/api_changes'Lars Knoll2012-04-171-17/+10
|\ | | | | | | Change-Id: I39905acde16ba6bb0ba39401cb73082a73dd9167
| * Merge remote-tracking branch 'origin/master' into api_changesLars Knoll2012-04-1111-501/+540
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/qml/debugger/qqmlprofilerservice_p.h src/qml/qml/qqmlboundsignal.cpp src/qml/qml/v4/qv4bindings.cpp src/quick/items/qquickshadereffect.cpp src/quick/particles/qquickcustomparticle.cpp src/quick/qtquick2.cpp Change-Id: Ia9c6517035ae912fa75e77473a452bd3383def56
| * \ Merge master into api_changesKent Hansen2012-03-271-10/+10
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/qml/debugger/qqmlenginedebugservice.cpp src/qml/debugger/qqmlprofilerservice_p.h src/qml/qml/qqmlboundsignal.cpp src/qml/qml/qqmlpropertycache.cpp src/quick/util/qquickimageprovider.cpp Change-Id: I0609aa5ed54c7769f1e2773a96a7cd43a69f133c
| * \ \ Merge master into api_changesKent Hansen2012-03-235-6/+35
| |\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/qml/qml/qqmlboundsignal.cpp src/qml/qml/qqmlpropertycache.cpp Change-Id: I5193a193fa301c0b518291645bf626a5fa07118f
| * | | | Migrate gui dependencies from QtQml to QtQuick.Matthew Vogt2012-03-201-15/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Ensure that users of declarative that have no need for functionality provided by the Qt Gui module do not have to link against it. Any use of QtGui functionality is delegated to providers that can be installed by another library; QtQuick adds default providers for this functionality when linked against QtQml. Task-number: QTBUG-24559 Change-Id: I5e6a58a4198732dc2f8f52f71abfa1152b871aa7 Reviewed-by: Martin Jones <martin.jones@nokia.com>
* | | | | Add support for variant properties in V4Matthew Vogt2012-04-167-4/+193
| |_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Support initialization of variant properties in V4. Variants can be set to contain basic types in V4, but we can't extract data from them since they may contain data types that V4 does not comprehend. Task-number: QTBUG-25022 Change-Id: I1935d77b50c5a3481c4c8ddd86b9d3d970571217 Reviewed-by: Michael Brasser <michael.brasser@nokia.com> Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>