Qt 4.8
Classes | Functions
qtransform.h File Reference
#include <QtGui/qmatrix.h>
#include <QtGui/qpainterpath.h>
#include <QtGui/qpolygon.h>
#include <QtGui/qregion.h>
#include <QtGui/qwindowdefs.h>
#include <QtCore/qline.h>
#include <QtCore/qpoint.h>
#include <QtCore/qrect.h>

Go to the source code of this file.

Classes

class  QTransform
 The QTransform class specifies 2D transformations of a coordinate system. More...
 

Functions

Q_GUI_EXPORT_INLINE QPoint operator* (const QPoint &p, const QTransform &m)
 
Q_GUI_EXPORT_INLINE QPointF operator* (const QPointF &p, const QTransform &m)
 
Q_GUI_EXPORT_INLINE QLineF operator* (const QLineF &l, const QTransform &m)
 
Q_GUI_EXPORT_INLINE QLine operator* (const QLine &l, const QTransform &m)
 
Q_GUI_EXPORT_INLINE QPolygon operator* (const QPolygon &a, const QTransform &m)
 
Q_GUI_EXPORT_INLINE QPolygonF operator* (const QPolygonF &a, const QTransform &m)
 
Q_GUI_EXPORT_INLINE QRegion operator* (const QRegion &r, const QTransform &m)
 
Q_GUI_EXPORT_INLINE QPainterPath operator* (const QPainterPath &p, const QTransform &m)
 
Q_GUI_EXPORT_INLINE QTransform operator* (const QTransform &a, qreal n)
 
Q_GUI_EXPORT_INLINE QTransform operator+ (const QTransform &a, qreal n)
 
Q_GUI_EXPORT_INLINE QTransform operator- (const QTransform &a, qreal n)
 
Q_GUI_EXPORT_INLINE QTransform operator/ (const QTransform &a, qreal n)
 
Q_GUI_EXPORT QDataStreamoperator<< (QDataStream &, const QTransform &)
 
Q_GUI_EXPORT QDebug operator<< (QDebug, const QTransform &)
 
Q_GUI_EXPORT QDataStreamoperator>> (QDataStream &, QTransform &)
 
 Q_DECLARE_TYPEINFO (QTransform, Q_MOVABLE_TYPE)
 
bool qFuzzyCompare (const QTransform &t1, const QTransform &t2)
 

Function Documentation

◆ operator*() [1/9]

Q_GUI_EXPORT_INLINE QPoint operator* ( const QPoint p,
const QTransform m 
)
related

Definition at line 365 of file qtransform.h.

Referenced by QTransform::QTransform().

366 { return m.map(p); }
QPoint map(const QPoint &p) const
Creates and returns a QPoint object that is a copy of the given point, mapped into the coordinate sys...

◆ operator*() [2/9]

Q_GUI_EXPORT_INLINE QPointF operator* ( const QPointF p,
const QTransform m 
)
related

Definition at line 367 of file qtransform.h.

368 { return m.map(p); }
QPoint map(const QPoint &p) const
Creates and returns a QPoint object that is a copy of the given point, mapped into the coordinate sys...

◆ operator*() [3/9]

Q_GUI_EXPORT_INLINE QLineF operator* ( const QLineF l,
const QTransform m 
)
related

Definition at line 369 of file qtransform.h.

370 { return m.map(l); }
QPoint map(const QPoint &p) const
Creates and returns a QPoint object that is a copy of the given point, mapped into the coordinate sys...

◆ operator*() [4/9]

Q_GUI_EXPORT_INLINE QLine operator* ( const QLine l,
const QTransform m 
)
related

Definition at line 371 of file qtransform.h.

372 { return m.map(l); }
QPoint map(const QPoint &p) const
Creates and returns a QPoint object that is a copy of the given point, mapped into the coordinate sys...

◆ operator*() [5/9]

Q_GUI_EXPORT_INLINE QPolygon operator* ( const QPolygon a,
const QTransform m 
)
related

Definition at line 373 of file qtransform.h.

374 { return m.map(a); }
QPoint map(const QPoint &p) const
Creates and returns a QPoint object that is a copy of the given point, mapped into the coordinate sys...

◆ operator*() [6/9]

Q_GUI_EXPORT_INLINE QPolygonF operator* ( const QPolygonF a,
const QTransform m 
)
related

Definition at line 375 of file qtransform.h.

376 { return m.map(a); }
QPoint map(const QPoint &p) const
Creates and returns a QPoint object that is a copy of the given point, mapped into the coordinate sys...

◆ operator*() [7/9]

Q_GUI_EXPORT_INLINE QRegion operator* ( const QRegion r,
const QTransform m 
)
related

Definition at line 377 of file qtransform.h.

378 { return m.map(r); }
QPoint map(const QPoint &p) const
Creates and returns a QPoint object that is a copy of the given point, mapped into the coordinate sys...

◆ operator*() [8/9]

Q_GUI_EXPORT_INLINE QPainterPath operator* ( const QPainterPath p,
const QTransform m 
)
related

Definition at line 379 of file qtransform.h.

380 { return m.map(p); }
QPoint map(const QPoint &p) const
Creates and returns a QPoint object that is a copy of the given point, mapped into the coordinate sys...

◆ operator*() [9/9]

Q_GUI_EXPORT_INLINE QTransform operator* ( const QTransform a,
qreal  n 
)

