C

Matrix4x4 QML Type

Provides a 4x4 matrix to transform an Item. More...

Import Statement: import QtQuick .
Since: Qt Quick Ultralite 1.7

Properties

Detailed Description

The Matrix4x4 type provides a 4x4 matrix to transform an Item. It supports rotation, scale, translation and shearing, using a single transformation in the 4x4 matrix. The following example rotates a Text item at a 45-degree angle (PI/4):

    Rectangle {
        color: "#41CD52"
        Text {
            anchors.centerIn: parent
            font.pixelSize: 30
            text: "Qt for MCUs"

            transform: Matrix4x4 {
                property real a: Math.PI / 4
                matrix: Qt.matrix4x4(Math.cos(a), -Math.sin(a), 0, 0,
                                     Math.sin(a),  Math.cos(a), 0, 0,
                                     0,           0,            1, 0,
                                     0,           0,            0, 1)
            }
        }
    }

See also matrix4x4.

Property Documentation

matrix : matrix4x4

The 4x4 matrix used in the transformation of an Item


Available under certain Qt licenses.
Find out more.