src/gui/painting/qtransform.cpp
changeset 33 3e2da88830cd
parent 30 5dc02b23752f
equal deleted inserted replaced
30:5dc02b23752f 33:3e2da88830cd
   146 
   146 
   147     By default, QPainter operates on the associated device's own
   147     By default, QPainter operates on the associated device's own
   148     coordinate system.  The standard coordinate system of a
   148     coordinate system.  The standard coordinate system of a
   149     QPaintDevice has its origin located at the top-left position. The
   149     QPaintDevice has its origin located at the top-left position. The
   150     \e x values increase to the right; \e y values increase
   150     \e x values increase to the right; \e y values increase
   151     downward. For a complete description, see the \l {The Coordinate
   151     downward. For a complete description, see the \l {Coordinate
   152     System}{coordinate system} documentation.
   152     System} {coordinate system} documentation.
   153 
   153 
   154     QPainter has functions to translate, scale, shear and rotate the
   154     QPainter has functions to translate, scale, shear and rotate the
   155     coordinate system without using a QTransform. For example:
   155     coordinate system without using a QTransform. For example:
   156 
   156 
   157     \table 100%
   157     \table 100%
   221     \o \inlineimage qtransform-combinedtransformation2.png
   221     \o \inlineimage qtransform-combinedtransformation2.png
   222     \o
   222     \o
   223     \snippet doc/src/snippets/transform/main.cpp 2
   223     \snippet doc/src/snippets/transform/main.cpp 2
   224     \endtable
   224     \endtable
   225 
   225 
   226     \sa QPainter, {The Coordinate System}, {demos/affine}{Affine
   226     \sa QPainter, {Coordinate System}, {demos/affine}{Affine
   227     Transformations Demo}, {Transformations Example}
   227     Transformations Demo}, {Transformations Example}
   228 */
   228 */
   229 
   229 
   230 /*!
   230 /*!
   231     \enum QTransform::TransformationType
   231     \enum QTransform::TransformationType
  1026     \relates QTransform
  1026     \relates QTransform
  1027 
  1027 
  1028     Writes the given \a matrix to the given \a stream and returns a
  1028     Writes the given \a matrix to the given \a stream and returns a
  1029     reference to the stream.
  1029     reference to the stream.
  1030 
  1030 
  1031     \sa {Format of the QDataStream Operators}
  1031     \sa {Serializing Qt Data Types}
  1032 */
  1032 */
  1033 QDataStream & operator<<(QDataStream &s, const QTransform &m)
  1033 QDataStream & operator<<(QDataStream &s, const QTransform &m)
  1034 {
  1034 {
  1035     s << double(m.m11())
  1035     s << double(m.m11())
  1036       << double(m.m12())
  1036       << double(m.m12())
  1050     \relates QTransform
  1050     \relates QTransform
  1051 
  1051 
  1052     Reads the given \a matrix from the given \a stream and returns a
  1052     Reads the given \a matrix from the given \a stream and returns a
  1053     reference to the stream.
  1053     reference to the stream.
  1054 
  1054 
  1055     \sa {Format of the QDataStream Operators}
  1055     \sa {Serializing Qt Data Types}
  1056 */
  1056 */
  1057 QDataStream & operator>>(QDataStream &s, QTransform &t)
  1057 QDataStream & operator>>(QDataStream &s, QTransform &t)
  1058 {
  1058 {
  1059      double m11, m12, m13,
  1059      double m11, m12, m13,
  1060          m21, m22, m23,
  1060          m21, m22, m23,
  1624     matrix.
  1624     matrix.
  1625 */
  1625 */
  1626 QPainterPath QTransform::map(const QPainterPath &path) const
  1626 QPainterPath QTransform::map(const QPainterPath &path) const
  1627 {
  1627 {
  1628     TransformationType t = inline_type();
  1628     TransformationType t = inline_type();
  1629     if (t == TxNone || path.isEmpty())
  1629     if (t == TxNone || path.elementCount() == 0)
  1630         return path;
  1630         return path;
  1631 
  1631 
  1632     if (t >= TxProject)
  1632     if (t >= TxProject)
  1633         return mapProjective(*this, path);
  1633         return mapProjective(*this, path);
  1634 
  1634