Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-13378

QGraphicsItem::setTransformOriginPoint ignored when rotating via QGraphicsItemAnimation::setRotationAt

    XMLWordPrintable

Details

    • Bug
    • Resolution: Out of scope
    • P2: Important
    • Some future release
    • 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

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            lscunha Leonardo Sobral Cunha (Inactive)
            detaos Rick Battle
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes