QTransform m32 is a matrix element in the QTransform class of the Qt framework, which provides a set of matrix transformation functions for graphical user interface (GUI) elements. The matrix element represents the third row and second column of a 3x3 matrix that defines a two-dimensional transformation.
Example 1: Scaling Transformation This code example scales a rectangle by a factor of 2 along the y-axis.
QRectF rect(0, 0, 100, 50); // create a rectangle QTransform transformation; // create a transformation object transformation.setMatrix(1, 0, 0, 0, 2, 0, 0, 0, 1); // set scaling matrix QRectF transformedRect = transformation.mapRect(rect); // apply transformation to rectangle
Example 2: Rotation Transformation This code example rotates a line segment by 30 degrees around its midpoint.
QLineF line(0, 0, 100, 0); // create a line segment QTransform transformation; // create a transformation object transformation.setMatrix(cos(30), -sin(30), 50, sin(30), cos(30), 0, 0, 0, 1); // set rotation matrix QLineF transformedLine = transformation.map(line); // apply transformation to line segment
This code example demonstrates how to use the QTransform m32 matrix element in the Qt framework to perform two-dimensional transformations on GUI elements. This library is a part of the Qt GUI module, which is responsible for providing user interface components such as windows, widgets, and controls.
C++ (Cpp) QTransform::m32 - 30 examples found. These are the top rated real world C++ (Cpp) examples of QTransform::m32 extracted from open source projects. You can rate examples to help us improve the quality of examples.