aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qquicklayouts
Commit message (Collapse)AuthorAgeFilesLines
* Blacklist failing tests in tst_qquicklayouts on AndroidAndreas Buhr2022-05-181-0/+9
| | | | | | | | Task-number: QTBUG-103060 Task-number: QTBUG-101865 Change-Id: Ib8da14710a9bc7caced99e069f752b2108268da2 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io> (cherry picked from commit 12ddc8bd6d84143868bb79b0aa53a9f8ad122667)
* Blacklist tst_qquicklayouts::Tests_GridLayout::test_spacings(NaN)Andreas Buhr2022-05-071-0/+3
| | | | | | | | | | | | tst_qquicklayouts::Tests_GridLayout::test_spacings(NaN) fails on Android. Blacklist it for now. Task-number: QTBUG-103060 Task-number: QTBUG-101865 Change-Id: Iead419e7bc2a986f4c3bb1898ac847b30dfda13f Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit b472a02a16380406c95bd0740f970b4a2193fc12) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Revert "Blacklist: test cases blacklisted in qquicklayouts:"Pasi Petäjäjärvi2022-04-011-9/+0
| | | | | | | | | | This reverts commit e215241b32753d4c1181a0069951ab7c7993acd1. Reason for revert: Should not have been merged Task-number: QTBUG-101327 Change-Id: I087204f14bcfc5f10b67459ba1be6c2a73b44302 Reviewed-by: Heikki Halmet <heikki.halmet@qt.io>
* Blacklist: test cases blacklisted in qquicklayouts:CI Insignificant Platforms Monitor Bot2022-03-011-0/+9
| | | | | | | | | | | | - tst_stacklayout::compile on qnx - tst_gridlayout::compile on qnx - tst_rowlayout::compile on qnx Task-number: QTBUG-101327 Change-Id: I06593184389f11a4dec1fdfc71a2986db046b364 Reviewed-by: CI Insignificant Platforms Monitor Bot <ci_insignificant_platforms_monitor_bot@qt.io> (cherry picked from commit 126afed75f738d93935b3b82f1afddda058ec148) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QNX: Disable flaky testPasi Petäjäjärvi2022-02-041-0/+2
| | | | | | | | | | | | | Fails with no apparent reason 1: FAIL! : qquicklayouts::Tests_GridLayout::test_spacings(NaN) property itemRect 1: Actual (): [18,0,10,10] 1: Expected (): [15,0,10,10] Change-Id: I796ea18d2d29780ae2433d9b9b4d2be8d09d495a Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io> (cherry picked from commit 5ed37bbbf1a32d1e32a82371d8602a54ba591b6d) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* qt_add_qml_module: Add FOLLOW_FOREIGN_VERSIONING optionMaximilian Goldstein2021-10-292-2/+2
| | | | | | | | | | This option allows modules to follow the versioning scheme of their foreign base types when it comes to exposing revisioned properties. It is enabled it by default for our internal Qt modules. Task-number: QTBUG-91706 Change-Id: Ie2a660289d2b4c14800f3394321898eae3718425 Reviewed-by: Craig Scott <craig.scott@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Introduce ensurePolished()Jan Arve Sæther2021-10-241-0/+33
| | | | | | | | This is useful for layouts and positioners Fixes: QTBUG-93988 Change-Id: I070b7bc4e23ff050ef55304f5069059ac08ef543 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Remove the qmake project filesFabian Kosmale2021-01-151-14/+0
| | | | | | | | | Remove all qmake project files, except for examples which are used to test that qmake continues to work. Change-Id: Ic4abb72dc2dcd75df7a797c56056b6b3c5fe62ac Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* 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. Pick-to: 5.15 6.0 Fixes: QTBUG-87253 Change-Id: I473ee219e7b5b13547e33ebbd3a6d884de2c7d45 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* CMake: Regenerate projects to use new qt_internal_ APIAlexandru Croitor2020-10-061-1/+1
| | | | | | | | Modify special case locations to use the new API as well. Task-number: QTBUG-86815 Change-Id: I3b964e3baf0cc7040830156dac30358ea1152801 Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* Follow layoutMirroring in Layout marginsDavid Edmundson2020-08-261-0/+41
| | | | | | | | | | | | | | | If a layout is laid out left to right using the layoutDirection property, we want left Margins on the left, and rightMargin still on the right However, if a layout is mirrored, not only should the layout direction change but also the left margin should now be on the right and vice versa. Task-number: QTBUG-62989 Pick-to: 5.15 Change-Id: Iaae4bc436fd1eb7f1947869563ac325f3d6b79bb Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Improve performance when dynamically adding items to a layoutJan Arve Sæther2020-05-043-25/+126
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This was especially noticeable when a Repeater was populating the children of a layout, and its model was dynamically changed: When the model was changed, the repeater removed one item at a time until all items were removed, then applied the new model and then added all the new items for the new model. The layout reacted to that by doing a full sync of the QML layout into the internal gridlayout engine each time an item got removed or added. For very large layouts (or layouts that have complex size hints to calculate), this caused a major slowdown. This patch fixes that by postponing the sync until we get a updatePolish(), basically replacing most calls to updateLayoutItems() (which does the sync) with a call to invalidate() (which schedules a polish). It will also get rid of some binding loop warnings due to this change. This means that there is a small change in behavior: impicitWidth, implicitHeight and Layout.{min,max}imum{Width,Height} might in some cases be incorrect until the updatePolish() have been done. (This is however consistent with how Row/Column/Grid behaves) The creation test in qmlbench was quite simple, so it did not suffer from the most severe performance issues, but we did not regress: > compareresults: auto/creation/layouts/delegates_rowlayout.qml: improvement by 3.91% auto/creation/layouts/delegates_columnlayout.qml: improvement by 6.59% auto/creation/layouts/delegates_gridlayout.qml: improvement by 1.83% Overall average of differences: 4.11% And for the gridlayout_large.qml (Repeater with 1000 dynamically changing items): > compareresults: auto/layouts/gridlayout_large.qml: improvement by 66477.78% Overall average of differences: 66477.78% [ChangeLog][Qt Quick Layouts] Performance improvements to Qt Quick Layouts. This has the small side-effect that size hints (implicitWidth/implicithHeight etc) changes are not immediately emitted after a layout has been modified (e.g item added) Pick-to: 5.15 Fixes: QTBUG-71839 Fixes: QTBUG-65121 Fixes: QTBUG-66017 Change-Id: I6922efe449134246df66b177992e4442747bc8fb Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Test if a layout with "fixed" size still do a rearrange if neededJan Arve Sæther2020-04-221-0/+57
| | | | | | | | | If a layout doesn't change size, it should in many cases still rearrange its children. Pick-to: 5.15 Change-Id: I72ae893da5c561d282800f80c9ab0bec86c557a3 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2020-04-091-3/+3
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/qml/jsruntime/qv4executablecompilationunit.cpp src/qml/jsruntime/qv4executablecompilationunit_p.h src/qml/qml/qqmlobjectcreator.cpp src/qml/qml/qqmlpropertycachecreator_p.h src/qml/qml/qqmltypecompiler.cpp src/qml/qml/qqmltypedata.cpp tests/auto/qml/qmlformat/tst_qmlformat.cpp tools/qmllint/scopetree.cpp src/qml/qml/qqmlapplicationengine_p.h Adjusted tools/qmllint/findunqualified.cpp to use newer API Change-Id: Ibfb4678ca39d626d47527265e3c96e43313873d4
| * Do not match for line numbers in the source code in ignoreWarning()Jan Arve Sæther2020-04-021-3/+3
| | | | | | | | | | | | | | | | It makes it very volatile to source code changes.. Use the RegExp variant of ignoreWarning() instead. Change-Id: I9a9a26e844d5e7e30289d3843c89a9e6724f9f71 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | StackLayout: add attached index, isCurrentItem, and layout propertiesMitch Curtis2020-03-231-3/+172
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These properties are useful for items within StackLayout to get access to their index within it, especially when those items are declared in their own QML files. Similar API already exists for e.g. ListView and SwipeView. [ChangeLog][StackLayout] Added attached index, isCurrentItem, and layout properties. Change-Id: I648d4434ab21573b56edd9a0f8399463946fd571 Fixes: QTBUG-76999 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | Merge remote-tracking branch 'origin/dev' into wip/cmakeAlexandru Croitor2020-03-121-0/+31
|\| | | | | | | | | | | | | | | Conflicts: dependencies.yaml src/qml/qml/qqmlengine.cpp Change-Id: I6a73fd1064286f4a2232de85c2ce7f80452d4641
| * Fix a bug where a layout could crash or become non-responsiveJan Arve Sæther2020-02-121-0/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This happened because of that QQuickText is ill-behaving: When the width on a QQuickText with word wrap enabled is changed to something less than its implicitWidth, its implicitHeight is changed to reflect the height it needs in order to fit all lines. This will cause the layout to be invalidated, and rearranged again. However, at the same time it will also change its implicitWidth actually become wider than its initial implicitWidth (this seems to be a bug). So the next time it is rearranged it will actually be wide enough so that it doesn't need to wrap. This again will cause its implicitWidth and implicitHeight to change to reflect that only one line is needed, which again will cause it to rearrange, but since the item has a too small width for that it will again change the implicitHeight to reflect that it needs more lines..... This went on forever until there was a stack overflow. In addition it also caused an endless (that is, if it didn't stack overflow) updatePolish()/polish() loop (basically polish() was called from within updatePolish() continuously). To make the layout more robust for such "ill-behaving" items we have to add one recursion guard, and one polish-loop guard. Change-Id: I9f752ed320a100c8d0f0fd340347a556e63318e5 Task-number: QTBUG-73683 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* | Regenerate qtdeclarativeAlexandru Croitor2020-02-121-4/+2
| | | | | | | | | | | | | | Change-Id: I48d7fd306f3d1b161a8e73029282ee591b1ef612 Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Liang Qi <liang.qi@qt.io>
* | Merge remote-tracking branch 'origin/dev' into wip/cmakeLeander Beernaert2020-01-161-0/+33
|\| | | | | | | Change-Id: I0c5b939c70bdb91ccdf7068784308416dcaa5736
| * Qt Quick Layouts: Do not assert when specifying an invalid row/columnJan Arve Sæther2019-11-131-0/+33
| | | | | | | | | | | | | | | | We now print a warning and try to gracefully handle it Change-Id: I66e79fe918808f5fede78a23df50e9e95b7b832d Fixes: QTBUG-67204 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Merge remote-tracking branch 'origin/dev' into wip/cmakeLeander Beernaert2019-11-251-0/+54
|\| | | | | | | Change-Id: I48b9c2e4f3a75c18470c55f73f2089dc1401de54
| * Add missing emits from various property setters in {Grid,Row}LayoutJan Arve Sæther2019-10-251-0/+54
| | | | | | | | | | | | Change-Id: I3ac473b3d46ff1f898c1607deb6ad3d586753244 Fixes: QTBUG-79359 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Regenerate all projects with new CMake API versionAlexandru Croitor2019-11-151-1/+1
| | | | | | | | | | | | Change-Id: Ie0db35f674137c229eaf049616f38f8e818f7092 Reviewed-by: Qt CMake Build Bot Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Regenerate testsAlexandru Croitor2019-11-141-5/+2
| | | | | | | | | | | | Change-Id: I67a6c8f1659e7b471a4fcb92a2699292cf4eea81 Reviewed-by: Qt CMake Build Bot Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Merge remote-tracking branch 'origin/dev' into wip/cmakeAlexandru Croitor2019-10-141-54/+41
|\| | | | | | | | | | | | | Removed dependencies.yaml because we don't use it yet in wip/cmake. Fixed conflict in qmlcachegen.cpp. Change-Id: Ie1060c737bee1daa85779903598e5b6d5020d922
| * tst_gridlayout.qml: use createTemporaryObject()Mitch Curtis2019-09-121-41/+15
| | | | | | | | | | | | | | | | Ensures that items created in a function are destroyed upon failures in that function, and results in less code. Change-Id: I62b3b7c3a19dbb2128c5c45bdc7adf4fe80df70d Reviewed-by: Liang Qi <liang.qi@qt.io>
| * tst_gridlayout.qml: convert to a proper data-driven testMitch Curtis2019-09-121-13/+26
| | | | | | | | | | Change-Id: I9f2ccd3d4e6933d68b03d82c2c319aa2e8951e78 Reviewed-by: Liang Qi <liang.qi@qt.io>
* | Add QtDeclarative Test CoverageLeander Beernaert2019-08-141-0/+33
|/ | | | | | | | | | | | | | | | | | | | | | All tests compile and run on a developer build. These tests are failing: tst_qqmlsqldatabase Fails due to missing sql driver tst_qqmlsqldatabase Fails in wip/qt6 tst_ququicklayouts Fails in wip/qt6 tst_flickableinterop Fails in wip/qt6 tst_qquickpinchandler Fails in wip/qt6 tst_qquickflickable Fails in wip/qt6 tst_qquickgridview Fails in wip/qt6 tst_qquickimage Fails due to missing jpeg plugin tst_qquicklistview Fails in wip/qt6 tst_qquicktext Fails in wip/qt6 tst_qquickcanvasitem Fails in wip/qt6 tst_scenegraph Fails due to missing jpeg plugin tst_TestFiltering Fails in wip/qt6 Change-Id: I4b9d69c118e23c095cb72ad5a67653fc30943bb1 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Fix items in layouts not being rendered when layers are usedMitch Curtis2018-07-092-0/+96
| | | | | | | | | | | | | | | | A layer effect is apparently considered a child item of the layout that manages the item, and this causes issues when layouting. As was done for positioners in 865b4ec8, exclude any items for which QQuickItemPrivate::isTransparentForPositioner() returns true from layouting. As that commit made QQuickItemLayer set it to true when the layer is enabled, QQuickShaderEffectSource will be excluded from layouting. Task-number: QTBUG-63269 Change-Id: I463ff8d0cea0dfd6c4273f376de347971040d3d0 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* Add testcase for how align-to-pixel affects size hint normalizationJan Arve Sæther2018-03-021-0/+17
| | | | | Change-Id: I404b06daa5202f6cca887dc63dc4c86d432dd1e5 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Fix flaky test - wait for the LayoutRequest to arriveJan Arve Sæther2018-03-011-0/+1
| | | | | Change-Id: I5fb8419bc86f0355ca19957456d2a3ebba3c9ef3 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Move test for ignoreMessage to the topJan Arve Sæther2018-02-281-62/+60
| | | | | | | This should make it more robust to changes in line numbers Change-Id: I8394fce060e05226d02af0dad5f7d8d9552bc63b Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* test_defaultPropertyAliasCrash(): fix anchor warningsMitch Curtis2018-02-201-1/+0
| | | | | | | | The item was trying to center itself within a layout for some reason. Change-Id: I7a4bdf0fdce91cd1dad6ec9c5ae27a5fbe07408f Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* Layout: improve warning message when anchors are detectedMitch Curtis2018-02-201-1/+2
| | | | | | | | | | - Use the more explicit term "manage" to make it clear that the warning only applies to items that are direct children of a layout type. - Instruct users towards the proper way to position items within a layout: Layout.alignment. Change-Id: Id13af95457a689e41aeaead1f9a0f958f095fca9 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* Only warn about actual *anchors* in layout childrenJan Arve Sæther2018-02-191-0/+61
| | | | | | | | | | | Do not warn if they don't actually pose a problem, such as having just anchors.margins: 42 in a layout child item (as demonstrated by the test) Change-Id: I01e4515e91d7d0df3ae6bf9061cebe5c51802998 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* Fix positioning and placement of initially invisible items in layoutsSascha Siebert2017-11-221-0/+35
| | | | | | | | | | | Instead of misusing implicitWidth/Height as a storage mechanism in scenarios where width/height is used for preferred size evaluation, new members are created to hold this information to prevent incorrect sizing in mentioned scenario and get rid of blocking signals. Task-number: QTBUG-57455 Change-Id: I102c45805c4106e5829b17b65c2e247b2381573f Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* Fix outdated BSD license headerKai Koehne2017-10-174-10/+50
| | | | | Change-Id: Icc08925454445fc9497fb3bfd2c26efe90605983 Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
* QQuickLayout: ensure that all change listeners are removedMitch Curtis2017-02-223-0/+111
| | | | | | | | | | | | | | | | | | The first fix for QTBUG-51927 (59c6c0e0) went to 5.6.2, where only the SiblingOrder ChangeType was listened to by QQuickLayout. It was then cherry-picked to 5.7 (5149aa68), where SiblingOrder was still the only ChangeType in use. 3b4f00ec then optimized QQuickLayout by swapping connections for item change listeners, but didn't check for usages of change types elsewhere in the file. This patch moves the change types into a variable that ensures there is one place for future changes. 5.6 is not affected. Task-number: QTBUG-51927 Change-Id: Ifd6e0545ce543ab79d6415e007b35c457cacc83a Reviewed-by: Robin Burchell <robin.burchell@crimson.no>
* StackLayout: propagate rearrange() call to child layoutsOleg Yadrov2017-01-192-1/+109
| | | | | | Task-number: QTBUG-57867 Change-Id: I0190b892e2bc2966b82a0dbd99e53fd9d6848957 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* Avoid needless notifications when destroying layoutsJan Arve Saether2017-01-121-0/+21
| | | | | | | | | | | | | | | | | When deleting a layout with children, it ends up in ~QQuickItem(), which in turn will call setParentItem(0). setParentItem(0) will in turn call setEffectiveVisibleRecur(), which will recurse down all its descendants. Therefore, deleting a top level layout might trigger item change listeners for *all* its descendants, not only its direct children. This behavior might even cause crashes: The visibility changes will then trigger an invalidation of the layout, which will propagate up the parent hierarchy, and potentially call invalidate() on a partially-destroyed layout, which then might crash. Change-Id: I48e11d57f69e9011ced6c3a0b51e3d89b24ad5c1 Task-number: QTBUG-55103 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Fix crash on exit when using default property aliases with layoutsMitch Curtis2016-09-153-0/+120
| | | | | | | | | | | | | | The layout was being destroyed before the text, which meant that the removeItemChangeListener() call never got hit. To ensure that the listener is always removed, loop through each child in QQuickLayout's destructor. This is a manual cherry-pick of 59c6c0e0b1b5b46747595a58e11311b7393d7e70. Task-number: QTBUG-51927 Change-Id: I669f42beb8c3dd6b4b741cae0b16e017bb3409df Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* Add more tests for pixel snapping of sizesJan Arve Sæther2016-03-021-0/+31
| | | | | | Task-number: QTBUG-41216 Change-Id: I4456709ec5c4e61183fb4056a5f6d6bd9bd863d5 Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
* Change test because of slight behavior change in the layout engineJan Arve Sæther2016-03-011-1/+1
| | | | | | | | | The test was assuming that pixel snapping did not change the minimum size hint of the layout. An upcoming patch to qtbase will change that. Change-Id: I53bed57d086aa9ba9972188b014140c95d7669b9 Task-number: QTBUG-41216 Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
* Make test more data drivenJan Arve Sæther2016-03-011-43/+21
| | | | | Change-Id: Ia1c2d53c77da29337b4453046ddb3d526c7015e4 Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
* Move QtQuick.Layouts to qtdeclarative from qtquickcontrolsJan Arve Saether2016-02-264-0/+1999
This is in order for it to be available without having to install Qt Quick Controls Change-Id: I3f0d0dc108829947cd189b7861944e556e00cef3 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>