aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml
Commit message (Collapse)AuthorAgeFilesLines
* Change error messages to reflect new module terminologyChris Adams2012-08-092-6/+6
| | | | | | | | | | | | | Previously, modules which registered types into a protected type namespace were known as "strict" modules; now they are known as "identified" modules. This commit also adds a unit test to ensure that the module identifier directive is the first command in the qmldir file. Change-Id: I90e9d2c5b51ecb2b9d058c9fe9d9310fd3cd4f45 Reviewed-by: Matthew Vogt <matthew.vogt@nokia.com> Reviewed-by: Bea Lam <bea.lam@nokia.com>
* Allow invokable functions of value-type classes to be calledChris Adams2012-08-093-12/+51
| | | | | | | | | | | | Previously, invokable functions of value-type classes were returned as properties. This commit fixes that bug by allowing such functions to be invoked normally. It also improves copy-value type handling. This commit also ensures that QMatrix4x4 value types are constructed with qreal values as this is the storage type used internally. Change-Id: Iab0fe4c522ed53d60154e8a8d46dda925fb9f4de Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Ensure that copy sequences can be passed as argumentsChris Adams2012-08-093-1/+18
| | | | | | | | | | | | Previously, automatic conversion from JS array to sequence copy resource was not performed in the case where the array was passed as a parameter to a QObject function invocation. This commit adds code to check if the parameter type is a sequence type - and if so, and if the value is a variantlist, we convert it to a sequence of the appropriate type. Change-Id: I3cc3e2f95604bc71d1d8d237e1acffa1e03b78ba Reviewed-by: Glenn Watson <glenn.watson@nokia.com>
* Fix test failures in Qt Location with string lists.Glenn Watson2012-08-092-3/+12
| | | | | | | | | | | | | Cloning the V8 prototype introduces some unexpected behaviour in the way string lists are used in Qt Location. Instead, leave the prototype intact and used a named property accessor to return the sort method for sequence wrappers. A test case will be added to declarative once a more isolated test case has been created. Change-Id: I533a66f60af4394a2cc8c938fdfc13bd193f0065 Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
* Fix uses of \inmodule, \inqqmlmodule and \sinceBea Lam2012-08-086-4/+5
| | | | | | | Some classes and QML types were missing these or had the wrong values. Change-Id: Ic6376b8b450301f8ae0549e636f4bc2db4400f2b Reviewed-by: Chris Adams <christopher.adams@nokia.com>
* Add type name to singleton (module api) implementations.Glenn Watson2012-08-0813-140/+228
| | | | | | | | | | | | | 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>
* Allow signal parameters which are custom QML object-typesChris Adams2012-08-084-15/+62
| | | | | | | | | | | 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>
* Support JS Array.sort() function for sequence wrappers.Glenn Watson2012-08-083-2/+67
| | | | | | | | | | | | | | The V8 natve sort implementation calls some functions that are incompatible with the way sequence wrappers work. In particular, it calls an internal length() function which does not pass through the length accessor provided by sequence wrappers, so the sort function always thinks the array is zero length. Instead, clone the array prototype and override the sort function with one that is specific to sequence wrappers. Task-number: QTBUG-25269 Change-Id: Ic83b9ee0bd3a0707e512f28057f0f99b432fded4 Reviewed-by: Matthew Vogt <matthew.vogt@nokia.com>
* Fix various broken links in documentationBea Lam2012-08-034-5/+6
| | | | | Change-Id: I9e2dac37d18e3ca62e4a92be25e5c2e60ffeba00 Reviewed-by: Andrew den Exter <andrew.den-exter@nokia.com>
* Fix docs for FormatType enumBea Lam2012-08-031-23/+25
| | | | | | | | | Enums can't be documented as a separate type in QML documentation, so move the enum docs into the class docs so it can be linked to from the methods. Change-Id: I22599ebc9e183d034d2d56cdac629d30aacf64ea Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Make QQmlScriptString opaque.Michael Brasser2012-08-0310-47/+140
| | | | | | | | Allow for future optimization by encapsulating the raw script data. Change-Id: I1863103e8e6d74ede60593cabb240e16f2ae657e Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
* Mark QQmlFile \internalBea Lam2012-08-021-0/+2
| | | | | Change-Id: Ia323e76f5922ef5c539243e2f834fbc9065451e6 Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Implement strict mode for qmldir modulesMatthew Vogt2012-07-319-11/+185
| | | | | | | | | | | | | | | Allow a module's qmldir to contain a module directive, which when present specifies 'strict mode' import processing. In strict mode, type registrations are only permitted into the namespace identified in the qmldir file's module directive. In addition, any type registrations to that namespace originating from other modules are treated as error conditions. Task-number: QTBUG-26551 Change-Id: I081bde2d3b83d3f28524440177fb2cd1ccee34ad Reviewed-by: Chris Adams <christopher.adams@nokia.com> Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
* Doc: Changed \qmlclass to \qmltype and added \instantiates.Jerome Pasion2012-07-305-7/+14
| | | | | | | | | | -To simplify QDoc, \qmlclass is now \qmltype. -'\instantiates <C+++ class>' is for the types that are defined in C++. Change-Id: I29242d33daf7b972d8b86a356b9689638866b950 Reviewed-by: Laszlo Papp <lpapp@kde.org> Reviewed-by: Bea Lam <bea.lam@nokia.com> Reviewed-by: Martin Smith <martin.smith@nokia.com>
* Improve QML basic types documentationChris Adams2012-07-301-1/+1
| | | | | | | | | | | | | | | Basic types are provided either by the language (int, string, bool, real, double, date, url, var, variant) or by modules (value types). In 5.1 we would like modules to be able to provide more basic types, and thus a cleaner separation of the documentation makes sense. This patch also improves linking of the term QtQml so that a clear distinction is made between the QtQml QML module and the QtQml C++ Qt Module (the QtQml QML module links now point to the QtQml type reference page). Change-Id: Ibe3ad33e4616c5f29ea38dadc27e13938aedb9d7 Reviewed-by: Bea Lam <bea.lam@nokia.com>
* Allow access to signals and slots in QQmlPropertyMap inheritorsMatthew Vogt2012-07-272-3/+3
| | | | | | | | | | | Allow inheritors of QQmlPropertyMap to pass the static meta object information needed to support their signals and slots. If the correct pointer is not provided to the constructor, it is not accessible via the virtual metaObject() function during construction. Task-number: QTBUG-26400 Change-Id: Ide8c6d3568e4abd4c48e0aa60e6fa05a9c2a11cf Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Fix QML import paths in Qt resources.Aaron McCarthy2012-07-273-1/+17
| | | | | | | | | | | | | | | Allow adding qrc: urls as import paths. Store an import path of the form :/import/path as qrc:/import/path which is expected by other parts of the code. Update documentation for QQmlEngine::addImportPath() to explicitly state what types of paths are supported. Add auto tests to check that importing a module from a Qt resource works. Change-Id: If0e75c75078a608b20d7a5c4080bccf6241e97f6 Reviewed-by: Chris Adams <christopher.adams@nokia.com>
* Ensure params listed after unnamed params are available in QML.Glenn Watson2012-07-251-3/+5
| | | | | | | | | | | If a parameter in a bound signal had no name, it was excluded from the metaobject created by the bound signal expression. Change this so that unnamed parameters are still added (with an anonymous name). This means that subsequent parameters can be accessed from QML. Task-number: QTBUG-24481 Change-Id: Ia3403fb3bdc3da0c7e58baf7e891b67ed413bebd Reviewed-by: Matthew Vogt <matthew.vogt@nokia.com>
* Remove QListModelInterface.Andrew den Exter2012-07-258-252/+99
| | | | | | | | | | Implement ListModel and XmlListModel using QAbstractListModel instead. Task-number: QTBUG-15728 Change-Id: I14e03d90883d341f4b1d89c1e9fc9dc1534fde78 Reviewed-by: Glenn Watson <glenn.watson@nokia.com>
* Fix value-type semantics in variant propertiesChris Adams2012-07-243-31/+88
| | | | | | | | | | | Previously, variant properties storing value-type values would be treated as value-type-copy values rather than value-type-reference values. This caused inconsistency in behaviour with value-type subproperty assignment. Task-number: QTBUG-26562 Change-Id: I524ee06ab8e02bf9582c1a88f3317278199225e0 Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Update var property to null on object deletionMatthew Vogt2012-07-202-11/+52
| | | | | | | | | 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>
* Allow QQmlPropertyMap property updates to be controlledMatthew Vogt2012-07-182-12/+18
| | | | | | | | | | Allow clients to control updates made from QML to types derived from QQmlPropertyMap, by overriding the updateValue() function. Task-number: QTBUG-23183 Change-Id: I0169093779ebfe50dc9349f5aaac08ed85c80a8f Reviewed-by: Michael Brasser <michael.brasser@nokia.com> Reviewed-by: abcd <amos.choy@nokia.com>
* Add fuzzyCompare() to qmltestCharles Yin2012-07-181-1/+1
| | | | | Change-Id: I4834f4af0839fb89424ed25f0addfb618e5374f8 Reviewed-by: Yunqiao Yin <charles.yin@nokia.com>
* Trim trailing whitespaceStephen Kelly2012-07-172-65/+65
| | | | | Change-Id: Iafc5a94bb07c499b581bfec300d01e0fde165146 Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Select appropriate version for located module componentsMatthew Vogt2012-07-171-26/+28
| | | | | | | | | When a located module is imported with a version specifier, ensure that the components resolved from that module use the appropriate version. Task-number: QTBUG-26473 Change-Id: I33209ddef3fe9bb0ab9d096dfe19aff233744afc Reviewed-by: Chris Adams <christopher.adams@nokia.com>
* Improved error message wordingMatthew Vogt2012-07-171-2/+2
| | | | | | | | | When a qmldir contains multiple definitions with the same name and version numbers, the error message should indicate that the problem is localized to that qmldir file. Change-Id: I02cd4862c9ead2fd7ed1c75d0fa6949ab3eda6f6 Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
* Change Quick docs to refer to "types" rather than "elements"Martin Jones2012-07-163-18/+18
| | | | | | Task-number: QTBUG-24785 Change-Id: I223479b879514abaacb123852323c1cfada7a5e1 Reviewed-by: Bea Lam <bea.lam@nokia.com>
* Support remote import pathsMatthew Vogt2012-07-168-580/+1150
| | | | | | | | | | | Probe for installed modules in import path elements which are not local to the machine. Note that all local paths in the import path list will be tried before any remote locations are probed. Task-number: QTBUG-21386 Change-Id: I4f7b9e54e54c1d62a5e7cb7f059ee1e9319ef054 Reviewed-by: Chris Adams <christopher.adams@nokia.com>
* Update multiple value type properties despite interceptorMatthew Vogt2012-07-131-5/+13
| | | | | | | | | | When an interceptor is present on a value type, ensure that multiple properties of that value can be updated simultaneously. Task-number: QTBUG-25139 Change-Id: I3042b9883d404aed4b6507e6d2f38a76caee1196 Reviewed-by: Glenn Watson <glenn.watson@nokia.com> Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
* Allow color to be explicitly compared to a stringMatthew Vogt2012-07-113-1/+41
| | | | | | | | | | Add the Qt.colorEqual() function which compares any combination of two supplied color and string arguments, by converting the string arguments to colors as necessary. Task-number: QTBUG-18754 Change-Id: I75baef9a2edd30a5f8b9cb5e151e4adba6f6a371 Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
* Don't provide typehint in QQmlExpression::evaluate()Chris Adams2012-07-111-1/+1
| | | | | | | | | | | | Previously, the result returned by QQmlExpression::evaluate() was converted from the actual JavaScript result with a default typehint of QList<QObject*>. This commit removes that typehint so that the engine's conversion code will choose the most appropriate return type for the result JavaScript value, instead. Task-number: QTBUG-17082 Change-Id: I368a018b235e9e001b1b92db3699de377748b74f Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
* Improved error messages for malformed .import statementsMatthew Vogt2012-07-115-29/+85
| | | | | | | | | Report errors in .import statements, rather than pass them through to V8 to yield 'Syntax error'. Task-number: QTBUG-24867 Change-Id: I111b3bd3d198e97f42b29591f61753e86295aeb2 Reviewed-by: Glenn Watson <glenn.watson@nokia.com>
* Fix broken value-type support by allowing property definitionChris Adams2012-07-1114-35/+269
| | | | | | | | | | | | | | | | | | | | | 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>
* load plugins properly when QT_NO_SETTINGS is definedTasuku Suzuki2012-07-101-2/+0
| | | | | Change-Id: I2d28d698f4bb5cc299f1ce83b1ecb7fa87bc5fdb Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* Do not permit excessive recursion in component creationMatthew Vogt2012-07-092-2/+30
| | | | | | | | | | Limit recursion during component creation to prevent infinite recursion resulting in a crash. Recursion results from invoking createObject() in the Component.onCompleted handler. Task-number: QTBUG-25439 Change-Id: Ica2ba099d82b5747c938501af04e67f7ace8402e Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
* Use V4 binding for non-final properties where possibleMatthew Vogt2012-07-0917-74/+181
| | | | | | | | | 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>
* Use enumeration in preference to enum when referring to QML API.Andrew den Exter2012-07-062-2/+2
| | | | | | Task-number: QTBUG-24666 Change-Id: I5197d4b4d1a1b53cae2033bd86ce26ba55d08384 Reviewed-by: Bea Lam <bea.lam@nokia.com>
* Add references between being/completeCreate in the documentationLaszlo Papp2012-07-051-0/+4
| | | | | Change-Id: I14f1c802347c9dad86f3fd7a9e858209a15d34e6 Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
* Add some private V8ASSERT macros.Andrew den Exter2012-07-041-0/+11
| | | | | | | | Simple variation on the V8THROW macros to consilidate the normal usage pattern of if (!condition) THROW. Change-Id: I71aaabab705c3f73922efdaf8bb40b5dcc390101 Reviewed-by: Chris Adams <christopher.adams@nokia.com>
* Document QQmlComponent::create(QQmlIncubator&, ...)Martin Jones2012-07-041-4/+24
| | | | | | Task-number: QTBUG-25132 Change-Id: Ice6c75cbd7a45519ce7f38190db3fae95146269e Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
* Mark QQmlComponent::createObject() and incubateObject() as internalMartin Jones2012-07-041-0/+7
| | | | | | | | These functions are for use in QML Component. They are not part of the C++ API. Change-Id: I92743a3b31c2864976756e2d6d76c9057aee9c1d Reviewed-by: Chris Adams <christopher.adams@nokia.com>
* Make Behaviors work correctly with value types.Glenn Watson2012-07-042-7/+73
| | | | | | | | | | | | | | 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>
* Fix crash in QQmlXmlHttpRequestChris Adams2012-07-021-8/+49
| | | | | | | | | | | | | | | | | | If an onreadystatechange handler of a QQmlXmlHttpRequest uses code which requires the engine->callingContext() to be valid, a crash could previously occur (since the callingContext() would be null if the handler was called due to a network request finishing. This commit saves the calling context on send, so that on dispatch we can create an activation scope from that context and use it. Note that even in this case, if the original context had previously been deleted (e.g., by a loader deleting the item context on source change) the saved context could be invalid by the time the dispatch function was invoked. In that case, we simply do nothing as the function call cannot succeed (invalid context). Change-Id: Iba357829a69433c11cc279e6cc9fdc0bedaa31fb Reviewed-by: Yunqiao Yin <charles.yin@nokia.com>
* MSVC: Fix warnings about struct/class mismatch.Friedemann Kleint2012-06-291-1/+1
| | | | | Change-Id: I7cc5b01279069229711dbdf0b28e935ab3391c08 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Add basic documentation for QML translation functions.Michael Brasser2012-06-281-4/+128
| | | | | Change-Id: I50932ffd956061dd172616c4de863eb1a322394d Reviewed-by: Bea Lam <bea.lam@nokia.com>
* Merge "Merge branch 'buildsystem'" into refs/staging/masterOswald Buddenhagen2012-06-271-1/+3
|\
| * Merge branch 'buildsystem'Oswald Buddenhagen2012-06-261-1/+3
| |\ | | | | | | | | | Change-Id: I230e776290761be7c811c3aec4d915367012fc99
| | * don't rely on qtbase sourcesOswald Buddenhagen2012-06-261-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | copied from qtquick1 Change-Id: I10f57f5563459a0784b8434a992a878fad401da8 Reviewed-by: Alan Alpert <alan.alpert@nokia.com> Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
* | | Document the concept of creation context for QML Components.Michael Brasser2012-06-271-0/+21
| | | | | | | | | | | | | | | | | | Task-number: QTBUG-18011 Change-Id: I78d13df70a20fd9286a20fad4cc09f21591d3f9a Reviewed-by: Bea Lam <bea.lam@nokia.com>
* | | Implement QAbstractDeclarativeData::isSignalConnected hookKent Hansen2012-06-273-9/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QQml_isSignalConnected is no longer needed, since QObjectPrivate::isSignalConnected will now call the declarativeData hook. Change-Id: I0685b0fa909d6c6c2d275bfa8d41100d9926a046 Reviewed-by: Michael Brasser <michael.brasser@nokia.com> Reviewed-by: Chris Adams <christopher.adams@nokia.com>