Definition at line 382 of file qtransform.h.

383 { QTransform t(a); t *= n; return t; }
The QTransform class specifies 2D transformations of a coordinate system.
Definition: qtransform.h:65

◆ operator+()

Q_GUI_EXPORT_INLINE QTransform operator+ ( const QTransform a,
qreal  n 
)

Definition at line 386 of file qtransform.h.

387 { QTransform t(a); t += n; return t; }
The QTransform class specifies 2D transformations of a coordinate system.
Definition: qtransform.h:65

◆ operator-()

Q_GUI_EXPORT_INLINE QTransform operator- ( const QTransform a,
qreal  n 
)

Definition at line 388 of file qtransform.h.

389 { QTransform t(a); t -= n; return t; }
The QTransform class specifies 2D transformations of a coordinate system.
Definition: qtransform.h:65

◆ operator/()

Q_GUI_EXPORT_INLINE QTransform operator/ ( const QTransform a,
qreal  n 
)

Definition at line 384 of file qtransform.h.

385 { QTransform t(a); t /= n; return t; }
The QTransform class specifies 2D transformations of a coordinate system.
Definition: qtransform.h:65

◆ operator<<() [1/2]

Q_GUI_EXPORT QDataStream& operator<< ( QDataStream ,
const QTransform  
)
related

Definition at line 1064 of file qtransform.cpp.

Referenced by qFuzzyCompare().

1065 {
1066  s << double(m.m11())
1067  << double(m.m12())
1068  << double(m.m13())
1069  << double(m.m21())
1070  << double(m.m22())
1071  << double(m.m23())
1072  << double(m.m31())
1073  << double(m.m32())
1074  << double(m.m33());
1075  return s;
1076 }

◆ operator<<() [2/2]

Q_GUI_EXPORT QDebug operator<< ( QDebug  ,
const QTransform  
)

Definition at line 1115 of file qtransform.cpp.

1116 {
1117  static const char *typeStr[] =
1118  {
1119  "TxNone",
1120  "TxTranslate",
1121  "TxScale",
1122  0,
1123  "TxRotate",
1124  0, 0, 0,
1125  "TxShear",
1126  0, 0, 0, 0, 0, 0, 0,
1127  "TxProject"
1128  };
1129 
1130  dbg.nospace() << "QTransform(type=" << typeStr[m.type()] << ','
1131  << " 11=" << m.m11()
1132  << " 12=" << m.m12()
1133  << " 13=" << m.m13()
1134  << " 21=" << m.m21()
1135  << " 22=" << m.m22()
1136  << " 23=" << m.m23()
1137  << " 31=" << m.m31()
1138  << " 32=" << m.m32()
1139  << " 33=" << m.m33()
1140  << ')';
1141 
1142  return dbg.space();
1143 }

◆ operator>>()

Q_GUI_EXPORT QDataStream& operator>> ( QDataStream ,
QTransform  
)
related

Definition at line 1091 of file qtransform.cpp.

Referenced by qFuzzyCompare().

1092 {
1093  double m11, m12, m13,
1094  m21, m22, m23,
1095  m31, m32, m33;
1096 
1097  s >> m11;
1098  s >> m12;
1099  s >> m13;
1100  s >> m21;
1101  s >> m22;
1102  s >> m23;
1103  s >> m31;
1104  s >> m32;
1105  s >> m33;
1106  t.setMatrix(m11, m12, m13,
1107  m21, m22, m23,
1108  m31, m32, m33);
1109  return s;
1110 }

◆ Q_DECLARE_TYPEINFO()

Q_DECLARE_TYPEINFO ( QTransform  ,
Q_MOVABLE_TYPE   
)

◆ qFuzzyCompare()

bool qFuzzyCompare ( const QTransform t1,
const QTransform t2 
)
related

Definition at line 339 of file qtransform.h.

340 {
341  return qFuzzyCompare(t1.m11(), t2.m11())
342  && qFuzzyCompare(t1.m12(), t2.m12())
343  && qFuzzyCompare(t1.m13(), t2.m13())
344  && qFuzzyCompare(t1.m21(), t2.m21())
345  && qFuzzyCompare(t1.m22(), t2.m22())
346  && qFuzzyCompare(t1.m23(), t2.m23())
347  && qFuzzyCompare(t1.m31(), t2.m31())
348  && qFuzzyCompare(t1.m32(), t2.m32())
349  && qFuzzyCompare(t1.m33(), t2.m33());
350 }
qreal m32() const
Returns the vertical translation factor.
Definition: qtransform.h:265
qreal m21() const
Returns the horizontal shearing factor.
Definition: qtransform.h:249
qreal m22() const
Returns the vertical scaling factor.
Definition: qtransform.h:253
qreal m12() const
Returns the vertical shearing factor.
Definition: qtransform.h:241
qreal m31() const
Returns the horizontal translation factor.
Definition: qtransform.h:261
qreal m23() const
Returns the vertical projection factor.
Definition: qtransform.h:257
bool qFuzzyCompare(const QMatrix &m1, const QMatrix &m2)
The qFuzzyCompare function is for comparing two matrices using a fuzziness factor.
Definition: qmatrix.h:172
qreal m13() const
Returns the horizontal projection factor.
Definition: qtransform.h:245
qreal m11() const
Returns the horizontal scaling factor.
Definition: qtransform.h:237
qreal m33() const
Returns the division factor.
Definition: qtransform.h:269