aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qquickpositioners
Commit message (Collapse)AuthorAgeFilesLines
* Revert "Positioners: allow distinguishing between implicit/explicit child size"Mitch Curtis2017-04-053-65/+0
| | | | | | | | | | | This reverts commit 2556bfdab42dc0aefb34bb7cf304063c7db0ff00. This is no longer necessary, as there are now no users of this functionality in other modules. Change-Id: If92bbdb3e5e95b4103610d68d22e929cf30c4e5e Reviewed-by: J-P Nurmi <jpnurmi@qt.io> Reviewed-by: Robin Burchell <robin.burchell@crimson.no>
* Positioners: allow distinguishing between implicit/explicit child sizeMitch Curtis2017-02-233-0/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In Qt Quick Controls 2, we plan on using positioners to layout an icon next to text in a button, for example. Consider the following example: AbstractButton { id: button text: "Button" contentItem: Row { Text { text: button.text width: parent.width } } background: Rectangle { radius: 5 color: "lightsteelblue" opacity: button.pressed ? 1.0 : 0.8 } } In Qt Quick Controls 2, implicit size propagates "up" from the delegates/building blocks to the control, whereas explicit size propagates "down" from the control to the delegates/building blocks. Providing a reasonable implicit size is important to make controls behave well in layouts, etc., and the internal building blocks must follow the size of the control to retain sensible looks when a control is resized. In the example above, contentItem needs to have a "natural" (implicit) size representing the ideal fit of the content, but it needs to respect the explicitly provided size from the control too. With the current behavior, as the explicit width of the Row is 0, the Text item (via the width binding) sets explicit width to 0, and Row uses that explicit width rather than the implicit width, thus, Row here will have an implicit width of 0, which is not what the control wants. This patch: - Allows subclasses of positioners to set QQuickBasePositionerPrivate::useImplicitSize to true in order to tell positioners to use implicit size rather than explicit size. This is not exposed as public API, as this behavior is typically not something desirable in the positioners themselves. For example, Row { Rectangle { width: 100; height: 100 } } would have an implicit size of 0, as Rectangle has no implicit size. - Adds QQuickImplicitRow and QQuickImplicitGrid, which are private subclasses of their respective positioners that simply set useImplicitSize to true in their constructors. - Exports the wrappers privately so that they can be registered by other modules as QML types. Change-Id: Ie68aabd7fbf6c76375badf6e338f2f238f3fc392 Reviewed-by: J-P Nurmi <jpnurmi@qt.io> Reviewed-by: Robin Burchell <robin.burchell@crimson.no>
* Updated license headersJani Heikkinen2016-01-201-17/+12
| | | | | | | | | | | | From Qt 5.7 -> tools & applications are lisenced under GPL v3 with some exceptions, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new GPL-EXCEPT header instead of LGPL21 one (in those files which will be under GPL 3 with exceptions) Change-Id: I04760a0801837cfc516d1c7c02d4f503f6bb70b6 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Tests: Remove QT_DISABLE_DEPRECATED_BEFORE=0 for simple cases.Friedemann Kleint2015-09-021-1/+0
| | | | | | | Fix usage of API that is marked deprecated. Change-Id: Ia887437f99b9ce207891ca19bc49294acb7d629d Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
* tests/quick: Replace Q[TRY]_VERIFY(a == b) by Q[TRY]_COMPARE(a, b).Friedemann Kleint2015-07-271-18/+18
| | | | | | | | | | | | - Replace Q[TRY]_VERIFY(pointer == 0) by Q[TRY]_VERIFY(!pointer). - Replace Q[TRY]_VERIFY(smartPointer == 0) by Q[TRY]_VERIFY(smartPointer.isNull()). - Replace Q[TRY]_VERIFY(a == b) by Q[TRY]_COMPARE(a, b) and add casts where necessary. The values will then be logged should a test fail. Change-Id: Ib9f4c2486af23c47990be4b9e004b965de226dcc Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* Tests: Replace Q[TRY]_VERIFY(v == true|false) by QVERIFY(v)|QVERIFY(!v).Friedemann Kleint2015-07-271-16/+16
| | | | | | | | Preparing the replacement of Q[TRY]_VERIFY(a == b) by Q[TRY]_COMPARE(a, b) for non-boolean types. Change-Id: I8a4e44a2b4e20a9c8b811799e3932c8ce1a2cbbb Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* Column, Row, Grid, Flow: add support for paddingLiang Qi2015-05-188-53/+2418
| | | | | | | | | | [ChangeLog][QtQuick] Added padding, leftPadding, topPadding, rightPadding and bottomPadding properties in Positioners, including Column, Row, Grid and Flow. Task-number: QTBUG-41559 Change-Id: If3be7b2243a79c01dad0a5600e22d30eeea43c8a Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
* Update copyright headersJani Heikkinen2015-02-121-7/+7
| | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Change-Id: I61120571787870c0ed17066afb31779b1e6e30e9 Reviewed-by: Iikka Eklund <iikka.eklund@theqtcompany.com>
* Fix tst_qquickpositioners on OS XFrederik Gladhorn2014-10-201-0/+3
| | | | | | Done-with: Jan Arve Sæther Change-Id: Iff66f62167a5977354319aac311d2cb81d9f3842 Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
* Update license headers and add new licensesJani Heikkinen2014-08-251-19/+11
| | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 & LICENSE.GPLv2 - Removed LICENSE.GPL Change-Id: I84a565e2e0caa3b76bf291a7d188a57a4b00e1b0 Reviewed-by: Jani Heikkinen <jani.heikkinen@digia.com>
* QQmlError::toString: improve handling of empty urls.David Faure2014-07-241-8/+8
| | | | | | | | | | | | "file::2:23: ..." is strange to read. Show "<Unknown File>:2:23: ..." instead, by treating empty urls (including "file:") as unknown, and by still showing line and column numbers in such a case. This change makes it possible for QUrl::fromLocalFile("") to return an empty url rather than "file:", which this module was relying upon in the tests. Change-Id: I91918090fd4e0aa9a25dbbb18893a0ce94140e21 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Positioners: fix layout mirroringJ-P Nurmi2014-01-251-0/+8
| | | | | | | | | Listen to positioner geometry changes when the _effective_ layout direction is RTL. Task-number: QTBUG-35095 Change-Id: If06955c6bb04e5bed2126b05489229278c192173 Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
* Merge branch 'stable' into devSergio Ahumada2013-09-061-0/+6
|\ | | | | | | | | | | | | | | | | Conflicts: src/qml/debugger/qv8debugservice.cpp src/qml/qml/v8/qv8engine.cpp tests/auto/quick/qquickitem/qquickitem.pro Change-Id: Ic4a1dcdd8b8a84155d2f2abefdf1da5c3a56af31
| * Fix tons of reference errors in tst_qquickpositionersJ-P Nurmi2013-09-051-0/+6
| | | | | | | | | | | | | | | | | | Due to missing context properties: ReferenceError: fooBar is not defined Task-number: QTBUG-33018 Change-Id: Ibba95ab688a8d5cadc94bdeb30d0ec087ffe3c0c Reviewed-by: Alan Alpert <aalpert@blackberry.com>
* | QtDeclarative: Removing parallel_test from configSimo Fält2013-07-091-1/+0
|/ | | | | | | | | | tst_qquickvisualdatamodel and tst_qquickpositioners have been failing recently on CI. One can't reproduce the failures locally unless running the tests parallel, like CI does. Task-number: QTQAINFRA-705 Change-Id: I09a9123d045f2213af915518917ce622b33b27ba Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
* Stabilize tst_qquickpositionersGunnar Sletta2013-02-071-80/+45
| | | | | Change-Id: I41e37493d5e1a6569beb5a26d6f2033a546af4b4 Reviewed-by: Alan Alpert <aalpert@rim.com>
* Allow aligning items in a gridFabian Bumberger2013-01-282-1/+131
| | | | | | | | This change introduces two new properties, horizontalItemAlignment and verticalItemAlignment to a Grid element. This gives the user the possibility to align the items. Change-Id: I7322a689f1bbc1da342bd618f6c30dd8c139ee29 Reviewed-by: Alan Alpert <aalpert@rim.com>
* Update copyright year in Digia's license headersSergio Ahumada2013-01-101-1/+1
| | | | | | Change-Id: I6c3bd7bebe3d62d1cfd0fa6334544c9db8398c76 Reviewed-by: Akseli Salovaara <akseli.salovaara@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* Quick tests: Introduce QQmlMessageHandler.Friedemann Kleint2012-12-201-32/+30
| | | | | | | | | | Add QQmlMessageHandler class that can be used to record messages into a QStringList. It also makes sure that the old message handler is reinstalled if the test fails. Task-number: QTBUG-28611 Change-Id: I0fff7bc11e188cf47178d9573e5f2eead693bc10 Reviewed-by: Kai Koehne <kai.koehne@digia.com>
* Remove interim compatibility measuresAlan Alpert2012-10-161-3/+3
| | | | | | | | Also update some variables in qtdeclarative which failed to update rootItem->contentItem. Change-Id: Id34e29546a22a74a7ae2ad90ee3a8def6fc541d3 Reviewed-by: Alan Alpert <416365416c@gmail.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-231-24/+24
| | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: Ie7f5d49ed8235d7a7845ab68f99ad1c220e64d5c Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Autotests: Use qInstallMessageHandlerKai Koehne2012-09-141-3/+3
| | | | | | | qInstallMsgHandler got deprecated in Qt 5. Change-Id: Icb6423c7d9f7e507ba36376b0af5ad183379c494 Reviewed-by: Martin Jones <martin.r.jones@gmail.com>
* Set the Qt API level to compatibility mode in all tests.Thiago Macieira2012-08-011-0/+1
| | | | | | | | | | Qt 5.0 beta requires changing the default to the 5.0 API, disabling the deprecated code. However, tests should test (and often do) the compatibility API too, so turn it back on. Task-number: QTBUG-25053 Change-Id: I6988c2360e9d88916311374a0c910bfc5b607439 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Remove QListModelInterface.Andrew den Exter2012-07-251-1/+0
| | | | | | | | | | Implement ListModel and XmlListModel using QAbstractListModel instead. Task-number: QTBUG-15728 Change-Id: I14e03d90883d341f4b1d89c1e9fc9dc1534fde78 Reviewed-by: Glenn Watson <glenn.watson@nokia.com>
* QtDeclarative: Remove usage of deprecated qWaitForWindowShown().Friedemann Kleint2012-07-191-6/+6
| | | | | | | | | | | - Replace by qWaitForWindowExposed() or qWaitForWindowActive() where applicable. - Use QVERIFY to verify success. - Stabilize some tests by checking for 'active', add missing call to show(). Change-Id: I6cae063e44a3839760ed9f61dacb26cd1717118d Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* QQuickCanvas renamesAlan Alpert2012-07-171-286/+286
| | | | | | | | | | | | | | | | QQuickCanvas is now called QQuickWindow QQuickCanvas::rootItem is now QQuickWindow::contentItem QQuickItem::canvas is now QQuickItem::window QQuickItem::ItemChangeData::canvas is also renamed window QQuickCanvas::grabFrameBuffer is now QQuickWindow::grabWindow The functions related to the color property have dropped the clear from their names. The first three changes have interim compatibility measures in place to ease the transition. Change-Id: Id34e29546a22a74a7ae2ad90ee3a8def6fc541d2 Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Remove insignificant flag because test is passing reliably.Toby Tomkins2012-07-111-1/+0
| | | | | Change-Id: I373a013d22a71695399b1d3f03c602eaf68409fe Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
* Fix warnings in declarative tests.Friedemann Kleint2012-06-201-3/+5
| | | | | | | | | | | | - Unused variables and test data. - () around operator &&. - Conversion of false to 0-pointer where QVariant was intended. - Missing enumeration value. - Remove duplicated qqmlecmascript entry from qml.pro (has an internal check for no-widgets). Change-Id: Ie030167e22bce26e3988a4406c630fb460f61a3c Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
* Fix PathView not updating after all items are removed from the model.Andrew den Exter2012-05-281-1/+1
| | | | | | | | | | | | Always clear the layoutScheduled flag on a refill even if there are no items to create, otherwise future layouts won't be scheduled because it appears one is already pending. Fixes an issue in the dragselection example where items that should have moved to the PathView instead disappeared. Change-Id: I4302b5b43184c697a78f5c09dc3811326e2271ca Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Don't parent (QObject) delegate items to views.Andrew den Exter2012-05-281-3/+3
| | | | | | | | | | | | This keeps object ownership within the context the items were created in and simplifies lifetime management as the VisualDataModel has sole license to delete objects and doesn't have to keep guards against a view and all it's children being deleted. Delegates are still reparented in the item heirarchy. Change-Id: Ife5afdfe294a5a8ca1ca3638a086f72452e4915c Reviewed-by: Martin Jones <martin.jones@nokia.com>
* populate transition for positionersBea Lam2012-05-015-20/+211
| | | | | | | | | | Fix positioners to apply a "populate" transition for initially added items. This is consistent with ListView and GridView and also fixes the behaviour from QtQuick 1.x where the positioners were instead running the "move" transition for initially added items. Change-Id: Ib43f1141ce3e7379df085c178b684f89b8567403 Reviewed-by: Alan Alpert <alan.alpert@nokia.com>
* Clean up testBea Lam2012-04-202-10/+12
| | | | | Change-Id: I750d059492c74fbdcd8d61ec3268ba10dcf0466b Reviewed-by: Bea Lam <bea.lam@nokia.com>
* Merge remote-tracking branch 'origin/api_changes'Lars Knoll2012-04-172-0/+5
| | | | Change-Id: I39905acde16ba6bb0ba39401cb73082a73dd9167
* Fix warnings in qtdeclarative.Friedemann Kleint2012-03-301-1/+1
| | | | | | | | | | - QString from ASCII conversions - Unused variables - Pointer mismatches Change-Id: I5f76dce4f2ba481c2c2bce8681cf8107bd629566 Reviewed-by: Andrew den Exter <andrew.den-exter@nokia.com> Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
* Windows: Fix file URL issues in declarative autotestsMiikka Heikkinen2012-03-151-2/+2
| | | | | | | | | | Fixed by using testFileUrl() shared utility function where appropriate instead of testFile() or various other ways file URLs were being incorrectly used. Task-number: QTBUG-24779 Change-Id: I48cbd297d419238f42ea45132344b7e5a487b6f1 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* Remove unneeded dependencies to QtWidgets and QtOpenGLLars Knoll2012-03-121-1/+1
| | | | | Change-Id: I43bb54524f5786a838073df8812107dda7b0d56e Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
* Changed quick tests to work from install directoryKurt Korbatits2012-03-071-3/+1
| | | | | | | | | - Changed tests to use TESTDATA - added check for cross_compile option to skip when sources not available Change-Id: I1f382794ff982bbc07fc20438a4e4a8c8b8d565f Reviewed-by: Michael Brasser <michael.brasser@nokia.com> Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
* Merge master <-> api_changesMatthew Vogt2012-03-053-0/+652
| | | | Change-Id: Iad2f07b989b25349fd2d4fff010e24dcd5a1688f
* Rename QDeclarative symbols to QQuick and QQmlMatthew Vogt2012-02-2427-0/+2482
Symbols beginning with QDeclarative are already exported by the quick1 module. Users can apply the bin/rename-qtdeclarative-symbols.sh script to modify client code using the previous names of the renamed symbols. Task-number: QTBUG-23737 Change-Id: Ifaa482663767634931e8711a8e9bf6e404859e66 Reviewed-by: Martin Jones <martin.jones@nokia.com>