Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
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 8122 of file qpainter.cpp.

Member Data Documentation

◆ height

qreal QPainter::PixmapFragment::height

Definition at line 71 of file qpainter.h.

◆ opacity

qreal QPainter::PixmapFragment::opacity

Definition at line 75 of file qpainter.h.

◆ rotation

qreal QPainter::PixmapFragment::rotation

Definition at line 74 of file qpainter.h.

◆ scaleX

qreal QPainter::PixmapFragment::scaleX

Definition at line 72 of file qpainter.h.

◆ scaleY

qreal QPainter::PixmapFragment::scaleY

Definition at line 73 of file qpainter.h.

◆ 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

qreal QPainter::PixmapFragment::width

Definition at line 70 of file qpainter.h.

◆ x

qreal QPainter::PixmapFragment::x

Definition at line 66 of file qpainter.h.

◆ y

qreal QPainter::PixmapFragment::y

Definition at line 67 of file qpainter.h.


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