- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files
- Directories
- Examples

- Class List
- Class Hierarchy
- Class Members

Public Types | Public Member Functions | Static Public Member Functions

# QTransform Class Reference

Search for all occurrences

## Detailed Description

Definition at line 65 of file qtransform.h.

`#include <qtransform.h>`

List of all members.

## Public Types
enum | TransformationType { TxNone = 0x00, TxTranslate = 0x01, TxScale = 0x02, TxRotate = 0x04, TxShear = 0x08, TxProject = 0x10 }
## Public Member Functions
| QTransform (Qt::Initialization)
| QTransform ()
| QTransform (qreal h11, qreal h12, qreal h13, qreal h21, qreal h22, qreal h23, qreal h31, qreal h32, qreal h33=1.0)
| QTransform (qreal h11, qreal h12, qreal h21, qreal h22, qreal dx, qreal dy)
| QTransform (const QMatrix &mtx)
bool | isAffine () const
bool | isIdentity () const
bool | isInvertible () const
bool | isScaling () const
bool | isRotating () const
bool | isTranslating () const
TransformationType | type () const
qreal | determinant () const
qreal | det () const
qreal | m11 () const
qreal | m12 () const
qreal | m13 () const
qreal | m21 () const
qreal | m22 () const
qreal | m23 () const
qreal | m31 () const
qreal | m32 () const
qreal | m33 () const
qreal | dx () const
qreal | dy () const
void | setMatrix (qreal m11, qreal m12, qreal m13, qreal m21, qreal m22, qreal m23, qreal m31, qreal m32, qreal m33)
QTransform | inverted (bool *invertible=0) const
QTransform | adjoint () const
QTransform | transposed () const
QTransform & | translate (qreal dx, qreal dy)
QTransform & | scale (qreal sx, qreal sy)
QTransform & | shear (qreal sh, qreal sv)
QTransform & | rotate (qreal a, Qt::Axis axis=Qt::ZAxis)
QTransform & | rotateRadians (qreal a, Qt::Axis axis=Qt::ZAxis)
bool | operator== (const QTransform &) const
bool | operator!= (const QTransform &) const
QTransform & | operator*= (const QTransform &)
QTransform | operator* (const QTransform &o) const
QTransform & | operator= (const QTransform &)
| operator QVariant () const
void | reset ()
QPoint | map (const QPoint &p) const
QPointF | map (const QPointF &p) const
QLine | map (const QLine &l) const
QLineF | map (const QLineF &l) const
QPolygonF | map (const QPolygonF &a) const
QPolygon | map (const QPolygon &a) const
QRegion | map (const QRegion &r) const
QPainterPath | map (const QPainterPath &p) const
QPolygon | mapToPolygon (const QRect &r) const
QRect | mapRect (const QRect &) const
QRectF | mapRect (const QRectF &) const
void | map (int x, int y, int *tx, int *ty) const
void | map (qreal x, qreal y, qreal *tx, qreal *ty) const
const QMatrix & | toAffine () const
QTransform & | operator*= (qreal div)
QTransform & | operator/= (qreal div)
QTransform & | operator+= (qreal div)
QTransform & | operator-= (qreal div)
## Static Public Member Functions
static bool | squareToQuad (const QPolygonF &square, QTransform &result)
static bool | quadToSquare (const QPolygonF &quad, QTransform &result)
static bool | quadToQuad (const QPolygonF &one, const QPolygonF &two, QTransform &result)
static QTransform | fromTranslate (qreal dx, qreal dy)
static QTransform | fromScale (qreal dx, qreal dy)

## Member Enumeration Documentation

enum TransformationType

Search for all occurrences

Enumerator:

  TxNone | Search for all occurrences
  TxTranslate | Search for all occurrences
  TxScale | Search for all occurrences
  TxRotate | Search for all occurrences
  TxShear | Search for all occurrences
  TxProject | Search for all occurrences

Definition at line 68 of file qtransform.h.

                                {
            TxNone      = 0x00,
            TxTranslate = 0x01,
            TxScale     = 0x02,
            TxRotate    = 0x04,
            TxShear     = 0x08,
            TxProject   = 0x10
        };

## Constructor & Destructor Documentation

QTransform | ( | Qt::Initialization |  | ) | `[inline, explicit]`

Definition at line 77 of file qtransform.h.

    : affine(Qt::Uninitialized) {}

QTransform | ( |  | ) |

QTransform | ( | qreal | h11,
|  | qreal | h12,
|  | qreal | h13,
|  | qreal | h21,
|  | qreal | h22,
|  | qreal | h23,
|  | qreal | h31,
|  | qreal | h32,
|  | qreal | h33 = `1.0`
| ) |  |

