Qt 4.8
Public Functions | Public Variables | List of all members
QGraphicsItemPrivate::TransformData Struct Reference

#include <qgraphicsitem_p.h>

Public Functions

QTransform computedFullTransform (QTransform *postmultiplyTransform=0) const
 
 TransformData ()
 

Public Variables

QList< QGraphicsTransform * > graphicsTransforms
 
bool onlyTransform
 
qreal rotation
 
qreal scale
 
QTransform transform
 
qreal xOrigin
 
qreal yOrigin
 

Detailed Description

Definition at line 596 of file qgraphicsitem_p.h.

Constructors and Destructors

◆ TransformData()

QGraphicsItemPrivate::TransformData::TransformData ( )
inline

Functions

◆ computedFullTransform()

QTransform QGraphicsItemPrivate::TransformData::computedFullTransform ( QTransform postmultiplyTransform = 0) const
inline

Definition at line 612 of file qgraphicsitem_p.h.

Referenced by QGraphicsItem::deviceTransform(), and QGraphicsItem::mouseMoveEvent().

613  {
614  if (onlyTransform) {
615  if (!postmultiplyTransform || postmultiplyTransform->isIdentity())
616  return transform;
617  if (transform.isIdentity())
618  return *postmultiplyTransform;
619  return transform * *postmultiplyTransform;
620  }
621 
623  if (!graphicsTransforms.isEmpty()) {
624  QMatrix4x4 m;
625  for (int i = 0; i < graphicsTransforms.size(); ++i)
626  graphicsTransforms.at(i)->applyTo(&m);
627  x *= m.toTransform();
628  }
630  x.rotate(rotation);
631  x.scale(scale, scale);
632  x.translate(-xOrigin, -yOrigin);
633  if (postmultiplyTransform)
634  x *= *postmultiplyTransform;
635  return x;
636  }
QTransform & translate(qreal dx, qreal dy)
Moves the coordinate system dx along the x axis and dy along the y axis, and returns a reference to t...
Definition: qtransform.cpp:417
bool isEmpty() const
Returns true if the list contains no items; otherwise returns false.
Definition: qlist.h:152
bool isIdentity() const
Returns true if the matrix is the identity matrix, otherwise returns false.
Definition: qtransform.h:204
virtual void applyTo(QMatrix4x4 *matrix) const =0
This pure virtual method has to be reimplemented in derived classes.
QTransform & rotate(qreal a, Qt::Axis axis=Qt::ZAxis)
Rotates the coordinate system counterclockwise by the given angle about the specified axis and return...
Definition: qtransform.cpp:615
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
The QMatrix4x4 class represents a 4x4 transformation matrix in 3D space.
Definition: qmatrix4x4.h:63
QTransform toTransform() const
Returns the conventional Qt 2D transformation matrix that corresponds to this matrix.
QList< QGraphicsTransform * > graphicsTransforms
int size() const
Returns the number of items in the list.
Definition: qlist.h:137
QTransform & scale(qreal sx, qreal sy)
Scales the coordinate system by sx horizontally and sy vertically, and returns a reference to the mat...
Definition: qtransform.cpp:485
The QTransform class specifies 2D transformations of a coordinate system.
Definition: qtransform.h:65

Properties

◆ graphicsTransforms

QList<QGraphicsTransform *> QGraphicsItemPrivate::TransformData::graphicsTransforms

◆ onlyTransform

bool QGraphicsItemPrivate::TransformData::onlyTransform

◆ rotation

qreal QGraphicsItemPrivate::TransformData::rotation

Definition at line 600 of file qgraphicsitem_p.h.

Referenced by QGraphicsItem::rotation(), and QGraphicsItem::setRotation().

◆ scale

qreal QGraphicsItemPrivate::TransformData::scale

Definition at line 599 of file qgraphicsitem_p.h.

Referenced by QGraphicsItem::scale(), and QGraphicsItem::setScale().

◆ transform

QTransform QGraphicsItemPrivate::TransformData::transform

◆ xOrigin

qreal QGraphicsItemPrivate::TransformData::xOrigin

◆ yOrigin

qreal QGraphicsItemPrivate::TransformData::yOrigin

The documentation for this struct was generated from the following file: