Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qquickitemanimation.cpp
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
7
8#include <private/qqmlproperty_p.h>
9#if QT_CONFIG(quick_path)
10#include <private/qquickpath_p.h>
11#endif
12#include "private/qparallelanimationgroupjob_p.h"
13#include "private/qsequentialanimationgroupjob_p.h"
14
15#include <QtCore/qmath.h>
16#include <QtGui/qtransform.h>
17#include <QtQml/qqmlinfo.h>
18
20
59
68{
69 Q_D(const QQuickParentAnimation);
70 return d->target;
71}
72
74{
76 if (target == d->target)
77 return;
78
79 d->target = target;
81}
82
92{
93 Q_D(const QQuickParentAnimation);
94 return d->newParent;
95}
96
98{
100 if (newParent == d->newParent)
101 return;
102
103 d->newParent = newParent;
105}
106
124{
125 Q_D(const QQuickParentAnimation);
126 return d->via;
127}
128
130{
132 if (via == d->via)
133 return;
134
135 d->via = via;
137}
138
139//### mirrors same-named function in QQuickItem
141{
142 switch (origin) {
143 default:
145 return QPointF(0, 0);
146 case QQuickItem::Top:
147 return QPointF(width / 2., 0);
149 return QPointF(width, 0);
150 case QQuickItem::Left:
151 return QPointF(0, height / 2.);
153 return QPointF(width / 2., height / 2.);
155 return QPointF(width, height / 2.);
157 return QPointF(0, height);
159 return QPointF(width / 2., height);
161 return QPointF(width, height);
162 }
163}
164
166{
169
171 //### reverse should probably apply on a per-action basis
173 QList<QQuickParentChange *> pc;
174 void doAction() override
175 {
176 for (int ii = 0; ii < actions.size(); ++ii) {
177 const QQuickStateAction &action = actions.at(ii);
178 if (reverse)
179 action.event->reverse();
180 else
181 action.event->execute();
182 }
183 }
184};
185
187 QQmlProperties &modified,
189 QObject *defaultTarget)
190{
192
193 std::unique_ptr<QQuickParentAnimationData> data(new QQuickParentAnimationData);
194 std::unique_ptr<QQuickParentAnimationData> viaData(new QQuickParentAnimationData);
195
196 bool hasExplicit = false;
197 if (d->target && d->newParent) {
198 data->reverse = false;
201 pc->setObject(d->target);
202 pc->setParent(d->newParent);
203 myAction.event = pc;
204 data->pc << pc;
206 hasExplicit = true;
207 if (d->via) {
208 viaData->reverse = false;
209 QQuickStateAction myVAction;
211 vpc->setObject(d->target);
212 vpc->setParent(d->via);
213 myVAction.event = vpc;
214 viaData->pc << vpc;
215 viaData->actions << myVAction;
216 }
217 //### once actions have concept of modified,
218 // loop to match appropriate ParentChanges and mark as modified
219 }
220
221 if (!hasExplicit)
222 for (int i = 0; i < actions.size(); ++i) {
223 QQuickStateAction &action = actions[i];
224 if (action.event && action.event->type() == QQuickStateActionEvent::ParentChange
225 && (!d->target || static_cast<QQuickParentChange*>(action.event)->object() == d->target)) {
226
227 QQuickParentChange *pc = static_cast<QQuickParentChange*>(action.event);
229 data->reverse = action.reverseEvent;
230
231 //### this logic differs from PropertyAnimation
232 // (probably a result of modified vs. done)
233 if (d->newParent) {
235 epc->setObject(static_cast<QQuickParentChange*>(action.event)->object());
236 epc->setParent(d->newParent);
237 myAction.event = epc;
238 data->pc << epc;
239 data->actions << myAction;
240 pc = epc;
241 } else {
242 action.actionDone = true;
243 data->actions << myAction;
244 }
245
246 if (d->via) {
247 viaData->reverse = false;
250 vpc->setObject(pc->object());
251 vpc->setParent(d->via);
252 myAction.event = vpc;
253 viaData->pc << vpc;
254 viaData->actions << myAction;
255 QQuickStateAction dummyAction;
256 QQuickStateAction &xAction = pc->xIsSet() && i < actions.size()-1 ? actions[++i] : dummyAction;
257 QQuickStateAction &yAction = pc->yIsSet() && i < actions.size()-1 ? actions[++i] : dummyAction;
258 QQuickStateAction &sAction = pc->scaleIsSet() && i < actions.size()-1 ? actions[++i] : dummyAction;
259 QQuickStateAction &rAction = pc->rotationIsSet() && i < actions.size()-1 ? actions[++i] : dummyAction;
260 QQuickItem *target = pc->object();
261 QQuickItem *targetParent = action.reverseEvent ? pc->originalParent() : pc->parent();
262
263 //### this mirrors the logic in QQuickParentChange.
264 bool ok;
265 const QTransform &transform = targetParent->itemTransform(d->via, &ok);
266 if (transform.type() >= QTransform::TxShear || !ok) {
267 qmlWarning(this) << QQuickParentAnimation::tr("Unable to preserve appearance under complex transform");
268 ok = false;
269 }
270
271 qreal scale = 1;
272 qreal rotation = 0;
273 bool isRotate = (transform.type() == QTransform::TxRotate) || (transform.m11() < 0);
274 if (ok && !isRotate) {
275 if (transform.m11() == transform.m22())
276 scale = transform.m11();
277 else {
278 qmlWarning(this) << QQuickParentAnimation::tr("Unable to preserve appearance under non-uniform scale");
279 ok = false;
280 }
281 } else if (ok && isRotate) {
282 if (transform.m11() == transform.m22())
283 scale = qSqrt(transform.m11()*transform.m11() + transform.m12()*transform.m12());
284 else {
285 qmlWarning(this) << QQuickParentAnimation::tr("Unable to preserve appearance under non-uniform scale");
286 ok = false;
287 }
288
289 if (scale != 0)
290 rotation = qRadiansToDegrees(qAtan2(transform.m12() / scale, transform.m11() / scale));
291 else {
292 qmlWarning(this) << QQuickParentAnimation::tr("Unable to preserve appearance under scale of 0");
293 ok = false;
294 }
295 }
296
297 const QPointF &point = transform.map(QPointF(xAction.toValue.toReal(),yAction.toValue.toReal()));
298 qreal x = point.x();
299 qreal y = point.y();
300 if (ok && target->transformOrigin() != QQuickItem::TopLeft) {
301 qreal w = target->width();
302 qreal h = target->height();
303 if (pc->widthIsSet() && i < actions.size() - 1)
304 w = actions.at(++i).toValue.toReal();
305 if (pc->heightIsSet() && i < actions.size() - 1)
306 h = actions.at(++i).toValue.toReal();
307 const QPointF &transformOrigin
308 = d->computeTransformOrigin(target->transformOrigin(), w,h);
309 qreal tempxt = transformOrigin.x();
310 qreal tempyt = transformOrigin.y();
312 t.translate(-tempxt, -tempyt);
313 t.rotate(rotation);
314 t.scale(scale, scale);
315 t.translate(tempxt, tempyt);
316 const QPointF &offset = t.map(QPointF(0,0));
317 x += offset.x();
318 y += offset.y();
319 }
320
321 if (ok) {
322 //qDebug() << x << y << rotation << scale;
323 xAction.toValue = x;
324 yAction.toValue = y;
325 sAction.toValue = sAction.toValue.toReal() * scale;
326 rAction.toValue = rAction.toValue.toReal() + rotation;
327 }
328 }
329 }
330 }
331
332 if (data->actions.size()) {
334 QActionAnimation *viaAction = d->via ? new QActionAnimation : nullptr;
335 QActionAnimation *targetAction = new QActionAnimation;
336 //we'll assume the common case by far is to have children, and always create ag
338
339 if (d->via)
340 viaAction->setAnimAction(viaData.release());
341 targetAction->setAnimAction(data.release());
342
343 //take care of any child animations
344 bool valid = d->defaultProperty.isValid();
346 for (int ii = 0; ii < d->animations.size(); ++ii) {
347 if (valid)
348 d->animations.at(ii)->setDefaultTarget(d->defaultProperty);
349 anim = d->animations.at(ii)->transition(actions, modified, direction, defaultTarget);
350 if (anim)
351 ag->appendAnimation(anim);
352 }
353
354 //TODO: simplify/clarify logic
356 if (forwards) {
357 topLevelGroup->appendAnimation(d->via ? viaAction : targetAction);
358 topLevelGroup->appendAnimation(ag);
359 if (d->via)
360 topLevelGroup->appendAnimation(targetAction);
361 } else {
362 if (d->via)
363 topLevelGroup->appendAnimation(targetAction);
364 topLevelGroup->appendAnimation(ag);
365 topLevelGroup->appendAnimation(d->via ? viaAction : targetAction);
366 }
367 return initInstance(topLevelGroup);
368 }
369 return nullptr;
370}
371
401
409QQmlListProperty<QQuickItem> QQuickAnchorAnimation::targets()
410{
412 return QQmlListProperty<QQuickItem>(this, &(d->targets));
413}
414
422{
423 Q_D(const QQuickAnchorAnimation);
424 return d->duration;
425}
426
428{
429 if (duration < 0) {
430 qmlWarning(this) << tr("Cannot set a duration of < 0");
431 return;
432 }
433
435 if (d->duration == duration)
436 return;
437 d->duration = duration;
439}
440
461{
462 Q_D(const QQuickAnchorAnimation);
463 return d->easing;
464}
465
467{
469 if (d->easing == e)
470 return;
471
472 d->easing = e;
474}
475
477 QQmlProperties &modified,
479 QObject *defaultTarget)
480{
481 Q_UNUSED(modified);
482 Q_UNUSED(defaultTarget);
486 data->interpolator = d->interpolator;
487 data->reverse = direction == Backward ? true : false;
488 data->fromIsSourced = false;
489 data->fromIsDefined = false;
490
491 for (int ii = 0; ii < actions.size(); ++ii) {
492 QQuickStateAction &action = actions[ii];
493 if (action.event && action.event->type() == QQuickStateActionEvent::AnchorChanges
494 && (d->targets.isEmpty() || d->targets.contains(static_cast<QQuickAnchorChanges*>(action.event)->object()))) {
495 data->actions << static_cast<QQuickAnchorChanges*>(action.event)->additionalActions();
496 }
497 }
498
500 if (data->actions.size()) {
501 animator->setAnimValue(data);
502 animator->setFromIsSourcedValue(&data->fromIsSourced);
503 } else {
504 delete data;
505 }
506
507 animator->setDuration(d->duration);
508 animator->setEasingCurve(d->easing);
509 return initInstance(animator);
510}
511
512
513#if QT_CONFIG(quick_path)
540QQuickPathAnimation::QQuickPathAnimation(QObject *parent)
541: QQuickAbstractAnimation(*(new QQuickPathAnimationPrivate), parent)
542{
543}
544
545QQuickPathAnimation::~QQuickPathAnimation()
546{
548
549 Q_D(QQuickPathAnimation);
550 for (ActiveAnimationsIt it = d->activeAnimations.begin(), end = d->activeAnimations.end(); it != end; ++it)
551 it.value()->clearTemplate();
552}
553
560int QQuickPathAnimation::duration() const
561{
562 Q_D(const QQuickPathAnimation);
563 return d->duration;
564}
565
566void QQuickPathAnimation::setDuration(int duration)
567{
568 if (duration < 0) {
569 qmlWarning(this) << tr("Cannot set a duration of < 0");
570 return;
571 }
572
573 Q_D(QQuickPathAnimation);
574 if (d->duration == duration)
575 return;
576 d->duration = duration;
577 emit durationChanged(duration);
578}
579
595QEasingCurve QQuickPathAnimation::easing() const
596{
597 Q_D(const QQuickPathAnimation);
598 return d->easingCurve;
599}
600
601void QQuickPathAnimation::setEasing(const QEasingCurve &e)
602{
603 Q_D(QQuickPathAnimation);
604 if (d->easingCurve == e)
605 return;
606
607 d->easingCurve = e;
608 emit easingChanged(e);
609}
610
617QQuickPath *QQuickPathAnimation::path() const
618{
619 Q_D(const QQuickPathAnimation);
620 return d->path;
621}
622
623void QQuickPathAnimation::setPath(QQuickPath *path)
624{
625 Q_D(QQuickPathAnimation);
626 if (d->path == path)
627 return;
628
629 d->path = path;
630 emit pathChanged();
631}
632
637QQuickItem *QQuickPathAnimation::target() const
638{
639 Q_D(const QQuickPathAnimation);
640 return d->target;
641}
642
643void QQuickPathAnimation::setTargetObject(QQuickItem *target)
644{
645 Q_D(QQuickPathAnimation);
646 if (d->target == target)
647 return;
648
649 d->target = target;
650 emit targetChanged();
651}
652
669QQuickPathAnimation::Orientation QQuickPathAnimation::orientation() const
670{
671 Q_D(const QQuickPathAnimation);
672 return d->orientation;
673}
674
675void QQuickPathAnimation::setOrientation(Orientation orientation)
676{
677 Q_D(QQuickPathAnimation);
678 if (d->orientation == orientation)
679 return;
680
681 d->orientation = orientation;
682 emit orientationChanged(d->orientation);
683}
684
694QPointF QQuickPathAnimation::anchorPoint() const
695{
696 Q_D(const QQuickPathAnimation);
697 return d->anchorPoint;
698}
699
700void QQuickPathAnimation::setAnchorPoint(const QPointF &point)
701{
702 Q_D(QQuickPathAnimation);
703 if (d->anchorPoint == point)
704 return;
705
706 d->anchorPoint = point;
707 emit anchorPointChanged(point);
708}
709
719int QQuickPathAnimation::orientationEntryDuration() const
720{
721 Q_D(const QQuickPathAnimation);
722 return d->entryDuration;
723}
724
725void QQuickPathAnimation::setOrientationEntryDuration(int duration)
726{
727 Q_D(QQuickPathAnimation);
728 if (d->entryDuration == duration)
729 return;
730 d->entryDuration = duration;
731 emit orientationEntryDurationChanged(duration);
732}
733
742int QQuickPathAnimation::orientationExitDuration() const
743{
744 Q_D(const QQuickPathAnimation);
745 return d->exitDuration;
746}
747
748void QQuickPathAnimation::setOrientationExitDuration(int duration)
749{
750 Q_D(QQuickPathAnimation);
751 if (d->exitDuration == duration)
752 return;
753 d->exitDuration = duration;
754 emit orientationExitDurationChanged(duration);
755}
756
770qreal QQuickPathAnimation::endRotation() const
771{
772 Q_D(const QQuickPathAnimation);
773 return d->endRotation.isValid() ? d->endRotation.value() : qreal(0);
774}
775
776void QQuickPathAnimation::setEndRotation(qreal rotation)
777{
778 Q_D(QQuickPathAnimation);
779 if (d->endRotation.isValid() && d->endRotation == rotation)
780 return;
781
782 d->endRotation = rotation;
783 emit endRotationChanged(d->endRotation);
784}
785
786QAbstractAnimationJob* QQuickPathAnimation::transition(QQuickStateActions &actions,
787 QQmlProperties &modified,
788 TransitionDirection direction,
789 QObject *defaultTarget)
790{
791 Q_D(QQuickPathAnimation);
792
793 QQuickItem *target = d->target ? d->target : qobject_cast<QQuickItem*>(defaultTarget);
794
795 QQuickPathAnimationUpdater prevData;
796 bool havePrevData = false;
797 if (d->activeAnimations.contains(target)) {
798 havePrevData = true;
799 prevData = *d->activeAnimations[target]->pathUpdater();
800 }
801
802 for (auto it = d->activeAnimations.begin(); it != d->activeAnimations.end();) {
803 QQuickPathAnimationAnimator *anim = it.value();
804 if (anim->state() == QAbstractAnimationJob::Stopped) {
805 anim->clearTemplate();
806 it = d->activeAnimations.erase(it);
807 } else {
808 ++it;
809 }
810 }
811
812 QQuickPathAnimationUpdater *data = new QQuickPathAnimationUpdater();
813 QQuickPathAnimationAnimator *pa = new QQuickPathAnimationAnimator(d);
814
815 d->activeAnimations[target] = pa;
816
817 data->orientation = d->orientation;
818 data->anchorPoint = d->anchorPoint;
819 data->entryInterval = d->duration ? qreal(d->entryDuration) / d->duration : qreal(0);
820 data->exitInterval = d->duration ? qreal(d->exitDuration) / d->duration : qreal(0);
821 data->endRotation = d->endRotation;
822 data->reverse = direction == Backward ? true : false;
823 data->fromIsSourced = false;
824 data->fromIsDefined = (d->path && d->path->hasStartX() && d->path->hasStartY()) ? true : false;
825 data->toIsDefined = d->path ? true : false;
826 int origModifiedSize = modified.size();
827
828 for (int i = 0; i < actions.size(); ++i) {
829 QQuickStateAction &action = actions[i];
830 if (action.event)
831 continue;
832 if (action.specifiedObject == target && action.property.name() == QLatin1String("x")) {
833 data->toX = action.toValue.toReal();
834 modified << action.property;
835 action.fromValue = action.toValue;
836 }
837 if (action.specifiedObject == target && action.property.name() == QLatin1String("y")) {
838 data->toY = action.toValue.toReal();
839 modified << action.property;
840 action.fromValue = action.toValue;
841 }
842 }
843
844 if (target && d->path && (modified.size() > origModifiedSize || data->toIsDefined)) {
845 data->target = target;
846 data->path = d->path;
847 data->path->invalidateSequentialHistory();
848
849 if (havePrevData) {
850 // get the original start angle that was used (so we can exactly reverse).
851 data->startRotation = prevData.startRotation;
852
853 // treat interruptions specially, otherwise we end up with strange paths
854 if ((data->reverse || prevData.reverse) && prevData.currentV > 0 && prevData.currentV < 1) {
855 if (!data->fromIsDefined && !data->toIsDefined && !prevData.painterPath.isEmpty()) {
856 QPointF pathPos = QQuickPath::sequentialPointAt(prevData.painterPath, prevData.pathLength, prevData.attributePoints, prevData.prevBez, prevData.currentV);
857 if (!prevData.anchorPoint.isNull())
858 pathPos -= prevData.anchorPoint;
859 if (pathPos == data->target->position()) { //only treat as interruption if we interrupted ourself
860 data->painterPath = prevData.painterPath;
861 data->toIsDefined = data->fromIsDefined = data->fromIsSourced = true;
862 data->prevBez.isValid = false;
863 data->interruptStart = prevData.currentV;
864 data->startRotation = prevData.startRotation;
865 data->pathLength = prevData.pathLength;
866 data->attributePoints = prevData.attributePoints;
867 }
868 }
869 }
870 }
871 pa->setFromIsSourcedValue(&data->fromIsSourced);
872 pa->setAnimValue(data);
873 pa->setDuration(d->duration);
874 pa->setEasingCurve(d->easingCurve);
875 return initInstance(pa);
876 } else {
877 pa->setFromIsSourcedValue(nullptr);
878 pa->setAnimValue(nullptr);
879 delete pa;
880 delete data;
881 }
882 return nullptr;
883}
884
885void QQuickPathAnimationUpdater::setValue(qreal v)
886{
887 v = qMin(qMax(v, (qreal)0.0), (qreal)1.0);;
888
889 if (interruptStart.isValid()) {
890 if (reverse)
891 v = 1 - v;
892 qreal end = reverse ? 0.0 : 1.0;
893 v = interruptStart + v * (end-interruptStart);
894 }
895 currentV = v;
896 bool atStart = ((reverse && v == 1.0) || (!reverse && v == 0.0));
897 if (!fromIsSourced && (!fromIsDefined || !toIsDefined)) {
898 qreal startX = reverse ? toX + anchorPoint.x() : target->x() + anchorPoint.x();
899 qreal startY = reverse ? toY + anchorPoint.y() : target->y() + anchorPoint.y();
900 qreal endX = reverse ? target->x() + anchorPoint.x() : toX + anchorPoint.x();
901 qreal endY = reverse ? target->y() + anchorPoint.y() : toY + anchorPoint.y();
902
903 prevBez.isValid = false;
904 painterPath = path->createPath(QPointF(startX, startY), QPointF(endX, endY), QStringList(), pathLength, attributePoints);
905 fromIsSourced = true;
906 }
907
908 qreal angle;
909 bool fixed = orientation == QQuickPathAnimation::Fixed;
910 QPointF currentPos = !painterPath.isEmpty() ? path->sequentialPointAt(painterPath, pathLength, attributePoints, prevBez, v, fixed ? nullptr : &angle) : path->sequentialPointAt(v, fixed ? nullptr : &angle);
911
912 //adjust position according to anchor point
913 if (!anchorPoint.isNull()) {
914 currentPos -= anchorPoint;
915 if (atStart) {
916 if (!anchorPoint.isNull() && !fixed)
917 target->setTransformOriginPoint(anchorPoint);
918 }
919 }
920
921 target->setPosition(currentPos);
922
923 //adjust angle according to orientation
924 if (!fixed) {
925 switch (orientation) {
926 case QQuickPathAnimation::RightFirst:
927 angle = -angle;
928 break;
929 case QQuickPathAnimation::TopFirst:
930 angle = -angle + 90;
931 break;
932 case QQuickPathAnimation::LeftFirst:
933 angle = -angle + 180;
934 break;
935 case QQuickPathAnimation::BottomFirst:
936 angle = -angle + 270;
937 break;
938 default:
939 angle = 0;
940 break;
941 }
942
943 if (atStart && !reverse) {
944 startRotation = target->rotation();
945
946 //shortest distance to correct orientation
947 qreal diff = angle - startRotation;
948 while (diff > 180.0) {
949 startRotation = startRotation.value() + 360.0;
950 diff -= 360.0;
951 }
952 while (diff < -180.0) {
953 startRotation = startRotation.value() - 360.0;
954 diff += 360.0;
955 }
956 }
957
958 //smoothly transition to the desired orientation
959 //TODO: shortest distance calculations
960 if (startRotation.isValid()) {
961 if (reverse && v == 0.0)
962 angle = startRotation;
963 else if (v < entryInterval)
964 angle = angle * v / entryInterval + startRotation * (entryInterval - v) / entryInterval;
965 }
966 if (endRotation.isValid()) {
967 qreal exitStart = 1 - entryInterval;
968 if (!reverse && v == 1.0)
969 angle = endRotation;
970 else if (v > exitStart)
971 angle = endRotation * (v - exitStart) / exitInterval + angle * (exitInterval - (v - exitStart)) / exitInterval;
972 }
973 target->setRotation(angle);
974 }
975
976 /*
977 NOTE: we don't always reset the transform origin, as it can cause a
978 visual jump if ending on an angle. This means that in some cases
979 (anchor point and orientation both specified, and ending at an angle)
980 the transform origin will always be set after running the path animation.
981 */
982 if ((reverse && v == 0.0) || (!reverse && v == 1.0)) {
983 if (!anchorPoint.isNull() && !fixed && qFuzzyIsNull(angle))
984 target->setTransformOriginPoint(QPointF());
985 }
986}
987
988QQuickPathAnimationAnimator::QQuickPathAnimationAnimator(QQuickPathAnimationPrivate *priv)
989 : animationTemplate(priv)
990{
991}
992
993QQuickPathAnimationAnimator::~QQuickPathAnimationAnimator()
994{
995 if (animationTemplate && pathUpdater()) {
996 auto it = animationTemplate->activeAnimations.constFind(pathUpdater()->target);
997 if (it != animationTemplate->activeAnimations.cend() && it.value() == this)
998 animationTemplate->activeAnimations.erase(it);
999 }
1000}
1001
1002#endif // quick_path
1003
1005
1006#include "moc_qquickitemanimation_p.cpp"
bool event(QEvent *) override
\reimp
Definition qaction.cpp:1027
\inmodule QtCore
\inmodule QtCore
Definition qhash.h:1103
qsizetype size() const noexcept
Definition qlist.h:397
const_reference at(qsizetype i) const noexcept
Definition qlist.h:446
\inmodule QtCore
Definition qobject.h:103
\inmodule QtCore\reentrant
Definition qpoint.h:217
constexpr qreal x() const noexcept
Returns the x coordinate of this point.
Definition qpoint.h:343
constexpr qreal y() const noexcept
Returns the y coordinate of this point.
Definition qpoint.h:348
QAbstractAnimationJob * initInstance(QAbstractAnimationJob *animation)
void setEasing(const QEasingCurve &)
QQmlListProperty< QQuickItem > targets
\qmlproperty list<Item> QtQuick::AnchorAnimation::targets The items to reanchor.
void easingChanged(const QEasingCurve &)
QAbstractAnimationJob * transition(QQuickStateActions &actions, QQmlProperties &modified, TransitionDirection direction, QObject *defaultTarget=nullptr) override
QQuickAnchorAnimation(QObject *parent=nullptr)
\qmltype AnchorAnimation \instantiates QQuickAnchorAnimation \inqmlmodule QtQuick\inherits Animation
QQuickItem * object() const
\qmlproperty Item QtQuick::AnchorChanges::target This property holds the \l Item for which the anchor...
void setAnimValue(QQuickBulkValueUpdater *value)
The QQuickItem class provides the most basic of all visual items in \l {Qt Quick}.
Definition qquickitem.h:63
TransformOrigin
\variable QQuickItem::ItemChangeData::realValue The numeric value that has changed: \l {QQuickItem::o...
Definition qquickitem.h:171
QPointF computeTransformOrigin(QQuickItem::TransformOrigin origin, qreal width, qreal height) const
void setTargetObject(QQuickItem *)
QQuickParentAnimation(QObject *parent=nullptr)
\qmltype ParentAnimation \instantiates QQuickParentAnimation \inqmlmodule QtQuick
QAbstractAnimationJob * transition(QQuickStateActions &actions, QQmlProperties &modified, TransitionDirection direction, QObject *defaultTarget=nullptr) override
void setNewParent(QQuickItem *)
void setObject(QQuickItem *)
ActionList actions() override
QQuickItem * object() const
\qmlproperty Item QtQuick::ParentChange::target This property holds the item to be reparented
void setParent(QQuickItem *)
QQuickItem * originalParent() const
QPointF sequentialPointAt(qreal p, qreal *angle=nullptr) const
virtual void reverse()
virtual void execute()
virtual EventType type() const =0
QQmlProperty property
QObject * specifiedObject
QQuickStateActionEvent * event
iterator begin()
Definition qset.h:136
iterator end()
Definition qset.h:140
const_iterator cend() const noexcept
Definition qset.h:142
iterator erase(const_iterator i)
Definition qset.h:145
const_iterator constFind(const T &value) const
Definition qset.h:161
The QTransform class specifies 2D transformations of a coordinate system.
Definition qtransform.h:20
QTransform & rotate(qreal a, Qt::Axis axis=Qt::ZAxis, qreal distanceToPlane=1024.0f)
QTransform & scale(qreal sx, qreal sy)
Scales the coordinate system by sx horizontally and sy vertically, and returns a reference to the mat...
QTransform & translate(qreal dx, qreal dy)
Moves the coordinate system dx along the x axis and dy along the y axis, and returns a reference to t...
qreal toReal(bool *ok=nullptr) const
Returns the variant as a qreal if the variant has userType() \l QMetaType::Double,...
qDeleteAll(list.begin(), list.end())
QSet< QString >::iterator it
direction
Combined button and popup list for selecting options.
QTextStream & fixed(QTextStream &stream)
Calls QTextStream::setRealNumberNotation(QTextStream::FixedNotation) on stream and returns stream.
QList< QString > QStringList
Constructs a string list that contains the given string, str.
bool qFuzzyIsNull(qfloat16 f) noexcept
Definition qfloat16.h:349
qfloat16 qSqrt(qfloat16 f)
Definition qfloat16.h:289
constexpr float qRadiansToDegrees(float radians)
Definition qmath.h:281
auto qAtan2(T1 y, T2 x)
Definition qmath.h:90
static const QMetaObjectPrivate * priv(const uint *data)
constexpr const T & qMin(const T &a, const T &b)
Definition qminmax.h:40
constexpr const T & qMax(const T &a, const T &b)
Definition qminmax.h:42
GLsizei const GLfloat * v
[13]
GLint GLint GLint GLint GLint x
[0]
GLfloat GLfloat GLfloat w
[0]
GLint GLsizei GLsizei height
GLuint GLuint end
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLint GLsizei width
GLfloat angle
GLenum target
GLenum GLuint GLintptr offset
GLint y
GLfloat GLfloat GLfloat GLfloat h
GLuint GLenum GLenum transform
GLdouble GLdouble t
Definition qopenglext.h:243
GLsizei const GLchar *const * path
GLenum GLenum GLenum GLenum GLenum scale
Q_QML_EXPORT QQmlInfo qmlWarning(const QObject *me)
QQuickItem * qobject_cast< QQuickItem * >(QObject *o)
Definition qquickitem.h:492
#define tr(X)
#define emit
#define Q_UNUSED(x)
double qreal
Definition qtypes.h:187
QObject::connect nullptr
QAction * myAction
QList< QQuickParentChange * > pc