QTransform | ( | qreal | h11,
|  | qreal | h12,
|  | qreal | h21,
|  | qreal | h22,
|  | qreal | dx,
|  | qreal | dy
| ) |  |

QTransform | ( | const QMatrix & | mtx | ) | `[explicit]`

## Member Function Documentation

bool isAffine | ( |  | ) | const `[inline]`

Search for all occurrences

Definition at line 200 of file qtransform.h.

    {
        return inline_type() < TxProject;
    }

bool isIdentity | ( |  | ) | const `[inline]`

Search for all occurrences

Definition at line 204 of file qtransform.h.

    {
        return inline_type() == TxNone;
    }

bool isInvertible | ( |  | ) | const `[inline]`

Search for all occurrences

Definition at line 209 of file qtransform.h.

    {
        return !qFuzzyIsNull(determinant());
    }

bool isScaling | ( |  | ) | const `[inline]`

Search for all occurrences

Definition at line 214 of file qtransform.h.

    {
        return type() >= TxScale;
    }

bool isRotating | ( |  | ) | const `[inline]`

Search for all occurrences

Definition at line 218 of file qtransform.h.

    {
        return inline_type() >= TxRotate;
    }

bool isTranslating | ( |  | ) | const `[inline]`

Search for all occurrences

Definition at line 223 of file qtransform.h.

    {
        return inline_type() >= TxTranslate;
    }

TransformationType type | ( |  | ) | const

Search for all occurrences

qreal determinant | ( |  | ) | const `[inline]`

Search for all occurrences

Definition at line 228 of file qtransform.h.

    {
        return affine._m11*(m_33*affine._m22-affine._dy*m_23) -
            affine._m21*(m_33*affine._m12-affine._dy*m_13)+affine._dx*(m_23*affine._m12-affine._m22*m_13);
    }

qreal det | ( |  | ) | const `[inline]`

Search for all occurrences

Definition at line 233 of file qtransform.h.

    {
        return determinant();
    }

qreal m11 | ( |  | ) | const `[inline]`

Search for all occurrences

Definition at line 237 of file qtransform.h.

    {
        return affine._m11;
    }

qreal m12 | ( |  | ) | const `[inline]`

Search for all occurrences

Definition at line 241 of file qtransform.h.

    {
        return affine._m12;
    }

qreal m13 | ( |  | ) | const `[inline]`

Search for all occurrences

Definition at line 245 of file qtransform.h.

    {
        return m_13;
    }

qreal m21 | ( |  | ) | const `[inline]`

Search for all occurrences

Definition at line 249 of file qtransform.h.

    {
        return affine._m21;
    }

qreal m22 | ( |  | ) | const `[inline]`

Search for all occurrences

Definition at line 253 of file qtransform.h.

    {
        return affine._m22;
    }

qreal m23 | ( |  | ) | const `[inline]`

Search for all occurrences

Definition at line 257 of file qtransform.h.

    {
        return m_23;
    }

qreal m31 | ( |  | ) | const `[inline]`

Search for all occurrences

Definition at line 261 of file qtransform.h.

    {
        return affine._dx;
    }

qreal m32 | ( |  | ) | const `[inline]`

Search for all occurrences

Definition at line 265 of file qtransform.h.

    {
        return affine._dy;
    }

qreal m33 | ( |  | ) | const `[inline]`

Search for all occurrences

Definition at line 269 of file qtransform.h.

    {
        return m_33;
    }

qreal dx | ( |  | ) | const `[inline]`

Search for all occurrences

Definition at line 273 of file qtransform.h.

    {
        return affine._dx;
    }

qreal dy | ( |  | ) | const `[inline]`

Search for all occurrences

Definition at line 277 of file qtransform.h.

    {
        return affine._dy;
    }

void setMatrix | ( | qreal | m11,
|  | qreal | m12,
|  | qreal | m13,
|  | qreal | m21,
|  | qreal | m22,
|  | qreal | m23,
|  | qreal | m31,
|  | qreal | m32,
|  | qreal | m33
| ) |  |

Search for all occurrences

QTransform inverted | ( | bool * | invertible = `0` | ) | const

Search for all occurrences

QTransform adjoint | ( |  | ) | const

Search for all occurrences

QTransform transposed | ( |  | ) | const

Search for all occurrences

QTransform& translate | ( | qreal | dx,
|  | qreal | dy
| ) |  |

Search for all occurrences

QTransform& scale | ( | qreal | sx,
|  | qreal | sy
| ) |  |

Search for all occurrences

QTransform& shear | ( | qreal | sh,
|  | qreal | sv
| ) |  |

Search for all occurrences

