aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qquickview/tst_qquickview.cpp
Commit message (Collapse)AuthorAgeFilesLines
* use nullptr consistently (clang-tidy)Shawn Rutledge2018-02-261-3/+3
| | | | | | | | | | | | | From now on we prefer nullptr instead of 0 to clarify cases where we are assigning or testing a pointer rather than a numeric zero. Also, replaced cases where 0 was passed as Qt::KeyboardModifiers with Qt::NoModifier (clang-tidy replaced them with nullptr, which waas wrong, so it was just as well to make the tests more readable rather than to revert those lines). Change-Id: I4735d35e4d9f42db5216862ce091429eadc6e65d Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Extract QSizeChangeListener from tst_quickview to shared test utilsAlexandr Akulich2017-10-201-24/+2
| | | | | | | The class is useful for other tests Change-Id: Iea287ee7659a7504800763c45ae5dc744360eaa0 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* QQuickWindow/View: set a QObject-parent on the root itemJ-P Nurmi2017-06-021-0/+40
| | | | | | | | | | | | | | | | | | | | | | | People are often confused why eg. the objects from: window->contentItem()->findChildren() are not included in window->findChildren(). This change connects the item tree to the window's object tree to make findChild() and findChildren() produce expected results. The same technique is already used for QQuickFlickable's contentItem. [ChangeLog][QtQuick][QQuickWindow] Set the window as the QObject-parent of the contentItem to ensure consistent behavior for calling findChildren() on QQuickWindow and QQuickWindow::contentItem. [ChangeLog][QtQuick][QQuickView] Set the window's contentItem as the QObject-parent of the rootObject to ensure consistent behavior for calling findChildren() on QQuickWindow::contentItem and QQuickView::rootObject. Change-Id: Idb7834eb5e560088ca849e6ce90e6fa3b3ae3e91 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Stabilize tst_QQuickView::resizemodeitemFrederik Gladhorn2016-07-191-0/+1
| | | | | | | | | | | | | | FAIL! : tst_QQuickView::resizemodeitem() Compared values are not the same Actual (sizeListener.at(i)): QSize(80x100) Expected (view->size()) : QSize(200x300) Loc: [tst_qquickview.cpp(172)] The "SizeChangesListener" can be instantiated too early, catching signals from the previous resize events. Make sure to flush all events before. Change-Id: Ib0933429f5c589f120c263619f00893fa813e361 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Remove redundant compare in testFrederik Gladhorn2016-07-191-1/+0
| | | | | | | The same condition is tested in the line above. Change-Id: I99720e3603b1ae5e2f5161696f1de3dd03f6ff50 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Set width and height simultaneously on SizeRootObjectToViewAlexandr Akulich2016-07-121-0/+31
| | | | | | | | | | | | | On QQuickView/QQuickWidget size update we used set width (with the notify signal emission) and then height (with signal emission again). This way code, relying on width and height would be triggered twice and at the first time with there would be outdated height value. The new code takes care on proper value for both width and height. Change-Id: I6525911c40af0ca6a26ab3e7dac16d32a96d9a27 Reviewed-by: Robin Burchell <robin.burchell@viroteck.net> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* 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>
* QQuickView/QQuickWidget::errors(): fix crashJ-P Nurmi2015-09-031-0/+4
| | | | | | Change-Id: Ie37ed5fac642931b658d2b738ddd45d23cda54c6 Reviewed-by: Robin Burchell <robin.burchell@viroteck.net> Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* tests/quick: Replace Q[TRY]_VERIFY(a == b) by Q[TRY]_COMPARE(a, b).Friedemann Kleint2015-07-271-7/+7
| | | | | | | | | | | | - 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>
* QQuickView/QQuickWidget: Report an error if rootObject ends up null.Robin Burchell2015-02-231-0/+9
| | | | | | | | | | | | This can happen when trying to use a non-QQuickItem item as the root item in a QQuickView, for instance, a Window or ApplicationWindow item. This generates a warning (correctly), but does not set an error state on the view, so automated tooling and the like does not know that the scene was not successfully loaded. Change-Id: I1dc4191ef07187e9b1929995aedb01c155b0957c Reviewed-by: Alan Alpert <aalpert@blackberry.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>
* tst_qquickview: Prepare test to handle multiple pieces of data.Robin Burchell2015-02-041-7/+7
| | | | | | | | Additionally, stack allocate the view. It's shorter, and saves an almost totally pointless QVERIFY. Change-Id: Ic90602d24659e1455dd50b706f96ef5ccac14f3a Reviewed-by: Alan Alpert <aalpert@blackberry.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>
* Merge remote-tracking branch 'origin/stable' into devSimon Hausmann2014-01-171-4/+0
|\ | | | | | | | | | | | | | | | | Conflicts: .qmake.conf src/imports/dialogs/DefaultFileDialog.qml src/imports/widgets/qquickqfiledialog.cpp Change-Id: I00de6dd05cb773f01254061d585a82c90b229acd
| * Fix some compiler warnings in tests and examples.Christian Kandeler2014-01-151-4/+0
| | | | | | | | | | Change-Id: Ia739c995005635caf6fd0bd4e495ed8567350e83 Reviewed-by: Alan Alpert (Personal) <416365416c@gmail.com>
* | Fix autotests expecting a trailing whitespace for qDebug streamKai Koehne2013-12-121-1/+1
|/ | | | | | | | The behavior of QDebug was fixed in qtbase. Update autotests accordingly. Change-Id: I36c442fb772ba35b71b6ab50b5f77a3f9c1463e3 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Fix tst_qquickview for full screen platformsRafael Roquetto2013-07-181-3/+3
| | | | | | | | | Some test cases rely on the fact that show() is not fullscreen, which may not be true for some platforms. Explicitly make use of showNormal() to avoid full-screen show on these platforms. Change-Id: I0787fb62b8e37a73974f87857de200485d7ba6da Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* Stabilize resizemodeitem test.Frederik Gladhorn2013-02-071-2/+1
| | | | | | | | | | Resizing can take time. Instead of qWait(50) use QTRY_COMPARE to make sure we give enough time. Change-Id: I484eca1f4d49381913dc82f405c73de653608493 Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com> Reviewed-by: David Faure (KDE) <faure@kde.org> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.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-2/+1
| | | | | | | | | | 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>
* 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>
* QQuickCanvas renamesAlan Alpert2012-07-171-80/+80
| | | | | | | | | | | | | | | | 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>
* Introduce a new constructor to QQuickViewCharles Yin2012-05-231-0/+38
| | | | | | | | Make it possible let QQuickView use an existing qml engine and multiple QQuickView objects can share one QQmlEngine instance. Change-Id: I035d1c15155be22f1131b504c40cf4ffb5da0f45 Reviewed-by: Glenn Watson <glenn.watson@nokia.com>
* Rename QDeclarative symbols to QQuick and QQmlMatthew Vogt2012-02-241-0/+207
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>