aboutsummaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* Fix bad rendering after text selectionShawn Rutledge2022-08-292-0/+94
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In 9db23e0e04906cf9ea33e23fa41f34955e5e6fe0 we added a new call to createTextNode(), but it turns out that it could be called again for the same block, a few lines below (in code that was originally added in dfdc4ce825e814b30449cfa1c85d3d2f47f8a845), if we have not reached the "last node that needed replacing or last block of the frame". This resulted in a memory leak: TransformNodes were created without parents, which b616028dae933e7ff6142d41bdafee8ad445a8ec tried to fix by calling addCurrentTextNodeToRoot(). That change made the code in "Update the position of the subsequent text blocks" re-add offsets that had already been added, which had the effect of moving down the blocks below the selected ones by the height of one line; but the new call to addCurrentTextNodeToRoot() was anyway just adding empty TransformNode instances to the scene graph. Afterwards we can see that any TransformNode that does not have a GeometryNode as a child is not actually rendering any text, it's just wasting memory. Having a debug operator for QQuickTextEditPrivate::Node, and using a QQuickTextEdit subclass in the autotest that checks the nodes corresponding to blocks rendered at the end of updatePaintNode(), makes this easier to see and verify. So now, if createTextNode() has already been called, we avoid calling it again a few lines below; but we keep the checks in place to make sure that every node which does not have a parent will get added to the scene graph (regardless of which line of code it was created on), so that there's no leak. It remains to be seen if this could be cleaned up further. Amends 9db23e0e04906cf9ea33e23fa41f34955e5e6fe0 and b616028dae933e7ff6142d41bdafee8ad445a8ec Task-number: QTBUG-103819 Fixes: QTBUG-105208 Fixes: QTBUG-105555 Fixes: QTBUG-105728 Change-Id: I321980c705887bfdb37825f7e6ed8da3d200654e Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> (cherry picked from commit b271755e6c9a5a939c3ad6dfca8da573779e06ee) Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
* qmlformat: Preserve variable declaration scope typeFabian Kosmale2022-08-113-0/+19
| | | | | | | | | | | If the user used for(let x;...) we need to preserve the let and must not change it to var. Fixes: QTBUG-105361 Change-Id: I49fc3797505b569cc9b8a9138dd57ec7e70d3eb9 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit 84dd339e2eb3385eb143f9d5ab282a135635052d) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* JSON: Properly handle bad objects in JSON.stringify()Ulf Hermann2022-08-071-0/+40
| | | | | | | | | | | | | | | | | | | For objects with circular structures we generate a proper error message and fail earlier. For objects with excessive recursion we throw a range error rather than crashing. This behavior is modeled after node's behavior in such circumstances. We use the existing stack overflow detection to determine when to throw the range error. Testing shows that on windows the limit was insufficient. Lower it. Fixes: QTBUG-92192 Change-Id: I25dd302f65f359111e42492df3c71549c4ed7157 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> (cherry picked from commit af1ef35fa00a466d3af04c17b59fcb4ea38f396a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Qml: Don't crash on nested group properties with aliasesUlf Hermann2022-08-042-0/+28
| | | | | | | | | | | | This fixes an oversight where in case of half-resolved grouped properties we would forget to add the bindings to the "pending" list. In addition we would fail to resolve their property caches later on. Fixes: QTBUG-94983 Change-Id: I88bd0ce56464438d2a105e5ed426e002495cc016 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit fed5b07980d9ae5a392a00563f70ee34fc261dbc)
* V4: Mark InternalClass parents when running GCUlf Hermann2022-08-034-13/+129
| | | | | | | | | | | | | | | | | We need to preserve them as they notify us about protoId related changes. In order to avoid wasting heap space in case many properties are added and removed from the same object, we put a mechanism in place to rebuild the InternalClass hierarchy if many redundant transitions are detected. Amends commit 69d76d59cec0dcff4c52eef24e779fbef14beeca. Fixes: QTBUG-91687 Task-number: QTBUG-58559 Change-Id: I3238931b5919ed2b98059e0b7f928334284ce7bf Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 0b9fa18dfefc06f542bd0c98b7e41fa14aa0c2cf) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* tst_qquickpopup: Fix child button positionDoris Verria2022-08-032-2/+11
| | | | | | | | | | Make sure the button is positioned in the center, where the test expects it to be, no matter the size of the popup. Change-Id: I9dd6a69aea758d77686eddb5f54851e06e1e07ca Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> (cherry picked from commit fe44ee9ac8d13f8c6a39ebee90b672c69ac01ee5) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* tst_qquickpopup: Fix click position and wait for transitions to finishDoris Verria2022-07-281-1/+2
| | | | | | | | | | | - Take into account the menu coordinates when clicking menu item - In closeOnEscapeWithNestedPopups wait for the Options menu to close before interacting with the dialog Change-Id: Ide182bdb44ca642322b09771f0a2bd52d98338bc Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> (cherry picked from commit f52d4cf2c0242d2b13990553a28bfde950fa05ce) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* ScrollView: ignore filtered wheel events when wheelEnabled is falseMitch Curtis2022-07-281-1/+45
| | | | | | | | | | | | | | | | The event filter was returning true when wheelEnabled was false, but wasn't ignoring the event, meaning that propagation of the wheel event stopped there, and items behind the ScrollView didn't get the event even if ScrollView wasn't using it. I'm not sure why it was done this way - the behavior isn't documented and no auto tests fail when changing it. Fixes: QTBUG-105164 Change-Id: Ie826ccfc406b77606ef0c6f043dc48f42a18cdc7 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit 7ef12715baf48912f713e6cb3ee2a784caaadaae) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* V4: Allow conversion from string to QByteArray when setting bindablesUlf Hermann2022-07-282-0/+37
| | | | | | | | | We allow it everywhere else, too. Fixes: QTBUG-105044 Change-Id: I714e5d501a780310791523c5f35a87681c69b1fb Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 00e95e35061c169237402af4b017e70175a881db)
* tst_qquickpincharea: fix signal handler parameter injection warningMitch Curtis2022-07-281-3/+3
| | | | | | | | | | | | | The warning was: pinchproperties.qml:45:13 Parameter "pinch" is not declared. Injection of parameters into signal handlers is deprecated. Use JavaScript functions with formal parameters instead. Change-Id: Iac453ae128cd4ac4b621d9548f439a121f83c407 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 384ba7dfa83b1680d435d4924e9098adcbfdf654) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* tst_qquickmenu: Unblacklist some test cases on macOSDoris Verria2022-07-272-11/+17
| | | | | | | | | | | | | | | | | | | | - SKIP instead of blacklist the popup test on macOS as the cursor position can't be controlled on this platform. - Use the TRY variant with isOpened() instead of isVisible() in order to make sure that all enter/exit transitions are finished before interacting with the menu. Otherwise, the test can be flaky. - The subMenuDisabledMouse test expects currentIndex to be set on mainMenu when the click happens. As we set the currentIndex on a hover or keyboard navigation event, explicitly generate a hover event with mouseMove before clicking. Change-Id: I7eba20a6b25f2e48a66145774539523def7142e6 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> (cherry picked from commit d223f1e3a887f7b953b23b6c911ef6028755c935) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QQmlListAccessor: Accept QQmlListPropertyUlf Hermann2022-07-273-0/+29
| | | | | | | | | | | | So far we have only accepted QQmlListReference. However, we can also pass a QQmlListProperty around as value. Fixes: QTBUG-105137 Change-Id: I7d4cd3048b62594298f91013c4cda5ec864a28df Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> (cherry picked from commit 6ea2a1cdb728635f9bd3cf239f751d4e88610881) Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Blacklist flaky tst_QQuickListView2::flickDuringFlicking test on macOSMitch Curtis2022-07-261-1/+1
| | | | | | | | Task-number: QTBUG-105190 Change-Id: I2c616c84059021e053b89aa3505510816021d472 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 10c475624cfef9cddca71622c2883e7c7595612a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* tst_QQuickListView2::flickDuringFlicking: improve failure messageMitch Curtis2022-07-261-1/+3
| | | | | | | | | | Use QTRY_VERIFY2 to show the actual contentY upon failure. Task-number: QTBUG-105190 Change-Id: I387d92cbc33e2aab67f72219f3354adbd537c334 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 8706661b3d959eb7a59648b4e6e8e64ac4aea2a3) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Add 'override' keyword to fix build warningsJiDe Zhang2022-07-262-2/+2
| | | | | | Change-Id: I8bd51da4ad27c97be78c708af33d6b1e4c1ca957 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit 90773dfbf1371a61a0ef142ef3199a858ff736b0)
* testbench: revert debugging codeMitch Curtis2022-07-261-1/+0
| | | | | | | | | | This was accidentally left in as part of e987d6029727ed22d12971080ae905732654f93f. Change-Id: I918aaf18a80d8460a357a2d097f02ee9917e33d5 Reviewed-by: Doris Verria <doris.verria@qt.io> (cherry picked from commit 44645d8c38cbf4ca020d051cfaf37a506dfbeb0a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix extension lookup in QQmlJSScopeAndrei Golubev2022-07-255-10/+192
| | | | | | | | | | | | | | Do not go over extension's base types since this is not how the engine logic work. Instead, only assess the direct extension type when traversing the base type hierarchy. The special cases are value types which still need base type extension traversal (e.g. due to Number and NumberPrototype extensions on primitives) and QObject type itself (we expect to see ObjectPrototype properties / methods of it) Change-Id: I92ba979202b33f16e1a7b948d4f1e79df37f2669 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit a287e862d467b21a8007698f8390088bdf887b44) Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* tst_qquickmenu: Fix click position and wait for menu opened() signalDoris Verria2022-07-222-5/+9
| | | | | | | | | | | | | | | | | - When clicking on the menu, take into account the menu's coordinates as this may not always be (0,0) depending on the style-specific margins. - Wait for the menu enter transitions to finish before trying to interact with it, otherwise it leads to flakiness. - Explicitly set the overlap property to 0 when testing the submenus as the test relies on the menuItem to be clickable and not hidden by an overlapping subMenu item. Change-Id: I561f47e69b2c9ee12c46f6accacd06e22b448df5 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit 76d992431e113c3df9b6f879e2889973d5093a44) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Qml: When cloning a stack frame, also clone its instruction pointerUlf Hermann2022-07-221-1/+1
| | | | | | | | | | | | | Otherwise we get an out of range access when looking for the line number. To be extra safe, we also add another guard against this to the lineNumber() function. Fixes: QTBUG-90466 Change-Id: I4d9cb52ecba2631696537f02a3c1b75c3658ceb8 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit c02b0e529a3266cce2f7d852deca7774402b236e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Imagine: don't show hover effects when disabledMitch Curtis2022-07-211-0/+1
| | | | | | | | | | | | 831efa14e91cfa358e57a32197578d41c2ae1b24 made disabled items get hover events, so we need to check if a control is disabled before showing hover effects. Task-number: QTBUG-94919 Change-Id: Iee93a053780e7c3c604ae62a99665fdc83be5421 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit e987d6029727ed22d12971080ae905732654f93f) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Add convenience API for making QQmlDataTest-based tests fail on warningsMitch Curtis2022-07-2117-19/+65
| | | | | | | | | | | | | | | | | | | | | After this patch, if a QQmlDataTest-derived class passes FailOnWarningsPolicy::FailOnWarnings to the base constructor, any non-empty warning encountered by that test will result in a test failure. This avoids the need to duplicate the catch-all regex in tests that want to fail on warnings. The goal is to gradually enable failure-on-warnings over time. Leave comments and explicitly pass DoNotFailOnWarnings for tests that should never fail on warnings. Task-number: QTBUG-98718 Change-Id: I4b647d93a0f28ac891c4bdb19ef74569f2918e8f Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit 234afb5502ab20b4f58ddd9b01a4245330a7e5a4) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* tst_qqmlfileselector::applicationEngineTest: do not use deprecated APIIvan Solovev2022-07-191-10/+4
| | | | | | | | | | | | | ... use QQmlApplicationEngine::setExtraFileSelectors() instead. We also need to rework the rest of the test, so that engine is actually initialized and the new selector is applied. Task-number: QTBUG-104950 Change-Id: I994ca01c3fe1acef63da01f6d7d4e443d1f28f91 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit b335d8311f7c0be9261305d5b41bbcbf94cd3d27) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Avoid qWaitForWindowActivated() in tst_qquickpathviewUlf Hermann2022-07-181-53/+19
| | | | | | | | | | There are platforms that don't support window activation. On such platforms the test would needlessly fail. Change-Id: I0dfcba892643cd254ce4987b1a09e494063035ed Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> (cherry picked from commit 99a35ac26a6523252bb041ea00af6ff0b8c237c2) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QQmlProxyMetaObject: Ignore properties/methods of non-creatable proxiesAndrei Golubev2022-07-182-0/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | Qt/QML allows marking a type with QML_EXTENDED_NAMESPACE(Type) where Type is a Q_OBJECT. In this case, we have a Type-specific meta object but do not have an extension function to create the object of that Type with, causing us a subtle runtime crash. The crash in fact happens when we attempt to access a shadowed property through the extension object (which surely fails since there's no extension object) Fix this by excluding properties and methods when cloning the metaobject for the proxy if we know that the proxy cannot be created. This somewhat matches what the documentation says about QML_EXTENDED_NAMESPACE: When we have a Q_OBJECT/Q_GADGET, methods and properties of that are not exposed As a drive by, add the same check to the QQmlMetaType::proxyData(). While untested, this seems logical since the proxy data assumes valid creation function in this case as well Fixes: QTBUG-103081 Fixes: QTBUG-104700 Change-Id: I63c6e535d4df5169e0279eb2f588593f43a70640 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit 218eb5f5712dd920459cb0108fcd305d653352bc) Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* testbench: clean up DelayButton pageMitch Curtis2022-07-181-3/+2
| | | | | | | | | | - Uncomment code which is needed to visualize states. - Remove print statements. Change-Id: If0d0cc65fb51f842f6030f7dbd99e02ae1e835d3 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit f699a8d823e53de8ef407d2f05168e8a7a6d5b60) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Don't ungrab for a TabletRelease event: wait for the synth-mouse releaseShawn Rutledge2022-07-152-1/+37
| | | | | | | | | | | | | | | | | | | | Many QTabletEvents are not handled, so being able to "press a button" or other kinds of basic UI interaction depend on tablet->mouse synthesis in QGuiApplicationPrivate::processTabletEvent(). If a basic mouse-handling Item like a MouseArea or Button grabs on _mouse_ press, it needs to receive the _mouse_ release too; so DeliveryAgent must not take away its grab until that happens. Amends a97759a336c597327cb82eebc9f45c793aec32c9 Fixes: QTBUG-98936 Fixes: QTBUG-102764 Fixes: QTBUG-103937 Change-Id: I6d75d988d617bc3ceb8465f939d0a69485278cdf Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Doris Verria <doris.verria@qt.io> (cherry picked from commit 718bef9d2c85989479a8eef7e3a2837c42230c07) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix tst_qquicktextedit::hAlignVisual on high-dpiShawn Rutledge2022-07-131-4/+4
| | | | | | | | | | text->implicitWidth() is in logical pixels, whereas the image from grabWindow() is in physical pixels as rendered in the view. Change-Id: Ib65d1d9690bf7bf58a2d603cf339e08fa96b1b40 Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io> (cherry picked from commit 7112b4e0cc9b7625288d0464c02d92390ab0f193) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Add QQDAPriv::allPointsGrabbed() and stop using QPointerEvent::apg()Shawn Rutledge2022-07-131-19/+20
| | | | | | | | | | | | | | | | QPointerEvent::allPointsGrabbed() was implemented wrong in qtbase 8932e80d0c8879a1e720fef825ed0d9c4e384a01. Fixing it has ramifications for event delivery; so it's easier to take care of that in one patch in qtdeclarative first, rather than causing a submodule update crisis, and then fix the public QPointerEvent version afterwards. It fits nicely alongside anyPointGrabbed() anyway. Task-number: QTBUG-101932 Change-Id: I4141a492c941963e5eb716b63d3e09f9ae165c57 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit 42eddf0743e09f5b751a68555dba045c17cf8520) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Disable debugger tests on macOS/x86_64Ulf Hermann2022-07-121-2/+2
| | | | | | | | | | | | They run into a hard to reproduce deadlock in the CI. In turn re-enable tst_qqmljdebugjs for macOS/arm as there it doesn't happen. Task-number: QTBUG-102984 Task-number: QTBUG-101678 Change-Id: I17d483b7c44b36d17cfc2f0f31fcccd30cd4548a Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> (cherry picked from commit 873bdb3146067a6c497b4e081e4f447140853b3c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* tst_popup: Fix popup size testDoris Verria2022-07-121-8/+8
| | | | | | | | | | | | | | | | | Setting the implicitWidth of the popup calls for a relayout, which sets the width/height of the contentItem to the popup's availableWidth/ Height, which is never negative: (i.e.: qMax<qreal>(0.0, width() - leftPadding() - rightPadding()) Fix the test case to check directly that the content size is set to the available size (width/height) of the popup, instead of manually removing the paddings from the popup size, which may result in the test to expect negative values. Change-Id: I565731a7f0b77b5dc211b5f13d721eedf6f637ca Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> (cherry picked from commit 6e65d262295ef2bab4e994d125798699ad655b92) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Stabilise changeFolderViaDoubleClick and chooseFolderViaEnterMitch Curtis2022-07-111-0/+8
| | | | | | | | | | | | These were failing on Ubuntu 20.04 due to the ListView delegates not being up-to-date. The only reliable solution is to repeatedly check until they are. Task-number: QTBUG-101488 Change-Id: I437bb1b4bf9ab35ad23b1da1a89e9f77872a2f48 Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io> (cherry picked from commit 989e05a0b8240778c9f249edea5c9d27d68f8e0f) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QQmlValueTypeWrapper: readReferenceValue in virtualGetOwnPropertyUlf Hermann2022-07-071-0/+30
| | | | | | | | | | Otherwise we may end up with a nullptr gadget. Fixes: QTBUG-104803 Change-Id: Ia0c3741fdf0214f0c3d4b352006442747f635f5c Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 0e48d9d9387aeb39c8289f61f75d9c6fcd6c753f) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QmlCompiler: Don't StoreNameSloppy undefined into incompatible typesUlf Hermann2022-07-073-1/+12
| | | | | | | | | | This would call the property's reset method, but we cannot do this, yet. Task-number: QTBUG-104508 Change-Id: I5d3f8ae25bad637935e7e4835bcac1120ffead7b Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 7c69258cdbf8f2dbf422ca274fa621a9b9879e3a) Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io>
* Delete transition when it's canceledBumjoon Park2022-07-071-0/+33
| | | | | | | | | | | | | | | | | If next transition occurs before previous transition ends, the animation of the previous transition is canceled. The problem is that it is not removed from A while it is being canceled. At this time, if a new job comes in translator->runningJobs,'busy' state cannot return back to its original state and mouseEvent/ touchEvent are broken. So, in case of transition canceled, we should remove the transition. Fixes: QTBUG-104491 Change-Id: I33083822763bdc006eb35262b9c216f27989139a Reviewed-by: Bumjoon Park <bumjoon.park@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> (cherry picked from commit 572b3ae9f32d039ed2b14a50731e939422646da4) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QQuickAbstractDialog: emit rejected() on mere close()Marc Mutz2022-07-061-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Like QDialog, there should be only two ways to close a QQuickAbstractDialog: by accepting or rejecting. Closing a dialog with the [X] button or hitting Esc should reject. This is natural, and what QDialog has been implementing since decades, but QQuickAbstractDialog only emitted rejected() on a manual reject(). To implement, move the emission of accepted() and rejected() to close() instead of done(), and swap the calls to close() and setResult() in done() so the correct result() is available when close() is called. [ChangeLog][Important Behavior Changes] QtQuick dialogs now emit rejected() on a mere close(), too. [ChangeLog][QtQuickDialogs][QQuickAbstractDialog] Now emits rejected() on a mere close(), too. The code in 5.15 is too different, so I made a separate fix. Fixes: QTBUG-101973 Change-Id: I90d1a78ee95b72eecae35005e191312c939cecf3 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit 83a306f7d84e3fb58ed8576546f61cbb2cb20f9a) Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* tst_QQuickFileDialogImpl: check that closing the dialog rejectsMarc Mutz2022-07-061-0/+28
| | | | | | | | | | | It doesn't. Task-number: QTBUG-101973 Change-Id: I63a76f9919a4b9a1ebc3b2f95189b518e9c6858b Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> (cherry picked from commit 321c4c8f3183e2260feb56d13d62e4592883775c) Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Add test for conversion/decrementUlf Hermann2022-07-063-0/+40
| | | | | | | | This proves that we don't have this problem in 6.3. Task-number: QTBUG-104512 Change-Id: I1fca1973f3aa0bc0e63d45fe60c024837a128709 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Fix window activation usage in tst_QQuickDrawerEskil Abrahamsen Blomfeldt2022-07-061-12/+14
| | | | | | | | | | | | | - Skip tests that depend on programmatic window activation on platforms where this is not supported, such as Wayland. - Change tests that don't rely on the window being activated to use qWaitForWindowExposed() instead. - Remove requestActivate() calls where they're not necessary. Fixes: QTBUG-104242 Change-Id: I1389ec155698d081f43feb47adcfe3b08e5b7b0d Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> (cherry picked from commit ba90c670055094147bd72e95d4e4dae5a314fbcb)
* FileDialog: fix selectedFile being incorrect due to async view changesMitch Curtis2022-07-061-54/+110
| | | | | | | | | | | | | | | | | | | | | | | | | | | To display a list of files in FileDialog, we use a ListView with a FolderListModel as the model. Part of being able to respect the selectedFile that the user has set involves setting that ListView's currentIndex to the index of selectedFile in the current folder. When currentFolder was set to a directory that contained a lot of files, there was an issue where we set the ListView's currentIndex before it had finished loading its items, resulting in an incorrect selected item. To fix this, we now store a "pending" currentIndex, and listen to the ListView's countChanged signal to know when we can set that pending currentIndex. This is not an ideal solution, but it's the most efficient one given the limited information we have from ListView. A better solution might be to have some way of telling ListView not reset currentIndex when its model changes (as long as the currentIndex that was set is within the bounds of the new model). Fixes: QTBUG-103547 Change-Id: If3677e5e1a7873a939af19d4ea996ff74033c6e0 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> (cherry picked from commit ae5fad789139489e5497ea4dbf98af4f588108dc)
* tst_qquickfiledialogimpl: refactor duplicated code into helpersMitch Curtis2022-07-061-290/+185
| | | | | | Change-Id: I1445d41dbbbe346506195c160e87d0b05770d22c Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io> (cherry picked from commit f047980dea361479865975c716736fdf46fd109c)
* Simplify tst_qquickfontloader::changeFontSourceViaStateMitch Curtis2022-07-061-3/+1
| | | | | | | | | | | Don't wait for the window to be active and have focus if we don't need keyboard focus. Task-number: QTBUG-89927 Change-Id: I77c4064138488fe512a9cf33b16393b9a1c5848b Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit 28428d7d7d2895af8c56922d6470ff4bb3ecfe62) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix SplitView containmentMask hit testingIgor Bugaev2022-07-051-0/+430
| | | | | | | | | | | | | | | | | If someone catches mouse events under a SplitView handle, and that handle uses containmentMask to extend hit testing, the mouse events outside the handle's bounds are not handled by the SplitView. Because of this containmentMask is not useful for hit testing. [ChangeLog][QtQuick][SplitView] SplitView now correctly handles mouse events when using containmentMask. Task-number: QTBUG-82678 Fixes: QTBUG-87119 Fixes: QTBUG-97385 Change-Id: I3f00a73f9d80f22575545dd8556af6c755aadaa6 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> (cherry picked from commit 80166d58a18370bd5a2c6c61d2519011cfd65721)
* Flickable: don't grab on press if already movingShawn Rutledge2022-07-042-1/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 9f9ea6e1837620a0ff4b98e262cba2df44215967 was too drastic: we cannot simply avoid calling filterPointerEvent() on press, because it calls handlePressEvent() which calls maybeBeginDrag() which sets pressPos, among other things. Failing to set pressPos caused a regression: flicking a second time while the flickable is already moving caused it to "start over" as if it was flicking from the top again. So now we revert that fix, and instead avoid setting stealMouse to true in handlePressEvent(). This makes the second flick more like the first: it waits for move events before taking the exclusive grab; so it's ok for a delegate (such as a Button or MouseArea) to detect the press and take a grab in the meantime. Flickable does not need to grab on press during filtering: it's not a lost opportunity, because it keeps filtering its children's events later on anyway. The flickDuringFlicking() test is added for this scenario. For the same reason as tapDelegateDuringFlicking(), this is also likely to fail on Android for now. This could have some impact on d7b5a485583004ad6a1374a50b7c3f6cab00aca3 but it seems the test that was added there still passes. Fixes: QTBUG-103832 Task-number: QTBUG-38765 Task-number: QTBUG-74842 Task-number: QTBUG-104471 Change-Id: Icb45fcd94847051121ee78a970fbd5f5dc8a42a4 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Antti Määttä <antti.maatta@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io> (cherry picked from commit bb337a0e1c22896984438cbd51ab7473807f017c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix and un-blacklist tst_qquickwidget::synthMouseFromTouchShawn Rutledge2022-07-012-9/+8
| | | | | | | | | | | | | | | | | | | In Qt 6, any QQuickItem that wants to handle touch events needs to explicitly enable them by calling setAcceptTouchEvents(true). This was anticipated in 1457df74f4c1d770e1e820de8cd082be1bd2489e and ab91e7fa02a562d80fd0747f28a60e00c3b45a01 If an Item calls setAcceptTouchEvents(true), it will not receive synth-mouse events, even if it calls ignore() on a particular touch press event. So now in this test, when we want to test synth-mouse events, we call setAcceptTouchEvents(false). Task-number: QTBUG-86729 Task-number: QTBUG-101736 Change-Id: I71d2f213bc62206c190c94de5e4d39ce17504a0d Reviewed-by: Doris Verria <doris.verria@qt.io> (cherry picked from commit 18954828363a6e14b969c7ba43784d48a157da06) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix debugger crash on attachSami Shalayel2022-07-012-2/+53
| | | | | | | | | | | | | | | | | | | The debugger treated QQmlGadgetPtrWrapper like normal QObjects, which means that their metacalls where done incorrectly. The meta system saw the QQmlGadgetPtrWrapper's metaobject, which is actually the wrapped type, and produced a garbage QObject* by reinterpret_casting the wrapper as the wrapped type. The debugger was changed to recognize gadgets and to call the read/write/resetOnGadget() methods instead of calling QMetaProperty.read/write/reset(). Added a test with the qml example that was making the application crash when a qml debugger was attached to it. Fixes: QTBUG-104379 Change-Id: I7c1138fc44ee78137386dcd7da145bbaab574afc Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit 33aa69529ca845e102ee9155ae90b29a6640afef) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix window activation usage in QQuickMenu(Bar)Eskil Abrahamsen Blomfeldt2022-07-012-18/+77
| | | | | | | | | | | | | - Skip tests that depend on programmatic window activation on platforms where this is not supported, such as Wayland. - Change tests that don't rely on the window being activated to use qWaitForWindowExposed() instead. Fixes: QTBUG-104257 Change-Id: If99721a223b328869af86fddf6565002a19e987a Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> (cherry picked from commit 79123dc66b9dcf9dbe4d898e4d29485e54114d4e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* tst_QQuickMenu: skip entire popup() test where necessaryMitch Curtis2022-07-011-3/+10
| | | | | | | | | | | If the cursor configure feature is not enabled, don't build the code. If the platform is Android or Wayland, skip the test. Change-Id: Ic60771decf7f2e0bd7db77c112925147015af5a6 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> (cherry picked from commit fb22bc65e2730c87dffd779668a1e74aaa3ebf7d) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Ensure that when an item resizes, its layer resizes immediatelyShawn Rutledge2022-06-303-0/+37
| | | | | | | | | | | | | | | | | | | | | | | | | geometryChange() notifies QQuickItemLayer::updateGeometry() to update its internal bounds; at that moment, QQuickImagePrivate::paintedHeight has not yet been updated, so the QQuickImage::boundingRect() override returns the old size. It gets updated in updatePaintedGeometry(); but until then, it's better to use QQuickItem::boundingRect() without polymorphism, because that simply returns the item width and height. An alternative would be to use clipRect(), as it was before 9b62f4c27ac3fb3dc563c7f4657094c14d752bac; but that is more complex now: in case ItemObservesViewport is set, we would need to worry about whether it's more appropriate to have the item's layer the same size as the viewport (and update it more often during scrolling), or the same size as the item, as it was before. Amends 9b62f4c27ac3fb3dc563c7f4657094c14d752bac Fixes: QTBUG-104442 Fixes: QTBUG-104536 Change-Id: I51e25402d358a57cea9fd718ee8fe759b572b1a2 Reviewed-by: Igor Bugaev <freedbrt@gmail.com> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> (cherry picked from commit b0fc5287b8378e0be13765e2f8dc90aa938a25fb) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix window activation usage in tst_QQuickPopupEskil Abrahamsen Blomfeldt2022-06-301-19/+62
| | | | | | | | | | | | | | - Skip tests that depend on programmatic window activation on platforms where this is not supported, such as Wayland. - Change tests that don't rely on the window being activated to use qWaitForWindowExposed() instead. - Remove requestActivate() calls where they're not necessary. Fixes: QTBUG-104258 Change-Id: Icfe701f601dd691747fc0048aa6fb62333e83ad8 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> (cherry picked from commit 563298bc660b0815dcadd1d5fcf1674094153cb1) Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* QmlCompiler: Properly annotate ThrowException instructionUlf Hermann2022-06-283-0/+20
| | | | | | | | | | | | It doesn't write the accumulator, but it does read it. Generating code for throwing exceptions reveals that we have to default-construct the return type rather than converting from undefined/void when throwing an exception. Fixes: QTBUG-104447 Change-Id: I0a725679d8ecb7e87bb20528033097bc0c3c7bb6 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 87f984714408bb5112fb38a66f0280b722ac9491)