aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qqmllanguage/data
Commit message (Collapse)AuthorAgeFilesLines
* Fix broken Maroon game / regression in PropertyChanges {} elementSimon Hausmann2013-12-101-0/+19
| | | | | | | | | | | | | | | | | | | | | | Commit 0aadcf8077840068eb182269e9ed9c31ad12f45e that pre-compiles the expressions in PropertyChanges {} introduced a regression in where the evaluation context was incorrect and thus bindings would not be able to access the correct properties. For example PropertyChanges { target: someObject y: height / 2 } Here height should be looked up in the context of "someObject", not of the PropertyChanges element. This patch introduces an auto-test that verifies that the lookup context is correct and fixes the bug by disabling accelerated compile time property lookups for binding expressions that are requested from a custom parser. Change-Id: I5cb607d07211b453ddfc9928ccbf5f9ecec85575 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Add a new variant of qmlRegisterSingletonType for QML singletons.Antti Piira2013-11-092-0/+107
| | | | | | | | | | | | | | Adds a new public API to register a QML based singleton type from C++. This is the equivalent of the the qmlRegisterType, but for singletons. qmldir file is not needed for types registered through this function, but the type still needs to include the following pragma statement among the import statements: pragma Singleton Change-Id: Icb35b665fe2a8605667fe8ac575347be2a60490c Reviewed-by: Alan Alpert <aalpert@blackberry.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Use finalUrl in QQmlTypeLoader::Blob::addPragma to fix a bug.Antti Piira2013-10-251-0/+10
| | | | | | | | | | There was a bug in addPragma where url() was being used instead of finalUrl(). This resulted in an error finding the type if selectors were used. This patch includes the fix and adds a unit test to cover the use case. Change-Id: I18b6c73e96af2e1464931de76f1f8fd804746d82 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Improve error location reporting for invalid aliases in old VMESimon Hausmann2013-09-301-1/+1
| | | | | | | | | When an alias declaration is missing a location, report the error with the location of the alias declaration, not the object declaration. This matches the code patch in the new compiler, which also reports it accurately. Change-Id: I709dbddb3273f4e05cc4d63079da52d7224466bd Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Add Singleton support for QMLAntti Piira2013-09-2142-0/+411
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This introduces Singleton support for QML (Composite Singleton). For now, the Singleton support is only availabe for QML types in modules or (remote and local) directories with qmldir file. However, in the future this support may be expanded to arbitrary QML file imports without by leaving out the qmldir requirement. You define a QML type as a Singleton with the following two steps: 1. By adding a pragma Singleton to a type's QML file: pragma Singleton The pragma and import statements can be mixed and their order does not matter. Singleton is the only supported pragma for now. Others will generate errors. 2. By specifying a qmldir file for the directory of your imported type and prepending the type with "singleton" keyword as follows: singleton TestTypeSingleton TestTypeSingleton.qml Alternatively you may specify a qmldir file for a module and specify your type as a singleton as follows: singleton TestTypeSingleton 1.0 TestTypeSingleton.qml Composite Singletons may be included in a module and may be used with a local namespace qualifier when imported with: "import xxx as NameSpace" A singleton instance is created at first use and stored into the QmlEngine (one instance per engine) and eventually released by the engine's destructor. CompositeSingletonType has a dual nature and will return true to both isComposite() and isSingleton() calls. In most cases its enough to check for just isComposite() or isSingleton(). However, there is a isCompositeSingleton() available as well. I used "qlalr --no-debug --no-lines --qt qqmljs.g" to generate the qqmljsparser and qqmljsgrammar files from qqmljs.g. Unit tests are included. Change-Id: I91b303612c5e132143b325b9a8f982e9355bc90e Reviewed-by: Alan Alpert (Personal) <416365416c@gmail.com>
* Forward port auto test for fix in QtQuick1Simon Hausmann2013-07-172-0/+11
| | | | | | | | | | This is the auto-test part of https://codereview.qt-project.org/#change,61117 The test passes as-is but we should forward the fix to ensure that we don't regress. Change-Id: Ief8fcfc29d671f33cd1b2c3bab7acfd4fcd1df2b Reviewed-by: Andrew den Exter <andrew.den.exter@qinetic.com.au>
* Delay loading implicit importAlan Alpert2013-03-272-0/+9
| | | | | | | | As a performance improvement to avoid extra filesystem access, only import "." if it is needed for type resolution. Change-Id: If9be25deb3205f8c81f9f418404d9fb41bebb84f Reviewed-by: Christopher Adams <chris.adams@jollamobile.com>
* Add qmlRegisterType for Composite TypesAlan Alpert2013-02-185-0/+13
| | | | | | | | | This is equivalent functionality to registering a composite type in a qmldir file, a type name in a versioned module is associated with a given file. This function now allows that to be done easily from C++. Change-Id: I1cf44b92c3ad7fee593f4f84773c35b56253e628 Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
* Add Composite Types to QQmlTypeAlan Alpert2013-02-183-0/+12
| | | | | | | | | 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>
* Make numeric-literal parsing even more robust.Erik Verbruggen2013-01-161-0/+1
| | | | | | | | The numeric value could overflow a unsigned 64-bit integer, so instead just buffer the string and have libc's strtod handle all the conversion. Change-Id: I220e490ddc22363460b0df65a91b47336e747310 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Make numeric-literal parsing more robust.Erik Verbruggen2013-01-111-0/+1
| | | | | | | | | | | For cases where large non-fp numeric literals might end up triggering coversion or rounding errors when stored as doubles when lexing. This is a corner case, but it does trigger a case or two in the ECMA5 test suite (test262). Change-Id: Ie6d355e28379aba9a339c4e345b5d2a0c32d5fdd Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Merge branch 'stable' into devFrederik Gladhorn2013-01-0438-19/+19
|\ | | | | | | | | | | | | | | | | Conflicts: src/qml/qml/parser/qqmljskeywords_p.h sync.profile tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp Change-Id: I9bc6659e1bab924009167bec567354d40a77a8cb
| * Fix tst_qqmllanguage for MSVC.Friedemann Kleint2012-12-181-3/+2
| | | | | | | | | | | | | | | | | | Do not use \u. Task-number: QTBUG-28611 Change-Id: I85fce2f945c97421b8b35fb8276cd4ee3cc19d38 Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
| * Remove 'com.nokia' string from autotestAlan Alpert2012-12-0538-19/+19
| | | | | | | | | | Change-Id: Ic318dbe7a48412e9689ca0f4506c7098d9f48b5e Reviewed-by: Christopher Adams <chris.adams@jollamobile.com>
* | Fix the test suiteLars Knoll2012-12-111-4/+3
|/ | | | | | | | | | | | We now fail when parsing octal numbers or escape sequences. This is ok according to the EcmaScript 5.1 spec. So remove all usages of these numbers or sequences. In addition delete an invalid test case that can't possibly be parsed correctly. V8 also chokes on it. Change-Id: I889de2810310f38206343d16175f9e31ddb44d30 Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* Restrict v8 property lookup to the execution contextMatthew Vogt2012-08-272-0/+48
| | | | | | | | | | | | | 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 crash in signal change notification overrideChris Adams2012-08-1612-0/+181
| | | | | | | | | | | | | | | 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>
* Allow signal parameters which are custom QML object-typesChris Adams2012-08-088-1/+135
| | | | | | | | | | | 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-032-0/+10
| | | | | | | | Allow for future optimization by encapsulating the raw script data. Change-Id: I1863103e8e6d74ede60593cabb240e16f2ae657e Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
* Update var property to null on object deletionMatthew Vogt2012-07-204-0/+159
| | | | | | | | | 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>
* Support remote import pathsMatthew Vogt2012-07-1610-0/+30
| | | | | | | | | | | 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>
* Add enum values from related typesMatthew Vogt2012-06-271-0/+3
| | | | | | | | | | 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>
* Add some tests for literal parsingMartin Jones2012-06-221-0/+24
| | | | | Change-Id: I3f3047cf27b1e5d230db0ed4154bac09e6adf087 Reviewed-by: Chris Adams <christopher.adams@nokia.com>
* Report clashing qmldir entries for components and scriptsMatthew Vogt2012-06-226-0/+12
| | | | | | | | | | If a qmldir contains multiple lines that install the same versioned property for a single component name or script qualifier, report an error rather than silently suppress one entry. Task-number: QTBUG-25834 Change-Id: I25d3a24102a5a4fa3d82f1d31d7e52505026fff7 Reviewed-by: Chris Adams <christopher.adams@nokia.com>
* Disallow signal-handler-specification for non-signal methodsChris Adams2012-06-212-0/+12
| | | | | | | | | | | | | | 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-0/+8
| | | | | | | | 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>
* Enable binding to properties of type QJSValue.Andrew den Exter2012-05-242-0/+169
| | | | | | | | | 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>
* Fix signal handlers for signals with default arguments.Michael Brasser2012-05-171-0/+23
| | | | | | | | | | For cloned signals, connect to the index of the original. This was a regression caused by the switch to QQmlNotifierEndpoint for signal handlers. This change also makes parameters with default arguments available from QML, while previously they were unavailable. Change-Id: I1feb3412c3e9b0f2a5d6644c404c56d53c5544ac Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Provide receivers count from QQmlData.Michael Brasser2012-04-201-0/+8
| | | | | | Change-Id: I70b06507158797df3083dc23a119935497aa19f4 Reviewed-by: Kent Hansen <kent.hansen@nokia.com> Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
* Merge master into api_changesKent Hansen2012-03-231-0/+55
|\ | | | | | | | | | | | | | | Conflicts: src/qml/qml/qqmlboundsignal.cpp src/qml/qml/qqmlpropertycache.cpp Change-Id: I5193a193fa301c0b518291645bf626a5fa07118f
| * Test unregistered local enums in QML methods and signal handlers.Michael Brasser2012-03-211-0/+12
| | | | | | | | | | | | | | Also make sure valueC and valueD are initialized. Change-Id: I8ee78b7b779c37ca792300c7771ae9975f43d8bb Reviewed-by: Chris Adams <christopher.adams@nokia.com>
| * Support unregistered Qt namespace enums in QML methods.Michael Brasser2012-03-211-0/+12
| | | | | | | | | | | | | | | | | | This brings the support in line with signal handlers, which should allow us to reuse the implementation there when appropriate. Also adds tests for both registered and unregisted Qt namespace enums. Change-Id: I366846626fc44d6d99b51e93fc9e3cb948c748f9 Reviewed-by: Chris Adams <christopher.adams@nokia.com>
| * Support (registered) non-local enums for signal/slot params in QML.Michael Brasser2012-03-211-0/+31
| | | | | | | | | | | | | | | | | | | | | | | | It's now possible to detect whether a registered type is an enum, allowing registered non-local enums to be used as parameters in signals and slots from QML/C++. Author: Glenn Watson <glenn.watson@nokia.com> Task-number: QTBUG-20639 Change-Id: I8c439f2dcc7bfd8ec31914b0c86cd3a1de3c038c Reviewed-by: Chris Adams <christopher.adams@nokia.com> Reviewed-by: Martin Jones <martin.jones@nokia.com>
* | Migrate gui dependencies from QtQml to QtQuick.Matthew Vogt2012-03-202-1/+2
|/ | | | | | | | | | | | | 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>
* Merge master <-> api_changesMatthew Vogt2012-03-052-0/+7
| | | | Change-Id: Iad2f07b989b25349fd2d4fff010e24dcd5a1688f
* Rename QDeclarative symbols to QQuick and QQmlMatthew Vogt2012-02-24492-0/+2231
Symbols beginning with QDeclarative are already exported by the quick1 module. Users can apply the bin/rename-qtdeclarative-symbols.sh script to modify client code using the previous names of the renamed symbols. Task-number: QTBUG-23737 Change-Id: Ifaa482663767634931e8711a8e9bf6e404859e66 Reviewed-by: Martin Jones <martin.jones@nokia.com>