Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
QPainter::PixmapFragment Class Reference

This class is used in conjunction with the QPainter::drawPixmapFragments() function to specify how a pixmap, or sub-rect of a pixmap, is drawn. More...

#include <qpainter.h>

+ Collaboration diagram for QPainter::PixmapFragment:

Static Public Member Functions

static PixmapFragment Q_GUI_EXPORT create (const QPointF &pos, const QRectF &sourceRect, qreal scaleX=1, qreal scaleY=1, qreal rotation=0, qreal opacity=1)
 

Public Attributes

qreal x
 
qreal y
 
qreal sourceLeft
 
qreal sourceTop
 
qreal width
 
qreal height
 
qreal scaleX
 
qreal scaleY
 
qreal rotation
 
qreal opacity
 

Detailed Description

This class is used in conjunction with the QPainter::drawPixmapFragments() function to specify how a pixmap, or sub-rect of a pixmap, is drawn.

Since
4.7

\inmodule QtGui

The sourceLeft, sourceTop, width and height variables are used as a source rectangle within the pixmap passed into the QPainter::drawPixmapFragments() function. The variables x, y, width and height are used to calculate the target rectangle that is drawn. x and y denotes the center of the target rectangle. The width and height in the target rectangle is scaled by the scaleX and scaleY values. The resulting target rectangle is then rotated rotation degrees around the x, y center point.

See also
QPainter::drawPixmapFragments()

Definition at line 64 of file qpainter.h.

Member Function Documentation

◆ create()

QPainter::PixmapFragment QPainter::PixmapFragment::create ( const QPointF & pos,
const QRectF & sourceRect,
qreal scaleX = 1,
qreal scaleY = 1,
qreal rotation = 0,
qreal opacity = 1 )
static
Since
4.7

This is a convenience function that returns a QPainter::PixmapFragment that is initialized with the pos, sourceRect, scaleX, scaleY, rotation, opacity parameters.

Definition at line 8084 of file qpainter.cpp.

References QRectF::height(), opacity, pos, rotation, scaleX, scaleY, QRectF::width(), QRectF::x(), x, and QRectF::y().

+ Here is the call graph for this function:

Member Data Documentation

◆ height

◆ opacity

◆ rotation

qreal QPainter::PixmapFragment::rotation

Definition at line 74 of file qpainter.h.

Referenced by create().

◆ scaleX

◆ scaleY

◆ sourceLeft

qreal QPainter::PixmapFragment::sourceLeft

Definition at line 68 of file qpainter.h.

◆ sourceTop

qreal QPainter::PixmapFragment::sourceTop

Definition at line 69 of file qpainter.h.

◆ width

◆ x

qreal QPainter::PixmapFragment::x

◆ y

qreal QPainter::PixmapFragment::y

The documentation for this class was generated from the following files: