Skip to content

PythonQt.QtGui.QTransform · declarations 001

Back to PythonQt.QtGui.QTransform

TransformationType instance-attribute

TransformationType: type

int([x]) -> integer int(x, base=10) -> integer

Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.

If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.

int('0b100', base=0) 4

TxNone instance-attribute

TxNone: Any

TxProject instance-attribute

TxProject: Any

TxRotate instance-attribute

TxRotate: Any

TxScale instance-attribute

TxScale: Any

TxShear instance-attribute

TxShear: Any

TxTranslate instance-attribute

TxTranslate: Any

adjoint

adjoint() -> Any

X.adjoint() -> PythonQt.QtGui.QTransform

Supplemental documentation: Qt 5 reference:

QTransform QTransform::adjoint() const

Returns the adjoint of this matrix.

Upstream PySide2 reference signatures (binding differences may apply):

adjoint(self) -> PySide2.QtGui.QTransform

Source: https://doc.qt.io/archives/qt-5.15/qtransform.html#adjoint

det

det() -> float

X.det() -> float

Upstream PySide2 reference signatures (binding differences may apply):

det(self) -> float

Source: https://doc.qt.io/archives/qt-5.15/qtransform.html#det

determinant

determinant() -> float

X.determinant() -> float

Supplemental documentation: Qt 5 reference:

qreal QTransform::determinant() const

Returns the matrix's determinant.

Upstream PySide2 reference signatures (binding differences may apply):

determinant(self) -> float

Source: https://doc.qt.io/archives/qt-5.15/qtransform.html#determinant

dx

dx() -> float

X.dx() -> float

Supplemental documentation: Qt 5 reference:

qreal QTransform::dx() const

Returns the horizontal translation factor.

See also m31(), translate(), and Basic Matrix Operations.

Upstream PySide2 reference signatures (binding differences may apply):

dx(self) -> float

Source: https://doc.qt.io/archives/qt-5.15/qtransform.html#dx

dy

dy() -> float

X.dy() -> float

Supplemental documentation: Qt 5 reference:

qreal QTransform::dy() const

Returns the vertical translation factor.

See also translate() and Basic Matrix Operations.

Upstream PySide2 reference signatures (binding differences may apply):

dy(self) -> float

Source: https://doc.qt.io/archives/qt-5.15/qtransform.html#dy

fromScale

fromScale(dx: float, dy: float) -> Any

X.fromScale(dx, dy) -> PythonQt.QtGui.QTransform

Supplemental documentation: Qt 5 reference:

[static] QTransform QTransform::fromScale(qreal sx, qreal sy)

Creates a matrix which corresponds to a scaling of sx horizontally and sy vertically. This is the same as QTransform().scale(sx, sy) but slightly faster.

This function was introduced in Qt 4.5.

Upstream PySide2 reference signatures (binding differences may apply):

fromScale(dx: float, dy: float) -> PySide2.QtGui.QTransform

Source: https://doc.qt.io/archives/qt-5.15/qtransform.html#fromScale

fromTranslate

fromTranslate(dx: float, dy: float) -> Any

X.fromTranslate(dx, dy) -> PythonQt.QtGui.QTransform

Supplemental documentation: Qt 5 reference:

[static] QTransform QTransform::fromTranslate(qreal dx, qreal dy)

Creates a matrix which corresponds to a translation of dx along the x axis and dy along the y axis. This is the same as QTransform().translate(dx, dy) but slightly faster.

This function was introduced in Qt 4.5.

Upstream PySide2 reference signatures (binding differences may apply):

fromTranslate(dx: float, dy: float) -> PySide2.QtGui.QTransform

Source: https://doc.qt.io/archives/qt-5.15/qtransform.html#fromTranslate

inverted

inverted(invertible: Any) -> Any

X.inverted(invertible) -> PythonQt.QtGui.QTransform

Supplemental documentation: Qt 5 reference:

QTransform QTransform::inverted(bool *invertible \= nullptr) const

Returns an inverted copy of this matrix.

If the matrix is singular (not invertible), the returned matrix is the identity matrix. If invertible is valid (i.e. not 0), its value is set to true if the matrix is invertible, otherwise it is set to false.

See also isInvertible().

Upstream PySide2 reference signatures (binding differences may apply):

