aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml
Commit message (Collapse)AuthorAgeFilesLines
...
| | * 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>
* | | TableModel: add roleDataProvider callbackShawn Rutledge2019-02-152-0/+84
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As an alternative to trying to write smarter C++ in the data() accessor, we give the user full control of data conversion by calling an external JS function if defined, to map role to the value that data() should return. This enables extracting arbitrary values, converting the data in arbitrary ways, or even doing calculations in case the EditRole stores a formula and the DisplayRole should provide the result, or something like that. This callback is implemented somewhat like TableView.columnWidthProvider, but the arguments are more complex: function(row, column, role, rawData) Change-Id: Ifaf5807f4809e0b5ad1d1c403f65c0707b902f10 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | | Add TableModelMitch Curtis2019-02-087-0/+1333
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a QML type that can be used as a model for the new TableView. The model data is set by assigning a JavaScript array to the rows property (or by calling appendRow()). After data has been assigned for the first time, the available columns and roles are fixed for the lifetime of the model, as opposed to ListModel where the dynamicRoles property could be used. This is done intentionally to simplify the code. The API is designed to be familiar to users of ListModel: - To add new rows, use appendRow() and insertRow(). - To modify existing rows, use setRow(), moveRow(), removeRow(), and clear(). [ChangeLog][Qt Labs QML Models] Added the TableModel QML type, a JavaScript-based model for the new TableView. Fixes: QTBUG-70334 Change-Id: I55387a08b122227c5624f78af3d450b7695d974a Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | | Merge remote-tracking branch 'origin/5.13' into devQt Forward Merge Bot2019-02-082-2/+2
|\| | | | | | | | | | | Change-Id: I92e477524c95cceed61882e494e478eb1f8991ce
| * | 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>
* | | Move QStringHash into its own fileUlf Hermann2019-02-061-1/+0
| | | | | | | | | | | | | | | | | | | | | QHashedString and QStringHash are different things. Change-Id: Ifcac58ef41bf15dd6172fa0c42b86eca385c2ce0 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | | QML: Split qqmlmetatype{_p.h|.cpp} into multiple filesUlf Hermann2019-02-062-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | Having all those classes in one big file promotes spaghetti code and makes the code unreadable. Change-Id: I3b6df93b9cfe1d97228771049b3054e78b868ea3 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | | V4: Clean up the runtime functions declarationsErik Verbruggen2019-02-051-2/+2
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The declarations and usage of runtime functions have seen a number of changes: - we don't use the array of method pointers anymore because we don't use cross-platform AOT JITting - the check if a method can throw a JS exception was invalid, and was not used anymore - value-pointer vs. const-value-ref was inconsistent This patch cleans that up. By fixing the exception checking, we can now use it in the baseline JIT to automatically insert those checks. To make that work correctly, all runtime methods are in a struct, which gets annotated to indicate if that method throws. (The old way of checking which type of engine was used is fragile: some non-throwing methods do not take an engine parameter at all, and those got flagged as throwing). By using a struct, we can also get rid of a bunch of interesting macros. The flags in the struct (as mentioned above) can later be extended to capture more information, e.g. if a method will change the context. Change-Id: I1e0b9ba62a0bf538eb728b4378e2678136e29a64 Reviewed-by: Lars Knoll <lars.knoll@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>
* | | Merge remote-tracking branch 'origin/5.12' into devQt Forward Merge Bot2018-11-2416-5/+220
|\| | | | | | | | | | | Change-Id: I57e4b762dcccf2f7f6e4b659f6fc8c40465d3322
| * | Fix qmlplugindump version dump issueMichal Policht2018-11-234-0/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Changed major and minor version of created QQmlType. Using major and minor version of a candidate instead of major and minor versions passed to a function. Task-number: QTBUG-67292 Change-Id: I2c30f5e8f49aa0be3a1d5b404ab16eb376ad8092 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
| * | V4: Avoid copying WeakValues with wrapped QObjectsUlf Hermann2018-11-221-0/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Such WeakValues are kept alive until the respective QObject is deleted. Therefore they are quite expensive. In this case we don't actually need a copy as on retrieval we only want a ReturnValue and on inserting we just want to replace the value in the map. Fixes: QTBUG-71817 Change-Id: I385c55140337d468289046243941077ba1ff61a3 Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
| * | Ensure our builtin constructors are subclassableLars Knoll2018-11-222-5/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | Respect the newTarget passed into those constructors and make sure we set up the proto chain correctly. Change-Id: I3d12c7dbef4b33660a6715d73e9fb0f89105167a Fixes: QTBUG-71138 Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>