wayfaerer
8th February 2012, 20:09
I'm trying to shear a QGraphicsItem with a custom transformOriginPoint, but there is no QGraphicsItem::setShear (like there is for rotation: QGraphicsItem::setRotation).
I realize I could create my own transform matrix and use QGraphicsItem::setTransform, but it doesn't seem to take into account the transformOriginPoint, which in my case is not (0,0).
For example, the following two examples produce completely different behavior:
// takes into account the transformOriginPoint
myItem->setRotation(30);
// does not take into account the transformOriginPoint
QTransform hi;
hi.rotate(30);
myItem->setTransform(hi);
I realize I could create my own transform matrix and use QGraphicsItem::setTransform, but it doesn't seem to take into account the transformOriginPoint, which in my case is not (0,0).
For example, the following two examples produce completely different behavior:
// takes into account the transformOriginPoint
myItem->setRotation(30);
// does not take into account the transformOriginPoint
QTransform hi;
hi.rotate(30);
myItem->setTransform(hi);