aboutsummaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* QNX: Cannot run qml only testsPasi Petäjäjärvi2022-01-291-1/+1
| | | | | | | | | | | QML only tests expect to run with qmltest tool and since QNX autotests are run on Qemu that does not work. Task-number: QTBUG-100202 Change-Id: I21732c312486d07e0902b9235a7f8cb84eb5e045 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 98d4a44ecfa0c1afe3e58605f56937f20072d281) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QML: Disable host debugging related tests when cross compilingPasi Petäjäjärvi2022-01-291-14/+18
| | | | | | | | | | | Disable tests that are meant to check debugging features using host binaries. No point running those tests on actual targets. Change-Id: If020dfa00410668a305013254617fd50a0a01175 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> (cherry picked from commit 584c912dbbdc2b6f746b22e651cc57c1835c8d35) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QNX: Disable ecmascriptestsPasi Petäjäjärvi2022-01-291-1/+1
| | | | | | | | | | | | | | | For QNX tests are run on qemu which is slow so the tests will always timeout. As currently timeout is set to env via CMakeLists.txt it does not have effect on QNX as that env variable is not passed over SSH connection. Running tests on QNX qemu takes ~30min: PASS : tst_EcmaScriptTests::cleanupTestCase() Totals: 4 passed, 0 failed, 0 skipped, 0 blacklisted, 1782249ms Change-Id: Ief1ccb05ce21bf3140554272708c95ca5515bc23 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit 856df4380a467d0a5554232d213d549fe8a94d0d) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QNX: Force logging to stderrPasi Petäjäjärvi2022-01-291-0/+5
| | | | | | | | | | | | | | | | | | Sub-process output is by default going to slog2 in QNX so we need to force output to stderr instead. 1: FAIL! : tst_qqmlapplicationengine::application(delayed quit) 'QString(testStdErr).endsWith(QString(expectedStdErr))' returned FALSE. ( 1: Expected ending: 1: qml: Start: delayedQuit.qml 1: qml: End 1: 1: Actual output: Task-number: QTBUG-76546 Change-Id: I4a7b6c25b079f7dcc479fc2bcbd3b079bd7bc519 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 5bc77e9b9c9ee878e31dbf6b0254b7cdee81d73c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Use up-to date LGPL license headerKai Köhne2022-01-273-33/+42
| | | | | | | | | | | | Remove usages of outdated LGPL3 header that references LICENSES.LGPLv3 instead of LICENSES.LGPL3. See also 5d4679289bc for a similar commit in the past. Change-Id: Icbe5eea7bb7b9c5d46cdd56fa3b177d2e22a5fa9 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit f3e4ecfbffa19facb12800ae41f261ff3bfdac63) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* qmltc: Rename CMake command's argument FILES -> QML_FILESAndrei Golubev2022-01-271-2/+2
| | | | | | | | | | This way we make it consistent with qt_add_qml_module() Fixes: QTBUG-100214 Change-Id: I9f38a8ba3dec978ccdf4ea937ff662ae2449e582 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 97123dbe6755a787e93797f717f8ebf193352b85) Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Enhance tst_qmltc::componentTypes() by verifying that ids are correctAndrei Golubev2022-01-271-0/+9
| | | | | | | | | We can in fact check that the ids match to correct objects Change-Id: I46ed1a3d0a9ef429670fdc0438a5d717971c459c Reviewed-by: Fawzi Mohamed <fawzi.mohamed@qt.io> (cherry picked from commit feaed5f7aa6c82d9132e71037007b7c91ea57713) Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Don't blacklist tst_QQuickFramebufferObject::everything on b2qtShawn Rutledge2022-01-271-0/+1
| | | | | | | | | | | | | Put back the [testInvalidate] condition accidentally removed while removing the first of the platforms it formerly guarded. Amends 6336763588b45a2eeae6af29f5e4ba705b64b4d6 Task-number: QTBUG-64470 Task-number: QTBUG-65614 Change-Id: I494c3359c027696dae795874e1f0337102738fe7 Reviewed-by: Marc Mutz <marc.mutz@qt.io> (cherry picked from commit affde02775e24047ff6e61651a3095654d2e3bba) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix tst_basic missing resourcesAssam Boudjelthia2022-01-272-1/+10
| | | | | | | | | | bundle all data resources and make sure all imports and bundled. Task-numer: QTBUG-97056 Change-Id: I0711675d6c2a9a79790ec460e419c65d581e6ec9 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit b44ee5022cd0418d97df7c467a209a0d1c24cff3) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Add missing dependencies to tst_qmlcppcodegenUlf Hermann2022-01-261-0/+6
| | | | | | | Change-Id: Ifb5af14faa8229d4f7025d275147044629f4f2cb Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 672891354220c05a712663d637e5c5d0074a3181) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QML: Host only testsPasi Petäjäjärvi2022-01-252-6/+10
| | | | | | | | Change-Id: I7c0f65868258bd706d9c55022d3546f2b1cb771a Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> (cherry picked from commit 3199567e96027e32f50d702ba65dede370cbd93e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Skip tests that fail on platforms that don't implement grabWindowVolker Hilsheimer2022-01-244-4/+4
| | | | | | | | | | | Replace QEXPECT_FAIL with QSKIP so that we can fix the offscreen plugin, and then re-enable tests that pass without having to orchestrate with the dependency updates. Change-Id: Ifdf7fe85a5005f30d2edcba958ff0e9c6c9000b2 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit a3924b9846f8f3412e6cfc3704f69488e64da98e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Skip the shapes tests on offscreen platformShawn Rutledge2022-01-241-10/+10
| | | | | | | | | | | Replace QEXPECT_FAIL with QSKIP so that grabWindow can be fixed in the offscreen plugin without XPASS-failing tests in qtdeclarative. Task-number: QTBUG-99962 Change-Id: I470061a324c963e09b9ebcb48daabdf8d960ff90 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit 5d2ffc03f89d092f46ae14e958bedf9fc441b7ec) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QQuickTreeView: be able to expand rows that are not yet visible in the viewRichard Moe Gustavsen2022-01-241-0/+25
| | | | | | | | | | | | | | | | | | If the app expands a row in TreeView, that row will for a brief moment be expanded in the proxy model, but not in the view, until the view is polished. For that reason, when determining if a row can be expanded or not, we should check the state of the proxy model, and not the view. Note: if the application needs the state of the view to reflect the state of the proxy model immediataly after a call to expand, forcePolish() is always possible. Task-number: QTBUG-91374 Change-Id: I5b85e0b5c3b32d17f93409153041df3fc2437424 Reviewed-by: Andy Shaw <andy.shaw@qt.io> (cherry picked from commit a43912865e294f2014f03eb7073ecd9ecf387623) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: Don't cross-compile qjtestAlexandru Croitor2022-01-241-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously it was only excluded on ANDROID, but cross-compiled for other platforms. The executable should only be built when the target Qt is meant to be used as a development SDK, to be executed on some host machine. Because at the moment we lack a proper abstraction for that, as a work around, we exclude building it when cross-compiling. The executable is not called automatically by any test, it is only run manually by a developer. In the future, the qt_internal_add_tool call should likely be replaced by a customized qt_internal_add_app call, installing the executable into $prefix/libexec rather than $prefix/bin. Amends 5a55e526382f0bb6eb647c2e6b7ce55661889990 Task-number: QTBUG-92591 Task-number: QTBUG-100040 Task-number: QTBUG-100047 Change-Id: If20e73fe378acd51fe41d181078d273a7842fc81 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 0de113d37924b7403b74eea4a92fe2b62c557247) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Skip borderImageMesh test with the software backendLaszlo Agocs2022-01-241-0/+7
| | | | | | | | | | | | ShaderEffect (and BorderImageMesh) do not do anything with the software backend so the results of a scene with an effect in it cannot possibly be compared with the output from another (non-effect) scene. Fixes: QTBUG-100046 Change-Id: Ie2504971f423f68d5be381a71de459ca81af7894 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit c96fbe3e565a88427141160932115c09a1bdeef9) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QmlCompiler: Handle ID lookups of incomplete types correctlyUlf Hermann2022-01-223-0/+21
| | | | | | | | | | | Incomplete types are generally stored in some wrapper type. We cannot just assign to the accumulator. Also, we already know whether we have an ID lookup there. No need to determine it again. Change-Id: I1f9fd9f147c44975df33fe862523987d8e711905 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 3747c02fe64fbf5496dc540402dddadb1fa33c12) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QmlCompiler: Add C++ name also for types with no export candidatesUlf Hermann2022-01-212-0/+6
| | | | | | | | | | | Even if the type is only exported in a newer version of the module, we still need to know about it in an earlier version, in order to resolve base types. Change-Id: Ibc7940308e3c4aaebf9871a159e1d85f43cd7693 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 24e5b9090b513861e77dcb17b8e4d75f0bdf8651) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QQmlProperty: Prohibit ID lookup on explicitly given objectUlf Hermann2022-01-211-0/+2
| | | | | | | | | | | If an object is given, we should only use that object. Amends commit 21f15ede606df028479335c64c333db5fb1bb3f7. Task-number: QTBUG-100110 Change-Id: I51c0a44750c31984ba4937fb1cd2405dd93fcc19 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 44ca135c5a4d02ab29b57a3f15b84850aafb1cec) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* tests: port to QMutableEventPoint static APIMarc Mutz2022-01-214-54/+54
| | | | | | | | | | | | | This code was actually ok (no UB), but it's in the way of making QMutableEventPoint a befriendable namespace, so port from using QMutableEventPoint to QEventPoint instances + QMutableEventPoint static setters. Task-number: QTBUG-99615 Change-Id: I7ddcf154cb5da9b6ea2f0f0d8cac130a28203371 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit c096435c307c610fe2dd3f177a1705b86d3631ab) Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
* QmlCompiler: Respect revisionsUlf Hermann2022-01-214-5/+38
| | | | | | | | | | | | | | | | | | | | | | | The only place where revisions matter is at the boundary between composite and non-composite types. The revision of the first composite type inherited from determines which members of all composite ancestors are available. Therefore, store the revision together with the base type and pass it through the imports to have it available. Then use it to check availability of methods and properties. The test exposes two further problems, which are fixed, too: 1. If no method is found to call, we need to generate an error in the type propagator. We don't know what the call will result in, after all, and the code generator should reject it. 2. We need to check the right scopes for hasOwnMethod(). Otherwise we might not find methods that are available. Fixes: QTBUG-99128 Change-Id: I4c320b8dfb490b140d7b8c16e6b638b32f156faa Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit e19d48d07310708e56cb379124dff193c1a7fa71)
* TabBar: allow wheel events to change currentIndexNoah Davis2022-01-211-0/+49
| | | | | | | | | | | | | Setting wheelEnabled to true allows wheel events to increment or decrement the currentIndex. We keep track of the total amount of angleDelta so that touchpads and high resolution mouse wheels don't change the currentIndex too rapidly. Fixes: QTBUG-99619 Change-Id: I9bda828338ee5136efcdd6abeca8e5be15da0822 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit 2ead10bf55733defe58616de7fe2c28452d00c93) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QQuickListView: Stop overlap for section and firstItem delegatesOliver Eftevaag2022-01-202-0/+173
| | | | | | | | | | | | | | | | | | | | | | | | | | Problem: The first delegate after a section delegate would have the same position as the section delegate, if the section delegate is invisible during initialization. In case the section delegates become visible later on during program execution, the delegates would be re-positioned again in the QQuickListViewPrivate::layoutVisibleItems function. But this would not call setPosition for the first item (delegate). It would only call setPosition for all delegates after the first one. This would mean that the position for the first delegate would never be updated, after the delegate was first created. Solution: Call FxListItemSG::setPosition() for the first item in QQuickListViewPrivate::layoutVisibleItems, just like we're already doing for all the items after the first one in the for-loop. Fixes: QTBUG-94848 Change-Id: I34a5ada336ab507b31e3675a1c11eba066fa139a Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit 3aad05bc09f40d81df7748cbc246974230a3ca17) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Document qmltc toolAndrei Golubev2022-01-191-0/+5
| | | | | | | | | | | | | | | Add initial qmltc tool documentation with introduction, compilation process picture, description and limitations To simplify the description, we can consider some simple application. The same app can additionally become a test scenario for qmltc and a showcase of its capabilities Task-number: QTBUG-84368 Change-Id: If6d586a8c68f48d17133b25170d0fff627e2066c Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit de30f10aeb1ccf495cf39b3910e89d60f3dc591a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix build with tests when qtshadertools is not availableJoerg Bornemann2022-01-181-0/+4
| | | | | | | | Fixes: QTBUG-99888 Change-Id: I07638d31c3978a551f3beedd4dbaf329c1445bc7 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 3bfba0424bdc2f47188509a13132e7299330388a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QmlCompiler: Handle context push/pop in dead codeUlf Hermann2022-01-183-0/+34
| | | | | | | | | | Otherwise we end up with unmatched curly braces in the generated code. Change-Id: I4c24d4062a8ed54cd6a9ecb43dfd2b5d0a26c9e1 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io> (cherry picked from commit 6a54c6013d9037f5c75d47f5e03d6871591e53b2) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* 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)