Qt 4.8
Typedefs | Functions
qvariantanimation.cpp File Reference
#include "qvariantanimation.h"
#include "qvariantanimation_p.h"
#include <QtCore/qrect.h>
#include <QtCore/qline.h>
#include <QtCore/qmutex.h>
#include <private/qmutexpool_p.h>
#include "moc_qvariantanimation.cpp"

Go to the source code of this file.

Typedefs

typedef QVector< QVariantAnimation::InterpolatorQInterpolatorVector
 

Functions

template<>
Q_INLINE_TEMPLATE QRect _q_interpolate (const QRect &f, const QRect &t, qreal progress)
 
template<>
Q_INLINE_TEMPLATE QRectF _q_interpolate (const QRectF &f, const QRectF &t, qreal progress)
 
template<>
Q_INLINE_TEMPLATE QLine _q_interpolate (const QLine &f, const QLine &t, qreal progress)
 
template<>
Q_INLINE_TEMPLATE QLineF _q_interpolate (const QLineF &f, const QLineF &t, qreal progress)
 
static bool animationValueLessThan (const QVariantAnimation::KeyValue &p1, const QVariantAnimation::KeyValue &p2)
 
template<typename T >
static QVariantAnimation::Interpolator castToInterpolator (QVariant(*func)(const T &from, const T &to, qreal progress))
 
static QVariant defaultInterpolator (const void *, const void *, qreal)
 

Typedef Documentation

◆ QInterpolatorVector

Definition at line 417 of file qvariantanimation.cpp.

Function Documentation

◆ _q_interpolate() [1/4]

template<>
Q_INLINE_TEMPLATE QRect _q_interpolate ( const QRect f,
const QRect t,
qreal  progress 
)

Definition at line 177 of file qvariantanimation.cpp.

Referenced by _q_interpolate().

178 {
179  QRect ret;
180  ret.setCoords(_q_interpolate(f.left(), t.left(), progress),
181  _q_interpolate(f.top(), t.top(), progress),
182  _q_interpolate(f.right(), t.right(), progress),
183  _q_interpolate(f.bottom(), t.bottom(), progress));
184  return ret;
185 }
int left() const
Returns the x-coordinate of the rectangle&#39;s left edge.
Definition: qrect.h:240
int bottom() const
Returns the y-coordinate of the rectangle&#39;s bottom edge.
Definition: qrect.h:249
void setCoords(int x1, int y1, int x2, int y2)
Sets the coordinates of the rectangle&#39;s top-left corner to (x1, y1), and the coordinates of its botto...
Definition: qrect.h:416
int top() const
Returns the y-coordinate of the rectangle&#39;s top edge.
Definition: qrect.h:243
int right() const
Returns the x-coordinate of the rectangle&#39;s right edge.
Definition: qrect.h:246
The QRect class defines a rectangle in the plane using integer precision.
Definition: qrect.h:58
Q_INLINE_TEMPLATE QRect _q_interpolate(const QRect &f, const QRect &t, qreal progress)

◆ _q_interpolate() [2/4]

template<>
Q_INLINE_TEMPLATE QRectF _q_interpolate ( const QRectF f,
const QRectF t,
qreal  progress 
)

Definition at line 187 of file qvariantanimation.cpp.

188 {
189  qreal x1, y1, w1, h1;
190  f.getRect(&x1, &y1, &w1, &h1);
191  qreal x2, y2, w2, h2;
192  t.getRect(&x2, &y2, &w2, &h2);
193  return QRectF(_q_interpolate(x1, x2, progress), _q_interpolate(y1, y2, progress),
194  _q_interpolate(w1, w2, progress), _q_interpolate(h1, h2, progress));
195 }
void getRect(qreal *x, qreal *y, qreal *w, qreal *h) const
Extracts the position of the rectangle&#39;s top-left corner to *x and y, and its dimensions to *width an...
Definition: qrect.h:746
double qreal
Definition: qglobal.h:1193
The QRectF class defines a rectangle in the plane using floating point precision. ...
Definition: qrect.h:511
Q_INLINE_TEMPLATE QRect _q_interpolate(const QRect &f, const QRect &t, qreal progress)

◆ _q_interpolate() [3/4]

template<>
Q_INLINE_TEMPLATE QLine _q_interpolate ( const QLine f,
const QLine t,
qreal  progress 
)

Definition at line 197 of file qvariantanimation.cpp.

198 {
199  return QLine( _q_interpolate(f.p1(), t.p1(), progress), _q_interpolate(f.p2(), t.p2(), progress));
200 }
The QLine class provides a two-dimensional vector using integer precision.
Definition: qline.h:57
QPoint p1() const
Returns the line&#39;s start point.
Definition: qline.h:132
QPoint p2() const
Returns the line&#39;s end point.
Definition: qline.h:137
Q_INLINE_TEMPLATE QRect _q_interpolate(const QRect &f, const QRect &t, qreal progress)

◆ _q_interpolate() [4/4]

template<>
Q_INLINE_TEMPLATE QLineF _q_interpolate ( const QLineF f,
const QLineF t,
qreal  progress 
)

Definition at line 202 of file qvariantanimation.cpp.

203 {
204  return QLineF( _q_interpolate(f.p1(), t.p1(), progress), _q_interpolate(f.p2(), t.p2(), progress));
205 }
QPointF p1() const
Returns the line&#39;s start point.
Definition: qline.h:314
The QLineF class provides a two-dimensional vector using floating point precision.
Definition: qline.h:212
QPointF p2() const
Returns the line&#39;s end point.
Definition: qline.h:319
Q_INLINE_TEMPLATE QRect _q_interpolate(const QRect &f, const QRect &t, qreal progress)

◆ animationValueLessThan()

static bool animationValueLessThan ( const QVariantAnimation::KeyValue p1,
const QVariantAnimation::KeyValue p2 
)
static

◆ castToInterpolator()

template<typename T >
static QVariantAnimation::Interpolator castToInterpolator ( QVariant(*)(const T &from, const T &to, qreal progress)  func)
inlinestatic

Definition at line 465 of file qvariantanimation.cpp.

Referenced by QVariantAnimationPrivate::getInterpolator().

466 {
467  return reinterpret_cast<QVariantAnimation::Interpolator>(func);
468 }
QVariant(* Interpolator)(const void *from, const void *to, qreal progress)

◆ defaultInterpolator()

static QVariant defaultInterpolator ( const void *  ,
const void *  ,
qreal   
)
static

Definition at line 172 of file qvariantanimation.cpp.

Referenced by QVariantAnimationPrivate::updateInterpolator().

173 {
174  return QVariant();
175 }
The QVariant class acts like a union for the most common Qt data types.
Definition: qvariant.h:92