summaryrefslogtreecommitdiffstats
path: root/src/corelib/animation
Commit message (Collapse)AuthorAgeFilesLines
* Allow negative delta for designer animation driverAntti Määttä2021-10-182-2/+6
| | | | | | | | | | | | The designer animation driver needs the ability to drive the animation both forwards and backwards. Pick-to: 6.2 6.2.1 Task-number: QDS-4910 Change-Id: Ie2b1855d062bb254b28b216328cb618d90ee8454 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io> Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* corelib: Fix typos in source code commentsJonas Kvinge2021-10-122-2/+2
| | | | | | Pick-to: 6.2 Change-Id: Ic78afb67143112468c6f84677ac88f27a74b53aa Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Fix qdoc warning: signal is not constVolker Hilsheimer2021-07-141-1/+1
| | | | | | | | | Amends fa664e0b2ad748a5b56de8ca0fd9ee3ed1966e7d. Pick-to: 6.2 Change-Id: I386ce27d4daf0679d40032e8b8bfbbf81adfb3a2 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Andreas Buhr <andreas.buhr@qt.io>
* Consistent indentation for BINDABLE propertiesAndreas Buhr2021-06-242-4/+4
| | | | | | | | | Triggered by API review in Gerrit patch 355960. Task-number: QTBUG-94407 Pick-to: 6.2 Change-Id: I7cafc1cc9d4b929040b53c6bf92c91d73c3b39f2 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Remove const from signalAndreas Buhr2021-06-241-1/+1
| | | | | | | | | | We made a signal const. This does not make sense. Task-number: QTBUG-94407 Pick-to: 6.2 Change-Id: I372da9c045ba880f8fba48399e441b53c1683e93 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* Avoid use after free in tst_qsequentialanimationgroupFabian Kosmale2021-06-021-2/+6
| | | | | | | | | | | | | | The test connects finished to the groups clear method, which in turn deletes the animation instance. Thus, no member must be accessed after calling stop, unless we use a (costly) QPointer to guard against deletion. Notify earlier that totalCurrentTime changed to avoid the issue. As a drive-by, modernize the connect in the test. Fixes: QTBUG-94143 Change-Id: I923101107b7f79115be69a58c8e8d5177a98d48f Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* Fix qdoc warning after port to QPropertyVolker Hilsheimer2021-05-271-1/+1
| | | | | | | | As of 7b6cef0e654eef0d932d1f8afe986eaa9b2299d4 the signal is a const member function. Change-Id: Ia5559904b7a47c9763863c73bb357d3d241307ea Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Remove unnecessary type conversionXiao YaoBing2021-05-251-2/+2
| | | | | Change-Id: Ic362f6647d8eaf2004d3bd5e1c6d6411cfb31d86 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Port QVariantAnimation to the new property systemSona Kurazyan2021-04-303-6/+35
| | | | | | | | | | | | | | Skipped startValue/endValue properties, since they are computed and writable, which is not supported at the moment. Skipped currentValue, since its setter might be called inside the getter, which is not recommended. Task-number: QTBUG-85520 Change-Id: I1f872b4fcc7227ed91b6915891bbc66019151826 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Andreas Buhr <andreas.buhr@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Port QPropertyAnimation::targetObject to bindable propertiesAndreas Buhr2021-04-283-31/+58
| | | | | | | | | | | | | | | | | | This is one of the more complicated ports. The target object was represented by two variables in the past: A raw pointer and a QPointer. The QPointer is checked in some cases to check whether the target object still exists. This patch introduces a targetObjectDestroyed() slot and connects it to the destroyed(QObject*) signal of the target object. In this slot, the animation is stopped. The checks become obsolete thereby and it is sufficient to represent the target Object in one raw pointer. This raw pointer becomes a bindable property. Fixes: QTBUG-92992 Change-Id: I7e2ddb5d8aed007400fe74bea1becf7bdfbf2563 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* Port QAbstractAnimation to the new property systemSona Kurazyan2021-04-273-15/+97
| | | | | | | Task-number: QTBUG-85520 Change-Id: I2710c314b8c32b03fccb826fd78482ee7095fdda Reviewed-by: Andreas Buhr <andreas.buhr@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Port QPropertyAnimation::propertyName to the new property systemAndreas Buhr2021-04-203-14/+40
| | | | | | | Task-number: QTBUG-85520 Change-Id: Id439783672b17810a51f867bcb69ee6c3eb5a022 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* Port QSequentialAnimationGroup to new property systemAndreas Buhr2021-04-193-8/+18
| | | | | | | | | | | | There is only one property in QSequentialAnimationGroup, currentAnimation. This patch ports this property to the new property system Task-number: QTBUG-85520 Change-Id: Id528d30f551e88a6165bbb6a3c09d44e89257de5 Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io> Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QAbstractAnimation: initialize the private members while declaring themSona Kurazyan2021-04-132-28/+13
| | | | | | | Change-Id: I5de0510d06b7d8e10c3cb0d4f23fb7991b8d6c51 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Andreas Buhr <andreas.buhr@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Do not notify about property changes if the value hasn't changedSona Kurazyan2021-04-071-2/+7
| | | | | | | | | | | | After 2ffb91ac592d69adf9458ac45074174537435918 we manually call notify() for QObjectCompatProperties. Currently we always call it when setting values to compat properties, even if the value hasn't actually changed. Fixed to call notify() only if the value is being changed. Task-number: QTBUG-85520 Change-Id: I385db84c4009c45406e204b96e0e37ce5fa8882b Reviewed-by: Andreas Buhr <andreas.buhr@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QObjectCompatProperty: Require explicit notifyFabian Kosmale2021-04-011-0/+1
| | | | | | | | | | For QObjectCompatProperty, which allows to do basically anything in its setter, it is actually easier to manually specify when the change should become visible. This is in line with manually writing emit calls in the old property system, and allows the preservation of class invariants. Change-Id: I585bd3f25d722ca3fd721ead85fe73dbee26c5f6 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Assert that setCurrentAnimation has the assumed side effectVolker Hilsheimer2021-02-251-1/+3
| | | | | | | | | | | setCurrentAnimation(0) is expected to set the currentAnimation pointer - which it does, as long as there are any animations. Fixes static analyzer warning 106daf11ddfe9bb4fa7cf98c9097962c Pick-to: 6.1 Change-Id: I3739bcfda103db391d21f135485f0b700c48ead1 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Remove QObjectCompatProperty::operator= for safer usageAndreas Buhr2021-01-291-1/+1
| | | | | | | | | | | | | Introduction of QObjectCompatProperty requires every write to the property to be examined whether it is OK or should be replaced by a setValueBypassingBindings/markDirty combination. The existence of operator= make this difficult as it is easy to miss places where it is written. By not having operator=, we can help developers make sure they had a conscious decision about each write to the property. Change-Id: Ia61ea4722eb0bab26ce7684b85dd03d710cd1751 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Port QPauseAnimation to the new property systemSona Kurazyan2021-01-262-2/+13
| | | | | | | Task-number: QTBUG-85520 Change-Id: I8c0ee86598f4c0f093f64b2891ee835a43964b84 Reviewed-by: Andreas Buhr <andreas.buhr@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Remove the qmake project filesJoerg Bornemann2021-01-071-25/+0
| | | | | | | | | | | | | | | | Remove the qmake project files for most of Qt. Leave the qmake project files for examples, because we still test those in the CI to ensure qmake does not regress. Also leave the qmake project files for utils and other minor parts that lack CMake project files. Task-number: QTBUG-88742 Change-Id: I6cdf059e6204816f617f9624f3ea9822703f73cc Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* Adjust code format, add space after 'if'Zhang Sheng2020-11-161-1/+1
| | | | | | Change-Id: Ice081c891ff7f4b766f49dd4bd5cf18c30237acf Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> Reviewed-by: hjk <hjk@qt.io>
* Doc: Add missing brief statements for \property documentationTopi Reinio2020-11-121-1/+1
| | | | | | | | ... where applicable. Fixes: QTBUG-88232 Change-Id: I835df434765caededd35d5114965b4a1663e7942 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Remove default parameter from QUnifiedTimer::updateAnimationTimersVolker Hilsheimer2020-10-162-2/+2
| | | | | | | After adjustments in Qt Declarative, this parameter is no longer needed. Change-Id: I4b398748277aa29edd06ac122cfa8984575abf97 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Remove timeStep parameter from QAnimationDrive::advanceAnimationVolker Hilsheimer2020-10-133-19/+14
| | | | | | | | | | | | This reverts commit 7544c242cb935b5ff625e54c3facceea535c6ae5, which reverted the first removal of the parameter under the assumption that it caused flakiness in tests. The flakiness was instead caused by changes to the wait functions in QTest, so remove the parameter again. Change-Id: I98154d5d7268375aebbcb09de757e75d9b765c5f Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Revert "Remove timeStep parameter from QAnimationDrive::advanceAnimation"Lars Knoll2020-09-113-14/+19
| | | | | | | | | | This reverts commit f51b690e91bb2d7c8a03c5cef42abca37d97f8bb. The commit made all animation tests in qtdeclarative on macOS flaky. Change-Id: I4ccaa879df7e2ba7e253657de01cbabc9b2c655f Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Remove timeStep parameter from QAnimationDrive::advanceAnimationVolker Hilsheimer2020-09-033-19/+14
| | | | | | | | | | | | | | Addresses ### Qt 6 comment, and documentation pointing out that the parameter value is ignored. It wasn't ignored in the code, but that's the kind of change we can make now. With this change, QUnifiedTimer::updateAnimationTimers is only called with -1 as the currentTick input parameter, also from Qt Declarative. Make it default, so that leaf modules can be fixed. Once that it done, the parameter can be removed completely. Change-Id: I80c57ff92f3b615b932dd73d711cf6397347efd8 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* QAnimationDriver: remove deprecated startTime(), setStartTime()Edward Welbourne2020-08-282-36/+0
| | | | | | | Deprecated since 5.13 Change-Id: Ie833647e4bd87698a882352f89b4727790ffeeaa Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Deprecate int based convert/canConvertLars Knoll2020-08-241-3/+4
| | | | | | | Better to provide the correct meta type to convert to. Change-Id: I8e0d46e4ba482186201c157e302c03874bd38e7b Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Another round of 0->nullptr cleanupAllan Sandfeld Jensen2020-07-312-3/+3
| | | | | Change-Id: Ic8db7dc252f8fea46eb5a4f334726d6c7f4645a6 Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* Use QList instead of QVector in corelib implementationJarek Kobus2020-06-291-2/+2
| | | | | | | | Omitting state machine and docs for now. Task-number: QTBUG-84469 Change-Id: Ibfa5e7035515773461f6cdbff35299315ef65737 Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* Use QList instead of QVector in corelibJarek Kobus2020-06-253-6/+5
| | | | | | | | | | Applied to headers only. Source file to be changed separately. Omitted statemachine for now to avoid conflicts. Omitted qmetatype.h for now - to be handled later. Task-number: QTBUG-84469 Change-Id: I317376037a62467c313467d92955ad0b7473aa97 Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* Replace most use of QVariant::type and occurrences of QVariant::TypeOlivier Goffart2020-01-231-3/+3
| | | | | | | | | | | | | | | | | | | | | I made a clazy automated check that replaced the use of QVariant::Type by the equivalent in QMetaType. This has been deprecated since Qt 5.0, but many uses were not yet removed. In addition, there was some manual changes to fix the compilation errors. Adapted the Private API of QDateTimeParser and QMimeDataPrivate and adjust QDateTimeEdit and QSpinBox. QVariant(QVariant::Invalid) in qstylesheet made no sense. But note that in QVariant::save, we actually wanted to use the non-user type. In the SQL module, many changes were actually reverted because the API still expects QVarient::Type. Change-Id: I98c368490e4ee465ed3a3b63bda8b8eaa50ea67e Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Tidy nullptr usageAllan Sandfeld Jensen2019-12-065-15/+15
| | | | | | | | | | | Move away from using 0 as pointer literal. Done using clang-tidy. This is not complete as run-clang-tidy can't handle all of qtbase in one go. Change-Id: I1076a21f32aac0dab078af6f175f7508145eece0 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Remove potential out of bounds accesses to QListLars Knoll2019-10-101-1/+4
| | | | | | Change-Id: I13431e45ef329921a8846c38047f704a299a1a94 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* QtCore: port all QMutexLocker users to qt_{scoped,unique}_lockMarc Mutz2019-08-252-3/+5
| | | | | | | | | | | | | | | | ... except four instances in QCoreApplication that would conflict with another change. Replace a locally-defined MutexUnlocker with a call to unlock() + qScopedGuard'ed lock() to avoid having to spell out the locker type while we can't depend on C++17 CTAD, yet. In QSettings, move the new mutex locker into and out of initDefaultPaths(), such as is idiomatic for std::unique_lock, but wasn't possible with QMutexLocker (which is not movable). Change-Id: I23056e13ecaa76159db583c7dccc6e05715e0788 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Merge remote-tracking branch 'origin/5.12' into devLiang Qi2019-06-251-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf src/gui/painting/qdrawhelper.cpp src/gui/text/qdistancefield.cpp src/gui/text/qdistancefield_p.h src/network/ssl/qsslsocket_openssl.cpp src/plugins/platforms/android/qandroidinputcontext.cpp src/widgets/styles/qstylesheetstyle.cpp Done-With: Timur Pocheptsov <timur.pocheptsov@qt.io> Change-Id: Ia7daad21f077ea889898f17734ec46303e71fe6b
| * Report correct state change when destroying QAbstractAnimationTor Arne Vestbø2019-06-201-1/+1
| | | | | | | | | | Change-Id: Ibe5310e20268d1baa5b329a4d02a3dc38d875008 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Port from QAtomic::load() to loadRelaxed()Giuseppe D'Angelo2019-06-201-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Semi-automated, just needed ~20 manual fixes: $ find \( -iname \*.cpp -or -iname \*.h \) -exec perl -pe 's/(\.|->)load\(\)/$1loadRelaxed\(\)/g' -i \{\} + $ find \( -iname \*.cpp -or -iname \*.h \) -exec perl -pe 's/(\.|->)store\(/$1storeRelaxed\(/g' -i \{\} + It can be easily improved (e.g. for store check that there are no commas after the opening parens). The most common offender is QLibrary::load, and some code using std::atomic directly. Change-Id: I07c38a3c8ed32c924ef4999e85c7e45cf48f0f6c Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | Merge remote-tracking branch 'origin/5.13' into devLiang Qi2019-06-144-2/+30
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: qmake/generators/makefile.cpp qmake/generators/unix/unixmake2.cpp src/corelib/thread/qthread_unix.cpp tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp Change-Id: I1df0d4ba20685de7f9300bf07458c13376493408
| * | Fix invalid vptr during destruction of animationsAllan Sandfeld Jensen2019-05-234-2/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes UBSAN warnings about objects used after partial destruction. Change-Id: Iceea083a77d47335ef595c0ff97b87f35f42e56f Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | | QPropertyAnimation: share some codeMarc Mutz2019-05-301-5/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Collapse the two qWarnings() into one by just storing what is different between them. Saves more than 400b in text size on optimized AMD64 Linux GCC 9.1 builds. Change-Id: I16489d6165a550a9ad4ce6a77ca736a1d17a8c8a Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* | | Merge remote-tracking branch 'origin/5.13' into devLiang Qi2019-05-131-2/+2
|\| | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/tools/qstring.cpp Change-Id: I81dbf90fc936c9bf08197baefa071117bddb1c63
| * | Doc: replace even more null/0/nullptr with \nullptr macroChristian Ehrlicher2019-05-081-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | Try to replace all wordings like '.. to 0' with '.. to \nullptr'. Also checked for 'null pointer' and similar. Change-Id: I73341f59ba51e0798e816a8b1a532c7c7374b74a Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | | Merge remote-tracking branch 'origin/5.13' into devQt Forward Merge Bot2019-04-051-1/+1
|\| | | | | | | | | | | Change-Id: If4974bbf0a166de244dd57cb71b05fa28bcc34ce
| * | Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-04-041-1/+1
| |\| | | | | | | | | | Change-Id: Ia7328524f2cd9d5995ac8705f0fe0bf570b2e831
| | * Doc: Use the \nullptr macro instead of 0Venugopal Shivashankar2019-04-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | This enables overriding the macro so that it translates to 'None' in the Qt for Python context. Change-Id: Ib3cecf57eeb0405a1929309b71e9f012a07f11cf Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
* | | Use QScopedValueRollback more as a reentrancy guardAllan Sandfeld Jensen2019-03-261-8/+8
| | | | | | | | | | | | | | | | | | | | | It is documented for the use, but we were rarely using it. Change-Id: I812b9e6c8fbf204aba43ce2b79eca308ca75de88 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | More nullptr usage in headersKevin Funk2019-03-144-4/+4
|/ / | | | | | | | | | | | | | | | | | | | | Diff generated by running clang-tidy's modernize-use-nullptr checker on the CMake-based Qt version. Skipping src/3rdparty, examples/, tests/ Change-Id: Ib182074e2e2fd52f63093f73b3e2e4c0cb7af188 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | QAnimationDriver: mark obsolete functions as deprecatedChristian Ehrlicher2019-02-052-3/+6
| | | | | | | | | | | | | | | | | | Mark the two long obsolete (and empty) functions as deprecated so they can be removed with Qt6: - setStartTime()/startTime() Change-Id: I7ee1d99ff194860e41723909f81adc181a71ec7c Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Merge remote-tracking branch 'origin/5.12' into devLiang Qi2018-10-2520-120/+25
|\| | | | | | | | | | | | | | | | | Conflicts: src/corelib/animation/qpropertyanimation.cpp src/gui/image/qicon.cpp tests/auto/widgets/itemviews/qtableview/tst_qtableview.cpp Change-Id: I3698172b7b44ebb487cb38f50fd2c4a9f8a35b21