aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlcompiler.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
| * Add a URL interceptor to the QML engineAlan Alpert2013-05-071-0/+5
| | | | | | | | | | | | | | | | Allows for custom file handling to a greater extent than the QNetworkAccessManager. Change-Id: Ifd3946bf33530c40ca2edeeb9f441f712e4941f6 Reviewed-by: Matthew Vogt <matthew.vogt@qinetic.com.au>
* | Remove the remaining dependencies onto the binding rewriterLars Knoll2013-05-241-26/+7
| | | | | | | | | | | | | | | | Remove the remaining places that were rewriting bindings. Remove the binding rewriter class. Change-Id: Ib1e9121dc10f4526ddb7cf0ae32fecd8ce2d4993 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Remove QV8Bindings classLars Knoll2013-05-241-144/+4
| | | | | | | | | | | | | | | | | | This class tries to optimise binding compilation with v8. With the approach in v4 where we don't rewrite binding expressions anymore, this is not required anymore. Change-Id: I616aeeba85bc17a950d4c7341b3042ed8aa42bff Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Remove all references to the old v4 codeLars Knoll2013-05-231-78/+4
| | | | | | | | | | | | | | | | The old v4 files have already been removed, so cleanup all the #ifdef'ed code that still references them. Change-Id: Ifc5c59add5af36a61586a43b13291d7836cccd78 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Disable the old v4 engine by defaultLars Knoll2013-04-201-2/+15
|/ | | | | | | | Left the code in there, as a reference for how we might want to build up binding evaluation in the new v4. Change-Id: I5c81ea986d642b524fb02087d819b39c4e3fb257 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Stabilize CodeAlan Alpert2013-04-021-1/+1
| | | | | | | | | Apparently it is no longer necessary to rely on undefined compiler behavior. Change-Id: I8e93dc0de663713c714d7894f4c66acb0aec30b4 Reviewed-by: Matthew Vogt <matthew.vogt@qinetic.com.au> Reviewed-by: Alan Alpert <aalpert@blackberry.com>
* Add Composite Types to QQmlTypeAlan Alpert2013-02-181-23/+24
| | | | | | | | | When a composite type is loaded from a QML file, it now generates a QQmlType entry in QQmlMetaTypeData. Change-Id: I9b127dff7955456aacb25138fa6ea8efb7bb9221 Reviewed-by: Christopher Adams <chris.adams@jollamobile.com> Reviewed-by: Alan Alpert <aalpert@rim.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>
* Declare QJSValue as a metatype where it is defined.Stephen Kelly2012-12-041-1/+0
| | | | | | | Instead of in multiple different TUs, therefore causing ODR violations. Change-Id: I08d3624d3ed5a995e96488361665afa197fb9fc9 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
* Enable mobule build with QT_NO_TRANSLATIONTasuku Suzuki2012-11-261-1/+4
| | | | | | Change-Id: Id7aeef0d499f48ddc64b4ea3e4dc713db8458c38 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Alan Alpert (RIM) <aalpert@rim.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>
* Evaluate bindings more intelligently during constructionAaron Kennedy2012-08-291-1/+4
| | | | | | | | | | | | | | | | | 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>
* Refactor singleton type registration codeChris Adams2012-08-281-1/+1
| | | | | | | | | | | 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-271-3/+3
| | | | | | | | | | | | | 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/+19
| | | | | | | | | | | 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>
* Fix signal offset in dynamic sig param lookupChris Adams2012-08-221-3/+2
| | | | | | | Related to 4317c442fd492121e2fc037a39b40653bbc34294 Change-Id: I6aa505b9dc13813d4996c0b5761e9c3e5eea0292 Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
* Reduce memory consumption in QV4Bindings::BindingMatthew Vogt2012-08-171-5/+0
| | | | | | | | 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>
* Fix crash in signal change notification overrideChris Adams2012-08-161-7/+45
| | | | | | | | | | | | | | | Manual overrides of automatically generated property change notification signals can cause crashes. They also don't work properly in the situations where they don't crash. This patch ensures that it is now a compile error to attempt to override a signal with a manual signal or slot. Note that this includes signals defined in superclasses. Task-number: QTBUG-26723 Task-number: QTBUG-26818 Change-Id: I4ecf448ce9de5d97526606126991e280debea2d6 Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
* Permit value types with metatype IDs >= QMetaType::UserMatthew Vogt2012-08-101-17/+16
| | | | | | | | | 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>
* Allow signal parameters which are custom QML object-typesChris Adams2012-08-081-3/+27
| | | | | | | | | | | This commit allows lazy resolution of signal parameter types, which allows QML object types to be used as signal parameters. If a signal is emitted with an incorrect parameter type, it will be passed through as a null parameter. Task-number: QTBUG-14550 Change-Id: I7e899ad57452826cc405bed10c541f8d35789d04 Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Make QQmlScriptString opaque.Michael Brasser2012-08-031-0/+3
| | | | | | | | Allow for future optimization by encapsulating the raw script data. Change-Id: I1863103e8e6d74ede60593cabb240e16f2ae657e Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
* Fix broken value-type support by allowing property definitionChris Adams2012-07-111-0/+8
| | | | | | | | | | | | | | | | | | | | | In QtQuick 1.x the "variant" property type was supported, which could be used to allow value type properties to be defined in QML. In QtQuick 2.0, we have deprecated the "variant" property, but its replacement ("var") is not suited for defining lightweight C++ type values (such as QColor, QFont, QRectF, QVector3D etc). This commit allows those QML basic types to be used in QML once more, by supporting them in the property definition syntax. Note that since some value types are provided by QtQuick and others are provided by QtQml, if a client imports only QtQml they can define but not use properties of certain types (eg, font). Task-number: QTBUG-21034 Task-number: QTBUG-18217 Change-Id: Ia951a8522f223408d27293bb96c276281a710277 Reviewed-by: Matthew Vogt <matthew.vogt@nokia.com>
* Use V4 binding for non-final properties where possibleMatthew Vogt2012-07-091-7/+34
| | | | | | | | | 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>
* Make Behaviors work correctly with value types.Glenn Watson2012-07-041-5/+30
| | | | | | | | | | | | | | When a value type is referenced by sub-component a grouped property is built. This code path did not handle behaviors being declared on the entire value type. Add support for value interceptors in this code path. Also issue an additional write to the value type property before calling the interceptor on components that are not being intercepted, so that the other sub-components don't get stale values during write back. Task-number: QTBUG-22625 Change-Id: I3365f422dfa1ab2e536e19575efcceceffb85e10 Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
* Add enum values from related typesMatthew Vogt2012-06-271-13/+15
| | | | | | | | | | If moc marks a type as being related to another type (by using that type's enums or properties), then include the enum values exported by the related type in those exposed by the dependent type. Task-number: QTBUG-22675 Change-Id: I78e72791a4f470200a9ba986a865ffac6c873725 Reviewed-by: Chris Adams <christopher.adams@nokia.com>
* Decode directory separators in source URLsMatthew Vogt2012-06-251-0/+2
| | | | | | | | | 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>
* Handle enum values of -1 correctly.Michael Brasser2012-06-221-6/+8
| | | | | | | | | | This was already handled correctly most places; now the remaining cases (using an enum in ListModel, and assigning an enum to an integer property) should also work correctly. Task-number: QTBUG-21679 Change-Id: Ibff13f0b94da94b18e2e3bae4aa6ba44e0fa944b Reviewed-by: Chris Adams <christopher.adams@nokia.com>
* Disallow signal-handler-specification for non-signal methodsChris Adams2012-06-211-1/+1
| | | | | | | | | | | | | | Previously, the code which checked whether a signal handler specification was valid was incorrect, in that it only checked that a method of the appropriate name existed (rather than specifically a signal method). This commit ensures that the appropriate code is updated to check the method for signal-ness. Task-number: QTBUG-26223 Change-Id: I306f6622aaa710d86c01d5bbc5146eecce7cf2c3 Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
* Enable literal Qt enum assignment to enum properties.Michael Brasser2012-06-211-9/+9
| | | | | | | | Assigning Qt global enums to enum properties was previously handled as a binding, rather than a literal assignment. Change-Id: If6bb65f63b34f4e10c0636221ddadb11f7025735 Reviewed-by: Chris Adams <christopher.adams@nokia.com>
* Adapt to connection-related changes in qtbaseKent Hansen2012-06-121-12/+12
| | | | | | | | | | | | | | | | | | | 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>
* Disallow parent changes for QML created objectsAaron Kennedy2012-06-061-13/+9
| | | | | | | | | 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>
* Avoid copy-and-paste of property cache resolution codeKent Hansen2012-06-011-24/+14
| | | | | Change-Id: I0f3d8c1641c7c277ef62af7d4f81437e44ac0bad Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
* Initialize data members in QML engineMartin Jones2012-05-291-1/+1
| | | | | | | | Found by static analysis. None look suspicious, but worthwhile cleaning up. Change-Id: Icb5046eb9e57493a9c68b3509ca0c7f546480b73 Reviewed-by: Chris Adams <christopher.adams@nokia.com>
* Lazily create QMetaObjectsAaron Kennedy2012-05-241-538/+511
| | | | | | | | | | 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>
* Optimize QML enum resolutionMartin Jones2012-05-241-23/+25
| | | | | Change-Id: Ibc9ffe882045adf1c1149601c3499e31b9393eeb Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
* Enable binding to properties of type QJSValue.Andrew den Exter2012-05-241-0/+29
| | | | | | | | | 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 a type name query.Jędrzej Nowacki2012-05-211-1/+1
| | | | | | | | QVariant::typeToName is calling QMetaType::typeName and returns the same data. Change-Id: I4028f54ef318292e27eaa0e6981ea114e6e6cd52 Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
* QtDeclarative: Fix warnings about uninitialized variables.Friedemann Kleint2012-05-211-1/+1
| | | | | Change-Id: Ie918f1e813b243b250cedfc2e94e9c66288d08e3 Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
* Optimize type resolutionMartin Jones2012-05-171-5/+6
| | | | | | | Faster qmlType() and resolveType() lookup. Change-Id: I096439f23bf6071e8bfdf0cda366cc71e00293ba Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
* Add QQmlEngine::trimComponentCache()Matthew Vogt2012-05-171-6/+4
| | | | | | | | | | | | 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-141-14/+14
| | | | | | | | | - 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>
* Allow V4 bindings to be assigned to aliasesMichael Brasser2012-05-101-15/+13
| | | | | | | | 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>
* Add rect property typeMichael Brasser2012-05-101-0/+1
| | | | | Change-Id: I9a533be414dca7fcf802e767164eeb745a9f6cd0 Reviewed-by: Matthew Vogt <matthew.vogt@nokia.com>
* Minor optimizations and cleanupAaron Kennedy2012-05-041-21/+10
| | | | | Change-Id: Iecbd5c46af00f649b1f1d78cdf5f2b40a2844897 Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
* Initial bundle supportAaron Kennedy2012-05-041-5/+5
| | | | | Change-Id: I095249f64ecf4ef1e3fbfb164e3d50edffab61e8 Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
* Use QUrl constructor directly.Michael Brasser2012-04-201-10/+2
| | | | | | | | | 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/master' into api_changesLars Knoll2012-04-111-16/+15
|\ | | | | | | | | | | | | | | | | | | | | | | 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
| * Allow V8 bindings to be assigned to aliasesAaron Kennedy2012-03-301-16/+15
| | | | | | | | | | | | | | | | | | V8 bindings must be able to be retargetted for them to be assignable to aliases. Change-Id: If72ff2a24188667113cbb46439129f8d2fcb8f90 Reviewed-by: Chris Adams <christopher.adams@nokia.com> Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
* | Merge master into api_changesKent Hansen2012-03-231-3/+15
|\| | | | | | | | | | | | | | | Conflicts: src/qml/qml/qqmlboundsignal.cpp src/qml/qml/qqmlpropertycache.cpp Change-Id: I5193a193fa301c0b518291645bf626a5fa07118f
| * Allow literal enum to int property assignmentsChris Adams2012-03-211-3/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, enum to int property assignments were considered bindings. This commit adds support for assigning enum values to int properties as enums. Note that to use an enum in QML, it must have been declared with Q_ENUMS or otherwise registered as a metatype. Enum values from the global Qt object are also usable. Task-number: QTBUG-23403 Change-Id: I50db6cae54a24400ea472bde43619d547e4ceb78 Reviewed-by: Michael Brasser <michael.brasser@nokia.com>