inverted(self) -> typing.Tuple[PySide2.QtGui.QTransform, bool]

Source: https://doc.qt.io/archives/qt-5.15/qtransform.html#inverted

isAffine

isAffine() -> bool

X.isAffine() -> bool

Supplemental documentation: Qt 5 reference:

bool QTransform::isAffine() const

Returns true if the matrix represent an affine transformation, otherwise returns false.

Upstream PySide2 reference signatures (binding differences may apply):

isAffine(self) -> bool

Source: https://doc.qt.io/archives/qt-5.15/qtransform.html#isAffine

isIdentity

isIdentity() -> bool

X.isIdentity() -> bool

Supplemental documentation: Qt 5 reference:

bool QTransform::isIdentity() const

Returns true if the matrix is the identity matrix, otherwise returns false.

See also reset().

Upstream PySide2 reference signatures (binding differences may apply):

isIdentity(self) -> bool

Source: https://doc.qt.io/archives/qt-5.15/qtransform.html#isIdentity

isInvertible

isInvertible() -> bool

X.isInvertible() -> bool

Supplemental documentation: Qt 5 reference:

bool QTransform::isInvertible() const

Returns true if the matrix is invertible, otherwise returns false.

See also inverted().

Upstream PySide2 reference signatures (binding differences may apply):

isInvertible(self) -> bool

Source: https://doc.qt.io/archives/qt-5.15/qtransform.html#isInvertible

isRotating

isRotating() -> bool

X.isRotating() -> bool

Supplemental documentation: Qt 5 reference:

bool QTransform::isRotating() const

Returns true if the matrix represents some kind of a rotating transformation, otherwise returns false.

Note: A rotation transformation of 180 degrees and/or 360 degrees is treated as a scaling transformation.

See also reset().

Upstream PySide2 reference signatures (binding differences may apply):

isRotating(self) -> bool

Source: https://doc.qt.io/archives/qt-5.15/qtransform.html#isRotating

isScaling

isScaling() -> bool

X.isScaling() -> bool

Supplemental documentation: Qt 5 reference:

bool QTransform::isScaling() const

Returns true if the matrix represents a scaling transformation, otherwise returns false.

See also reset().

Upstream PySide2 reference signatures (binding differences may apply):

isScaling(self) -> bool

Source: https://doc.qt.io/archives/qt-5.15/qtransform.html#isScaling

isTranslating

isTranslating() -> bool

X.isTranslating() -> bool

Supplemental documentation: Qt 5 reference:

bool QTransform::isTranslating() const

Returns true if the matrix represents a translating transformation, otherwise returns false.

See also reset().

Upstream PySide2 reference signatures (binding differences may apply):

isTranslating(self) -> bool

Source: https://doc.qt.io/archives/qt-5.15/qtransform.html#isTranslating

m11

m11() -> float

X.m11() -> float

Supplemental documentation: Qt 5 reference:

qreal QTransform::m11() const

Returns the horizontal scaling factor.

See also scale() and Basic Matrix Operations.

Upstream PySide2 reference signatures (binding differences may apply):

m11(self) -> float

Source: https://doc.qt.io/archives/qt-5.15/qtransform.html#m11

m12

m12() -> float

X.m12() -> float

Supplemental documentation: Qt 5 reference:

qreal QTransform::m12() const

Returns the vertical shearing factor.

See also shear() and Basic Matrix Operations.

Upstream PySide2 reference signatures (binding differences may apply):

m12(self) -> float

Source: https://doc.qt.io/archives/qt-5.15/qtransform.html#m12

m13

m13() -> float

X.m13() -> float

Supplemental documentation: Qt 5 reference:

qreal QTransform::m13() const

Returns the horizontal projection factor.

See also translate() and Basic Matrix Operations.

Upstream PySide2 reference signatures (binding differences may apply):

m13(self) -> float

Source: https://doc.qt.io/archives/qt-5.15/qtransform.html#m13

m21

m21() -> float

X.m21() -> float

Supplemental documentation: Qt 5 reference:

qreal QTransform::m21() const

Returns the horizontal shearing factor.

See also shear() and Basic Matrix Operations.

Upstream PySide2 reference signatures (binding differences may apply):

m21(self) -> float

Source: https://doc.qt.io/archives/qt-5.15/qtransform.html#m21

m22

m22() -> float

X.m22() -> float

Supplemental documentation: Qt 5 reference:

qreal QTransform::m22() const

Returns the vertical scaling factor.

See also scale() and Basic Matrix Operations.

Upstream PySide2 reference signatures (binding differences may apply):

m22(self) -> float

Source: https://doc.qt.io/archives/qt-5.15/qtransform.html#m22

m23

m23() -> float

X.m23() -> float

Supplemental documentation: Qt 5 reference:

qreal QTransform::m23() const

Returns the vertical projection factor.

See also translate() and Basic Matrix Operations.

Upstream PySide2 reference signatures (binding differences may apply):

m23(self) -> float

Source: https://doc.qt.io/archives/qt-5.15/qtransform.html#m23

m31

m31() -> float

X.m31() -> float

Supplemental documentation: Qt 5 reference:

qreal QTransform::m31() const

Returns the horizontal translation factor.

See also dx(), translate(), and Basic Matrix Operations.

Upstream PySide2 reference signatures (binding differences may apply):

m31(self) -> float

Source: https://doc.qt.io/archives/qt-5.15/qtransform.html#m31

m32

m32() -> float

X.m32() -> float

Supplemental documentation: Qt 5 reference:

qreal QTransform::m32() const

Returns the vertical translation factor.

See also dy(), translate(), and Basic Matrix Operations.

Upstream PySide2 reference signatures (binding differences may apply):

m32(self) -> float

Source: https://doc.qt.io/archives/qt-5.15/qtransform.html#m32

m33

m33() -> float

X.m33() -> float

Supplemental documentation: Qt 5 reference:

qreal QTransform::m33() const

Returns the division factor.

See also translate() and Basic Matrix Operations.

Upstream PySide2 reference signatures (binding differences may apply):

m33(self) -> float

Source: https://doc.qt.io/archives/qt-5.15/qtransform.html#m33

map

map(l: Any) -> Any

X.map(l) -> PythonQt.QtCore.QLine

Supplemental documentation: Qt 5 reference:

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

Maps the given coordinates x and y into the coordinate system defined by this matrix. The resulting values are put in *tx and *ty, respectively.

The coordinates are transformed using the following formulas:

x' = m11*x + m21*y + dx
y' = m22*y + m12*x + dy
if (!isAffine()) {
    w' = m13*x + m23*y + m33
    x' /= w'
    y' /= w'
}

The point (x, y) is the original point, and (x', y') is the transformed point.

See also Basic Matrix Operations.

QPoint QTransform::map(const QPoint \&point) const

This is an overloaded function.

Creates and returns a QPoint object that is a copy of the given point, mapped into the coordinate system defined by this matrix. Note that the transformed coordinates are rounded to the nearest integer.

QPointF QTransform::map(const QPointF \&p) const

This is an overloaded function.

Creates and returns a QPointF object that is a copy of the given point, p, mapped into the coordinate system defined by this matrix.

QLine QTransform::map(const QLine \&l) const

This is an overloaded function.

Creates and returns a QLineF object that is a copy of the given line, l, mapped into the coordinate system defined by this matrix.

QLineF QTransform::map(const QLineF \&line) const

This is an overloaded function.

Creates and returns a QLine object that is a copy of the given line, mapped into the coordinate system defined by this matrix. Note that the transformed coordinates are rounded to the nearest integer.

QPolygonF QTransform::map(const QPolygonF \&polygon) const

This is an overloaded function.

Creates and returns a QPolygonF object that is a copy of the given polygon, mapped into the coordinate system defined by this matrix.

QPolygon QTransform::map(const QPolygon \&polygon) const

This is an overloaded function.

Creates and returns a QPolygon object that is a copy of the given polygon, mapped into the coordinate system defined by this matrix. Note that the transformed coordinates are rounded to the nearest integer.

QRegion QTransform::map(const QRegion \&region) const

This is an overloaded function.

Creates and returns a QRegion object that is a copy of the given region, mapped into the coordinate system defined by this matrix.

Calling this method can be rather expensive if rotations or shearing are used.

QPainterPath QTransform::map(const QPainterPath \&path) const

This is an overloaded function.

Creates and returns a QPainterPath object that is a copy of the given path, mapped into the coordinate system defined by this matrix.

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

This is an overloaded function.

