aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qquickanimatedsprite/tst_qquickanimatedsprite.cpp
Commit message (Collapse)AuthorAgeFilesLines
* tst_qquickanimatedsprite: use QQuickTest::qWaitForItemPolished()Mitch Curtis2018-10-311-2/+3
| | | | | | | | This is a public function that encapsulates the behavior of the old checks without requiring use of private API. Change-Id: I06091c70c784570499bc891d37f97af48c317665 Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
* Merge remote-tracking branch 'origin/5.11' into devLiang Qi2018-02-271-18/+50
|\ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/qml/jsruntime/qv4engine.cpp src/qml/jsruntime/qv4internalclass.cpp src/qml/parser/qqmljslexer.cpp src/qml/qml/v8/qv8engine.cpp src/qml/util/qqmladaptormodel_p.h src/quick/items/qquickanimatedsprite.cpp tests/auto/quick/qquickanimatedsprite/tst_qquickanimatedsprite.cpp Change-Id: I16702b7a0da29c2a332afee47728d6a6ebf4fb3f
| * AnimatedSprite: set implicit size based on implicit frame sizeMitch Curtis2018-02-261-0/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | By doing so, users no longer need to set an implicit or explicit size for AnimatedSprite. [ChangeLog][QtQuick][AnimatedSprite] AnimatedSprite's implicitWidth and implicitHeight are now based on frameWidth and frameHeight, respectively. This means it is no longer necessary to explicitly size AnimatedSprite. Task-number: QTBUG-36341 Change-Id: I3eb87e9b1c6bb93b3c667123c345341f34e2eee8 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
| * tst_qquickanimatedsprite: use QScopedPointerMitch Curtis2018-02-261-17/+10
| | | | | | | | | | Change-Id: Ib0e0cccef197fb8c5fa163c7a57f096e8fcb8c25 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
| * use nullptr consistently (clang-tidy)Shawn Rutledge2018-02-261-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Add finished() signal to AnimatedSpriteMitch Curtis2018-02-261-0/+33
|/ | | | | | | | | | | | | | | | | | | | | It's nicer to respond to a sprite finishing its animation like this: onFinished: doStuff() than this: onRunningChanged: if (!running) doStuff() In addition, the latter will get executed even if the animation is manually stopped, whereas finished() is only emitted when the animation finishes naturally. [ChangeLog][QtQuick][AnimatedSprite] Added finished() signal to AnimatedSprite as a convenient way to react to an animation finishing. Change-Id: I558e8372b54bacacd5695cb0edf97d8b84b373f9 Reviewed-by: J-P Nurmi <jpnurmi@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Replace Q_DECL_OVERRIDE with overrideKevin Funk2017-09-251-1/+1
| | | | | Change-Id: I176f91a8c51e81a2df3fe91733118261491223ee Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-06-291-0/+39
|\ | | | | | | Change-Id: I70c0c672708522f7157849365cc53ee271d8e460
| * QQuickSpriteEngine: avoid entering infinite loop in assembledImage()Daniel d'Andrada2016-06-211-0/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Do not allow a frame size larger than the image size, otherwise we would never leave "while (framesLeft > 0) {...}" as framesLeft is never decremented because "copied/frameWidth" in the expression "framesLeft -= copied/frameWidth;" always resolves to zero because copied < frameWidth. Task-number: QTBUG-53937 Change-Id: Ia777ec65d72562426b13533918efcaca5bcabdd7 Reviewed-by: Albert Astals Cid <albert.astals@canonical.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-03-071-0/+22
|\| | | | | | | Change-Id: Icfa1d61fcc286c3418d4a625de11d2191336fa60
| * AnimatedSprite: don't access deleted scene graph nodesJ-P Nurmi2016-03-031-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | It’s a bad idea to store a scene graph paint node as a member variable. First of all, it should not access the node outside updatePaintNode(), that is, outside the render thread. Secondly, the node is owned by the scene graph and may be nuked whenever the scene graph feels so. Some creative re-parenting easily triggers a case where AnimatedSprite ends up accessing a node that was already deleted by the scene graph. Change-Id: I89205ac36333a2fcb094121afa61b6409fda5883 Task-number: QTBUG-51162 Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* | 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>
* 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>
* Default to threaded when using opengl32Laszlo Agocs2014-12-121-1/+11
| | | | | | | | | | | | | | | | | | This appplies only when using opengl32.dll. When using ANGLE or when using another non-opengl32 DLL, the "windows" single-threaded loop is chosen, just like before. One badly written autotest is fixed. We must never assume that performing some QQuickWindow related work will leave a context current on the main thread. The assumption worked by accident with the single-threaded render loop. [ChangeLog][QtQuick] Changed to use the threaded render loop by default on Windows when running with desktop OpenGL (opengl32.dll). Change-Id: I21798622c19ca510a97a96c19c1e70e29f086e3a Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
* Fixed AnimatedSprite to respect 'loops' properlyJan Arve Saether2014-10-061-0/+113
| | | | | | | | | Previously, AnimatedSprite could stop before it had performed its desired number of loops. Task-number: QTBUG-36338 Change-Id: I9485886681f55d410786f27b4f6afdc72a058202 Reviewed-by: Michael Brasser <michael.brasser@live.com>
* Made emission of AnimatedSprite currentFrameChanges consistent.Jan Arve Saether2014-09-121-3/+21
| | | | | | | | | | | | | | | | | | | | Both the order was wrong and sometimes the currentFrame property did not correspond to the 'arg' argument that was carried by the signal. The order was sometimes like this: [window got exposed, m_running == false] currentFrame: 1, arg: 1 <== Unexpected, its not running [start() got called, m_running == true] currentFrame: 1, arg: 0 <== Unexpected, they are inequal currentFrame: 2, arg: 2 <== Not sure what to expect here The root of the problem was that we would enter prepareNextFrame on startup (due to QQuickWindow::exposeEvent) even if we were in the stopped state. Getting rid of the first invalid emission solved the issue. Change-Id: Iba002ee91d4d1acafcf4fd0911c28c93a4bc6fd5 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>
* emit runningChanged when AnimatedSprite stops by loops settingsTasuku Suzuki2013-06-221-0/+24
| | | | | | Task-number: QTBUG-31522 Change-Id: I20718cda5f77f3a53176c8b1a4baacedd77375af Reviewed-by: Alan Alpert <aalpert@blackberry.com>
* Attempt to stabilize tst_qquickanimatedspriteFrederik Gladhorn2013-03-261-2/+2
| | | | | | Change-Id: I557f985ca5e68eb75d0b032b1dfa28cc33d56b6a Reviewed-by: David Faure (KDE) <faure@kde.org> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* Autotests w CONFIG+=parallel_test don't depend on activation or focusShawn Rutledge2013-03-041-2/+1
| | | | | | | | | | If the test does requestActivate() or relies on isFocusWindow(), the test cannot be parallel_test. Also, a lot of the tests don't actually need the window to be active, only exposed; and waiting only for exposed is likely to make them more stable. Change-Id: I0845b9b12ddf7f0c8906d9738a3e26d46ab98820 Reviewed-by: Gunnar Sletta <gunnar.sletta@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>
* All QWindow properties that have "window" in them have been renamed.Shawn Rutledge2012-11-081-1/+1
| | | | | | | Depends on patch Ie4424ec15fbdef6b29b137f90a2ae33f173edd21 in qtbase. Change-Id: I9614cc2c7ed119c663b3f6f99267483e291e529c Reviewed-by: Samuel Rødal <samuel.rodal@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>
* QtDeclarative: Remove usage of deprecated qWaitForWindowShown().Friedemann Kleint2012-07-191-2/+3
| | | | | | | | | | | - 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-14/+14
| | | | | | | | | | | | | | | | 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>
* Emit currentFrameChanged signal when neededAlan Alpert2012-06-121-0/+34
| | | | | | | Task-number: QTBUG-25039 Change-Id: I8bd5fd40a5fee1314f0401ed4708d73ed1cfad94 Reviewed-by: Alan Alpert <alan.alpert@nokia.com>
* Merge master <-> api_changesMatthew Vogt2012-03-051-0/+83
Change-Id: Iad2f07b989b25349fd2d4fff010e24dcd5a1688f