aboutsummaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* Controls: add todolist example for showcasing the iOS StyleJenny Lofthus2022-09-121-0/+1
| | | | | | | | Task-number: QTBUG-80261 Change-Id: Ie6d86b0a49bd0684373816d709c7e010aff7e7a5 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit 6b5cf5969889a88d5f506692c859d1bd4f59d5dd) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Engine: Fix handling of attached objects in function callsFabian Kosmale2022-09-023-0/+37
| | | | | | | | | | | | | | | | | When we use an attached object as an argument to a function call, we need to properly extract it from the QmlTypeWrapper. Before this change, we simpley left the argument pointer as null, which lead to subsequent crashes when it got dereferenced. Moreover, treat passing namespaces to functions expecting a QObject as a TypeError, by returning false from CallArgument::fromValue (used to crash for the same reason as with the attached object case). Fixes: QTBUG-106119 Change-Id: Ifa6a32e20a29935aff1f265eb0edd3e35ea1c11b Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit 84483bff4f4d49e5f87abf564021647f2fb2a8d0) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Material: add TreeViewDelegate.qmlRichard Moe Gustavsen2022-09-022-2/+2
| | | | | | | | | | | | | | | | Add a version of TreeViewDelegate.qml to the Material style, that looks more at home for that style (rather than using the one in the Basic style). This version is using the arrow-indicator from the Material style as expand/collapse indicator, and makes the height of each row match the height of a normal Material button. Change-Id: I084532ca6e527593e5711d66aa53f240f0356d99 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> (cherry picked from commit 55fab9a73e720a84d0f0a86cc4175f34a4573188) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* PinchHandler: Enforce min/max scale limits with native gesturesShawn Rutledge2022-09-022-19/+26
| | | | | | | | | | | | So far the qBound() using m_minimumScale and m_maximumScale was only applied for normal pointer events: there were no limits when using a touchpad that sends native gestures. Fixes: QTBUG-106110 Change-Id: Ibf8d955e5f1dac517e0a3e9588fb117d83f443a6 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 5cb3ba93da2673b20abae8a544a961b7b57dff45) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Integrate property binding evaluation fix from qtbaseFabian Kosmale2022-09-022-0/+42
| | | | | | | | | | | | This is basically the same as QTBUG-105204, only with the QML engine being involved. Fixes: QTBUG-104982 Change-Id: I5afaadedcd7af41198702a8f2331703b4f6ef2e7 Reviewed-by: Sami Shalayel <sami.shalayel@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit 2879c7c3411955b1d4f795436f803abd960c176d) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QmlCompiler: Prevent lookup of value type where we need an object typeUlf Hermann2022-09-013-0/+28
| | | | | | | | | | | | | | | | | With a particular nefarious combination of Q_GADGET and inheritance from QObject you can make QmlCompiler believe a type is a value type even though it is actually an object type. We never want to touch such a thing. There was a safe guard against this when looking up the type from the scope, but by putting it in a type namespace you could circumvent it. Refactor the code to apply to both cases the same way. Fixes: QTBUG-104556 Fixes: QTBUG-105608 Change-Id: I8a690e2b6f78fcaba0911a93504cde0d2c7dde0d Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 0a8fe228f6bb65afe08f1bc203653266fa204ba5)
* Parser: Preserve keywordiness of "static" across nested classesUlf Hermann2022-09-011-0/+17
| | | | | | | | | | | | | | | | "static" is a keyword in the context of JS classes, no matter how deeply nested. Therefore, keep track of the nesting level. Switching the keywordiness of "static" off during method definition parsing makes no sense as the standard doesn't mention such a thing. Method bodies are strict code where you cannot use "static" as identifier. Methods and properties can be called "static" no matter if static is a keyword or not. Fixes: QTBUG-96631 Change-Id: Ia09e52fe2ae72721fe1c8a9b95899a31095db988 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit b50d01891b1adba15c4cfc47ad078d227aa1f491)
* Fusion: add TreeViewDelegateRichard Moe Gustavsen2022-08-312-2/+3
| | | | | | | | | | | | | | | | Add a version of TreeViewDelegate.qml to the Fusion style, that looks more at home for that style (rather than using the one in the Basic style). This version is using the arrow-indicator from the Fusion style as expand/collapse indicator, and makes the height of each row match the height of a normal Fusion button. Change-Id: I153bb5776e23476cf8c383fb6f76e63981e28639 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 13a8df4a878a4f62e626b577cb92a2e0d0ba54c9) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Transition: properly remove QPropery based bindingsFabian Kosmale2022-08-302-0/+44
| | | | | | | | | | | | We need to use QQmlAnyBinding::removeBindingFrom instead of the functionality in QQmlPropertyPrivate, as the latter does not correctly handle QProperty based bindings. Fixes: QTBUG-105535 Change-Id: Ifcd8d3a97ff6d62b365008768e6bf50cfa102a39 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit af5f853413c633c665696dc176677fdde196dd01) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix TextInput and TextField mouse/touch selection fallback behaviorShawn Rutledge2022-08-306-0/+166
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | We tried to make default behavior depend on the import version; but in Controls that does not work well, because the QQuickTextField instance is created in a style-specific QML file that does not use the same import version that the user is using. So we work around it by adding support for a Controls-specific env var to revert to pre-6.4 behavior. Adding the autotest proves that the fallback was broken a different way too: we didn't check selectByTouchDrag in all the necessary places. Amends 650342de792e0ab37ce8bac8ccde21ab9b96b2c9 [ChangeLog][Controls][TextField] The selectByMouse property is now enabled by default, but no longer enables selecting by dragging your finger across text on a touchscreen. Platforms that are optimized for touchscreens normally use special text-selection handles, which interact with Qt via QInputMethod. You can opt out of the behavior change by setting the environment variable QT_QUICK_CONTROLS_TEXT_SELECTION_BEHAVIOR=old. Task-number: QTBUG-10684 Task-number: QTBUG-38934 Task-number: QTBUG-101205 Change-Id: If1c1d6bd9c538f52022ae06d5252d178a1ae5a38 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> (cherry picked from commit 42848bda5cb7ed92781cbbd536005af617e91020) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* tst_qquickmenu: Take into account menu margins when checking coordinatesDoris Verria2022-08-301-4/+4
| | | | | | | | Change-Id: I416de281882a2ad94d03567d12dbb1491ffa801c Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> (cherry picked from commit f66d0bfebeaa6c5cdea4d8d65de8bd29b50e50ca) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* qmlls: fix import as resolutionFawzi Mohamed2022-08-304-8/+26
| | | | | | | | | | | | | | Import as resolution (i.e. finding a type that was imported with an import as) was broken in two ways: the shortcut looking for types did look only to types imported without as, and the normal lookup for symbols declared the ImportScope as visited (to avoid loops) too early in one case and would skip it. This was visible in qmlls completions of Controls. Change-Id: Ifc1e777973ddc251bd0685290e8d28bfb025f269 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 8e6dcc04fc1073b043eba6792472c2d7cd3d5993) Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Blacklist tst_QQuickMultiPointTouchArea::nonOverlapping and nestedHeikki Halmet2022-08-301-0/+2
| | | | | | | | | | | nonOverlapping for Ubuntu 22.04 nested for Ubuntu 22.04 Task-number: QTBUG-101499 Change-Id: I28e8a4f61c9bb1a5e0b2185e88dff22fbf170e37 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit 6186f7109a45a6cd477df39aff3d20d4f1f82593) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* iOS Style: Add Menu controlsDoris Verria2022-08-301-1/+1
| | | | | | | | | Add Menu, MenuItem, and MenuSeparator. Change-Id: Ic5d6629418081e591c1abd28cea73b6c3b3ecd1c Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> (cherry picked from commit b1c90719fe991c5dd1f7e290c52eeeebe447278c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* TextArea: selectByMouse default=true, but not on touchscreensShawn Rutledge2022-08-297-0/+263
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When you drag a finger across a TextArea, it should not select text. - your finger probably covers several characters, so you can't see where you're selecting until afterwards - if the item is in a Flickable, flicking by touch should be prioritized - if flicking happens, the text cursor should not move; but to avoid losing too much functionality, we allow it to move on release, if the TextArea gets the release (i.e. if it still has the exclusive grab) - TextArea's pressed, pressAndHold and released signals continue to behave the same with touch as with mouse As with the TextEdit change in 90d3fac73a10b9363fd34e6757cc730d7a0c086c, we now distinguish mouse events that are synthesized from non-mouse devices and avoid mouse-like behaviors as described above, but there is no behavior change if the event comes from an actual mouse or touchpad. In QQuickPressHandler::mousePressEvent() we give the original event's device to the delayed press event, now that we check the device to distinguish "real" mouse events from those that are synthesized from touch. [ChangeLog][Controls][TextArea] The selectByMouse property is now enabled by default, but no longer enables selecting by dragging your finger across text on a touchscreen. Platforms that are optimized for touchscreens normally use special text-selection handles, which interact with Qt via QInputMethod. You can opt out of the behavior change by setting the environment variable QT_QUICK_CONTROLS_TEXT_SELECTION_BEHAVIOR=old. Task-number: QTBUG-10684 Task-number: QTBUG-38934 Task-number: QTBUG-90494 Task-number: QTBUG-101205 Change-Id: Icbe81e547b1cf8d5e3cc3ed922f12c7b411ca658 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> (cherry picked from commit 3ebb3540df9729d336d90225d3b4c1d2ca182e8e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QmlModels: Fix enum resolution in ListElementUlf Hermann2022-08-294-1/+36
| | | | | | | | | | | | | | | | | | There were two problems: a, We need to allow recursion when querying for enums. Otherwise we cannot find enums in the same document. b, when the enum resolution is done in the validation phase, we cannot query the current document's QQmlType for enums, yet, as it's not finalized. However, the QQmlPropertyValidator has the QQmlPropertyCache we're looking for in that case. c, As a drive-by, fix the excessive conversions between QByteArray and QString. Fixes: QTBUG-95864 Change-Id: If0d2687986e1483a27ce11373a204235b92a6efd Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit cad5c89a0f0ebb24f17171fdbab8355832f0f415) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* qmllint: Don't warn about access to attached enumsUlf Hermann2022-08-292-0/+8
| | | | | | | | | | | | You can always access enums of attached objects, no matter what other rules apply to the attached properties. Fixes: QTBUG-105590 Change-Id: I07878d8efe63468539168aa2c2842e3159ed2090 Reviewed-by: Sami Shalayel <sami.shalayel@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit cc89f62851ce1b9f859e9bc43415d4ce7e3a36e2) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Flickable: let changing contentItem pos also affect the drag starting posOliver Eftevaag2022-08-272-2/+127
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When calling the setContentX(qreal) and setContentY(qreal) functions, the flickable would not update the drag starting position if they were called in the middle of a dragging operation. This patch makes those function update the drag starting position, so that the drag will take into account the external changes to the contentItem position, and not make any massive leaps on the next call to drag() after changing the contentItem position directly. Note that vData.pressPos and hData.pressPos are set to the x and y position of the contentItem at the beginning of a drag operation. They are unrelated to the mouse position. The bug QTBUG-104966 will be fixed from this, since QQuickItemView::setModel() calls QQuickListViewPrivate::setPosition() which calls QQuickFlickable::setContentX/Y(). The QQuickFlickable::setContentX/Y functions are public (part of the public API). They will update the timeline value for the x and y axis, which will as a result also call setViewportX/Y, which calls setX/Y for the contentItem itself. Done-with: Jan Arve Sæther <jan-arve.saether@qt.io> Fixes: QTBUG-104966 Change-Id: Id5165e1ff37a07b94be8c1cc152e86dfcc13d1c6 Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io> Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io> (cherry picked from commit 5647527a8cde84b51fff66fc482f02435770b3dd) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* StackLayout: Do not set size of children to (-1, -1)Jan Arve Sæther2022-08-261-0/+51
| | | | | | | | | | | | The item-size-hint-cache in StackLayout was not always valid when QQuickStackLayout::rearrange() was entered, so it would end up setting the size of the item to (-1, -1) Fixes: QTBUG-105899 Change-Id: I632aa18bb10b84d59af35cd3c7cb0c675d8d1692 Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io> (cherry picked from commit 9a4874ab7f18a54b2497f689dfd7f7a2ee0516b8) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Use the time stamp of the touch event when deliver touch as mouseSeokha Ko2022-08-261-0/+110
| | | | | | | | | | | Use the time stamp of the touch event when converting a touch event to a mouse event for items that do not handle touch events Fixes: QTBUG-105907 Change-Id: I642093346459a031b77174eeecba8470e103e8dc Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit 3c3aef14865fe8a9865403feb044771a27522256) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Ensure that multiple HoverHandlers can react to multiple device typesShawn Rutledge2022-08-262-0/+147
| | | | | | | | | | | | | | | | | | | | | | | | 1c44804600ad3dbeb60d1f5209ce9cf937d30ab3 had some known incompleteness in QQuickItemPrivate::effectiveCursorHandler because it couldn't be finished in Qt 5; but HoverHandlers with different acceptedDevices and acceptedPointerTypes were working together in Qt 6.0 and 6.1 to an extent. Perhaps for this case it helped that HoverHandlers got passive grabs, but we stopped that in bbcc2657fa0dbf715e6db7d675662e4be94a1e04. So now, as with mouse events, we need to ensure that when a HoverHandler detects a particular stylus device in a QTabletEvent and chooses a different cursor, it is applied to the window. At this time, since QQuickDeliveryAgentPrivate::deliverHoverEvent() sends a synth-mouse event, it's not suitable for tablet hover; so we depend on correct implementation of allPointsGrabbed() to ensure that QQuickDeliveryAgentPrivate::deliverUpdatedPoints() will visit all the HoverHandlers, in this case only. Fixes: QTBUG-101932 Change-Id: Ia8f31610e9252825afc7151be58765ac5217b0e8 Reviewed-by: Doris Verria <doris.verria@qt.io> (cherry picked from commit 79893e1773be9d04208243cb88c1daf793d830a4) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix bad rendering after text selectionShawn Rutledge2022-08-252-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: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* tst_qquicklistview: remove some bindings to parentMitch Curtis2022-08-258-8/+13
| | | | | | | | | See ed73efa27acd8e7c42a960ef90c2e4a898c20c30. Change-Id: I32434afcfd5faaf1c05b50cd96dfe6e6468f3ac4 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit 08398aed81cea328e4948e060d10dc53298c10ec) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* tst_cursor: blacklist flaky test on webOSJanne Juntunen2022-08-251-0/+3
| | | | | | | | | | | | Scrollbar test fails quite often on webOS emulator. This could be related to test environment or webOS specific cursor handling, which is out of The Qt Company's control. Fixes: QTBUG-105611 Change-Id: I0d7dce93c611ef03eaedbde8cd31fdbf54b89f89 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> (cherry picked from commit 69cb61a64196640664bfa38d13f64e0e2715b6b1) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* tst_signalspy: don't wait for window activationMitch Curtis2022-08-251-1/+1
| | | | | | | | | | The test doesn't need it; qWaitForWindowExposed is sufficient. Fixes: QTBUG-104022 Change-Id: I7e818b2f377bf5798e881100c555d54482ee3dbf Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit 0fa3cbd9ab0a50c3156feee9575c4719e6b83f9f) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Platform: fix MenuItem being triggered when disabledMitch Curtis2022-08-253-1/+99
| | | | | | | | | | | Ensure that we remove shortcuts for a MenuItem when it's disabled, not just when a new shortcut is set. Fixes: QTBUG-89567 Change-Id: I9c4eeda1a68a23317fe5e7bf517046e4e403c46a Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io> (cherry picked from commit acf2ed0c5fb7594ab01ff48e3dc5c3c16e203755) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* JSON: Properly handle bad objects in JSON.stringify()Ulf Hermann2022-08-231-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>
* QQuickTreeViewDelegate: use pointerhandlers instead of event handlersRichard Moe Gustavsen2022-08-194-20/+103
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | TreeViewDelegate was using mouse event handlers to detect clicks on the delegate and its indicator (to e.g toggle the expanded state of a tree node). This had the effect that any pointer handlers installed on the TreeView itself would be blocked from working, since the delegate would accept the mouse events, and thereby stop propagation. Since TreeView uses drag-, and tap handlers to perform selections (installed by SelectionRectangle), using TreeViewDelegate as delegate would basically stop selections from working. Therefore, this patch will switch to use pointer handlers instead. Pointer handlers are by default non-blocking, and will naturally work better with other pointer handlers in the application, including of course the pointer handlers installed on the TreeView itself. The reason QQuickTreeViewDelegate was using mouse event handlers from the start, was because it inherits QQuickAbstractButton, which does the same. For that reason, we still need to override mouseButtonPressed(), and ignore the mouse events, to make sure that the QAbstractButton implementation doesn't block. Instead we now call the appropriate mouse handling functions in QAbstractButton directly from the pointer handlers. Since we don't use mouse event handlers anymore, this also has the advantage that we no longer need to recommend users to install custom pointer handlers on a child item of the delegate - they can now be installed directly on the delegate. Docs that described that work-around are therefore removed/changed. Fixes: QTBUG-105570 Change-Id: I46d82175c577a27d083494960f1cad645f4d75a4 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit 32cf2b272b13b1d9781ffb2fc5c168911a42fbb0) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix scroll bars not showing up when binding to standalone contentItemMitch Curtis2022-08-181-0/+47
| | | | | | | | | | | | | | | | | | | | 908aa77d16e00f2bccc0ddae0f8b61955c56a6a1 hid old scroll bars, but didn't account for the situation where the old scroll bars would be put back into place, and so they never showed up. In the case of the linked bug report, since there was a binding to the ScrollView's contentItem, a default Flickable would be created. After that binding was evaluated, the contentItem was set, causing the scroll bars to be hidden (as part of the process of disconnecting from the old flickable). To fix the issue, we now do the reverse of hideOldItem when a new contentItem is set. Fixes: QTBUG-104983 Change-Id: I910259cc3e8f6a6231ae6c87c7d4f0f652bd0545 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Nate Graham (cherry picked from commit 58bae53237417f28eac6d772fa6ecab657f8a73f) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QQuickFileDialog: give non-native dialog a text field for filenameOliver Eftevaag2022-08-171-0/+44
| | | | | | | | | | | | The non-native filedialog was missing a text input field that would allow the user to easily set the filename in a filedialog with fileMode set to SaveFile. Fixes: QTBUG-101502 Change-Id: Id800a1e34de0e65455409a7edc5fa2f5f13b4b19 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> (cherry picked from commit b7ae0a90c162cd2f137b259e1336634c737973b6) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* PinchArea: fix pinches being stolen when in PathViewMitch Curtis2022-08-162-0/+137
| | | | | | | | | | | | Keep the mouse grab in addition to touch, as PathView apparently doesn't deal with touch events yet. Fixes: QTBUG-105058 Change-Id: Id94768aec847138cccdeccfa92e4bc72a19810fe Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit 10800723ab6dacf1203986a6b0815dec45528ef4) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QQuickTableView: clear selection on tap directly in TableViewRichard Moe Gustavsen2022-08-111-0/+24
| | | | | | | | | | | | | | Before 6.4, it was only possible to make a selection in TableView by using a SelectionRectangle. But in 6.4, you can also make a selection directly in TableView by using the shift+arrow keys. To make sure that a selection is cleared either way on tap, move the implementation that clears the selection from SelectionRectangle to TableView. Change-Id: Ic718763bf9b643cb3e3c04cc3b90c6ffcf9ca4b2 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io> (cherry picked from commit b51ad14bc6a055de22b9c5f0083a3ca42795779b) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* 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>
* QQuickControlPrivate::resizeBackground: preserve geometry bindingFabian Kosmale2022-08-102-0/+57
| | | | | | | | | | | | | | | | | | | | | When resizing the background, use setSize instead of setWidth and setHeight to reduce the number of geometryChange calls when both width and height get resized. Additionally, setSize preserves bindings, which fixes the linked bug: We would resize the background even when we have binding on height/width, which would later overwrite the value again. With the porting to bindable properties, the setWidth/Height calls would have destroyed that binding. setSize avoids that issue. Lastly, do not even attempt to overwrite the binding when we detect that it exists. Fixes: QTBUG-102136 Change-Id: I16a99fd9f7d56f84b423b477d373e265e39d4094 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> (cherry picked from commit cda435941ee0a8e5d0d9491d337e89a6982f2e0d) Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io>
* Revert accidental change to test262Ulf Hermann2022-08-041-0/+0
| | | | | | | | | Amends commit 0dc4fd240a2897c5c443a0ef6d84c416843e4938. Change-Id: I8b74645becdfa91402f49156f77799dc5dd8ec5c Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 59ccd01b7e879ba370954f2f7883442e755ada5f) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QmlCompiler: Allow any conversion possible via QJSPrimitiveValueUlf Hermann2022-08-045-25/+34
| | | | | | | | | | | | All of those are legal in ECMAScript, and so we need to support them in script bindings. As we have stricter rules for literal bindings, add an extra method there to check for what QQmlPropertyValidator does. Fixes: QTBUG-105252 Task-number: QTBUG-105188 Change-Id: I0621b2c3aa196414f669873e93670557284a8bca Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit b184d026484572915c3ff34224dfc371a4e6a3cc)
* 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) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* tst_qquickmenu: Unblacklist some test cases on macOSDoris Verria2022-08-032-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>
* 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>
* qmltc: Make explicit component ids accessible during object creationAndrei Golubev2022-07-293-0/+19
| | | | | | | | | | | | | | | | | | | Explicit components could be accessed by id like regular objects. Make this work in qmltc by revisiting the object creation procedure - store explicit components along with pure QML types in QQmltcObjectCreationBase: xxxxxxxx x'x'x'x'x'|yyyyy... ^ ^ ^ pure explicit types from base class types components As a drive by, fix unset required property in one test file and add a bunch of other test files to the initTestCase() check Change-Id: Ibdaa430d692c81101853f51dae1da462a57a9980 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 12ce72825995529e203c98adbe636a01b995ff13)
* qmltc: Fix alias assignment code generationAndrei Golubev2022-07-295-0/+39
| | | | | | | | | | | | | | | | Fix subtle issue where alias assignment would cause qmltc to generate direct property set code (doesn't work for aliases since those do not have "real" properties) Remove now redundant TODO and identical code path when compiling alias assignments on types with composite bases (used to work poorly during prototype times) Change-Id: Ifacf5872ff5432a748fb1ec16c300ec844d65e9a Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> (cherry picked from commit e14b7fe59767e972a32aed7b019d01def14b429c) Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* qmltc: Acknowledge group/attached properties have objects in QmlIRAndrei Golubev2022-07-291-0/+1
| | | | | | | | | | | | | | Group and attached properties have QmlIR::Objects associated with them. However, qmltc's object index calculation ignores groups/attached types. Fix this, making object index calculation aligned for implicit components Fixes: QTBUG-104780 Change-Id: I377d3eab714d0e9618ac2ef84c2738b45ad3b6cc Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 2f4935289e99cd5f174316ceb82032d62292bd46) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* qqmltypecompiler: align runtime function table order to qmlcachegenAndrei Golubev2022-07-293-10/+59
| | | | | | | | | | | | | | | | | | When we write runtime functions to compilation unit at run time, the order of the functions in the unit (often) differs from the order of functions in the unit produced ahead of time by qmlcachegen and friends. Additionally, the order also differs from what qmltc expects (and qmlcompiler library in general) Fix the order by simplifying the procedure of JS code generation when we create the compilation unit at run time: new logic just goes over the objects in the document linearly, instead of relying on bindings (which are known to be out of order w.r.t. AST) Change-Id: I4070b9d061f03c4c76d03120654ad3f30725493a Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit 8d0adee3b3317f1fab03742bdf0f7cdbe57df914) Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Support RegExpLiteral bindings in qmltcAndrei Golubev2022-07-294-0/+19
| | | | | | | Task-number: QTBUG-91956 Change-Id: I02f8c6d1f0d6e4411985ffe3f22fb3c51fb36db6 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 2d5f3eb86e1eed13f143173eec0cbc724ed5d9a9)
* qmltc: Fix import namespace code generationAndrei Golubev2022-07-291-0/+2
| | | | | | | | | | | Fix subtle issue where an import namespace would become part of the generated C++ class name without modifications (so with '.'). Preserve the namespace for the time being just to make the generated code more verbose (e.g. consider mixing QQ.Text and ZZ.Text in the same file) Change-Id: I3d409988ae136c272aac6a4eab287a7221f88450 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 38d9bf60ba270cd02d28497252eb64fa60b1f4c9)
* tst_qquickpincharea: fix signal handler parameter injection warningMitch Curtis2022-07-291-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>
* CMake: Rename tests to be unique for top-level buildsAlexandru Croitor2022-07-283-7/+7
| | | | | | | | Task-number: QTBUG-105238 Change-Id: I5037d942818d96b8f6cc474a81c56362df0fd01d Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> (cherry picked from commit 93f8443c526c32394d7edcd52c9b08175ea97f3f) 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>
* tst_qmllscompletions: Correctly handle test failuresFabian Kosmale2022-07-271-8/+17
| | | | | | | | | | | | | | | | | | | | testlib's VERIFY and COMPARE macros only work in the function directly invoked by the test framework. Temporarily use a copy of the upcoming QTEST_CHECKED marco from testlib to check that the indirectly called functions actually behaved currently. Moreover, move the call to the clean function into a scope guard, so that it also will be called when the callback returns early due to failed testlib change – otherwise, we'll end up waiting until the timeout in QTRY_COMPARE_WITH_TIMEOUT. Change-Id: I371c021f55f11e32950b12a57cf52ad0edb1fd7b Reviewed-by: Moody Liu <mooodyhunter@outlook.com> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> (cherry picked from commit 9c8e04f9895b37bcf910b23a388d2d4e1f03878f) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>