Maps the given coordinates x and y into the coordinate system defined by this matrix. The resulting values are put in *tx and *ty, respectively. Note that the transformed coordinates are rounded to the nearest integer.

Upstream PySide2 reference signatures (binding differences may apply):

map(self, a: PySide2.QtGui.QPolygon) -> PySide2.QtGui.QPolygon
map(self, a: PySide2.QtGui.QPolygonF) -> PySide2.QtGui.QPolygonF
map(self, l: PySide2.QtCore.QLine) -> PySide2.QtCore.QLine
map(self, l: PySide2.QtCore.QLineF) -> PySide2.QtCore.QLineF
map(self, p: PySide2.QtCore.QPoint) -> PySide2.QtCore.QPoint
map(self, p: PySide2.QtCore.QPointF) -> PySide2.QtCore.QPointF
map(self, p: PySide2.QtGui.QPainterPath) -> PySide2.QtGui.QPainterPath
map(self, r: PySide2.QtGui.QRegion) -> PySide2.QtGui.QRegion
map(self, x: float, y: float) -> typing.Tuple[float, float]

Source: https://doc.qt.io/archives/qt-5.15/qtransform.html#map

mapRect

mapRect(arg__1: Any) -> Any

X.mapRect(arg__1) -> PythonQt.QtCore.QRect

Supplemental documentation: Qt 5 reference:

QRectF QTransform::mapRect(const QRectF \&rectangle) const

Creates and returns a QRectF object that is a copy of the given rectangle, mapped into the coordinate system defined by this matrix.

The rectangle's coordinates are transformed using the following formulas:

x' = m11*x + m21*y + dx
y' = m22*y + m12*x + dy
if (!isAffine()) {
    w' = m13*x + m23*y + m33
    x' /= w'
    y' /= w'
}

If rotation or shearing has been specified, this function returns the bounding rectangle. To retrieve the exact region the given rectangle maps to, use the mapToPolygon() function instead.

See also mapToPolygon() and Basic Matrix Operations.

QRect QTransform::mapRect(const QRect \&rectangle) const

This is an overloaded function.

Creates and returns a QRect object that is a copy of the given rectangle, mapped into the coordinate system defined by this matrix. Note that the transformed coordinates are rounded to the nearest integer.

Upstream PySide2 reference signatures (binding differences may apply):

mapRect(self, arg__1: PySide2.QtCore.QRect) -> PySide2.QtCore.QRect
mapRect(self, arg__1: PySide2.QtCore.QRectF) -> PySide2.QtCore.QRectF

Source: https://doc.qt.io/archives/qt-5.15/qtransform.html#mapRect

mapToPolygon

mapToPolygon(r: Any) -> Any

X.mapToPolygon(r) -> PythonQt.QtGui.QPolygon

Supplemental documentation: Qt 5 reference:

QPolygon QTransform::mapToPolygon(const QRect \&rectangle) const

Creates and returns a QPolygon representation of the given rectangle, mapped into the coordinate system defined by this matrix.

The rectangle's coordinates are transformed using the following formulas:

x' = m11*x + m21*y + dx
y' = m22*y + m12*x + dy
if (!isAffine()) {
    w' = m13*x + m23*y + m33
    x' /= w'
    y' /= w'
}

Polygons and rectangles behave slightly differently when transformed (due to integer rounding), so matrix.map(QPolygon(rectangle)) is not always the same as matrix.mapToPolygon(rectangle).

See also mapRect() and Basic Matrix Operations.

Upstream PySide2 reference signatures (binding differences may apply):

mapToPolygon(self, r: PySide2.QtCore.QRect) -> PySide2.QtGui.QPolygon

Source: https://doc.qt.io/archives/qt-5.15/qtransform.html#mapToPolygon

multiplied

multiplied(o: Any) -> Any

X.multiplied(o) -> PythonQt.QtGui.QTransform

quadToQuad

quadToQuad(one: Any, two: Any, result: Any) -> bool

X.quadToQuad(one, two, result) -> bool

Supplemental documentation: Qt 5 reference:

[static] bool QTransform::quadToQuad(const QPolygonF \&one, const QPolygonF \&two, QTransform \&trans)

Creates a transformation matrix, trans, that maps a four-sided polygon, one, to another four-sided polygon, two. Returns true if the transformation is possible; otherwise returns false.

