Skip to content

PythonQt.QtGui.QMatrix · declarations 001

Back to PythonQt.QtGui.QMatrix

determinant

determinant() -> float

X.determinant() -> float

Supplemental documentation: Qt 5 reference:

qreal QMatrix::determinant() const

Returns the matrix's determinant.

This function was introduced in Qt 4.6.

Upstream PySide2 reference signatures (binding differences may apply):

determinant(self) -> float

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

dx

dx() -> float

X.dx() -> float

Supplemental documentation: Qt 5 reference:

qreal QMatrix::dx() const

Returns the horizontal translation factor.

See also 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/qmatrix.html#dx

dy

dy() -> float

X.dy() -> float

Supplemental documentation: Qt 5 reference:

qreal QMatrix::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/qmatrix.html#dy

inverted

inverted(invertible: Any) -> Any

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

Supplemental documentation: Qt 5 reference:

QMatrix QMatrix::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.QMatrix, bool]

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

isIdentity

isIdentity() -> bool

X.isIdentity() -> bool

Supplemental documentation: Qt 5 reference:

bool QMatrix::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/qmatrix.html#isIdentity

isInvertible

isInvertible() -> bool

X.isInvertible() -> bool

Supplemental documentation: Qt 5 reference:

bool QMatrix::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/qmatrix.html#isInvertible

m11

m11() -> float

X.m11() -> float

Supplemental documentation: Qt 5 reference:

qreal QMatrix::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/qmatrix.html#m11

m12

m12() -> float

X.m12() -> float

Supplemental documentation: Qt 5 reference:

qreal QMatrix::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/qmatrix.html#m12

m21

m21() -> float

X.m21() -> float

Supplemental documentation: Qt 5 reference:

qreal QMatrix::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/qmatrix.html#m21

m22

m22() -> float

X.m22() -> float

Supplemental documentation: Qt 5 reference:

qreal QMatrix::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/qmatrix.html#m22

map

map(l: Any) -> Any

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

Supplemental documentation: Qt 5 reference:

void QMatrix::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

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

See also Basic Matrix Operations.

void QMatrix::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.

QPoint QMatrix::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 QMatrix::map(const QPointF \&point) const

This is an overloaded function.

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

QLine QMatrix::map(const QLine \&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.

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

This is an overloaded function.

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

QPolygonF QMatrix::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 QMatrix::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 QMatrix::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 QMatrix::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.

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: int, y: int) -> typing.Tuple[int, int]
map(self, x: float, y: float) -> typing.Tuple[float, float]

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

mapRect

mapRect(arg__1: Any) -> Any

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

Supplemental documentation: Qt 5 reference:

QRectF QMatrix::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 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 QMatrix::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/qmatrix.html#mapRect

mapToPolygon

mapToPolygon(r: Any) -> Any

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

Supplemental documentation: Qt 5 reference:

QPolygon QMatrix::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

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/qmatrix.html#mapToPolygon

reset

reset() -> None

X.reset()

Supplemental documentation: Qt 5 reference:

void QMatrix::reset()

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

See also QMatrix(), 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/qmatrix.html#reset

rotate

rotate(a: float) -> Any

X.rotate(a) -> PythonQt.QtGui.QMatrix

Supplemental documentation: Qt 5 reference:

QMatrix \&QMatrix::rotate(qreal degrees)

Rotates the coordinate system the given degrees counterclockwise.

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

Returns a reference to the matrix.

See also setMatrix().

Upstream PySide2 reference signatures (binding differences may apply):

rotate(self, a: float) -> PySide2.QtGui.QMatrix

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

scale

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

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

Supplemental documentation: Qt 5 reference:

QMatrix \&QMatrix::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.QMatrix

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

setMatrix

setMatrix(m11: float, m12: float, m21: float, m22: float, dx: float, dy: float) -> None

X.setMatrix(m11, m12, m21, m22, dx, dy)

Supplemental documentation: Qt 5 reference:

void QMatrix::setMatrix(qreal m11, qreal m12, qreal m21, qreal m22, qreal dx, qreal dy)

Sets the matrix elements to the specified values, m11, m12, m21, m22, dx and dy.

Note that this function replaces the previous values. QMatrix provide the translate(), rotate(), scale() and shear() convenience functions to manipulate the various matrix elements based on the currently defined coordinate system.

See also QMatrix().

Upstream PySide2 reference signatures (binding differences may apply):

setMatrix(self, m11: float, m12: float, m21: float, m22: float, dx: float, dy: float) -> None

Source: https://doc.qt.io/archives/qt-5.15/qmatrix.html#setMatrix

shear

shear(sh: float, sv: float) -> Any

X.shear(sh, sv) -> PythonQt.QtGui.QMatrix

Supplemental documentation: Qt 5 reference:

QMatrix \&QMatrix::shear(qreal sh, qreal sv)

Shears the coordinate system by sh horizontally and sv vertically, and returns a reference to the matrix.

See also setMatrix().

Upstream PySide2 reference signatures (binding differences may apply):

shear(self, sh: float, sv: float) -> PySide2.QtGui.QMatrix

Source: https://doc.qt.io/archives/qt-5.15/qmatrix.html#shear

translate

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

X.translate(dx, dy) -> PythonQt.QtGui.QMatrix

Supplemental documentation: Qt 5 reference:

QMatrix \&QMatrix::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 the matrix.

See also setMatrix().

Upstream PySide2 reference signatures (binding differences may apply):

translate(self, dx: float, dy: float) -> PySide2.QtGui.QMatrix

Source: https://doc.qt.io/archives/qt-5.15/qmatrix.html#translate