aboutsummaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* mingw: Skip segfaulting testsOliver Wolff2021-05-251-0/+15
| | | | | | | | | | | | | QQuickDesignerSupportProperties::registerCustomData segfaults on mingw. Due to these segfaulting tests, mingw is marked insignificant at the moment. In order to get at least some test coverage for this configuration, the tests are skipped for now. Task-number: QTBUG-90869 Change-Id: I75c61b83c53e038be4dc518bf39955f477d381ee Reviewed-by: Heikki Halmet <heikki.halmet@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 9184f6c1de2c315cc66eb6cd3886c3daea90516f)
* Blacklist tst_QQuickGridView::snapOneRow for Win 10 MinGW developer buildHeikki Halmet2021-05-161-0/+1
| | | | | | | | Task-number: QTBUG-88644 Change-Id: I0fdaa7d8d527dcb4c22c54e7d1004ee02c5e241c Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io> (cherry picked from commit f3ed98bf09885795de160468fd615c9e07d5ed5d) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* TestCase: Fix colors comparison in fuzzyCompare()Alexander Akulich2021-05-143-0/+75
| | | | | | | | | | | fuzzyCompare() messed up the arguments and compared the first color argument with itself (ignoring the second color). Fixes: QTBUG-91694 Change-Id: I86453c937e27a2112f8375b144ca21a9d088f017 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit 35a0c2552f17e40d3584af422a3c5fe75c700d0f) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Blacklist tst_QQuickGridView::snapToRow for Win 10 MinGW Developer buildHeikki Halmet2021-05-111-0/+1
| | | | | | | | Task-number: QTBUG-88644 Change-Id: I6ee6e443f68d628a28cc0101670dac86721d58cf Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> (cherry picked from commit 0a51e25816a018d274c9f5f47e283ffc2e15604a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QQmlComponentPrivate::setInitialProperty: improve error messageFabian Kosmale2021-04-271-1/+1
| | | | | | | | | | We can discern between the case where the property does not exist at all, and the case where we cannot set it. Change-Id: Ia2e8f4cc077a00b90d720db01bff1542a812dea0 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> (cherry picked from commit 7275328b967582010abfd59c9a93feef4cb1379f) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* tst_qquickcanvas: Verfiy that canvas.context existsFabian Kosmale2021-04-231-0/+2
| | | | | | | | | | | Apparently it was possible to execute the pixel check before the canvas was fully created. Use tryVerify to ensure that it is actually is there before running the actual test function. Change-Id: I8e9f1133ea718c001f0456cb3af27f13e6d85e96 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> (cherry picked from commit b8451949ba375ecf253fe07a3e043d83d00f9b74) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* qqmlirbuilder: Fix treating parser warnings as errrosMaximilian Goldstein2021-04-192-0/+15
| | | | | | | | | | | Previously parser warnings (i.e. inline components having lowercase names) were treated as errors. Because these were not handled properly this also resulted in the QQmlComponent with the warning never becoming ready. This resulted applications hanging instead of terminating. Change-Id: Ia5ad3b54edc1b94dd94d0bf771c3494691abec71 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit e49be8d2b1b7acb310873a63f46980d1f0296f95) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QQuickTextInput: update cursor rectangle after padding changedWang Chuan2021-04-162-0/+46
| | | | | | | | | | | The position of cursor delegate needs to be updated when we change padding, otherwise it will be in a wrong position. Fixes: QTBUG-91867 Change-Id: I89ca84fe893ebf517ab67890196eede14a4055d7 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit d98694c4023881673259ba040c10df7e71ec3d37) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QQuickItem::forceActiveFocus(): actually force active focusShawn Rutledge2021-04-162-0/+82
| | | | | | | | | | | | | | | | | | | | | It was trying to get by with setFocus() but that doesn't always work, in cases when the item's d->focus flag is true (leftover state) but it doesn't actually have focus anymore after a reparenting scenario. Item.focus represents the intention to be focused when possible, and does not necessarily change due to environmental circumstances, such as having its parent reparented. QQuickItem::setFocus(true) returns early if the new requested focus state is the same as the stored d->focus; so it was not enough for foceActiveFocus() to call only setFocus(). In the bug, TextInput and Loader both get stuck in the state d->focus == true, so forceActiveFocus() did not do anything before. Fixes: QTBUG-89736 Change-Id: Ib7f4caccf81b60a02e2655332b64efba4d1fd7cf Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> (cherry picked from commit a8be17a1472c6f504c0c40f68fdc13df035ac4b4) Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Do not auto-clean components with live inline componentsUlf Hermann2021-04-093-0/+46
| | | | | | | | | | The inline components do not hold a strong reference to their outer type because that would be a reference cycle. Fixes: QTBUG-92236 Change-Id: I6d76a114352653210f0ece6c198cf761d3b4eda1 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit d0d4cc528ba9e3c39c15a2292066dac1d457abd5)
* When resolving property types, also update the property type namesUlf Hermann2021-04-092-0/+11
| | | | | | | | | Otherwise we end up with a mixture of QML and C++ names. Task-number: QTBUG-92447 Change-Id: I94c44307d8dd762d11cfd8f178f33ab6a895ee83 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 4beba3a2b68a389c426791dd43c638f3539d8f20)
* Fix string type name in qmllintUlf Hermann2021-04-092-0/+10
| | | | | | | | | | | | | The "length" property is special cased because it's the only own property of any JavaScript built-in type. As we've changed the internal name of the string type in builtins.qmltypes, we need to reflect this in qmllint. Fixes: QTBUG-92447 Change-Id: I9a5c7e9ab3da686bb6ac3fdffa36269abb0eb6ea Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit b28c8c87ec84dccc156603f8479fd0a8a06bc46c)
* DelegateModelGroup: Fix bug where item could be removed from the modelJan Arve Sæther2021-03-304-1/+62
| | | | | | | | | | | | | | | | | | | | | | | If an item was removed from the DelegateModelGroup before it was completed it caused subsequent items in the model to be missing in some cases. The reason was that while populating the ListView, it iterated with an index for each item to call createItem() on. However, createItem() might call onCompleted (which in the case of QTBUG-86708 removed the item from the DelegateModel), which caused the next index we called createItem() with to be wrong (it became one step ahead). We therefore add a helper class MutableModelIterator, which keeps track of if a index in the model got removed (and if the iterator index needs to be adjusted because of that).... Task-number: QTBUG-86708 Change-Id: I33537b43727aed4f2b9bdda794b011b6684c44b4 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> (cherry picked from commit 0ff9db566c48172c688bf9327fe6a781dc4a1c34) Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* QQuickTableView: always update content size when rebuilding small tablesRichard Moe Gustavsen2021-03-292-0/+99
| | | | | | | | | | | | | | | | | | | | | If you have a TableView with only a couple of rows, and you add a third one, the contentHeight doesn't update. This is fine if not all rows are loaded (some are outside the viewport), but when they are all inside, it should update to reflect the exact height. The same is also the case for the contentWidth. If you add a new row that increases the with of a column (and all columns are visible), the contentWidth should update. This patch adds an extra check when we do a rebuild (which we do when you add a new row), to see if all rows or columns are loaded. And if that is the case, we update contentHeight or contentWidth, respecitively. Fixes: QTBUG-92099 Change-Id: I806bfb7c3606fca97c5d27cbb91856cc40df9fb8 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> (cherry picked from commit d6a5afd120838647e0dd2a420dacf06389f0a48e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Add binary compatibility files for Qt 6.0.0 for QtDeclarativeMilla Pohjanheimo2021-03-264-0/+64965
| | | | | | | | | Binary compatibility files added Change-Id: Ifccf803f8f2bcf1b5c857ae36fb7090700ffe4b8 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit e8a0014cc847cc10247ffbe1d7e6f5b8e25738b8) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* PinchHandler: scale incrementally when new pinch gesture beginsShawn Rutledge2021-03-251-0/+74
| | | | | | | | | | | | | | | | | | | | | | | | | When the gesture begins, we begin multiplying the target item's scale by 1.0 at first; it doesn't make sense to start immediately with the accumulated scale remembered from previous pinch gestures, because the target item remembers its own scale. When QQuickPinchHandler::wantsPointerEvent() returns false because some irrelevant gesture was received (for example a PanNativeGesture), that's not a good reason to deactivate. Deactivating and re-activating with each ZoomNativeGesture event results in extreme behavior, because PinchHandler depends on the BeginNativeGesture and EndNativeGesture events to reset internal state. Likewise, the fact that the button state is NoButton is not a good reason for wantsPointerEvent() to return false. Added an autotest: the first of its kind that actually simulates the native gesture events. Fixes: QTBUG-92064 Change-Id: I3a9b92d70f99497ee58ad8557d90d521fbe16d41 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> (cherry picked from commit fc636af3a723ee8b4ee42cf71864ae0df5ca4621) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QQuickTableView: forceLayout() should work, even when no items are loadedRichard Moe Gustavsen2021-03-231-0/+33
| | | | | | | | | | | | | | | | | | As it stood, we would return early from forceLayout if no items were loaded. This made sense, since when no items are loaded, there would be no items to lay out. But after we changed the logic so that an application can show or hide rows and columns by returning an empty size from the size providers, we now always need to do a layout to check if some rows or columns should become visible. Fixes: QTBUG-92076 Change-Id: I2a07bf8e62cfeebcbe36c01aa92eca3ed8227cd3 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit 9ba9336ec4515d157a1207fad1dcd2de311527ac) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Lancelot test: follow name change in dev branchEirik Aavitsland2021-03-181-1/+1
| | | | | | | Change-Id: I367b4b914d1956a6312fcc6e8b16d47762248d41 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 9321077b9233907f091919704825a3b9492b52c4) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* qv4generatorobject: Fix crash when creating new propertiesMaximilian Goldstein2021-03-082-0/+36
| | | | | | | | | | | | | | | | | Previously HeapObject::GeneratorObject utilized a ValueArray member to store stack information. As we rely on all HeapObject members to have a constant size in order for QV4Table::inlinePropertyOffset to remain accurate, this lead to a memory conflict when a user defined his own property on the Generator. Please do not use ValueArray for any types that are user accessible or that you intend to add properties to. Now the stack information is stored into ArrayObjects instead which circumvents the issue. Fixes: QTBUG-91491 Change-Id: Id6f638bf36a3ae3c9320ac99e67214c48dc81226 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> (cherry picked from commit 7ea690c61dabd2485e80e7fae9aed392ba02c846) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QQmlIncubator: handle clear inside setinitialStateFabian Kosmale2021-03-041-0/+33
| | | | | | | | Fixes: QTBUG-91519 Change-Id: Idfe3116c2e94b8e96300d72e15db0bc78425f517 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit 2cb306c194625626957fcde44bd56473b0436f83) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* qqmlapplicationengine: Handle errors during component creationMaximilian Goldstein2021-03-043-0/+27
| | | | | | | | | | | Previously QQmlApplicationEngine did not handle any errors that occurred during object creation (i.e. failures to initialize required properties) which lead to QObject::connect errors and to the error messages not getting printed among other issues. Change-Id: I69bc566a6d349c786cae82a963a621388684c8f5 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 890cb4cb236333fd5b112fffc0e9088ecb43f2df) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Use the correct metaObject in captureProperty()Ulf Hermann2021-03-011-0/+73
| | | | | | | | QObject::staticMetaObject is not very useful. Change-Id: Ifc40e1fa08755c59ff6b8ae23a7a1257f34507da Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 89ebac46d7bde1df265b8970132bf09dc790eca2)
* Fix release-only windows buildsAllan Sandfeld Jensen2021-02-222-2/+6
| | | | | | | | The test was linking with debug version of 'foreign' in both debug and relase. Change-Id: Id567626bb5d9427b39447489d623effee731bb9b Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* QQmlPropertyPrivate::signalExpression: handle object being nullFabian Kosmale2021-02-191-0/+10
| | | | | | | | | | | | | | | QQmlData::get expects a non-null pointer, therefore we need to check whether the object still exists. Note that while this fixes the crash in the referenced bug, PropertyChanges still does not support a dynamic target. Task-number: QTBUG-46350 Change-Id: Ifeecf5df83e87468a1d314ce2b120006124d6f4b Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit 1ff376e64bf5af6df7e0079700d2b9164037dc89) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* MouseArea: fix containsMouse behavior during visibility changesVolker Hilsheimer2021-02-122-0/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | QQuickItem returns whether it contains QGuiApplicationPrivate's lastCursorPosition. Since that position stores the coordinate last seen by Qt (the window border), it will always be within the window, and within an item that covers that part of the window's border. However, QQuickWindow stores the lastMousePosition as well, and resets that value when it receives a QEvent::Leave. We can use that to test whether the window that contains the item has seen a Leave event, in which case the item is definitely not under the mouse. Notes on the test: That we use QPointF() as the "reset" value leave the small possibility that the cursor might be at position 0,0 of the window (ie inside the window), and the QQuickItem there will not be under the mouse. We can't confirm this (through an expected failure test), as QTest::mouseMove interprets a QPoint(0, 0) as "center of the window". And since we can't simulate mouse moves outside a window's boundary using QTest::mouseMove, the test needs to explicitly synthesize a QEvent::Leave for the window. Fixes: QTBUG-87197 Change-Id: I04870d6e914092275d9d790312fc702fb99f2935 Done-with: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit ba1246c543118515ea244787f3d7f9c1133ccf0f) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix QJSValue string parameters used in signalsMaximilian Goldstein2021-02-112-0/+125
| | | | | | | Fixes: QTBUG-86482 Change-Id: If938fad22f51b08fe3cb20b94634efe46a1eed47 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit e887f25dd6c4c9630a7367c3a2ed95a284191843)
* Make tst_qmldiskcache::regenerateAfterChange() pass on big endian systemsDmitry Shachnev2021-02-091-3/+2
| | | | | | | | | | | | | | We cannot use reinterpret_cast here, because testUnit->constants() returns a pointer to quint64_le data, which needs to be converted to native endianness first. Here I used the QV4::Value converter that accepts quint64, so this conversion now happens implicitly. Change-Id: Iff6e3e4554af8890e61cb06e6fd79339c7a14653 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit dab0d62b655ce9a476993de2558a573a5066288c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Return errors if validation of inline components failsUlf Hermann2021-02-091-0/+18
| | | | | | | Fixes: QTBUG-90038 Change-Id: Ic01b5d097e0b9e6720bcec7ccb18c22abb5418f4 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 001596d472557bca08eb93159e724301dea88ad6)
* QQuickItemParticle give() method kill particleFabio Falsini2021-02-052-1/+6
| | | | | | | | | | | | | | | Currently removing an item connected to a particle only invalidate the particle that will be reused for the next item set. This has the effect that the new item inserted appears in the same position as the old one just removed. This patch force killing the particle to assign next item to a new particle starting from initial position. Change-Id: Ic937a6d7aea65368cceb1405bb81ef1502d988a5 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit d0b1bef8b889ab852eaf906fdc9cd4219238872e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QSequentialAnimationGroupJob: Protect against self-deletionUlf Hermann2021-02-051-1/+41
| | | | | | | | | | | | setCurrentAnimation() can indirectly delete the animation group job itself by invoking the animation controller. Use the RETURN_IF_DELETED mechanism to avoid the resulting dangling pointers. Task-number: QTBUG-90401 Change-Id: Ibd0ad21e8d3af4760604c3ff37dc46101d5f49ad Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 680f28b08f65ad38c8d5498b5738231b2a2779a3) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* qmllint: Fix segmentation faultMaximilian Goldstein2021-02-043-0/+22
| | | | | | Change-Id: Ie04ad4221b25628687c2575facf90488b83d21bf Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 5fb34b67b810ca284c216009925f4f38220c4510)
* QQmlIRLoader: Actually load RequiredPropertyExtraDataFabian Kosmale2021-02-032-0/+17
| | | | | | | | | | | | | | | | If a QML component wants to mark properties of its "parent" component as required, it can do so via required propertyName The information about those properties is stored in a RequiredPropertyExtraData data structure. This structure is already serialized to disk in the QQmlIRWriter. However, we neglected to restore it so far in the loader. Fixes: QTBUG-90538 Change-Id: I789daff9bc881e4f35c942c77f5116b5284de81b Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit b322a971f06823a4356f2b3aa331501aa4d0dc7f) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QuickTest: Do not recurse forever on inline components in enumerateTestCasesFabian Kosmale2021-02-015-0/+128
| | | | | | | | | | | | | | | | | | | | | In TestCaseCollector::enumerateTestCases, we visit the super compilation unit of QML tpyes to check if they might be instances of TestCase. However, in the case of inline components, the super unit is the current compilation unit, and we would recurse endlessly. This does not address the issue that an inline component might actually inherit TestCase. However, as this only affects the enumeration output and does not actually affect test execution, this is not that much of an issue. It should also be noted that the enumeration also fails in any case where TestCases are loaded dynamically (with a loader), so the method is not 100% accurate even in the absence of inline components. Fixes: QTBUG-90740 Task-number: QTBUG-90762 Change-Id: I7e133d62c4f62fc46e9bd3999ff755f7ded3c386 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit edca9f3d60141a823a3b4401039f260c2c7f7888) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Extend blacklisting of tst_QQmlImport::importPathOrder to MinGWTony Sarajärvi2021-01-251-0/+1
| | | | | | | Task-number: QTBUG-88643 Change-Id: I51d346c127e3269eca49e387db578c16480a0565 Reviewed-by: Liang Qi <liang.qi@qt.io> (cherry picked from commit 93c791eaf39f2ed198c7dc188b8257b638b61465)
* tests: blacklist tst_QQuickGridView::snapToRow() and snapOneRow() on MSVCLiang Qi2021-01-251-0/+3
| | | | | | | | Task-number: QTBUG-88644 Change-Id: I363763788b53b0722f680599c08e17d0cb40fcac Reviewed-by: Heikki Halmet <heikki.halmet@qt.io> (cherry picked from commit 19226ef1f1df0375395d832e07ee7655cb0dd83d) Reviewed-by: Liang Qi <liang.qi@qt.io>
* tests: blacklist tst_qquicktext::contentSize() on MSVCLiang Qi2021-01-251-0/+1
| | | | | | | | Task-number: QTBUG-88646 Change-Id: Ia37fc8c4f5c0e56eeaef4f8f82974ee749dd74fc Reviewed-by: Heikki Halmet <heikki.halmet@qt.io> (cherry picked from commit 1ddc6b5216c48a078a03653697ad6fec99ec9ce4) Reviewed-by: Liang Qi <liang.qi@qt.io>
* tests: blacklist tst_QQmlImport::importPathOrder() on MSVCLiang Qi2021-01-251-0/+2
| | | | | | | | | Task-number: QTBUG-88643 Change-Id: I4614e46e9740769660f6c068ed1ff0407378b66b Reviewed-by: Heikki Halmet <heikki.halmet@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit fe2d3a839775f64f7aad8610ea241c8760be4646) Reviewed-by: Liang Qi <liang.qi@qt.io>
* qmllint: Fix auto-importing of qmltypes from same directoryUlf Hermann2021-01-223-0/+27
| | | | | | | Fixes: QTBUG-90513 Change-Id: Ic39e72d6df20be30c61123a7f8091d70dbc2d924 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 9b407b68d1fc0abe08091aa7ca007fbf0f03fb89)
* Change QQuickShortcut::setSequences to bind to all sequencesAndreas Buhr2021-01-151-17/+106
| | | | | | | | | | | | | | | | When binding a Shortcut to a standard key sequence like QKeySequence::FullScreen, it binds only to one key sequence, even though there might be multiple key sequences associated. This patch changes the code to emit a warning in this case and allows to bind to multiple key sequences using 'sequences: [ <key> ]'. Fixes: QTBUG-88682 Change-Id: I88998aa8858d8f2c0c86e46bae94afd7ceb15b66 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 6511b17038627ac30cb6622b13c7d46d9877bac5) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QQmlComponent: Avoid crash when setting initial properties in JS moduleFabian Kosmale2021-01-154-0/+31
| | | | | | | | | | | In a JS module, we lack a qml context. Thus, we have to check whether qmlContext is null. In that case we use the engine's scriptContext('s ExecutionContext) instead. Fixes: QTBUG-90245 Change-Id: I337e9c7cade472f52fc81c93d1152ff59f8018a5 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit e68b498424f63c1cb6151e4fc6bbc50bac584909)
* QuickLayouts: fix crash when layout width depends on parent widthIvan Solovev2021-01-151-0/+37
| | | | | | | | | | | | | | | | | | Some tricky cases of setting layout width based on parent layout width were leading to infinite recursive loop of layout size calculation (see the attached example in the related Jira task). Initially the QQuickGridLayoutBase::rearrange() method already had a recurse check, but it seemed to happen too late, so that the recursive calls kept happening from the ensureLayoutItemsUpdated() calls. This commit moves the recursion check up, so that it's actually executed before we have a chance to get to the next level of recursion. Fixes: QTBUG-87253 Change-Id: I473ee219e7b5b13547e33ebbd3a6d884de2c7d45 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io> (cherry picked from commit 4f8041b01445fd4eec0beb133719645d00d0b2ac) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Flickable: ignore trackpad events with px deltas in disallowed directionShawn Rutledge2021-01-152-0/+113
| | | | | | | | | | | | | | | | | If Flickable.flickDirection == HorizontalFlick, then if the accumulated QWheelEvent::pixelDelta()'s abs(dx) > 2 * abs(dy), clearly the user is trying to scroll horizontally; otherwise, don't accept the event. That way the event is allowed to propagate to a parent Flickable that does allow flicking vertically. Likewise if the nesting is the other way around, only allow the inner vertical Flickable to accept if the flicking is actually vertical. Fixes: QTBUG-57245 Fixes: QTBUG-80236 Change-Id: Ieb0bf9310a67210ce7e9fe7a80c88baef2cc7ede Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit dccd8f0b5ca8f6faefb49718e33f9090243f3202) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix Text with ElideRight not being rendered when width goes from 0 to >0Fabian Kosmale2021-01-142-0/+33
| | | | | | | | | | | | | | | | | | | QQuickText attempts to reduce relayouting. However, it was a bit to aggressive in doing that. If only the width changed in a geometrychange, it would not relayout if widthMaximum was true. However, if the width goes from 0 to greater than 0, the value of widthMaximum should have actually been false (but we would only notice this after relayouting). Thus, don't skip relayouting in that case. Amends 56ade46b4234bb828b8e4f9a6bf83b5687bd122e, which fixed the same issue, but for height. Fixes: QTBUG-83408 Fixes: QTBUG-33608 Change-Id: I14b610c703eb0496c71de7b12ad9fcf16842af64 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> (cherry picked from commit 127c79fb7fda16b9a48ce8c425d1700d1aa7502d) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix QQuickShortcut::setContext so re-grab all shortcutsAndreas Buhr2021-01-131-0/+44
| | | | | | | | | | | | | A while ago, QQuickShortcut was extended to not only have a shortcut m_shortcut but in addition a list m_shortcuts. During this extension, the setContext method was missed: Shortcuts in m_shortcuts are not re-grabbed on context change. This patch fixes this. Task-number: QTBUG-88682 Change-Id: Ie73d516f2a325a328b6e975d69490eea29a18401 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 28f515e6334fd1c15a2f7f18de6be7bfe1f9c302) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* ListModel: Fix move handling in syncFabian Kosmale2021-01-135-0/+361
| | | | | | | | | | | | | | | | | When a ListModel is modified in a workerscript, we reconciliate the state in ListModel::sync. However, the logic for moving elements was wrong, causing crashes in endMoveRows due to invalid moves. This patch ensures that elements are moved to the correct position. Notably, whenever an element is moved, we must update the targetIndex of all elements affected by that move. Amends 3accc1dae76575120e71cadb547e961ecd50bcb0. Task-number: QTBUG-85557 Change-Id: I1a1ffa43eab39ed2315f1916527d897b208c2c3b Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io> (cherry picked from commit 2996439993c587bc9c7169e4f152169f28247c21) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Add Lancelot tests for both types of clippingLaszlo Agocs2021-01-123-0/+99
| | | | | | | | | | | Scissor-based clipping is exercised by existing tests, the stencil-based one however is likely not. Add a simple test case for both. Task-number: QTBUG-89898 Change-Id: I6cba2e30542fba074ee052782170e150ae2f074a Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io> (cherry picked from commit e3cca3df718d8ff298d2d73ce4d6139a3ba620f9) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Correct #if-ery in QML locale's time-zone update testEdward Welbourne2021-01-081-7/+11
| | | | | | | | | | | | The feature check for timezone should apply to the whole test; it makes no sense without. The checks against Q_OS_WIN were redundant in code already subject to a Q_OS_UNIX check. Task-number: QTBUG-89889 Change-Id: I419a775bf0777379662aa19e5b0c81fd6e0e26f6 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit 338ae625a350d1e471a4033f1bcc6e1bfa9c1690) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* tst_qqmlenginecleanup::test_customModuleCleanup(): Add error outputFriedemann Kleint2021-01-041-2/+10
| | | | | | | | | | The test fails for MinGW in the CI for unknown reasons. Output the error string on failure. Change-Id: I96415c9d5753f9013be22b55884175fda6604130 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit cffae9109eecc838a5b107cc58f43637a3c3279e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix compilation warning in lancelot testEirik Aavitsland2020-12-281-1/+1
| | | | | | | | | Use new qChecksum overload Change-Id: Ia2990e3491ee0c4029bba8e645109b03ac5001db Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io> (cherry picked from commit 5aec31639c503bfe00249c65a13d0f34f93edcc1) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Blacklist qqmlenginecleanup::test_customModuleCleanup() for MinGWFriedemann Kleint2020-12-231-0/+2
| | | | | | | | | The test fails for MinGW in the CI for unknown reasons. Change-Id: I20199704a9c810499551b8952375926902a75aa0 Reviewed-by: Tony Sarajärvi <tony.sarajarvi@qt.io> (cherry picked from commit 3c049c7a996d156c2faf9a257e209fe8b23d1151) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>