aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qqmllanguage/data
Commit message (Collapse)AuthorAgeFilesLines
* Fix issue with circular singleton instantiationsv5.10.0-rc2Michael Brasser2017-11-283-0/+19
| | | | | | | | | While a recursion check exists and works, it can lead to instanting the same singleton multiple times (leaking all but one copy). Change-Id: Icf342aad71c5cb225488262341517d95786e1f84 Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Merge remote-tracking branch 'origin/5.9' into 5.10Liang Qi2017-10-245-6/+74
|\ | | | | | | | | | | | | | | | | | | Conflicts: src/qml/qml/qqmlimport.cpp src/qml/qml/qqmlimport_p.h src/qml/qml/qqmltypenamecache.cpp Done-with: Ulf Hermann<ulf.hermann@qt.io> Change-Id: I41ba7a592b2659ddf53da6952ea3b456a7bba319
| * Fix execution of deferred propertiesJ-P Nurmi2017-10-182-0/+38
| | | | | | | | | | | | | | | | | | | | | | When deferred properties were assigned in multiple contexts, only the outermost context was executed. Any deferred property assignments in other inner contexts were never executed. Collect the deferred data to a container to be able to execute them all. Task-number: QTBUG-63200 Change-Id: I88fab27c1f81b5188430ada086dcc19842507e99 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
| * Fix outdated BSD license headerKai Koehne2017-10-173-6/+36
| | | | | | | | | | Change-Id: Icc08925454445fc9497fb3bfd2c26efe90605983 Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
* | Fix implicit loading of internal types when using explicit importsSimon Hausmann2017-09-264-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The QQC Android style has a type that is intended to be internal only and it's loaded implictly (see bug report for details). However the qml file also has to import the module explicitly in order to get access to the singleton the module provides. The documentation says that types of a module are to be specified in the qmldir file, otherwise they are derived from the file name. With commit 22a2cc43387ec3b9f74a6c01f8665378a4541147 that become an exclusive relationship with regards to types from implicit imports. The proposed solution for the JIRA task is to mark the types that are needed internally as "internal" in the qmldir file and fix support for loading internal types through implicit imports (which is what this commit fixes). Task-number: QTBUG-63309 Change-Id: Id696a691f1af1d335c7c8d72f2627064c3d7b9ac Reviewed-by: Michael Brasser <michael.brasser@live.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* | Merge remote-tracking branch 'origin/5.9' into 5.10Lars Knoll2017-09-202-0/+11
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/qml/compiler/qv4compileddata.cpp src/qml/compiler/qv4compileddata_p.h src/qml/jsruntime/qv4engine.cpp src/qml/jsruntime/qv4qmlcontext.cpp src/qml/jsruntime/qv4qmlcontext_p.h src/qml/jsruntime/qv4regexpobject.cpp src/qml/jsruntime/qv4regexpobject_p.h src/qml/types/qqmllistmodel.cpp src/quick/items/qquickanimatedimage_p.h src/quick/scenegraph/qsgrenderloop.cpp tests/auto/qml/qmlcachegen/tst_qmlcachegen.cpp Change-Id: If20ef62b2c98bdf656cb2f5d27b1897b754d3dc0
| * Disable deferring when referenced as a grouped propertyJ-P Nurmi2017-09-062-0/+11
| | | | | | | | | | | | | | | | | | This allows us to fix QTBUG-50992 - the issue with most votes in QQC2. Task-number: QTBUG-63036 Change-Id: I996cd1128582b80e0c8480ae143d682c1e8eb8fe Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* | Support explicit enum value declaration in QMLMichael Brasser2017-08-189-0/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allow declarations such as: enum MyEnum { Value1 = 1, Value2 } Not all features of C++ enums are supported. Specifically, we don't yet allow: * Negative numbers (Value1 = -1) * Assignment of other values (Value2 = Value1) Change-Id: I4776f8d86bd0c8688c7dd8b7d4ccb2f72fdfe721 Task-number: QTBUG-14861 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Add support for enum declarations in QMLMichael Brasser2017-07-1311-0/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Enums can be declared with the following syntax: enum MyEnum { Value1, Value2 } Grammar changes done by Simon Hausmann. [ChangeLog][QtQml] Enums can now be declared directly in QML. Task-number: QTBUG-14861 Change-Id: Ic6b6e032651d01ee2ecf9d5ce5734976cb3ad7ab Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Merge remote-tracking branch 'origin/5.9' into devLiang Qi2017-06-063-0/+19
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf src/qml/jsruntime/qv4argumentsobject.cpp src/qml/jsruntime/qv4arraydata.cpp src/qml/jsruntime/qv4context.cpp src/qml/jsruntime/qv4context_p.h src/qml/jsruntime/qv4errorobject.cpp src/qml/jsruntime/qv4functionobject.cpp src/qml/jsruntime/qv4internalclass.cpp src/qml/jsruntime/qv4lookup.cpp src/qml/jsruntime/qv4managed.cpp src/qml/jsruntime/qv4managed_p.h src/qml/jsruntime/qv4object.cpp src/qml/jsruntime/qv4object_p.h src/qml/jsruntime/qv4qmlcontext.cpp src/qml/jsruntime/qv4runtime.cpp src/qml/jsruntime/qv4vme_moth.cpp src/qml/memory/qv4heap_p.h src/qml/memory/qv4mm.cpp src/qml/memory/qv4mm_p.h src/qml/memory/qv4mmdefs_p.h src/quick/scenegraph/util/qsgdistancefieldutil.cpp src/quick/scenegraph/util/qsgdistancefieldutil_p.h tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp Change-Id: I7ed925d4f5d308f872a58ddf51fdce0c8494ec9c
| * Fix concurrent loading of the same qmldir from different scriptsAndy Shaw2017-05-023-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QQmlQmldirData keeps a pointer to a QQmlScript::Import, and an integer priority. Each Blob that is waiting on it was setting its own import and priority even though the QQmlQmldirData itself was shared. This resulted in whichever one began loading last succeeding to load, and the rest failing. This change instead stores the import and priority data per-dependent Blob Fix was originally done by Josh Faust <jfaust@suitabletech.com>. I added the test. Task-number: QTBUG-30469 Change-Id: Id3d15569a999a7c22eeb12b431e5daf1ddae51dc Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | C++11 scoped enum support for QMLMichael Brasser2017-05-035-0/+34
| | | | | | | | | | | | | | | | | | [ChangeLog][QtQml] Support C++11 scoped enums in QML. These can now be accessed as <TypeName>.<EnumName>.<EnumValue> Change-Id: I29bd3f16e980f3e6f1b2390b5a8e9e8e999952a3 Task-number: QTBUG-54961 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | qml: Override the new Object::instanceOf hook to allow QML type checkingRobin Burchell2017-03-159-0/+111
|/ | | | | | | | | | | | | | | [ChangeLog][QtQml] The instanceof keyword in JavaScript has been extended to work on QML types and instances. This means that you are now able to use it to verify that a var is indeed the type you expect (e.g. someVar instanceof Rectangle). Note that one of the added tests revealed a slight shortcoming in the QML type system (QTBUG-58477). For now, we should keep consistency and work to address the problem universally in the future. Change-Id: I7d9bf9b64cfd037908de1ae51b01065eacb95abe Task-number: QTBUG-24799 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Enable resolution of composite types in QQmlTypeNameCacheRobin Burchell2017-01-276-0/+39
| | | | | | | | | | | | | | | | | | | | | We didn't have resolution of composite types previously, which is a prerequisite to do more exciting things with QML types in JavaScript (such as instanceof). By deferring the resolution to QQmlImports, we can avoid the need to fill the cache with types that may not be needed, while still finding types which are requested. In the future, we could consider removing the "special" handling for composite singletons as they should be found through QQmlImports now. If we do that, we may still want to cache the QUrl for the types, to avoid using QQmlImports too often directly, as it is a little slow itself. This change doesn't regress tst_compilation. Task-number: QTBUG-24799 Change-Id: I9ba2e4829ca49008fd180fb488c586475cf90674 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix support for namespaced types in property/signal declarationsSimon Hausmann2016-11-302-1/+9
| | | | | | | | | | | | | | | | | | | | Declarations such as property Namespace.Item foo or property list<Namespace.Item> foo would get rejected by the grammar due to the lack of productions. This is now encapsulated in the UiPropertyType, which used to be merely an identifier but is now changed to produce a UiQualifiedId - the same type that's also used for MyNamespace.Item { ... } object declarations for example. Task-number: QTBUG-10822 Change-Id: Ic3ac1adbe17c83b24b67950c2f089e267b73b99b Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix support for QML declared default list propertiesSimon Hausmann2016-11-232-0/+11
| | | | | | | | | | | | | | | | | The grammar was not permitting to write default property list<Item> myChildren; and instead developers had to work around it with an alias property list<Item> myChildrenData; default property alias myChildren: myChildrenData which is not nice. Fortunately this is easy to fix in the grammar. Task-number: QTBUG-10822 Change-Id: I4e914ddb9588913da09e9fb6c6aa154cf8a9e18f Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Add qmlRegisterUncreatableMetaObject convenience functionBogDan Vatra2016-09-071-0/+1
| | | | | | | | | qmlRegisterUncreatableMetaObject is needed to register Q_NAMESPACE QMetaObjects. Task-number: QTBUG-54982 Change-Id: I767dfcb15db647e0dceb0c37b17e64f2a5c1dd8f Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Merge remote-tracking branch 'origin/5.7' into devEdward Welbourne2016-08-021-0/+2
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/quick/items/qquickshadereffect.cpp 5.7 had a bug-fix in code dev has replaced wholesale. src/quick/items/qquickwindow.cpp src/quick/items/qquickwindow_p.h One side changed a method's signature; the other side renamed a method declared adjacent to it and changed some code using it, moving some from the public class to its private partner. tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp One side added a blank line before a comment the other re-wrote. Kept the re-write, killed the stray blank. .qmake.conf Ignore 5.7's change to MODULE_VERSION. src/qml/compiler/qqmltypecompiler.cpp src/qml/compiler/qqmlpropertyvalidator.cpp 5.7 changed code in the former that dev moved to the latter. Reflect 5.7's changes there, adapted to dev's form. src/qml/qml/qqmlobjectcreator.cpp One side added new QVariant types; the other changed how it handled each type of QVariant (without git seeing any conflict); adapted the new stanzas to work the same as the transformed ones. tests/manual/v4/test262 dev had a broken sha1 for it; so used 5.7's 9741ac4655808ac46c127e3d1d8ba3d27ada618e Change-Id: I1fbe2255b97d6ef405cdd1d0cea7fab8dc351d6f
| * Fix string property assignments to 2d vectors and quaternionsSimon Hausmann2016-07-211-0/+2
| | | | | | | | | | | | | | | | | | Just like it's possible to assign "1,2,3" to a QVector3D, the same should be possible for a QVector2D and a QQuaternion. Task-number: QTBUG-54858 Change-Id: I8f394279dcdf5c057876efaa316b4bad51a4c126 Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
* | Fix alias resolution algorithmSimon Hausmann2016-07-154-0/+29
| | | | | | | | | | | | | | | | | | | | | | The resolution of aliases needs to to be solved in iterations as an alias can refer to another alias, which may not be created yet in the property cache by the time we try to perform the resolution. Therefore the alias resolution code works off a list of pending aliases after the initial pass of resolution. This also requires the ability to detect circular references. Change-Id: Id4e159b9c713aa8a8a095759e22e3fac456a38a0 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Added two unit tests for alias nestingSimon Hausmann2016-07-072-0/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The first test covers a use-case currently only otherwise see in QtQuickControls, and so having it here allows for catching regressions in that area before hitting the next qt5 build. Having an alias refer to another alias property within the same file only works if the second alias is resolved/processed before the first one. This works by chance when relying on the order of processing reverse to the declaration, but that's a bug. It should work regardless of the order. That is what the second test-case demonstrates and that is why it is marked as failure. Change-Id: Iba386437d21efa868d9814221092df5f7ef6f1f6 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Clean up pragma singleton handling in the type loaderSimon Hausmann2016-06-202-2/+2
| | | | | | | | | | | | | | | | | | Get rid of the m_isSingleton boolean by checking the CompiledData::Unit::flags after the type compilation. This is more compact and makes the singleton type checks independent from the IR. Change-Id: I04189d284e6ea275ac8540918836b641914e7588 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Clean up file/error handling in the type loaderSimon Hausmann2016-06-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | Fold the functionality of reading QFile contents via QQmlFile into QQmlDataBlob::Data. This reduces the dependency on QQmlFile - which is scheduled for removal - and it makes it possible in the future to avoid reading the file altogether if we have a cached compilation unit on disk. Change-Id: Ieeaf52b6fb1d25665cd3c3b196819e25aba3dd15 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Optimize named object handlingSimon Hausmann2016-05-261-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | By storing the object indices of named objects in the CompiledData::Object of a component, we can achieve two things: (1) We can eliminate the hash of vectors in QQmlCompiledData for the object-to-id mapping (2) We can store the mapping from object name to integer object id in the CompilationUnit and share it across different QQmlContextData instances (as long as it is not modified). Also added a new test that verifies the functionality of a .qml file starting with Component{} itself with object names, something that was previously only implicitly tested through some of the examples (corkboards.qml for example). Change-Id: I28c70217222dc0e5252bf5247b7e3fc4def47446 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | Allow the use of uncreatable types for propertiesSimon Hausmann2016-04-292-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | It should be possible to write property SomeUncreatableType blah; It should not be possible to write: property SomeUncreatableType blah: SomeUncreatableType {} Task-number: QTBUG-36752 Change-Id: I2d1aa9f070a368f51844bbc0733d285022aab403 Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
* | Convert QByteArray in C++ type to ArrayBuffer in QML and vice-versaNobuaki Sukegawa2016-03-056-0/+63
|/ | | | | Change-Id: Ie4e29a443a17826a3ce4d1e1912bd35dc497ac78 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Properly signal errors when accessing lowercase enum valuesThomas McGuire2016-02-246-0/+34
| | | | | | Task-number: QTBUG-46758 Change-Id: I14e394021c231bda5552c8d1c98f20c903a62f12 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Make QML composite types inherit attached propertiesJ-P Nurmi2015-10-092-0/+10
| | | | | | | | Change-Id: Ic06af4805da987dd08e361f2668e7a1788d3eefe Task-number: QTBUG-43581 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com> Reviewed-by: Liang Qi <liang.qi@theqtcompany.com> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Make QML composite types inherit enumsJ-P Nurmi2015-09-212-0/+10
| | | | | | | | | | | | | | | | | | | | | | | Problem: in Qt Quick Controls 2, enums declared in the abstract C++ base types were not accessible with the concrete QML type name, but had to be referenced using the base type name: Slider { snapMode: AbstractSlider.SnapOnRelease } Solution: this change resolves the C++ base type and creates the missing link between the composite type and its base type's meta- object. This allows referencing enums using the concrete/composite QML type name: Slider { snapMode: Slider.SnapOnRelease } Change-Id: Icefdec91b012b12728367fd54b4d16796233ee12 Task-number: QTBUG-43582 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Fix use of function expressions with signal handlersSimon Hausmann2015-08-241-0/+5
| | | | | | | | | | | | | | | | | | | | Writing onClicked: function(mouseEvent) { ... } would get silently "accepted" by the engine, but it wouldn't do anything. We basically wrapped it in a new function, so that it became onClicked: function(mouse){ function(mouseEvent() {} } which is a noop. With older versions this used to produce a syntax error. However the better fix is to simply support this kind of assignment for more expressive signal handlers, because now the names of the signal parameters can be explicitly named (with names of your choice). Change-Id: I96369f8805fab97509784222f614ee17cf681aba Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com> Reviewed-by: Michael Brasser <michael.brasser@live.com>
* Improve qml error message "invalid alias location"Aleix Pol2015-06-105-5/+5
| | | | | | | | | | | | | | Specify we're talking about the target itself rather than talking location, which I always doubt about whether it's the location within the file. Also specify the offending property, so we get a clue about what to look into. [ChangeLog][QtQml] Improve "invalid alias location" error message by specifying what's the offending property and by calling it "invalid alias target location" Change-Id: I7a9390089ee8986872c119df44d8036bf267ab99 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Merge remote-tracking branch 'origin/5.4' into 5.5Simon Hausmann2015-04-271-1/+1
|\ | | | | | | | | | | | | | | Conflicts: .qmake.conf tests/auto/qml/qqmlxmlhttprequest/tst_qqmlxmlhttprequest.cpp Change-Id: I715b8a78b74cbe0dcaf599367fd6e08af4858e11
| * Prospective fix for flakey "network" related QML testsv5.4.2Simon Hausmann2015-04-251-1/+1
| | | | | | | | | | | | | | Replace hard-coded server ports with dynamically allocated ports. Change-Id: Iab8f9a88343a9f2c49af3cd700c954c13c3bf121 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
* | Fix regression with nested objects served by custom parsersSimon Hausmann2015-04-231-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The following piece of code used to work and broke with Qt 5.3: ListModel { property var conn: Connection { ... } } When validating the properties of the ListModel we would not validate the Connection sub-object here, which meant the custom parser for the connection object was never called. We need to extend the logic for sub-object validation to recursive into sub-objects when this is either an attached property (Component.onComplete on a list model for example) or the object is assigned to an _existing_ property, i.e. a property not deal with by the custom parser. In this case that's a custom declared property. Change-Id: Ic99f746f08771460cc6424a9e8a839c78a7eafd9 Task-number: QTBUG-45735 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Fixed license headersJani Heikkinen2015-02-173-9/+9
| | | | | | | | | | Change-Id: I4d5640ff95e1361ec7e65fb3e87d7726d8185ff5 Reviewed-by: Sergio Ahumada <sahumada@texla.cl>
* | Update copyright headersJani Heikkinen2015-02-123-12/+12
| | | | | | | | | | | | | | | | | | 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>
* | Add propertyName to errorAlbert Astals Cid2015-01-052-2/+2
| | | | | | | | | | | | | | | | | | May help a bit to the reader, even if the line is already there sometimes it can be confusing if it is a default property like data Change-Id: I5cb8e8833c78a784ad4f5541d094840477e8f350 Reviewed-by: Robin Burchell <robin.burchell@viroteck.net> Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Do not cause SegFault when importing empty javascriptNobuaki Sukegawa2015-01-024-0/+11
|/ | | | | Change-Id: I31f6571e73b5dd74bf3ade5cadc2daa02475b5cb Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Fix syntax error when trying to declare read-only object propertiesSimon Hausmann2014-10-241-0/+7
| | | | | | | | | | | | | | | | | | | | The grammar did not allow for the declaration of readonly property QtObject foo: QtObject { ... } and it required a workaround through an alias: readonly property alias foo: _foo property QtObject _foo: QtObject { ... } This was merely a glitch in the grammar, I see no reason not to support this. The semantics are like a const pointer in C++, the property itself is read-only but the object pointed to has per-property defined read/write semantics. Task-number: QTBUG-41971 Change-Id: I99e2e7ed58731e387a38e46ec39922d280a21ceb Reviewed-by: Michael Brasser <michael.brasser@live.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Check list property before component when validating bindingsUlf Hermann2014-10-212-0/+6
| | | | | | | | | There are lists that won't accept a component as element. For example QQuickItem's children will only accept QQuickItems. Task-number: QTBUG-41848 Change-Id: I0fc7b0d1a4770d596caf681be92dff216f48d32b Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Merge remote-tracking branch 'origin/5.3' into 5.4Simon Hausmann2014-08-261-0/+23
|\ | | | | | | | | | | Conflicts: src/qml/qml/qqmlobjectcreator_p.h Change-Id: I60858ddb46866a8fa1a8576bb05b412afeeb4e41
| * Fix crash with early QObject property accessSimon Hausmann2014-08-251-0/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the reported bug, it can happen that we try to access the compile-time resolved QObject property of an object that is referenced by id. The binding that uses this is triggered when the property changes but _also_ when the id referenced object gets either created or deleted. The first time the binding is evaluated is very early on, when the id referenced object is not created yet, so the binding evaluation fails. However the dependency is set up, and so later then the id referenced object is created and the id property is set on the context, the notification triggers and the binding is re-evaluated. During that binding evaluation a QObject property access happens by index on an object that doesn't have its VME meta-object set up yet. Therefore the property access fails and a crash occurs or the Q_ASSERT(property) assertion fails. The fix is to set register the id named object in the context _after_ the VME meta-object is setup. Task-number: QTBUG-40018 Change-Id: Ic2d7b4a0c49635efe68e93f2f6c316eb65f0c309 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | v4: Enable primitive conversation to QQmlScriptString in javascriptSebastian Sauer2014-08-221-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This makes following QML-code proper working: ParentChange { x: 0 Component.onCompleted: x = 10 } where x is a QQmlScriptString. Before this patch an error-message would be thrown that the bool/int/string/etc cannot be converted to a QQmlScriptString. With the patch primitive types including null and undefined are proper converted to a QQmlScriptString. The patch ignores (as in not implements) function/binding assignment. Unfortunately since commit aa25ad8d5f4 its not possible any longer to instanciate QQmlScriptString what means there is otherwise no (easy) way to inject a QQmlScriptString from within Javascript. Change-Id: I18aac6a6e9a57f3b7d0a2d66cdab2be6c3c153c5 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Merge remote-tracking branch 'origin/5.3' into 5.4Simon Hausmann2014-08-122-0/+6
|\| | | | | | | | | | | | | | | | | | | Conflicts: src/qml/jsruntime/qv4include.cpp src/quick/items/qquickrendercontrol.cpp src/quick/items/qquickrendercontrol_p.h src/quickwidgets/qquickwidget.cpp Change-Id: Ib2dc0051a38cd283a37a7665eb4a76f6f7ec8b15
| * Fix crash when loading invalid QML with behavior on invalid group propertySimon Hausmann2014-08-082-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Behaviors require the creation of a meta-object. However when trying to create a behavior on a non-existent group property, we don't have a base meta-object to base the "new" meta-object on, therefore this patch adds a null pointer check. The error in the QML file itself will be caught later on. The added test ensures that as well as that it doesn't crash of course. Change-Id: If73116053464e7e69b02ef59e8387060835083c8 Task-number: QTBUG-40369 Reviewed-by: Sérgio Martins <sergio.martins@kdab.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | qmlRegisterCustomExtendedType, qmlRegisterExtendedUncreatableTypePaul Lemire2014-07-251-0/+12
|/ | | | | | | | | | | | | | | | | | There are cases in Qt3D where we'd like to be able to register uncreatable extended types. The main use case is having an abstract class that has an extension class so as to have a clean separation between the C++ and QML API. Implementations of the abstract can then be easily registered to QML and rely on the extension class for QML specific properties. The other feature we'll need in the near future is the ability to create extended QML types that use a custom parser. Two new type registration method were added to qqml.h to fulfill those needs. Unit tests for those are present in qqmlecmascript and qqmllanguage. Change-Id: I15b2cd791ffd36b537305af1873491c079d4094e Reviewed-by: Sean Harmer <sean.harmer@kdab.com> Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Fix crash (failing assertion) when declaring a non-string id propertySimon Hausmann2014-05-271-0/+5
| | | | | | | | | | | | | | | | | This isn't very useful QML, but the following was "legal" in 5.1: property int id: id: foo The integer property was not set, but the object's name (id) was still set. With 5.3 this causes a failing assertion, which shouldn't happen. We should do the same thing as the old code in QQmlComponent::buildProperty did for id properties: Set them only if they're of string type. Task-number: QTBUG-38463 Change-Id: I0da58557fbfb0944f53127e0ee77117ac33ce250 Reviewed-by: Tasuku Suzuki <stasuku@gmail.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Fix crash when loading QML that tries to set non-existent group propertiesSimon Hausmann2014-04-242-0/+5
| | | | | | | | | | This happens when trying to search for implicit component definitions, which only makes sense if we have a property cache. Task-number: QTBUG-38466 Change-Id: I788159453efc24bcda1b9709a1933b49fd54d6a7 Reviewed-by: Liang Qi <liang.qi@digia.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Fix assignments of null strings in QML and JavaScriptSimon Hausmann2014-04-121-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | Assigning "" to a string based property would exhibit inconsistent behavior: * When assigned as a literal, it would assign an empty string * When assigned from JavaScript, it would assign a null string When the assignment was done _to_ a QByteArray property, it would hit the case of calling QVariant::convert where the incoming variant is either an empty or a null string and the target is a QByteArray. For historical reasons - as documented - QVariant::convert will return false when the incoming variant is a null variant. In V8 assignment from JavaScript would produce an empty string and thus hit the "succesfull" conversion code path in QVariant to convert to a seemingly empty QByteArray. With v4 a null string would result in a failed conversion and spurious warnings as seen in the reported task. This patch ensures that we consistently map "" to a null string, when it comes from JavaScript or QML as a literal string. We now also detect the situation of trying to convert a (valid) null variant to another target type. Task-number: QTBUG-37197 Change-Id: I68f9031262fdd287d69a38d5468fb38a20441d7b Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
* Regression: Fix id objects in group propertiesSimon Hausmann2014-04-041-0/+4
| | | | | | | | | Setting someGroupProperty.id should not be subject to the usual restrictions with regards to valid values for id properties. Task-number: QTBUG-38085 Change-Id: Ie66d9d4d4524ddaf5a6a0b0e260354db44d9995e Reviewed-by: Lars Knoll <lars.knoll@digia.com>