| Home · All Namespaces · All Classes |
#include <transformlayoutanimation.h>


Public Member Functions | |
| TransformAnimation (QGraphicsWidget *widget) | |
| virtual | ~TransformAnimation () |
| Destructor. | |
| virtual void | updateCurrentValue (const QVariant &value) |
| virtual void | updateState (QAbstractAnimation::State newState, QAbstractAnimation::State oldState) |
| QGraphicsWidget * | widget () const |
| void | setEndValue (const QRectF &rect) |
Animates a widget's translation and scale transform
Definition at line 31 of file transformlayoutanimation.h.
| TransformAnimation::TransformAnimation | ( | QGraphicsWidget * | widget | ) |
Constructor
| widget | the widget to animate |
Definition at line 22 of file transformlayoutanimation.cpp.
: animatedWidget(widget) { }
| TransformAnimation::~TransformAnimation | ( | ) | [virtual] |
| void TransformAnimation::setEndValue | ( | const QRectF & | rect | ) |
Sets the destination rectangle
Definition at line 35 of file transformlayoutanimation.cpp.
{
invDestSize = QSizeF(1.0f / qMax(qreal(1.0f), rect.width()),
1.0f / qMax(qreal(1.0f), rect.height()));
QVariantAnimation::setEndValue(rect);
}
| void TransformAnimation::updateCurrentValue | ( | const QVariant & | value | ) | [virtual] |
REIMPLEMENTATION
Definition at line 43 of file transformlayoutanimation.cpp.
{
QRectF rect = value.toRectF();
QRectF destRect = endValue().toRectF();
QPointF translate = rect.topLeft() - destRect.topLeft();
QPointF scale = QPointF(rect.size().width() * invDestSize.width(),
rect.size().height() * invDestSize.height());
animatedWidget->setTransform(QTransform::fromTranslate(translate.x(), translate.y()).scale(scale.x(), scale.y()));
}
| virtual void TransformAnimation::updateState | ( | QAbstractAnimation::State | newState, | |
| QAbstractAnimation::State | oldState | |||
| ) | [virtual] |
| QGraphicsWidget * TransformAnimation::widget | ( | ) | const |
Returns the widget controlled by this animation
Definition at line 30 of file transformlayoutanimation.cpp.
{
return animatedWidget;
}
| Copyright © 2010 Nokia Corporation | Generated on Thu Nov 4 2010 18:20:43 Doxygen 1.7.1 |
MeeGo Touch |