QTransform& rotate | ( | qreal | a,
|  | Qt::Axis | axis = `Qt::ZAxis`
| ) |  |

Search for all occurrences

QTransform& rotateRadians | ( | qreal | a,
|  | Qt::Axis | axis = `Qt::ZAxis`
| ) |  |

Search for all occurrences

static bool squareToQuad | ( | const QPolygonF & | square,
|  | QTransform & | result
| ) |  | `[static]`

Search for all occurrences

static bool quadToSquare | ( | const QPolygonF & | quad,
|  | QTransform & | result
| ) |  | `[static]`

Search for all occurrences

static bool quadToQuad | ( | const QPolygonF & | one,
|  | const QPolygonF & | two,
|  | QTransform & | result
| ) |  | `[static]`

Search for all occurrences

bool operator== | ( | const QTransform & |  | ) | const

bool operator!= | ( | const QTransform & |  | ) | const

QTransform& operator*= | ( | const QTransform & |  | ) |

QTransform operator* | ( | const QTransform & | o | ) | const

QTransform& operator= | ( | const QTransform & |  | ) |

operator QVariant | ( |  | ) | const

void reset | ( |  | ) |

Search for all occurrences

QPoint map | ( | const QPoint & | p | ) | const

Search for all occurrences

QPointF map | ( | const QPointF & | p | ) | const

Search for all occurrences

QLine map | ( | const QLine & | l | ) | const

Search for all occurrences

QLineF map | ( | const QLineF & | l | ) | const

Search for all occurrences

QPolygonF map | ( | const QPolygonF & | a | ) | const

Search for all occurrences

QPolygon map | ( | const QPolygon & | a | ) | const

Search for all occurrences

QRegion map | ( | const QRegion & | r | ) | const

Search for all occurrences

QPainterPath map | ( | const QPainterPath & | p | ) | const

Search for all occurrences

QPolygon mapToPolygon | ( | const QRect & | r | ) | const

Search for all occurrences

QRect mapRect | ( | const QRect & |  | ) | const

Search for all occurrences

QRectF mapRect | ( | const QRectF & |  | ) | const

Search for all occurrences

void map | ( | int | x,
|  | int | y,
|  | int * | tx,
|  | int * | ty
| ) |  | const

Search for all occurrences

void map | ( | qreal | x,
|  | qreal | y,
|  | qreal * | tx,
|  | qreal * | ty
| ) |  | const

Search for all occurrences

const QMatrix& toAffine | ( |  | ) | const

Search for all occurrences

QTransform & operator*= | ( | qreal | div | ) | `[inline]`

Definition at line 282 of file qtransform.h.

    {
        if (num == 1.)
            return *this;
        affine._m11 *= num;
        affine._m12 *= num;
        m_13        *= num;
        affine._m21 *= num;
        affine._m22 *= num;
        m_23        *= num;
        affine._dx  *= num;
        affine._dy  *= num;
        m_33        *= num;
        if (m_dirty < TxScale)
            m_dirty = TxScale;
        return *this;
    }

QTransform & operator/= | ( | qreal | div | ) | `[inline]`

Definition at line 299 of file qtransform.h.

    {
        if (div == 0)
            return *this;
        div = 1/div;
        return operator*=(div);
    }

QTransform & operator+= | ( | qreal | div | ) | `[inline]`

Definition at line 306 of file qtransform.h.

    {
        if (num == 0)
            return *this;
        affine._m11 += num;
        affine._m12 += num;
        m_13        += num;
        affine._m21 += num;
        affine._m22 += num;
        m_23        += num;
        affine._dx  += num;
        affine._dy  += num;
        m_33        += num;
        m_dirty     = TxProject;
        return *this;
    }

QTransform & operator-= | ( | qreal | div | ) | `[inline]`

Definition at line 322 of file qtransform.h.

    {
        if (num == 0)
            return *this;
        affine._m11 -= num;
        affine._m12 -= num;
        m_13        -= num;
        affine._m21 -= num;
        affine._m22 -= num;
        m_23        -= num;
        affine._dx  -= num;
        affine._dy  -= num;
        m_33        -= num;
        m_dirty     = TxProject;
        return *this;
    }

static QTransform fromTranslate | ( | qreal | dx,
|  | qreal | dy
| ) |  | `[static]`

Search for all occurrences

static QTransform fromScale | ( | qreal | dx,
|  | qreal | dy
| ) |  | `[static]`

Search for all occurrences

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

- QtGui/qtransform.h

QTransform QTransform QTransform QTransform QTransform QTransform QTransform QTransform QTransform QTransform
QTransform QTransform QTransform QTransform QTransform QTransform QTransform QTransform QTransform QTransform