Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qgraphicsitemanimation.h
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// Qt-Security score:significant reason:default
4
5#ifndef QGRAPHICSITEMANIMATION_H
6#define QGRAPHICSITEMANIMATION_H
7
8#include <QtWidgets/qtwidgetsglobal.h>
9#include <QtCore/qobject.h>
10
12
13QT_BEGIN_NAMESPACE
14
15class QGraphicsItem;
16class QPointF;
17class QTimeLine;
18class QTransform;
19
21class Q_WIDGETS_EXPORT QGraphicsItemAnimation : public QObject
22{
23 Q_OBJECT
24public:
25 QGraphicsItemAnimation(QObject *parent = nullptr);
26 virtual ~QGraphicsItemAnimation();
27
28 QGraphicsItem *item() const;
29 void setItem(QGraphicsItem *item);
30
31 QTimeLine *timeLine() const;
32 void setTimeLine(QTimeLine *timeLine);
33
34 QPointF posAt(qreal step) const;
35 QList<std::pair<qreal, QPointF> > posList() const;
36 void setPosAt(qreal step, const QPointF &pos);
37
38 QTransform transformAt(qreal step) const;
39
40 qreal rotationAt(qreal step) const;
41 QList<std::pair<qreal, qreal> > rotationList() const;
42 void setRotationAt(qreal step, qreal angle);
43
44 qreal xTranslationAt(qreal step) const;
45 qreal yTranslationAt(qreal step) const;
46 QList<std::pair<qreal, QPointF> > translationList() const;
47 void setTranslationAt(qreal step, qreal dx, qreal dy);
48
49 qreal verticalScaleAt(qreal step) const;
50 qreal horizontalScaleAt(qreal step) const;
51 QList<std::pair<qreal, QPointF> > scaleList() const;
52 void setScaleAt(qreal step, qreal sx, qreal sy);
53
54 qreal verticalShearAt(qreal step) const;
55 qreal horizontalShearAt(qreal step) const;
56 QList<std::pair<qreal, QPointF> > shearList() const;
57 void setShearAt(qreal step, qreal sh, qreal sv);
58
59 void clear();
60
61public Q_SLOTS:
62 void setStep(qreal x);
63
64protected:
65 virtual void beforeAnimationStep(qreal step);
66 virtual void afterAnimationStep(qreal step);
67
68private:
69 Q_DISABLE_COPY(QGraphicsItemAnimation)
70 QGraphicsItemAnimationPrivate *d;
71};
72
73QT_END_NAMESPACE
74
75#endif
void insertUniquePair(qreal step, qreal value, QList< Pair > *binList, const char *method)
qreal linearValueForStep(qreal step, const QList< Pair > &source, qreal defaultValue=0)
The QGraphicsItemAnimation class provides simple animation support for QGraphicsItem.
\inmodule QtCore\reentrant
Definition qpoint.h:231
static QT_BEGIN_NAMESPACE bool check_step_valid(qreal step, const char *method)
Q_DECLARE_TYPEINFO(QGraphicsItemAnimationPrivate::Pair, Q_PRIMITIVE_TYPE)
QT_REQUIRE_CONFIG(graphicsview)
bool operator==(const Pair &other) const
bool operator<(const Pair &other) const