This is a convenience method combining quadToSquare() and squareToQuad() methods. It allows the input quad to be transformed into any other quad.

See also squareToQuad() and quadToSquare().

Upstream PySide2 reference signatures (binding differences may apply):

quadToQuad(arg__1: PySide2.QtGui.QPolygonF, arg__2: PySide2.QtGui.QPolygonF) -> object
quadToQuad(one: PySide2.QtGui.QPolygonF, two: PySide2.QtGui.QPolygonF, result: PySide2.QtGui.QTransform) -> bool

Source: https://doc.qt.io/archives/qt-5.15/qtransform.html#quadToQuad

quadToSquare

quadToSquare(quad: Any, result: Any) -> bool

X.quadToSquare(quad, result) -> bool

Supplemental documentation: Qt 5 reference:

[static] bool QTransform::quadToSquare(const QPolygonF \&quad, QTransform \&trans)

Creates a transformation matrix, trans, that maps a four-sided polygon, quad, to a unit square. Returns true if the transformation is constructed or false if such a transformation does not exist.

See also squareToQuad() and quadToQuad().

Upstream PySide2 reference signatures (binding differences may apply):

quadToSquare(arg__1: PySide2.QtGui.QPolygonF) -> object
quadToSquare(quad: PySide2.QtGui.QPolygonF, result: PySide2.QtGui.QTransform) -> bool

Source: https://doc.qt.io/archives/qt-5.15/qtransform.html#quadToSquare

reset

reset() -> None

X.reset()

Supplemental documentation: Qt 5 reference:

void QTransform::reset()

Resets the matrix to an identity matrix, i.e. all elements are set to zero, except m11 and m22 (specifying the scale) and m33 which are set to 1.

See also QTransform(), isIdentity(), and Basic Matrix Operations.

Upstream PySide2 reference signatures (binding differences may apply):

reset(self) -> None

Source: https://doc.qt.io/archives/qt-5.15/qtransform.html#reset

rotate

rotate(a: float, axis: Any) -> Any

X.rotate(a, axis) -> PythonQt.QtGui.QTransform

Supplemental documentation: Qt 5 reference:

QTransform \&QTransform::rotate(qreal angle, Qt::Axis axis \= Qt::ZAxis)

Rotates the coordinate system counterclockwise by the given angle about the specified axis and returns a reference to the matrix.

Note that if you apply a QTransform to a point defined in widget coordinates, the direction of the rotation will be clockwise because the y-axis points downwards.

The angle is specified in degrees.

See also setMatrix().

Upstream PySide2 reference signatures (binding differences may apply):

rotate(self, a: float, axis: PySide2.QtCore.Qt.Axis=...) -> PySide2.QtGui.QTransform

Source: https://doc.qt.io/archives/qt-5.15/qtransform.html#rotate

rotateRadians

rotateRadians(a: float, axis: Any) -> Any

X.rotateRadians(a, axis) -> PythonQt.QtGui.QTransform

Supplemental documentation: Qt 5 reference:

QTransform \&QTransform::rotateRadians(qreal angle, Qt::Axis axis \= Qt::ZAxis)

Rotates the coordinate system counterclockwise by the given angle about the specified axis and returns a reference to the matrix.

Note that if you apply a QTransform to a point defined in widget coordinates, the direction of the rotation will be clockwise because the y-axis points downwards.

The angle is specified in radians.

See also setMatrix().

Upstream PySide2 reference signatures (binding differences may apply):

rotateRadians(self, a: float, axis: PySide2.QtCore.Qt.Axis=...) -> PySide2.QtGui.QTransform

Source: https://doc.qt.io/archives/qt-5.15/qtransform.html#rotateRadians

scale

scale(sx: float, sy: float) -> Any

X.scale(sx, sy) -> PythonQt.QtGui.QTransform

Supplemental documentation: Qt 5 reference:

QTransform \&QTransform::scale(qreal sx, qreal sy)

Scales the coordinate system by sx horizontally and sy vertically, and returns a reference to the matrix.

See also setMatrix().

Upstream PySide2 reference signatures (binding differences may apply):

scale(self, sx: float, sy: float) -> PySide2.QtGui.QTransform

Source: https://doc.qt.io/archives/qt-5.15/qtransform.html#scale