aboutsummaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
...
* QmlCompiler: Construct multi-part URIs with '.' rather than '/'Ulf Hermann2022-01-184-0/+17
| | | | | | | | | | | This is how URIs are defined and how we store them in our caches. Without this, we cannot find modules with multi-part URIs imported using -i. Change-Id: I86b02b2c2102a2d4edd8c20388c6cd9b1e92b0ff Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit b245faae89f3b76890a9b49a2a1a5ee4b1568d28) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* qmltc: Do not generate bindables and setters for QQmlListPropertyUlf Hermann2022-01-182-2/+12
| | | | | | | | | Assigning to a QQmlListProperty does not do what you think it does. Change-Id: Ie6ac3208d552d8f40d9f2f4d7fb33c1cd64e4b79 Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> (cherry picked from commit 134f305b7f96e1a127261bbfac9bdb1f3a22e546) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* tst_baseline_scenegraph: Remove unused private fieldMaximilian Goldstein2022-01-171-1/+0
| | | | | | | | | | | This caused clang warnings and doesn't seem to have any use anymore. Change-Id: Icc34cddbd32b2e59df662ae1e3796c7b3aae1155 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> (cherry picked from commit 6e4dd74bbcb6c67229c87c3113c006df4f11847a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* ShaderEffect: Make uniform setting saferLaszlo Agocs2022-01-176-0/+117
| | | | | | | | | | | | | | | | | | ...to better match the Qt 5 behavior. For example, trying to assign a Qt.point() to a vec3 works in Qt 5, setting the 3rd component to 0, because it just does a blind call to glUniform2fv. In Qt 6 this was not done initially, and the data copy is based on the value's size, so one either gets an assert in debug builds, and perhaps a crash or some strange behavior in the shader in release. Make this safer. The handling of QTransform->mat3 was broken as well, although it is unlikely anyone ever used that in practice. Fix it so that we properly map the 9 floats to the 4-float-per-column layout. Change-Id: Ia4a24bff0e54d94ddb2f5db276f0ed0a2cde0efd Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> (cherry picked from commit c4f49a9e1f2c5a7819495f567f5ffe32d0eb468b) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Port users of QMutableEventPoint::from() to new static settersMarc Mutz2022-01-162-5/+5
| | | | | | | | | | In QQuickItem, added an opportunistic std::move() as a drive-by. Task-number: QTBUG-99615 Change-Id: Ib9426ae7e749036541d5f97824800636b5ccfb5e Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit f988168432068f04c0f9a0c485bc1c6584f0aa5e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Re-allow retrieval of list properties in QQmlJSCodeGeneratorUlf Hermann2022-01-155-0/+44
| | | | | | | | | | It's not particularly slow. It probably was when we were using QQmlListReference or JavaScript arrays. Change-Id: I1a4575a5b84cdfb732a6c3615d00bbe2abaffc94 Reviewed-by: Fawzi Mohamed <fawzi.mohamed@qt.io> (cherry picked from commit bd0f4459ce31b6c5f232d60e7cdc3d9e0cb84ad7) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QQuickAbstractButton: fix crash on destructionUlf Hermann2022-01-141-0/+23
| | | | | | | | | | | If we listen for size changes we also need to remove the object listened to when it's deleted. Fixes: QTBUG-99644 Change-Id: I613855ebd986b1e67685088020b88d8b070659cf Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> (cherry picked from commit 720ffaeb60d43123522066e1de3a69ad551644aa) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* qqmljstypepropagator: Add compiler error for unknown function callsMaximilian Goldstein2022-01-131-0/+2
| | | | | | | | | | | Previously we would not generate an error when an unknown function was called. Change-Id: I31845a642afe0fd6038228c4aabf2ef5c6f1140e Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> (cherry picked from commit fddd82345ae63f1769f5fc9e486cfdccea4d0124) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Don't rely on transitive include of qeventpoint_p.hMarc Mutz2022-01-135-1/+6
| | | | | | | | | | | It will be dropped from qevent_p.h. Task-number: QTBUG-99615 Change-Id: Id4eee3036a873f0e021b30a8d43b2c4df25dc53c Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit bec4d008c22340b1913c1871ae57a4b9b675acad) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Don't crash when pasting text into TextAreaShawn Rutledge2022-01-071-0/+33
| | | | | | | | | | | | | | | | If QQuickTextAreaPrivate::ensureCursorVisible() calls QQuickFlickable::setContentY() while the Flickable does not yet know the extents of its new content, it caused a crash when QQuickScrollBarPrivate::visualArea() called qBound(0, 1, -something). We need to wait until Flickable knows it can scroll that far. It turns out ensureCursorVisible() is called several times anyway, so it's OK to skip the calls that would ask the Flickable to scroll out-of-bounds. Task-number: QTBUG-99582 Change-Id: Ifb374a81591df49d3c571f55cb3076a78a808918 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> (cherry picked from commit 924b2d5d47a33d11999a8edbfe6960e9593038ec) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* TextEdit: hide cursor outside viewport if ItemObservesViewportShawn Rutledge2022-01-061-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | Given a TextEdit in a Flickable, when someone scrolls the text such that the text cursor is completely outside the viewport, we want the text cursor to be hidden. It is clipped if Flickable has clip: true, which is better for "pixel-perfect" clipping, but has a performance penalty. Anyway it still looked ridiculous in the case when clipping is not turned on, to have a stray text cursor appearing on top of some neighbor items, even though the text wasn't visible. To have awareness of the viewport (such as Flickable) within which it's shown, TextEdit has to opt-in with the ItemObservesViewport flag so that QQuickTextEditPrivate::transformChanged() will be called; the question is under what conditions. We already opt-in when the text is large; otherwise we don't really want to have updatePaintNode() called so often, unless other code opts in by setting that flag; because for short texts, the old way is more efficient (populate all the glyphs from the document into the scenegraph one time, and no need to update until editing happens). Task-number: QTBUG-83069 Change-Id: Idd7cc9d2369d67b967eec50fe81964e6abe84e9c Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> (cherry picked from commit 308f3cbc1a00181e39db94e6329978d872d7b520) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* TextEdit: deal with scrolling backwards in rich textShawn Rutledge2022-01-062-10/+30
| | | | | | | | | | | | | | | | | | | | | | | A bug was introduced in 9db23e0e04906cf9ea33e23fa41f34955e5e6fe0 : when scrolling backwards in some kinds of rich text, updatePaintNode() failed to re-populate the nodes that had been scrolled out above the viewport. That was because those nodes had been removed from textNodeMap, and then firstDirtyPos was set from the first node in textNodeMap. For some reason this didn't happen with the markdown document that I was testing (maybe because it had a table and an image near the beginning), but showed up when viewing an html document similar to the one we ship with the rich text example. So now we iterate backwards from textNodeMap.begin() when this happens, to find all nodes in the current frame that intersect the viewport as rendered. In the autotest we now use font.pixelSize in an attempt to make the rendered text ranges more consistent across platforms in CI; and we need to wait for the rendering to be redone after scrolling. Change-Id: I70ef54c8d8facc439b9a6f8b5cb8e3a4a1c37e16 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit cd083920b3b4f3a1ed7f2297058cf0d110d7cf10) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Replace currentFile(s) with selectedFile(s)Mitch Curtis2022-01-051-32/+31
| | | | | | | | | | | | | | | | | | | selectedFile can represent the currently-selected file (if the platform supports it), and so we can free up "currentFolder" for FolderDialog now that it means the folder that is being displayed, rather than the folder that is currently selected. [ChangeLog][QtQuickDialogs] FileDialog's currentFile and currentFiles properties have been deprecated. The selectedFile and selectedFiles properties now refer to the currently selected file(s), as well as the final selection. Fixes: QTBUG-98562 Task-number: QTBUG-87798 Change-Id: Ic66481332338f21169a9f63617cf4db4be83265d Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit 13399bd54d084ed837ec061ca9315dbd173f3b48) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* qmltc: Support Component rootsAndrei Golubev2022-01-035-0/+78
| | | | | | | | | | | | | | | | | | | | | | | | | It is a very special case that doesn't undergo a normal compilation but instead just uses QQmlObjectCreator::createComponent() logic. As QQmlObjectCreator::createComponent() returns a new QQmlComponent, we can't use it within the qmltc-generated type's ctor. Instead, just fake the same flow by incorporating the code into the qmltc type setting As a drive-by, fix the code to work correctly with Component roots. This should now pretty much cover all the mystical logic of QQmlComponentAndAliasResolver and, with tests, we can safely simplify the qmltc code generator bits later without introducing bugs Enhance tst_qqmlcomponent::componentTypes test to highlight that property Component p: ComponentDerivedType {} is not marked with QV4::CompiledData::Object::IsComponent flag at all and thus considered to be an ordinary object binding, unlike property Component p: NotComponentDerivedType {} Change-Id: I4ec41952d15f9659d316e44dab4050aa4908327c Reviewed-by: Fawzi Mohamed <fawzi.mohamed@qt.io> (cherry picked from commit 39aee682bf388e191a409485cbbe2e01996bc163) Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* qmlls: Rename lifecycle testUlf Hermann2022-01-035-8/+8
| | | | | | | | | | | | | | We have another target called tst_qlanguageserver which breaks in top-level builds. The test in qtdeclarative doesn't actually test the base language server but only the life cycle methods added for the QML language server. Change-Id: I4cf6f038289c962b1fe1434d5c3e68ec7c1d3b95 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 7f3d8fc7eb41b6192c07b5faea5939bc33d1a1e9) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Skip tst_qmltc::listView() under QEMUAndrei Golubev2021-12-262-0/+6
| | | | | | | | | It seems flaky and I fail to see any reasonable explanation for this Task-number: QTBUG-99355 Pick-to: dev Change-Id: I21880b6d041cfc21cf847fc3e4f09563be2c5569 Reviewed-by: Fawzi Mohamed <fawzi.mohamed@qt.io>
* qmltc: Support different property change handlersAndrei Golubev2021-12-246-0/+279
| | | | | | | | | | | | | | | | | qmltc must be able to compile property change handlers: - for bindable properties (with no notify) - for notifiable properties (with no bindable) - for both bindable and notifiable properties (preferring notify signal) Test the aforementioned cases and some signal handling cases along the way Task-number: QTBUG-84368 Change-Id: I2cd2d0ad6407889942c806e03831dec4c7ce265a Reviewed-by: Fawzi Mohamed <fawzi.mohamed@qt.io> (cherry picked from commit 71084db1df9453aa9c657b91f2dab6766a56903b) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QQmlJSImportVisitor: Fix property change handler detection logicAndrei Golubev2021-12-248-0/+130
| | | | | | | | | | | | | | We can have weird cases like `onXChanged: {}` with x's NOTIFY named xNotReallyChanged and those should still function correctly; bindable properties without notify can also use property change handlers Picking to 6.3 as this is pretty much a bug + qmltc needs this as well to support the weird cases (as otherwise it'll just fail in the visitor) Change-Id: Ib9a1ce8b7d76133a89bcf0dab16f25659ce69c2b Reviewed-by: Fawzi Mohamed <fawzi.mohamed@qt.io> (cherry picked from commit 72efa7f9814e0593156cfde3ce7201d481173d1a) Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Add dummy_imports for qmlimportscanner to find the correct dependenciesAssam Boudjelthia2021-12-242-0/+14
| | | | | | | | | | | | Otherwise, some dependencies won't be fulfilled and the following will fail: component.setData("import QtQml\nQtObject{}", QUrl()) Task-number: QTBUG-97056 Change-Id: If53c77b992a01051d7e83378723000615be9dfe8 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit 91930dd3d71f977eb613a0d93f0ef332e2a53392) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Include images to test data and use correct testFileUrl for comparisonAssam Boudjelthia2021-12-242-2/+2
| | | | | | | | | | | | Add the test image a.png to the test data so it can be found by the tests on Android. Task-number: QTBUG-97056 Change-Id: Ida6c3f8ca5e682bda86e879dee558a5465af7cdb Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> (cherry picked from commit 84877818092bfc3091e4d3daa206d18382d8a463) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Skip test cases execute the app's main shared lib on AndroidAssam Boudjelthia2021-12-241-0/+11
| | | | | | | | | | | | | Because on Android the project main target is compiled into a shared library. Task-number: QTBUG-99214 Task-number: QTBUG-97056 Change-Id: Ia0b5d84f6a07964ce7e1802c42a9b35675248e51 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 6e6e22b07d6c9998fdd1d04a2b8d55e206b5bbad) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Skip host tools tests like qmlimportscanner on AndroidAssam Boudjelthia2021-12-241-1/+1
| | | | | | | | Task-number: QTBUG-97056 Change-Id: Iaef3b9cfcd5c58968d48e0b7381749c2c5c7fcba Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 1b242589a1543862f879f4ae8fd62ee4058de499) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Restructure Qt Quick Dialogs testsMitch Curtis2021-12-2443-8/+3
| | | | | | | | | | | | | | | | - Move contents of tests/auto/quickcontrols2/dialogs to tests/auto/quickdialogs. - Move tests/manual/quickcontrols2/dialogs to tests/manual/quickdialogs/dialogs. This makes the dialogs tests consistent with other modules that have their own "top-level" test directories. Fixes: QTBUG-99034 Change-Id: I4ba155433507870fa607100af1b7957f8430727c Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit 2dc1080f5f14c0b15a40e210d17a403c7490a18e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* qmlls qiopipe: avoid non needed castsFawzi Mohamed2021-12-231-3/+2
| | | | | | | | | | | | QByteArray uses qsizetype, so some of the limitations for qiopipe are not relevant anymore. Still keep a max size of std::numeric_limits<int>::max(), because if we exceed it something has gone seriously wrong, and this is just or testing. Change-Id: If3f15714fdbad94a521cea72167cb4a3054cfb11 Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> (cherry picked from commit 6e516d89864703849cdd3deba4e8af6b8753a8cf)
* Separate JS files from QML files in qmltc-calling cmake commandAndrei Golubev2021-12-231-1/+4
| | | | | | | | | | Produces annoying CMake warning, so just not include javascript files for qmltc to process Change-Id: I833dc21d927da10a33b2f382a13bc38a47b4f686 Reviewed-by: Fawzi Mohamed <fawzi.mohamed@qt.io> (cherry picked from commit 85eb0481eac6796f4853484d89c81d225cb8ff62) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* qmlls: qml language server implementationFawzi Mohamed2021-12-2310-0/+632
| | | | | | | | | | This is the initial commit, with just qmllint integration, but many of the tricky bits and the architecture are already there, see the description in qqmllanguageserver.cpp and qqmlcodemodel.cpp Change-Id: Ie493fed02276f938fde641e8d91c67aed0514d1f Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> (cherry picked from commit 25ac957f6da559333938430eec9cc341823e22cc)
* qmltc: Fix explicit import of local QML typesAndrei Golubev2021-12-234-4/+42
| | | | | | | | | | | | | | | | | | qmltc passes re-import local QML types in order to get their URLs and modifiable versions of types. The existing logic seems to work only when we've already imported the types before. But re-import may, in fact, easily load *same* types from a *different* place. This is totally wrong and exceptionally evil (even within the passes). Re-write this logic by looking up the already-imported types from QQmlJSImportVisitor instead This, in particular, fixes a case: import MyOwnModule 1.0 MyOwnType { } // oops, does not include "myowntype.h" Change-Id: I35be7e41094c3bb9e210727a7a59bee33b548698 Reviewed-by: Fawzi Mohamed <fawzi.mohamed@qt.io> (cherry picked from commit 0d40cde68ea89db46eac896a28ff65bd2c3ab40d)
* FolderDialog: undocument ShowDirsOnly optionMitch Curtis2021-12-231-9/+1
| | | | | | | | | | | This option doesn't make sense for FolderDialog, and was likely an oversight in the original Qt.labs.platform version. Task-number: QTBUG-87798 Change-Id: Ia97b6d208ec9344f071a93e36387de804cddb283 Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io> (cherry picked from commit dbf207116e857bb20adacf6e72f2910732fec0f1) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* dialogs: rename file => folderMitch Curtis2021-12-221-9/+8
| | | | | | | Change-Id: I1b70e7f124163a49ab2e5014a4de823735f71869 Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io> (cherry picked from commit 1be5a1f89bafdbab883ec7ab47c4caa3c1bc2d78) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Add prefer record to the output of qmlimportscannerAlexey Edelev2021-12-2016-60/+120
| | | | | | | | Task-number: QTBUG-95984 Change-Id: I2e126db655ef986b23d66a465e8b28b9fb17bbb1 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit e0a6ee877dce82bdeff3fae64af0d4d95426d19a) Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* AbstractButton: fix fast clicks being treated as double clicksMitch Curtis2021-12-201-0/+49
| | | | | | | | | | | | | Only emit the doubleClicked signal if it's connected to something. While we're at it, optimize isPressAndHoldConnected() by making locals static. Fixes: QTBUG-96888 Change-Id: I7b737d5ab75240bd06cc7f9daad7d848b8278d49 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 220a547aa440019ebcb1dd411ed95ecbf197e0f1) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Implement remaining non-native FolderDialog stylesMitch Curtis2021-12-191-0/+3
| | | | | | | | | | | | While we're at it, correct the values of some properties we're setting on FolderListModel. Task-number: QTBUG-87798 Change-Id: I61d40c84e6ee8784cb2c27f90b6aaffc9976311c Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io> (cherry picked from commit 7dcffc2e54652c873d95402c1d5eef908e212977) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Package tst_signalspy test data otherwise it's not found on AndroidAssam Boudjelthia2021-12-191-0/+6
| | | | | | | | Task-number: QTBUG-97056 Change-Id: I29f268b8738c4033d5d855b1652f4a6182de4264 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 7b21a4fbbac34f24bd003fe03c444f203230a50f) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Use the correct scheme in setUrlHandler() for openUrlExternally() testsAssam Boudjelthia2021-12-191-6/+8
| | | | | | | | | | | | testFileUrl() can return a QUrl with either file or qrc scheme, so the handler need to register the correct scheme as well. Task-number: QTBUG-97056 Change-Id: I87028f75bbaf267b5eb58d28497cd2bea593c02a Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit 36874e799ae5922e50d97ffcbc26532bebc0d06c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Do not return a null scope from storedType()Ulf Hermann2021-12-193-0/+14
| | | | | | | | | | | We can store everything in a QJSValue. Returning an invalid scope triggers inadequate code paths later on. Change-Id: I700d7a3219e5784d3ec125806f70018417ceac14 Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit f6294b7938c221974cdf3a39d7d71addf5b08f6b) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QmlCompiler: Don't try to get attached objects for non-QObject*Ulf Hermann2021-12-194-0/+20
| | | | | | | | | | | We might end up in this situation if we don't know enough about the base of the attached lookup. This would generate invalid C++ code. Change-Id: I210077388d0d1d0d4e9454bd3ba3792af9b42049 Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 0ea14fa1266a00c4102445021f46c042706c963a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* qmltc: Do not crash on import namespacesAndrei Golubev2021-12-184-0/+15
| | | | | | | Change-Id: I9767857076ea6ae565c7efd75d64cb47a82b7be7 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit 790d257ef01e0f95b776db873ad34bebe16396a3) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* qmltc: Be aware of Component-wrapped typesAndrei Golubev2021-12-185-12/+299
| | | | | | | | | | | | | | | | | | | | | | While implicit components (the ones bound to Component-based property) are covered, cases like `Component { Text{} }` are not, so fix that Revisit the logic in the QmlIR / QQmlJSScope passes and code generator as part of this This might be a fairly used pattern in QML so no reason not to address this right away, especially given that we have most of the infrastructure in place already While at it, bring over extra tests that some other (non-merged) commit introduced. These give good coverage for missing cases and also exercise the feature supported here Task-number: QTBUG-84368 Change-Id: I8f5c74fc79380566475b1139d4cc5560fac123e3 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit 362b4bf3d6df1e1799a163d3e6d7ee39f75ad080) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* qmltc: Explicitly reject inline componentsAndrei Golubev2021-12-173-1/+16
| | | | | | | | | | | Because they seem to be hard and there's little reason to invest in their support immediately Task-number: QTBUG-84368 Change-Id: If056aa401d8f54d067eb583669074cb3f6bfd304 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit 8fac197ba20cca5a85f8caedf4cb3e4f4c7ac553) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Add listing of the components and scripts that belongs to the qml moduleAlexey Edelev2021-12-171-0/+2
| | | | | | | | | | | Add qml components and scripts to the qmlimportscanner output to give information about files that actually belong to the qml module. Task-number: QTBUG-97834 Change-Id: I41394ba6fe9d9fe3af74786b4a802903849ae27d Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 1d135de5cfef6da7457e5caf1612c0c112cfea7b) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Use qmltc compiler prototype as a fallback implementationAndrei Golubev2021-12-1757-1/+2639
| | | | | | | | | | | Task-number: QTBUG-91927 Task-number: QTBUG-96041 Task-number: QTBUG-84368 Change-Id: I47320b5f3ed8efff6fb234778df5fae5be5b64f2 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit e7ce5abf24f04d1b071343f07ca28b6a5d9ad4b9) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* tst_qquickimageprovider: fix some memleaksMarc Mutz2021-12-171-11/+11
| | | | | | | | | | | | | | | QTest::toString() returns a heap-allocated char pointer that must be delete[]ed after use. Instead of abusing QTest::toString(), use QTest::addRow(), which features printf-style formatting for the label. Found by lsan, which was going completely wild. Change-Id: I53f2aa1dce7a128c964a2b02420c65a410bf9b15 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit e95a43fb7666d6cf6095598c8bb9bbc1de9c3eb3) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Blacklist even more flaky timer testsFabian Kosmale2021-12-151-0/+6
| | | | | | | | Task-number: QTBUG-99143 Change-Id: I81514075ef6c6dceb8b09b82766d5c8ba9813173 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit c7e8989274271b654479b83989c743da68c67c25) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Blacklist flaky tst_QSequentialAnimationGroupJob test on macosFabian Kosmale2021-12-151-0/+2
| | | | | | | | | Task-number: QTBUG-99175 Task-number: QTBUG-99174 Change-Id: I544a5df72b94bf06c906e70fb38a1374e9cf3575 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit aab386753bb9a197617e1ca32894fbdc1d303db9) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* qqmljstypepropagator: Use variant type for arguments of unknown typeMaximilian Goldstein2021-12-132-0/+15
| | | | | | | | | | | | | Previously those function arguments would result in an invalid type being used which lead to crashes when invoking methods using those arguments. Fixes: QTBUG-99027 Change-Id: I27e643f2512e1542d766b5fe98adfee043245c6f Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit e83fd85cce26823c6289a32fd5f7a0fa87639407) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Provide a function for querying QML module details for deploymentCraig Scott2021-12-139-0/+110
| | | | | | | | | | | | | | | | | | | | | | | | The new qt6_query_qml_module() command allows the caller to obtain all necessary details for deploying a QML module (just the one module, not any other modules it might import). The QML_FILES and RESOURCES are file lists, and their corresponding ..._DEPLOY_PATHS and ..._PREFIX_OVERRIDES lists will be of the exact same length. The ..._DEPLOY_PATHS indicate where to copy the files below the module's target path, which itself should be below the base install location for QML modules. An empty list item means no deploy path can be safely determined for that item because a custom PREFIX override has been used when adding it. The ..._PREFIX_OVERRIDES list records the prefix override for each file in its associated list. An empty list item means there is no override. An empty entry in ..._DEPLOY_PATHS should correspond to a non-empty entry in ..._PREFIX_OVERRIDES and vice versa. Fixes: QTBUG-95024 Change-Id: I7ba3396934abac7d951cd3b95701cd58d9ca60ec Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit c6ba40f05ab35b8f9e5c495d7114a723a0ce4b85) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Pass qmldir to qmlcachegen, qmllint and qmltc, not the qmltypes fileUlf Hermann2021-12-131-3/+5
| | | | | | | | | | | | | | | | | | | The tools will still grudgingly accept qmltypes files being passed via the -i option. We generally expect qmldir files, though. Ignoring the qmldir file and importing the qmltypes directly, ignores qmldir imports, dependencies and other component entries. This leads to unresolvable types. [ChangeLog][QML Tooling] qmllint expects qmldir files, not qmltypes files to be passed via the -i option now. This enables it to see the imports and dependencies of the module being imported. For backwards compatibility it still accepts qmltypes files, with a warning. Fixes: QTBUG-99043 Change-Id: I5ed32d7e78df1e604aaf1bfa2ebda09d5d57b628 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 576fafd1e69429d7387e4c35f6d15fc42af6513e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QmlCompiler: Reject ambiguous and inaccessible typesUlf Hermann2021-12-135-0/+29
| | | | | | | | | | | | If a type is not accessible in the imported version of a module, exclude it. If we find multiple types for the same name and version, drop them all and warn. Fixes: QTBUG-99113 Change-Id: I91d99d603ada6cf87f84afdbb01a543880d9aa76 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 22f4306283d10e9aa5d6acb3e33ab2a8a397bb4c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Blacklist even more flaky timer tests on macOsFabian Kosmale2021-12-131-0/+3
| | | | | | | | Taks-number: QTBUG-99143 Change-Id: I8f38dae6b6407632128cc0e4d739d911f81361e0 Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io> (cherry picked from commit 3a4828460e8aa7beae587e505777ac35cb482a4f) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Blacklist flaky qquicktextinput tests on openSuseFabian Kosmale2021-12-121-0/+8
| | | | | | Taks-number: QTBUG-99150 Change-Id: I445a0314c2f18472884740d911d2cb6f2e4ca9f4 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>