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
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
4#ifndef QGRAPHICSITEMANIMATION_H
5#define QGRAPHICSITEMANIMATION_H
6
7#include <QtWidgets/qtwidgetsglobal.h>
8#include <QtCore/qobject.h>
9
10QT_REQUIRE_CONFIG(graphicsview);
11
13
14class QGraphicsItem;
15class QPointF;
16class QTimeLine;
17class QTransform;
18
20class Q_WIDGETS_EXPORT QGraphicsItemAnimation : public QObject
21{
23public:
24 QGraphicsItemAnimation(QObject *parent = nullptr);
26
27 QGraphicsItem *item() const;
28 void setItem(QGraphicsItem *item);
29
30 QTimeLine *timeLine() const;
31 void setTimeLine(QTimeLine *timeLine);
32
33 QPointF posAt(qreal step) const;
34 QList<QPair<qreal, QPointF> > posList() const;
35 void setPosAt(qreal step, const QPointF &pos);
36
37 QTransform transformAt(qreal step) const;
38
39 qreal rotationAt(qreal step) const;
40 QList<QPair<qreal, qreal> > rotationList() const;
41 void setRotationAt(qreal step, qreal angle);
42
43 qreal xTranslationAt(qreal step) const;
44 qreal yTranslationAt(qreal step) const;
45 QList<QPair<qreal, QPointF> > translationList() const;
46 void setTranslationAt(qreal step, qreal dx, qreal dy);
47
48 qreal verticalScaleAt(qreal step) const;
49 qreal horizontalScaleAt(qreal step) const;
50 QList<QPair<qreal, QPointF> > scaleList() const;
51 void setScaleAt(qreal step, qreal sx, qreal sy);
52
53 qreal verticalShearAt(qreal step) const;
54 qreal horizontalShearAt(qreal step) const;
55 QList<QPair<qreal, QPointF> > shearList() const;
56 void setShearAt(qreal step, qreal sh, qreal sv);
57
58 void clear();
59
60public Q_SLOTS:
61 void setStep(qreal x);
62
63protected:
64 virtual void beforeAnimationStep(qreal step);
65 virtual void afterAnimationStep(qreal step);
66
67private:
68 Q_DISABLE_COPY(QGraphicsItemAnimation)
70};
71
73
74#endif
The QGraphicsItemAnimation class provides simple animation support for QGraphicsItem.
The QGraphicsItem class is the base class for all graphical items in a QGraphicsScene.
\inmodule QtCore
Definition qobject.h:103
\inmodule QtCore\reentrant
Definition qpoint.h:217
\inmodule QtCore
Definition qtimeline.h:19
The QTransform class specifies 2D transformations of a coordinate system.
Definition qtransform.h:20
b clear()
Combined button and popup list for selecting options.
GLint GLint GLint GLint GLint x
[0]
GLfloat angle
#define QT_REQUIRE_CONFIG(feature)
#define Q_OBJECT
#define Q_SLOTS
double qreal
Definition qtypes.h:187
QTimeLine * timeLine
QGraphicsItem * item