aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qqmlecmascript
Commit message (Collapse)AuthorAgeFilesLines
* tst_qqmlecmascript: Adjust to QObjectCompatProperty change in qtbaseFabian Kosmale2021-02-011-2/+2
| | | | | | | Fixes: QTBUG-90786 Change-Id: Id05afbeb18b7c30246a29b95673a1319649f389f Reviewed-by: Andreas Buhr <andreas.buhr@qt.io> Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io>
* V4: Store instruction pointer before CmpInUlf Hermann2021-01-271-0/+13
| | | | | | | | The "in" operator may throw an exception. Change-Id: I7d0b6e2212ac6ec237fbf14719349f8e23810028 Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QQmlPropertyBinding: improve error reportingFabian Kosmale2021-01-256-0/+118
| | | | | | | | | | | | | | | | | | This change ensures that bindings created in QML between new-style properties contain information about which property caused the loop. To do this, we store additional information about the property involved to retrieve its name and position at a later point. We print the warning in case we detect a binding loop in evaluate, and also set the error reporting callback correctly, so that the condition can be reported when the loop is detected in another part of the binding evaluation. In addition, we do not only set the QPropertyBinding's error member when JS evaluation results in an error, but also print the warning with qmlWarning. Fixes: QTBUG-87733 Change-Id: Idb25237d1f57355ca31189e6bf2a918430b3a810 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Use new QObjectPrivate connection mechanism in dynamic connectionsAndrei Golubev2021-01-213-0/+105
| | | | | | | | | | | Old API assumes sender == receiver, which results in wrong handling of connections when receiver is deleted: connection is not removed or notified elsehow as it's not really tied to a valid receiver Task-number: QTBUG-86368 Pick-to: 5.15 6.0 Change-Id: I0f3115f1b0f26cf353752ba2b8fd88e0f3bdd388 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* QML engine: Fix writing function to property through aliasFabian Kosmale2021-01-182-0/+23
| | | | | | | | | | | | | | We special case writing functions to properties, only allowing assigning them to var properties and QJSValue properties. This would however break when aliases are involved. This commit fixes the issue by resolving the alias, and then checking and writing to the resolved property. Fixes: QTBUG-90373 Pick-to: 5.15 6.0 Change-Id: Ia09ebe92feeaf8359c99ff9aeadc676b9fcfaa07 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Remove the qmake project filesFabian Kosmale2021-01-151-21/+0
| | | | | | | | | Remove all qmake project files, except for examples which are used to test that qmake continues to work. Change-Id: Ic4abb72dc2dcd75df7a797c56056b6b3c5fe62ac Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* QML: Fix proxy iterationFabian Kosmale2020-12-172-0/+39
| | | | | | | | | | | If the target of a proxy was extensible, we did not set the iteratorTarget to its correct value, and thus the ForInIteratorObject would not be usable. Pick-to: 6.0 5.15 Fixes: QTBUG-86323 Change-Id: Id1924ac4087bab38c006b8eba92b619b79d36b7a Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* tst_qqmlecmascript: Avoid memory leak on failureFabian Kosmale2020-12-031-3/+2
| | | | | | Pick-to: 6.0 Change-Id: Icf31fbe473e5b0659cfe09d5bef8652c22a2b1ce Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* QML engine: Fix binding setupFabian Kosmale2020-12-034-0/+33
| | | | | | | | | | | We set QProperty bindings up in the wrong way: Parent components would overwrite their child component's binding. This patch reverses the order, fixing the bug. Task-number: QTBUG-87153 Pick-to: 6.0 Change-Id: I3e90d1d14a41a7c5c337745f1453484d360a3979 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Fix crash when calling hasOwnProperty() on proxy objectRichard Weickelt2020-11-241-1/+30
| | | | | | | | | | | Property pointer p needs to be checked for nullptr value in QV4::ProxyObject::virtualGetOwnProperty(). This can happen when calling hasOwnProperty() or propertyIsEnumerable(). Fixes: QTBUG-88786 Pick-to: 6.0 5.15 Change-Id: I43da58fed4d8656f9187213f7317f17398739e34 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* QML: Rewrite Qt object in actual C++Ulf Hermann2020-11-092-18/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Quite obviously, the Qt object is a singleton, extended with a namespace, backed by a member of the JavaScript global object. Defining all the methods as JavaScript functions is unnecessary and duplicates the general type transformation code. Also, it makes it hard to use those same methods from a C++ context as we cannot properly set up the arguments outside the JS engine. Rewriting the Qt object reveals some deficiencies in the old implementation that we need to fix now: 1. The enums of the Qt type were listed as properties of the Qt object, which means you could iterate them with a for..in loop in in JavaScript. This is just wrong. Enums are not properties. This functionality is deleted and the test adapted to check for each enum value separately. The commit message for the change that introduced the iterability already mentioned that the author had failed to find any occurrence of this in the real world. 2. Parsing time objects from strings was done by parsing the string as a date/time and then picking the time from that. We still support that for now, but output a (categorized) warning. Parsing the time directly is preferred where possible. 3. Previously you could create (invalid) dates and times from various kinds of QML types, like int and color. This does not work anymore as we now validate the types before calling the functions. 4. Passing more arguments to a function than the function accepted was unconditionally ignored before. Now, a Q_CLASSINFO on the surrounding class can specify that the arguments should be checked, in which case a JavaScript error is thrown if too many arguments are passed. In order for this to work correctly we also have to ignore JS undefined values as trailing arguments for overload resolution. This way, if a method matching the defined arguments exists, it will be preferred over a method that matches the full argument count, but possibly cannot accept undefined as parameter. Consequently a number of error messages change, which is reflected in the qqmlqt test. [ChangeLog][QtQMl][Important Behavior Changes] You can not iterate the enumerations of the Qt object in JavaScript anymore. This does not work with any other enumeration type either. You can of course still access them by name, for example as Qt.LeftButton or similar. [ChangeLog][QtQMl][Important Behavior Changes] The time formatting functions of the Qt object in QML now allow you to pass an actual time string, rather than a date/time string as argument. Passing a date/time string results in a warning now. [ChangeLog][QtQml][Important Behavior Changes] Functions in the Qt object for formatting date and time will now throw a JavaScript error when presented with a value of an incompatible type, such as int or color. [ChangeLog][QtQml][Important Behavior Changes] The Qt.resolvedUrl() function now returns a URL rather than a string. This follows the documentation. [ChangeLog][QtQml][Important Behavior Changes] The GlobalColor enum of the Qt namespace is not exposed to QML anymore. It did not make any sense before as the enum values could not be used as colors. Change-Id: I7fc2f24377eb2fde8f63a1ffac5548d652de7b12 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QQmlListProperty: Use qsizetype rather than int for sizesUlf Hermann2020-11-092-4/+4
| | | | | | | | | | [ChangeLog][QtQml] The QQmlListProperty callback functions use qsizetype now as type for the size of a list. This is in line with the containers that you might use to back the list. Fixes: QTBUG-88269 Change-Id: Ia38403cb32f241e6c70e1a580dbeff1d6d694331 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* V4: Prevent heap objects from getting immediately swept by GCUlf Hermann2020-11-061-1/+4
| | | | | | | | | | | A destruction handler can cause a new object to be allocated during garbage collection. Depending on where in the heap the object ends up, it may be found during the sweep pass. As the mark pass had no chance to mark the object, we need to set the mark bit right at allocation time in this case. Change-Id: Ie43eeb548e78bd375b001b3a6bb4ef6596f91980 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QML engine: fix conversion scores for sequences in CallOverloadedFabian Kosmale2020-11-043-0/+45
| | | | | | | | | | | | A QV4Sequence can be converted back to its underlying container; we therefore should give the conversion of QV4Sequence to container a high score if metaTypeForSequence and the target metatype agree. This has a larger effect in Qt 6 than in Qt 5, as we now can have new sequence types for any (QMeta)Container. Fixes: QTBUG-87616 Change-Id: I2bf02ebadbf9b707719d09edaf14b112eb2caf4f Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Fix compiler warnings from testsVolker Hilsheimer2020-11-022-7/+7
| | | | | | | | Replace foreach with ranged for; don't name unused function parameters. Change-Id: If0d9138261567edb14b72791799c6da1b16b5a5b Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: David Skoland <david.skoland@qt.io>
* Update tests to use new metaType systemDavid Skoland2020-11-021-22/+21
| | | | | | | | Change from the QVariant enum to the QMetaType enum and prefer typeId over userType where possible Change-Id: Ic89c55978d46cc23d23b8e9c82c475c0c220fae3 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QML: Make date parsing more lenientFabian Kosmale2020-10-292-0/+13
| | | | | | | | | | | This fixes a regression from Qt 5 to Qt 6, because QDateTime is now apparently more strict in its parsing of RFC2822Date. The string in the test-case is not valid according to that spec, but JS engines like V8 still accept it, and so did we in Qt 5. Fixes: QTBUG-87610 Change-Id: I2c6eb2087e4845b04fa0dc4f7aa9a229b3428a43 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Fix QProperty property interaction with aliasesFabian Kosmale2020-10-122-0/+44
| | | | | | | | | | | | | | | | With this change, an alias of a bindable property is also bindable, and shares its bindable interface with the target. Moreover, the logic in QQmlTypeCompiler is adjusted so that a change handler of an alias uses the bindable interface if possible, instead of connecting to the alias' change signal. That would never be emitted if the target is a QProperty without a notify signal. Alias properties still have a change signal, but those never get emitted. Change-Id: I857dfdbe51048a2b604ad632982e7f4adac6b907 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* CMake: Regenerate projects to use new qt_internal_ APIAlexandru Croitor2020-10-062-10/+10
| | | | | | | | Modify special case locations to use the new API as well. Task-number: QTBUG-86815 Change-Id: I3b964e3baf0cc7040830156dac30358ea1152801 Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* Handle QProperty inside bindingsFabian Kosmale2020-09-212-0/+17
| | | | | | | | | | | | | | | | | | | If we have a binding containing QProperties, and the binding target is an old style binding, still we have to trigger an update if any of the captured properties changes. We cannot reuse the QQmlJavaScriptExpressionGuards as those depend on Qt's signals, and a QProperty is not associated with a change signal in the general case. Therefore, we introduce a new list of QPropertyChangeHandler, which when triggered cause a reevaluation of the binding. As an optimization, we skip the whole capturing process for QQmlPropertyBinding, as that one already takes care of updating itself. Reverts 845bbb99a41a3e4f05c2b3d05d6db748c825dca0 (because skipping the capture is only possible when _both_ the bindee and the property in the binding are QProperty based.) Change-Id: Iafed2a41dcd708bcc33912ce810d803949379c63 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Fix additional warnings from usage of deprecated APIsVolker Hilsheimer2020-09-161-1/+1
| | | | | | | | | | Replace more QLibaryInfo::location with QLibraryInfo::path Replace old event accessors APIs, including relevant comments. Change-Id: Ie205fc93b6e1c0dfb3dca9100fbde417ab68fc9f Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Adapt to changes in qtbaseUlf Hermann2020-09-151-0/+1
| | | | | | | | | Due to qiterable.h specializing a template declared in qmetatype.h we temporarily need to include it in a few tests so that the iterables work. Change-Id: Ia32392419dead76eaf2b91b2ec4157b726d8de74 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Adjust to qtbase changesFabian Kosmale2020-09-043-12/+14
| | | | | | | | | | | | | - isQProperty has been renamed to bindable - QNotifiedProperty is no more - Bindable properties have a function to obtain the QBindable; store that information in the qmltypes files. Task-number: QTBUG-86434 Task-number: QTBUG-86435 Change-Id: I2ba593af1e197d04d2c30cfb9e6904a3d2059e4b Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Tests: pass QDate and QTime by value rather than const referenceEdward Welbourne2020-09-011-2/+2
| | | | | | | They've value types, packaging qint64 and int respectively. Change-Id: Ia9a96748f9423139f41df720ce987ce96435beca Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Remove deprecated QQmlListProperty constructorFabian Kosmale2020-08-311-2/+2
| | | | | | | | | | [ChangeLog][QML][QQmlListProperty] Removed deprecated QQmlListProperty constructor taking a reference. Use the overload taking a pointer instead. Change-Id: I8942026d1bb1c88065659d96d648a4b256d7d427 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Unify "variant" and "var" properties in QMLFabian Kosmale2020-08-244-320/+3
| | | | | | | | | | | | | | | | | | | | variant and var properties differ in two important ways: - variant properties trigger "magic" string conversions: variant v1: "red" // contains a QColor var v2: "red" // contains a string - variant properties behave differently for value types: they create copies, instead of references. However, as variant properties were marked as obsolete and this behavior was effetively undocumented, it should be safe to give "variant" "var semantics". With this change, we can also avoid doing magic conversions when storing data in QVariant properties of QObjects/QGadgets Change-Id: I549b1beb98e6af9639c1ee81f316bda513d5ff65 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Do not set QQmlPropertyBinding until we reach finalizeFabian Kosmale2020-08-124-3/+47
| | | | | | | | | | | If we install the binding eagerly, context properties cannot be resolved yet, as the context object has not been created so far. This causes issues with a QNotifiedProperty using a callback which accesses the current value, and thus forcing the binding evaluation while the object creation is still ongoing. Change-Id: I3bf3def04cd044371cb757a1854a3224a9c669b8 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Give a better score for methods with a convertable type when matchingAndy Shaw2020-07-033-0/+37
| | | | | | | | | | | | When it is looking for a matching method based on the argument types, then if a QVariant can be converted to that type then it should give a better score for that method. This is so that it can see it as being more viable a choice when calling the method instead of potentially not being able to find a matching one. Pick-to: 5.15 Change-Id: Ief7e11feacd1d0b0959330af2576c2d01affbc54 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Add ; to Q_UNUSED and UNUSED_PARAMLars Schmertmann2020-06-262-18/+18
| | | | | | | | | This is required to remove the ; from the macro with Qt 6. Task-number: QTBUG-82978 Change-Id: Iead53d18fd790fb2d870d80ef2db79666f0d2392 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Drop special casing of QDateTime when setting valuesUlf Hermann2020-06-251-2/+2
| | | | | | | | | | | | | | | | | This introduced inconsistency in order to be compatible with V8 and Qt 5.0/5.1, respectively. We don't need to do this anymore. We standardize on the behavior observed when statically setting a property in QML, e.g. "foo: '2014-03-03'", rather than the behavior observed when dynamically setting it from JavaScript. [ChangeLog][Important Behavior Changes] Dates are interpreted the same way when assigned to QML properties as when parsed in JavaScript now. The time zone is generally left alone, not forced to UTC in some cases. Fixes: QTBUG-36635 Change-Id: I72a7045d7b39ee1c6e0ac1ef55d74ef8aa505f00 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QQmlPropertyBinding: convert to correct typeFabian Kosmale2020-06-252-3/+3
| | | | | Change-Id: I5b7b4d670c6308b33a2fd0580790934345bb3504 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* qqmlecmascript: modify test to return type which is actually unknownFabian Kosmale2020-06-231-1/+3
| | | | | | | | This is necessary after the change to QMetaMethod, which now uses compile time information to return the (meta) return type. Change-Id: I9f0bf4fd174c7000273b6d3c65ec3ebf8f2c46f8 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* tst_qqmlecmascript: QList is now QList again (not QVector)Fabian Kosmale2020-06-231-1/+1
| | | | | Change-Id: Ib3b7437fcf3696111563cc1b5f9440b6b0d9c75e Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Do not resolve URLs when assigning them to a propertyUlf Hermann2020-06-221-6/+6
| | | | | | | | | | | | | | | We don't know in advance if a URL is part of the source code and should be relative to the current element, or if it is part of the application data and should not be touched. [ChangeLog][QtQml][Important Behavior Changes] URLs are not resolved or intercepted anymore when assigning them to a "url" property. Instead they are resolved and possibly intercepted when used to access an actual resource. Fixes: QTBUG-76879 Change-Id: Iaa2385aff2c13aa71a12e57385d9afb5dc60a073 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Adapt test to QMetaMethod changeFabian Kosmale2020-06-041-0/+1
| | | | | | | | | | With the new compile time type registration, the type is no longer unknown, causing the test to fail. Until we decide exactly how to deal with unknown types in QML, leave the test as is, but mark the failing comparison as an expected failure. Change-Id: Iaa23f096f686399b7199541b390655142fc40a37 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Implement URLSearchParamsMaximilian Goldstein2020-05-061-0/+59
| | | | | | | | | | Implements URLSearchParams (https://url.spec.whatwg.org/#urlsearchparams), completing our implementation of the URL object. Still needs the for..of iterator to get implemented. Change-Id: Iad33ed2f3fe0b2598ca2b0b21a4743f5f7dc19fd Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Implement URL objectMaximilian Goldstein2020-04-081-0/+191
| | | | | | | | | Implements the JavaScript URL object (https://url.spec.whatwg.org/#api). Except that it does not currently implement the searchParams field. Task-number: QTBUG-54988 Change-Id: I19abc69e075cbf84bd15e6791be195ce16f3fe73 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Remove QRegExp from qml autotestsLars Knoll2020-04-034-36/+0
| | | | | | | | QRegExp will get removed in Qt6. Clean up by removing dependencies on QRegExp in the autotests. Change-Id: I8ef8561ba30b98b61cd9ed52907b48c5969f2c49 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Implement support for property observersSimon Hausmann2020-04-032-0/+7
| | | | | | | | | Syntactically we call them signal handler expressions :-), now also working when the underlying property doesn't emit an old-style signal but is just a QProperty. Change-Id: I719a3e428f44af0fd48036434aefa682a02f7de1 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Throw an error if an incompatible parameter is passed to a C++ functionMaximilian Goldstein2020-04-021-24/+18
| | | | | | | | [ChangeLog][Important Behavior Changes][QML] Throw an error if an incompatible parameter is passed to a C++ function Change-Id: I088e362869f7dc00ca639a0fbc4ba20cb9e82f7d Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Warn if too many parameters are passed to a C++ functionMaximilian Goldstein2020-04-011-0/+4
| | | | | Change-Id: I8ddf55d48d9276be5880e89e7b854f3355891f8e Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Add support for binding directly to QProperty instancesSimon Hausmann2020-03-304-0/+35
| | | | | | | | | | Avoid going through externally managed bindings and instead allocate a more lightweight property binding. It's basically a QQmlJavaScriptExpression and one pointer plus the overhead of QPropertyBindingPrivate. Change-Id: I1530330926d351b61f2b3bbad39301c628a8bef1 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Encapsulate QQmlContextDataUlf Hermann2020-03-231-29/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This class is not a private detail of QQmlContext. And it is incredibly hard to see who owns what in there. Let's add some civilization ... We enforce refcounting for QQmlContextData across the code base, with two exceptions: 1. QQmlContextPrivate may or may not own its QQmlContextData. 2. We may request a QQmlContextData owned by its parent QQmlContextData. For these two cases we keep flags in QQmlContextData and when the respective field (m_parent or m_publicContext) is reset, we release() once. Furthermore, QQmlContextData and QQmlGuardedContextData are moved to their own files, in order to de-spaghettify qqmlcontext_p.h and qqmlcontext.cpp. When the QQmlEngine is deleted, any QQmlComponents drop their object creators now, in order to release any context data held by those. Before, the context data would be deleted, but the object creators would retain the dangling pointer. [ChangeLog][QML][Important Behavior Changes] QQmlContext::baseUrl() does what the documentation says now: It prefers explicitly set baseUrls over compilation unit URLs. Only if no baseUrl is set, the CU's URL is returned. It used to prefer the CU's URL. Change-Id: Ieeb5dcb07b45d891526191321386d5443b8f5738 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QQmlPropertyCache: Avoid costly string comparisonFabian Kosmale2020-03-181-13/+5
| | | | | | | | The qqmlecmacsript required changes, because the call to id makes the type now known to the QML engine. Change-Id: I73aed804ae8769c71676b44d8450e1dabf5baa6d Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Store a QV4::ReturnedValue in QJSValueUlf Hermann2020-03-181-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Being careful, we can now save primitive values inline. We use the heap pointer of QV4::Value as either QString* or QV4::Value* for complex types. We cannot store persistent managed QV4::Value without the double indirection as those need to be allocated in a special place. The generic QVariant case is not supported anymore. The only place where it was actually needed were the stream operators for QJSValue. Those were fundamentally broken: * A managed QJSValue saved and loaded from a stream was converted to a QVariant-type QJSValue * QVariant-type QJSValues were not callable, could not be objects or arrays, or any of the special types. * Cyclic references were forcibly broken when saving to a data stream. In general the support for saving and loading of managed types to/from a data stream was so abysmally bad that we don't lose much by dropping it. [ChangeLog][QML][Important Behavior Changes] When saving a QJSValue to a QDataStream only primitive values or strings will be retained. Support for objects and arrays was incomplete and unreliable already before. It cannot work correctly as we don't necessarily have a JavaScript heap when loading a QJSValue from a stream. Therefore, we don't have a proper place to keep any managed values. Using QVariant to keep them instead is a bad idea because QVariant cannot represent everything a QJSValue can contain. Fixes: QTBUG-75174 Change-Id: I75697670639bca8d4b1668763d7020c4cf871bda Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Also support partly specified versions in JS .importsUlf Hermann2020-03-181-3/+3
| | | | | | Task-number: QTBUG-71278 Change-Id: Ie3167d44780a192b5010052eea5192eee8c21c32 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* CMake: Update Apple platform defines after rename in qtbaseTor Arne Vestbø2020-03-172-4/+4
| | | | | Change-Id: Ia0a075e3199eab735f9b289873beeb8730ebc47e Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Merge remote-tracking branch 'origin/dev' into wip/cmakeAlexandru Croitor2020-03-122-14/+38
|\ | | | | | | | | | | | | | | Conflicts: dependencies.yaml src/qml/qml/qqmlengine.cpp Change-Id: I6a73fd1064286f4a2232de85c2ce7f80452d4641
| * Remove parts of sequence type testFabian Kosmale2020-03-091-7/+1
| | | | | | | | | | | | | | | | | | The tests makes assumptions which simply don't hold anymore, now that QProperty does automatic type registration, and the engine supports magic conversions via QSequentialIterable. Change-Id: I33e8eeca95757686e59da9db5ef5d92041364335 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2020-03-091-1/+1
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/qml/compiler/qqmlirbuilder_p.h src/qml/qml/qqmlpropertycachecreator_p.h src/qmltyperegistrar/qmltypesclassdescription.cpp src/qmltyperegistrar/qmltypesclassdescription.h src/qmltyperegistrar/qmltypescreator.cpp src/quick/items/qquicktext_p.h src/quick/util/qquickvaluetypes_p.h Change-Id: Ic209741592e7b85820bf3845722023a190ebc1c5