Details
-
Bug
-
Resolution: Out of scope
-
P2: Important
-
4.6.3
-
None
-
Debian Sid dist-upgraded as of 02 Sep 2010.
Description
QGraphicsItem::setTransformOriginPoint appears to be ignored when rotating an object using QGraphicsItemAnimation::setRotationAt. No matter what values are passed to setTransformOriginPoint, the QGraphicsItem is always rotated about local (0 ,0).
code example:
code
class Character : public QGraphicsItem {
public:
Character();
~Character();
QRectF boundingRect() const;
void paint(QPainter*, const QStyleOptionGraphicsItem*, QWidget*);
protected:
QGraphicsPixmapItem *torso, *head, *upper_arm, *lower_arm, *hand, *thigh, *calf, *foot;
QTimeLine *timeLine;
};
Character::Character() {
torso = new QGraphicsPixmapItem(QPixmap("img/torso.png"), this);
thigh = new QGraphicsPixmapItem(QPixmap("img/thigh.png"), torso);
torso->setPos(-35, -95);
thigh->setPos(8, 144);
thigh->setTransformOriginPoint(32, 14);
timeLine = new QTimeLine;
timeLine->setUpdateInterval(1000 / 25);
timeLine->setCurveShape(QTimeLine::CosineCurve);
timeLine->setLoopCount(0);
timeLine->setDuration(4000);
QGraphicsItemAnimation *thigh_anim = new QGraphicsItemAnimation;
thigh_anim->setItem(thigh);
thigh_anim->setTimeLine(timeLine);
thigh_anim->setRotationAt(0.00, -64.52+90);
/* lots of rotation points excluded for brevity */
timeLine->start();
}
code