aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml
Commit message (Collapse)AuthorAgeFilesLines
...
| * | QML: Pass type minor version when creating property dataUlf Hermann2019-02-213-0/+69
| | | | | | | | | | | | | | | | | | | | | | | | | | | Depending on the type minor version recursive properties should be available or not. Check for that when resolving grouped properties. Fixes: QTBUG-33179 Change-Id: Id8f62befdc4a29d879710499e19d3d289bd18775 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * | QQmlPropertyCache: support setting an explicit metaObject revisionRichard Moe Gustavsen2019-02-211-0/+21
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When creating a QQmlPropertyCache for a QMetaObject, there were currently no way to specify which revision to use. Normally this is not needed, since when creating property caches for types declared in QML, the correct revision would be filled in later, based on the import version found in the QML file. But sometimes we need to create a QQmlPropertyCache for a QMetaObject created in C++, that has no associated QML file and import version. And if that meta object has revisioned properties, we need to specify which revision of the meta object the cache should represent. Otherwise, the revision would just be 0, which means that revisoned properties would not be found by the V4 runtime later. As an example, QQmlAdaptorModel has a set of classes that wraps various models (QAIM, arrays, etc). When a new delegate item is created by a view, an instance of a model class will be created as well (from C++). This instance will be set as context object for the delegate item, enabling properties such as index, row, column and model roles. But since row and column should a revision (currently they don't), we need to be able to specify that the property cache should have a revision that matches the import version of the view. That way, we can ensure that they don't shadow any existing row and column properties that might exist in the application from before, and as such, cause regressions. This patch will add an extra argument to the constructor that lets you specify which revision of the QMetaObject to use. Task-number: QTBUG-70031 Change-Id: I1c245a0c8b6f071e35865966fedc97f2839cd2f3 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | Only generate a warning when assigning null to incompatible propertiesUlf Hermann2019-02-224-4/+4
| | | | | | | | | | | | | | | | Such code used to work before and we should not break it without a proper deprecation procedure. Change-Id: I049caf6ae5cc06aa796b19eda858612935b8d674 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-02-205-43/+86
|\| | | | | | | Change-Id: I69c3e6610ff590d9c18f386fc17ed2e429b58d26
| * Avoid unnecessary re-generation qml cache files in some circumstancesUlf Hermann2019-02-182-17/+46
| | | | | | | | | | | | | | | | | | | | | | | | The map of name IDs to resolved types so far is copied several times during compilation and different compile passes see different copies of it. Compile passes may add things to the map, and if they do that on copies that are inaccessible to other code, we get nondeterministic results. Furthermore all the copies and pointers are confusing and inefficient. Fixes: QTBUG-69340 Change-Id: I43ad3cbeeec34f90e05570eddc901fe8aa64c709 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * QML: Don't crash the parser on certain kinds of bad inputUlf Hermann2019-02-181-0/+10
| | | | | | | | | | | | Fixes: QTBUG-72734 Change-Id: I92146ec517c6a26a67e13830618e137f2a3021c2 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * Check parameter types when invoking C++ functions from QMLUlf Hermann2019-02-172-26/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We now check if the given parameters can be converted to the expected arguments of the function being invoked and throw a type error if not. Previously we would still invoke the method with random parameters. [ChangeLog][QtQml][Important Behavior Changes] The parameters passed to C++ functions from QML are now checked for compatibility with the expected arguments. If they cannot be converted, a type error is thrown in JavaScript and the function is not invoked. Fixes: QTBUG-73405 Change-Id: If16089510d314bb7cdb7d4db86478114c61281a8 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-02-152-0/+51
|\| | | | | | | | | | | | | Conflicts: src/qml/qml/qqmlpropertycache.cpp Change-Id: Ie7727499700b85cc0959ef3abb30d55dc728b659
| * PropertCache: Don't pass Q_GADGET value types as integersUlf Hermann2019-02-142-0/+51
| | | | | | | | | | | | | | | | We need to check for the IsGadget flag there. Fixes: QTBUG-73734 Change-Id: Ic4afd4215e6ed346bc40794d85397f0f262715e2 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-02-149-13/+103
|\| | | | | | | Change-Id: I2842f4a8096c4555e29f08e65b88b77b841441cb
| * Connect quit() and exit() signals with queued connectionsMichal Policht2019-02-137-13/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Class QQmlApplicationEngine connects QQmlApplicationEngine::quit() signal to QCoreApplication::quit() and QQmlApplicationEngine::exit() signal to QCoreApplication::exit(), but it does so with AutoConnection. This causes in some circumstances problems, which are described in Qt documentation (see QCoreApplication::exit()). This change modifies type of connections to queued connections. [ChangeLog][QtQml][QQmlApplicationEngine] QQmlApplicationEngine connects quit() and exit() signals with queued connections to avoid problems with AutoConnection, when connecting to QCoreApplication slots. Task-number: QTBUG-73649 Change-Id: Ib27738b5af2f879efee8862b1ca01613a2e8dc4e Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
| * Don't optimize global lookups if fast QML lookups are disabledUlf Hermann2019-02-132-0/+38
| | | | | | | | | | | | | | | | | | | | | | If fast QML lookups are disabled, we generally want to look up by string. If the name then happens to be a member of the global JavaScript object, we still don't want to directly access that, as the name could have been overridden in a deeper context. Fixes: QTBUG-73750 Change-Id: Id16110969123d91501064ba46bfad4c2a39e4650 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Update tests/auto/qml/ecmascripttests/test262Jani Heikkinen2019-02-081-0/+0
| | | | | | | | | | | | Task-number: QTBUG-73454 Change-Id: I12925ce49cc18f4bb6908a5515fc476b32a222dc Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Merge remote-tracking branch 'origin/5.12' into 5.13v5.13.0-alpha1Qt Forward Merge Bot2019-02-072-2/+2
|\| | | | | | | Change-Id: I5209d833e171c795556c075e2a5f964b59b6df2e
| * Improve error messageRainer Keller2019-02-042-2/+2
| | | | | | | | | | | | | | Show more datails about what actually went wrong. Change-Id: I418a4d1f433bd4d440fc34e9a4932a9ea010b174 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | Merge remote-tracking branch 'origin/5.12' into 5.13Liang Qi2019-02-011-3/+44
|\| | | | | | | | | | | | | | | Conflicts: src/qml/compiler/qv4codegen.cpp Done-With: Erik Verbruggen <erik.verbruggen@qt.io> Change-Id: I3ae3d64317e4f3fccba6605f4c6da15479ca75e0
| * Correctly scope unwind handlers for try blocksLars Knoll2019-01-301-3/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | Make sure the unwind handler is always reset when leaving the try block. This exposes a couple of failures in the ECMAScript test suite that were before passing by pure luck. Task-number: QTBUG-72858 Change-Id: I014b1e37c2beff136ecd53a665a2f10933f7e12c Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
* | Merge remote-tracking branch 'origin/5.12' into devLiang Qi2019-01-2910-3/+252
|\| | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/3rdparty/masm/yarr/YarrJIT.cpp src/qml/compiler/qv4instr_moth.cpp src/quick/handlers/qquicksinglepointhandler_p.h src/quick/handlers/qquicktaphandler.cpp src/quick/items/context2d/qquickcontext2d.cpp Done-With: Ulf Hermann <ulf.hermann@qt.io> Change-Id: I109453131f9f0a05316ae37c7d6ed1edc8c0f9d4
| * Bring behavior of String.replace() in line with other enginesLars Knoll2019-01-251-0/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "x".replace("x", "$1") gives "$1" in both JSC and V8, as there are no captures that could be used as a replacement for $1. Implement the same behavior as it's the most logical thing to do (even though it's undefined according to the spec). Two digit captures ($nm) work in a way that they get applied if $nm captures exist. If there are less than nm but more than n captures available $n is replaced by the n'th capture and m is copied over verbatim. Change-Id: I8b5f576f2c42c8334859ab7854dcdf07104dd35b Fixes: QTBUG-73152 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * MemoryManager: Only clear weak values onceUlf Hermann2019-01-234-3/+90
| | | | | | | | | | | | | | | | | | | | | | | | We want to keep the weak values alive while the destruction callbacks are running, so that they can still access them. We set them to undefined later anyway because we expect the destruction callbacks to mess with the values. Therefore there is no point in also setting them in between. Fixes: QTBUG-72137 Change-Id: I83f70230f5b4ad2761c74770f975b14a5ca71f18 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
| * QQmlNotifier: Always keep the isNotifying flag when updating senderPtrUlf Hermann2019-01-232-0/+41
| | | | | | | | | | | | | | | | | | | | | | When the sender gets deleted we still want to retain the flag that tells us that the notifier is currently active. Otherwise we can miss the error message about synchronously deleting objects while signal handlers are in progress. Task-number: QTBUG-73013 Change-Id: I8abba9b492327c15963d1875841c6822f345a89e Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * Merge remote-tracking branch 'origin/5.12.1' into 5.12Qt Forward Merge Bot2019-01-213-0/+62
| |\ | | | | | | | | | Change-Id: I1e0bbc35807bd0f7f96694539d2fbec0f83ddb16
| | * When matching RegExps catch JIT failuresUlf Hermann2019-01-093-0/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Yarr JIT can generate code that fails to evaluate the RegExp at runtime. In that case we need to fall back to the interpreter. Also, don't needlessly cast the unsigned return value of RegExp::match to signed int before range-checking it. And fix some typos in the comments for the disassembler dumps. Fixes: QTBUG-72879 Change-Id: Ic8f80c076d6461d714816a9f66e1cac1d9b0c7a8 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | V4: Collect trace information in the interpreterErik Verbruggen2019-01-253-0/+334
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Collect type information about values used in a function. These include all parameters, and the results of many bytecode instructions. For array loads/stores, it also tracks if the access is in-bounds of a SimpleArrayData. Collection is only enabled when the qml-tracing feature is turned on while configuring. In subsequent patches this is used to generated optimized JITted code. Change-Id: I63985c334c3fdc55fca7fb4addfe3e535989aac5 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | | QML: Don't accept assignment of Component to properties of other typesUlf Hermann2019-01-223-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | This is dangerous and I don't see a reason why we should allow it. Fixes: QTBUG-72930 Change-Id: I01b9e624b4b80d52c1a847fa6ecd7a6d44614010 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | Merge remote-tracking branch 'origin/5.12' into devLiang Qi2019-01-222-0/+55
|\| | | | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf tests/auto/quick/qquickpathview/tst_qquickpathview.cpp Change-Id: Ic1f5e219a255d0613f7654368a5ce3eccb8f0ee9
| * | Annotate stack traces when frames are elided through tail callsErik Verbruggen2019-01-151-0/+16
| | | | | | | | | | | | | | | | | | Task-number: QTBUG-72407 Change-Id: I98b96852309fc783a945797185f666196513d24b Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
| * | QQmlMetaType: Erase attached properties in dtorUlf Hermann2019-01-151-0/+39
| |/ | | | | | | | | | | | | | | | | | | Also, make it more obvious that the attachedPropertyIds are a static member of QQmlTypePrivate. Fixes: QTBUG-72972 Change-Id: If0a28e034dd46d7127993ed15aed11c7641d580e Reviewed-by: Harald Hvaal <harald.hvaal@gmail.com> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | QML: Special case null as binding typeUlf Hermann2019-01-216-4/+18
| | | | | | | | | | | | | | | | | | | | | | | | This gives us the opportunity to map the JavaScript null to QVariant's concept of isNull(). [ChangeLog][QML] Assigning JavaScript null to incompatibly typed properties generates a compile error now, rather than a runtime error. Fixes: QTBUG-72098 Change-Id: I72fd1c30d84128c774230eaaea10455b2a0e064c Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Merge remote-tracking branch 'origin/5.12' into devQt Forward Merge Bot2019-01-101-7/+7
|\| | | | | | | | | | | | | Conflicts: .qmake.conf Change-Id: I6b2539bf17d3e9bc66d96b53c1bce95680113ed8
| * Tests: Don't capture stack value by referenceUlf Hermann2019-01-031-7/+7
| | | | | | | | | | | | | | | | | | We can actually not capture d at all there, as some of the items get deleted before the root object is deleted. Therefore, we need to iterate the children again on receiving the destroyed() signal. Change-Id: Iab7ebc3c731438a21b243284de7515530232828f Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Property Cache: Use related meta objects to check for "enums"Ulf Hermann2019-01-041-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | If a method of a QObject-derived class takes a "foreign" enum as a parameter, the enum's meta object is added to the "relatedMetaObjects" property. Therefore, we can actually determine if something is a named enumerator, even if we initially don't have its metaobject. This way we don't need to detect these types by their type flags anymore and therefore we can remove the band aid added in commit fd9d88e3a9f24eb84d029fb9324b4f03ae58ffeb. Change-Id: Id602d2b6f688a12b5addef855f6a16920b4e6549 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Add option to retain sources when generating QML cacheUlf Hermann2019-01-044-0/+18
| | | | | | | | | | | | | | | | | | | | | | By default any .qrc files are filtered and QML and JS sources dropped when generating the cache. The new QTQUICK_COMPILER_RETAINED_RESOURCES option allows the specification of .qrc files to be kept as they are. The source fils specified in them will be available to the application. Change-Id: If45bcd95c29fe4b91f5817573964ff55b1db8a00 Fixes: QTBUG-72430 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Improve logging of nested arraysUlf Hermann2019-01-032-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | Nested arrays should be printed with nested '[' and ']', rather than flattened. [ChangeLog][QML] Nested arrays are not flattened anymore when printed through console.log() and friends. Change-Id: Ic27e58047fd78bc146e1179585fd0cb2c60a1144 Fixes: QTBUG-71931 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | QQmlPropertyCache: Add test that reads and writes short enumsUlf Hermann2019-01-032-1/+31
| | | | | | | | | | | | | | | | This is to guard against any problems from casting those to int and back. Change-Id: I740a5250158ce47195ab04d42d967ff9c82bf9bd Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Merge remote-tracking branch 'origin/5.12' into devQt Forward Merge Bot2018-12-236-45/+82
|\| | | | | | | Change-Id: I9c3d282c11a556e616c5e1ba1b51e88b741327f6
| * Quote stringified generic variants on JSON.stringifyUlf Hermann2018-12-201-1/+2
| | | | | | | | | | | | | | | | | | | | A string representation of those is unlikely to be actual JSON, and even if it is, we don't want to use it as such. Fixes: QTBUG-72674 Change-Id: I6815366a0176d9725ff4840d3fc545792ce00535 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Robin Burchell <robin.burchell@crimson.no>
| * Un-blacklist qsequentialanimationgroupjob testShawn Rutledge2018-12-131-2/+0
| | | | | | | | | | | | | | Recent Coin statistics seem to tell us that it's been passing. Change-Id: I0d32531266d1642a3fe2b18c0956a3ac589f5ee2 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
| * Avoid memory leaks in QQmlComponent testUlf Hermann2018-12-121-42/+49
| | | | | | | | | | Change-Id: I33f5f72bf90ba1ba6aef5668fab660421c722ae6 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * QML: Fix registering and unregistering of context objectsUlf Hermann2018-12-123-0/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When we add a context object we need to include it into the list of contextObjects of its outer context, so that the outerContext member can be reset when the outer context disappears. On the flip side, we also need to remove it from this list when the object gets removed. We don't need to reset the inner context of an object when the outer context disappears, though. Fixes: QTBUG-72241 Change-Id: Ifd34650d852642a364df23b697d32e3961d0479b Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Tests: Add a ctor to MyQmlObject::MyType to mark it as complexUlf Hermann2018-12-211-0/+1
| | | | | | | | | | | | | | | | | | This is a band aid fix for the fact that we don't have a way to mark a type as not-passable-as-int in this case. Task-number: QTBUG-72719 Change-Id: I781d6bfbd1717d2cf6b3f9a31ae176e3b87704b6 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Merge remote-tracking branch 'origin/5.12' into devQt Forward Merge Bot2018-12-127-12/+102
|\| | | | | | | | | | | | | Conflicts: tests/auto/qml/debugger/qqmldebugjs/tst_qqmldebugjs.cpp Change-Id: Ic1dace832ad4b29023d24808b8617b5dcc915eb5
| * Merge remote-tracking branch 'origin/5.12.0' into 5.12Qt Forward Merge Bot2018-12-071-0/+9
| |\ | | | | | | | | | | | | | | | | | | | | | Conflicts: src/qml/jsruntime/qv4script.cpp src/qml/parser/qqmljslexer.cpp Change-Id: I82252a8c504a4b77c45f4f8efe849ff9acb949fd
| | * QML Lexer: Stop scanning template literals on closing '`'v5.12.0-rc2v5.12.0-rc1v5.12.0Ulf Hermann2018-11-191-0/+9
| | | | | | | | | | | | | | | | | | | | | Fixes: QTBUG-71812 Change-Id: I93b99496a7572c0f5128c69b865bb2b4f87d29af Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
| * | Fix compilation with gcc 4.8Ville Voutilainen2018-12-033-12/+12
| | | | | | | | | | | | | | | | | | | | | GCC 4.8 doesn't like using QPointers in signal connections. Change-Id: Ide55318374183e52eaf09176a118f7d22b7cfd6e Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * | QML: Also clear outerContext's contextObject on destructionUlf Hermann2018-11-303-0/+81
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A QObject can not only be set as contextObject of the own context, but also as contextObject of the outerContext of a respective QQmlData. This can be seen in QQmlObjectCreator::createInstance(...) if isContextObject is true. Therefore, when catching a QObject deletion we need to clear the pointer in the outerContext if that refers to the object being deleted. Fixes: QTBUG-71037 Change-Id: Ib6ba99bd5336f7582486b2128515021245370c60 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | V4: Generate function tables on 64bit windowsUlf Hermann2018-12-033-1/+111
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In order for global exception handlers to be called reliably, the runtime needs to unwind through JIT-generated code. This can be facilitated by installing a "function table" for each JITed function that specifies "use the frame pointer". Also make sure to generate a function table for JIT'ed regular expressions. Those were forgotten also in the linux case. Fixes: QTBUG-50061 Change-Id: Ib0b8ae9356ed80afe1cab017e36efa4ccbe73f90 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | Merge remote-tracking branch 'origin/5.12' into devQt Forward Merge Bot2018-11-302-1/+30
|\| | | | | | | | | | | Change-Id: Ie977b1998eba8c9aa8582a96132bf1aa0ec55ca4
| * | Fix parsing of js files via Qt.include()Simon Hausmann2018-11-292-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make sure to parse them as JavaScript, not as QML, so that certain keywords such as char or double map to identifiers as expected. Also removed an unused function. Fixes: QTBUG-71524 Change-Id: Ie8a8dabe717ee12def6af512943e6d01efcf9876 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
| * | JS: Limit expression and statement nesting levelErik Verbruggen2018-11-291-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | This is to prevent extremely deeply nested expressions and statements make the code-generator run out of (native) stack space. Task-number: QTBUG-71087 Change-Id: I8e1a20a361bff3e49101e535754546475a63ca18 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>