50#include <QtCore/qtimeline.h>
51#include <QtCore/qpoint.h>
52#include <QtCore/qpointer.h>
53#include <QtCore/qpair.h>
61 if (!(step >= 0 && step <= 1)) {
62 qWarning(
"QGraphicsItemAnimation::%s: invalid step = %f",
method, step);
113 step = qMin<qreal>(qMax<qreal>(
step, 0), 1);
116 return source.back().value;
118 qreal stepBefore = 0;
120 qreal valueBefore =
source.front().step == 0 ?
source.front().value : defaultValue;
136 return valueBefore + (valueAfter - valueBefore) * ((
step - stepBefore) / (stepAfter - stepBefore));
254 const int xPosCount = d->
xPosition.size();
256 for (
int i = 0;
i < xPosCount; ++
i)
312 const int numRotations = d->
rotation.size();
314 for (
int i = 0;
i < numRotations; ++
i)
364 for (
int i = 0;
i < numTranslations; ++
i)
415 for (
int i = 0;
i < numScales; ++
i)
465 for (
int i = 0;
i < numShears; ++
i)
547#include "moc_qgraphicsitemanimation.cpp"
QList< Pair > yTranslation
QList< Pair > verticalShear
void insertUniquePair(qreal step, qreal value, QList< Pair > *binList, const char *method)
QList< Pair > xTranslation
QPointer< QTimeLine > timeLine
QList< Pair > horizontalScale
QGraphicsItemAnimation * q
QList< Pair > verticalScale
QTransform startTransform
QList< Pair > horizontalShear
qreal linearValueForStep(qreal step, const QList< Pair > &source, qreal defaultValue=0)
QGraphicsItemAnimationPrivate()
The QGraphicsItemAnimation class provides simple animation support for QGraphicsItem.
qreal horizontalScaleAt(qreal step) const
Returns the horizontal scale for the item at the specified step value.
QList< QPair< qreal, QPointF > > shearList() const
Returns all explicitly inserted shears.
void setTimeLine(QTimeLine *timeLine)
Sets the timeline object used to control the rate of animation to the timeLine specified.
QTransform transformAt(qreal step) const
Returns the transform used for the item at the specified step value.
QGraphicsItem * item() const
Returns the item on which the animation object operates.
qreal horizontalShearAt(qreal step) const
Returns the horizontal shear for the item at the specified step value.
void setRotationAt(qreal step, qreal angle)
Sets the rotation of the item at the given step value to the angle specified.
QList< QPair< qreal, QPointF > > translationList() const
Returns all explicitly inserted translations.
qreal xTranslationAt(qreal step) const
Returns the horizontal translation of the item at the specified step value.
void setStep(qreal x)
Sets the current step value for the animation, causing the transformations scheduled at this step to ...
qreal rotationAt(qreal step) const
Returns the angle at which the item is rotated at the specified step value.
virtual ~QGraphicsItemAnimation()
Destroys the animation object.
virtual void afterAnimationStep(qreal step)
This method is meant to be overridden in subclasses that need to execute additional code after a new ...
void setScaleAt(qreal step, qreal sx, qreal sy)
Sets the scale of the item at the given step value using the horizontal and vertical scale factors sp...
void setTranslationAt(qreal step, qreal dx, qreal dy)
Sets the translation of the item at the given step value using the horizontal and vertical coordinate...
void setItem(QGraphicsItem *item)
Sets the specified item to be used in the animation.
QList< QPair< qreal, QPointF > > scaleList() const
Returns all explicitly inserted scales.
QTimeLine * timeLine() const
Returns the timeline object used to control the rate at which the animation occurs.
void clear()
Clears the scheduled transformations used for the animation, but retains the item and timeline.
qreal verticalScaleAt(qreal step) const
Returns the vertical scale for the item at the specified step value.
qreal yTranslationAt(qreal step) const
Returns the vertical translation of the item at the specified step value.
virtual void beforeAnimationStep(qreal step)
This method is meant to be overridden by subclassed that needs to execute additional code before a ne...
QList< QPair< qreal, qreal > > rotationList() const
Returns all explicitly inserted rotations.
qreal verticalShearAt(qreal step) const
Returns the vertical shear for the item at the specified step value.
QList< QPair< qreal, QPointF > > posList() const
Returns all explicitly inserted positions.
void setShearAt(qreal step, qreal sh, qreal sv)
Sets the shear of the item at the given step value using the horizontal and vertical shear factors sp...
void setPosAt(qreal step, const QPointF &pos)
Sets the position of the item at the given step value to the point specified.
QGraphicsItemAnimation(QObject *parent=nullptr)
Constructs an animation object with the given parent.
QPointF posAt(qreal step) const
Returns the position of the item at the given step value.
The QGraphicsItem class is the base class for all graphical items in a QGraphicsScene.
void setTransform(const QTransform &matrix, bool combine=false)
QPointF pos() const
Returns the position of the item in parent coordinates.
void setPos(const QPointF &pos)
Sets the position of the item to pos, which is in parent coordinates.
iterator insert(qsizetype i, parameter_type t)
void reserve(qsizetype size)
static QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
\threadsafe
\inmodule QtCore\reentrant
constexpr qreal x() const noexcept
Returns the x coordinate of this point.
constexpr qreal y() const noexcept
Returns the y coordinate of this point.
Combined button and popup list for selecting options.
std::pair< T1, T2 > QPair
DBusConnection const char DBusError DBusBusType DBusError return DBusConnection DBusHandleMessageFunction void DBusFreeFunction return DBusConnection return DBusConnection return const char DBusError return DBusConnection DBusMessage dbus_uint32_t return DBusConnection dbus_bool_t DBusConnection DBusAddWatchFunction DBusRemoveWatchFunction DBusWatchToggledFunction void DBusFreeFunction return DBusConnection DBusDispatchStatusFunction void DBusFreeFunction DBusTimeout return DBusTimeout return DBusWatch return DBusWatch unsigned int return DBusError const DBusError return const DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessageIter int const void return DBusMessageIter DBusMessageIter return DBusMessageIter void DBusMessageIter void int return DBusMessage DBusMessageIter return DBusMessageIter return DBusMessageIter DBusMessageIter const char const char const char const char * method
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
static QT_BEGIN_NAMESPACE bool check_step_valid(qreal step, const char *method)
GLsizei GLsizei GLchar * source
GLuint GLenum GLenum transform
GLdouble GLdouble GLdouble GLdouble q
#define Q_DECLARE_TYPEINFO(TYPE, FLAGS)
bool operator==(const Pair &other) const
bool operator<(const Pair &other) const
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent