Qt 4.8
|
The QPainter class performs low-level painting on widgets and other paint devices. More...
#include <qpainter.h>
Classes | |
class | PixmapFragment |
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... | |
Public Functions | |
const QBrush & | background () const |
Returns the current background brush. More... | |
Qt::BGMode | backgroundMode () const |
Returns the current background mode. More... | |
bool | begin (QPaintDevice *) |
Begins painting the paint device and returns true if successful; otherwise returns false. More... | |
void | beginNativePainting () |
Flushes the painting pipeline and prepares for the user issuing commands directly to the underlying graphics context. More... | |
QRectF | boundingRect (const QRectF &rect, int flags, const QString &text) |
Returns the bounding rectangle of the text as it will appear when drawn inside the given rectangle with the specified flags using the currently set font(); i. More... | |
QRect | boundingRect (const QRect &rect, int flags, const QString &text) |
Returns the bounding rectangle of the text as it will appear when drawn inside the given rectangle with the specified flags using the currently set font(). More... | |
QRect | boundingRect (int x, int y, int w, int h, int flags, const QString &text) |
Returns the bounding rectangle of the given text as it will appear when drawn inside the rectangle beginning at the point ({x}, {y}) with width w and height h. More... | |
QRectF | boundingRect (const QRectF &rect, const QString &text, const QTextOption &o=QTextOption()) |
Instead of specifying flags as a bitwise OR of the Qt::AlignmentFlag and Qt::TextFlag, this overloaded function takes an option argument. More... | |
const QBrush & | brush () const |
Returns the painter's current brush. More... | |
QPoint | brushOrigin () const |
Returns the currently set brush origin. More... | |
QRectF | clipBoundingRect () const |
Returns the bounding rectangle of the current clip if there is a clip; otherwise returns an empty rectangle. More... | |
QPainterPath | clipPath () const |
Returns the currently clip as a path. More... | |
QRegion | clipRegion () const |
Returns the currently set clip region. More... | |
QMatrix | combinedMatrix () const |
Returns the transformation matrix combining the current window/viewport and world transformation. More... | |
QTransform | combinedTransform () const |
Returns the transformation matrix combining the current window/viewport and world transformation. More... | |
CompositionMode | compositionMode () const |
Returns the current composition mode. More... | |
QPaintDevice * | device () const |
Returns the paint device on which this painter is currently painting, or 0 if the painter is not active. More... | |
const QMatrix & | deviceMatrix () const |
Returns the matrix that transforms from logical coordinates to device coordinates of the platform dependent paint device. More... | |
const QTransform & | deviceTransform () const |
Returns the matrix that transforms from logical coordinates to device coordinates of the platform dependent paint device. More... | |
void | drawArc (const QRectF &rect, int a, int alen) |
Draws the arc defined by the given rectangle, startAngle and spanAngle. More... | |
void | drawArc (const QRect &, int a, int alen) |
Draws the arc defined by the given rectangle, startAngle and spanAngle. More... | |
void | drawArc (int x, int y, int w, int h, int a, int alen) |
Draws the arc defined by the rectangle beginning at (x, y) with the specified width and height, and the given startAngle and spanAngle. More... | |
void | drawChord (const QRectF &rect, int a, int alen) |
Draws the chord defined by the given rectangle, startAngle and spanAngle. More... | |
void | drawChord (int x, int y, int w, int h, int a, int alen) |
Draws the chord defined by the rectangle beginning at (x, y) with the specified width and height, and the given startAngle and spanAngle. More... | |
void | drawChord (const QRect &, int a, int alen) |
Draws the chord defined by the given rectangle, startAngle and spanAngle. More... | |
void | drawConvexPolygon (const QPointF *points, int pointCount) |
Draws the convex polygon defined by the first pointCount points in the array points using the current pen. More... | |
void | drawConvexPolygon (const QPolygonF &polygon) |
Draws the convex polygon defined by polygon using the current pen and brush. More... | |
void | drawConvexPolygon (const QPoint *points, int pointCount) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Draws the convex polygon defined by the first pointCount points in the array points using the current pen. More... | |
void | drawConvexPolygon (const QPolygon &polygon) |
Draws the convex polygon defined by polygon using the current pen and brush. More... | |
void | drawEllipse (const QRectF &r) |
Draws the ellipse defined by the given rectangle. More... | |
void | drawEllipse (const QRect &r) |
Draws the ellipse defined by the given rectangle. More... | |
void | drawEllipse (int x, int y, int w, int h) |
Draws the ellipse defined by the rectangle beginning at ({x}, {y}) with the given width and height. More... | |
void | drawEllipse (const QPointF ¢er, qreal rx, qreal ry) |
Draws the ellipse positioned at {center} with radii {rx} and {ry}. More... | |
void | drawEllipse (const QPoint ¢er, int rx, int ry) |
Draws the ellipse positioned at {center} with radii {rx} and {ry}. More... | |
void | drawGlyphRun (const QPointF &position, const QGlyphRun &glyphRun) |
Draws the specified glyphs at the given position. More... | |
void | drawImage (const QRectF &targetRect, const QImage &image, const QRectF &sourceRect, Qt::ImageConversionFlags flags=Qt::AutoColor) |
void | drawImage (const QRect &targetRect, const QImage &image, const QRect &sourceRect, Qt::ImageConversionFlags flags=Qt::AutoColor) |
void | drawImage (const QPointF &p, const QImage &image, const QRectF &sr, Qt::ImageConversionFlags flags=Qt::AutoColor) |
void | drawImage (const QPoint &p, const QImage &image, const QRect &sr, Qt::ImageConversionFlags flags=Qt::AutoColor) |
void | drawImage (const QRectF &r, const QImage &image) |
Draws the given image into the given rectangle. More... | |
void | drawImage (const QRect &r, const QImage &image) |
Draws the given image into the given rectangle. More... | |
void | drawImage (const QPointF &p, const QImage &image) |
Draws the given image at the given point. More... | |
void | drawImage (const QPoint &p, const QImage &image) |
Draws the given image at the given point. More... | |
void | drawImage (int x, int y, const QImage &image, int sx=0, int sy=0, int sw=-1, int sh=-1, Qt::ImageConversionFlags flags=Qt::AutoColor) |
void | drawLine (const QLineF &line) |
Draws a line defined by line. More... | |
void | drawLine (const QLine &line) |
Draws a line defined by line. More... | |
void | drawLine (int x1, int y1, int x2, int y2) |
Draws a line from (x1, y1) to (x2, y2) and sets the current pen position to (x2, y2). More... | |
void | drawLine (const QPoint &p1, const QPoint &p2) |
Draws a line from p1 to p2. More... | |
void | drawLine (const QPointF &p1, const QPointF &p2) |
Draws a line from p1 to p2. More... | |
void | drawLines (const QLineF *lines, int lineCount) |
Draws the first lineCount lines in the array lines using the current pen. More... | |
void | drawLines (const QVector< QLineF > &lines) |
Draws the set of lines defined by the list lines using the current pen and brush. More... | |
void | drawLines (const QPointF *pointPairs, int lineCount) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Draws the first lineCount lines in the array pointPairs using the current pen. More... | |
void | drawLines (const QVector< QPointF > &pointPairs) |
Draws a line for each pair of points in the vector pointPairs using the current pen. More... | |
void | drawLines (const QLine *lines, int lineCount) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Draws the first lineCount lines in the array lines using the current pen. More... | |
void | drawLines (const QVector< QLine > &lines) |
Draws the set of lines defined by the list lines using the current pen and brush. More... | |
void | drawLines (const QPoint *pointPairs, int lineCount) |
Draws the first lineCount lines in the array pointPairs using the current pen. More... | |
void | drawLines (const QVector< QPoint > &pointPairs) |
Draws a line for each pair of points in the vector pointPairs using the current pen. More... | |
void | drawPath (const QPainterPath &path) |
Draws the given painter path using the current pen for outline and the current brush for filling. More... | |
void | drawPicture (const QPointF &p, const QPicture &picture) |
Replays the given picture at the given point. More... | |
void | drawPicture (int x, int y, const QPicture &picture) |
Draws the given picture at point (x, y). More... | |
void | drawPicture (const QPoint &p, const QPicture &picture) |
Replays the given picture at the given point. More... | |
void | drawPie (const QRectF &rect, int a, int alen) |
Draws a pie defined by the given rectangle, startAngle and and spanAngle. More... | |
void | drawPie (int x, int y, int w, int h, int a, int alen) |
void | drawPie (const QRect &, int a, int alen) |
Draws a pie defined by the given rectangle, startAngle and and spanAngle. More... | |
void | drawPixmap (const QRectF &targetRect, const QPixmap &pixmap, const QRectF &sourceRect) |
Draws the rectangular portion source of the given pixmap into the given target in the paint device. More... | |
void | drawPixmap (const QRect &targetRect, const QPixmap &pixmap, const QRect &sourceRect) |
Draws the rectangular portion source of the given pixmap into the given target in the paint device. More... | |
void | drawPixmap (int x, int y, int w, int h, const QPixmap &pm, int sx, int sy, int sw, int sh) |
Draws the rectangular portion with the origin ({sx}, {sy}), width sw and height sh, of the given pixmap , at the point ({x}, {y}), with a width of w and a height of h. More... | |
void | drawPixmap (int x, int y, const QPixmap &pm, int sx, int sy, int sw, int sh) |
Draws a pixmap at ({x}, {y}) by copying a part of the given pixmap into the paint device. More... | |
void | drawPixmap (const QPointF &p, const QPixmap &pm, const QRectF &sr) |
Draws the rectangular portion source of the given pixmap with its origin at the given point. More... | |
void | drawPixmap (const QPoint &p, const QPixmap &pm, const QRect &sr) |
Draws the rectangular portion source of the given pixmap with its origin at the given point. More... | |
void | drawPixmap (const QPointF &p, const QPixmap &pm) |
Draws the given pixmap with its origin at the given point. More... | |
void | drawPixmap (const QPoint &p, const QPixmap &pm) |
Draws the given pixmap with its origin at the given point. More... | |
void | drawPixmap (int x, int y, const QPixmap &pm) |
Draws the given pixmap at position ({x}, {y}). More... | |
void | drawPixmap (const QRect &r, const QPixmap &pm) |
Draws the given pixmap into the given rectangle. More... | |
void | drawPixmap (int x, int y, int w, int h, const QPixmap &pm) |
Draws the pixmap into the rectangle at position ({x}, {y}) with the given width and height. More... | |
void | drawPixmapFragments (const PixmapFragment *fragments, int fragmentCount, const QPixmap &pixmap, PixmapFragmentHints hints=0) |
This function is used to draw pixmap, or a sub-rectangle of pixmap, at multiple positions with different scale, rotation and opacity. More... | |
void | drawPixmapFragments (const QRectF *targetRects, const QRectF *sourceRects, int fragmentCount, const QPixmap &pixmap, PixmapFragmentHints hints=0) |
This function is used to draw the same pixmap with multiple target and source rectangles specified by targetRects. More... | |
void | drawPoint (const QPointF &pt) |
Draws a single point at the given position using the current pen's color. More... | |
void | drawPoint (const QPoint &p) |
Draws a single point at the given position using the current pen's color. More... | |
void | drawPoint (int x, int y) |
Draws a single point at position (x, y). More... | |
void | drawPoints (const QPointF *points, int pointCount) |
Draws the first pointCount points in the array points using the current pen's color. More... | |
void | drawPoints (const QPolygonF &points) |
Draws the points in the vector points. More... | |
void | drawPoints (const QPoint *points, int pointCount) |
Draws the first pointCount points in the array points using the current pen's color. More... | |
void | drawPoints (const QPolygon &points) |
Draws the points in the vector points. More... | |
void | drawPolygon (const QPointF *points, int pointCount, Qt::FillRule fillRule=Qt::OddEvenFill) |
Draws the polygon defined by the first pointCount points in the array points using the current pen and brush. More... | |
void | drawPolygon (const QPolygonF &polygon, Qt::FillRule fillRule=Qt::OddEvenFill) |
Draws the polygon defined by the given points using the fill rule fillRule. More... | |
void | drawPolygon (const QPoint *points, int pointCount, Qt::FillRule fillRule=Qt::OddEvenFill) |
Draws the polygon defined by the first pointCount points in the array points. More... | |
void | drawPolygon (const QPolygon &polygon, Qt::FillRule fillRule=Qt::OddEvenFill) |
Draws the polygon defined by the given points using the fill rule fillRule. More... | |
void | drawPolyline (const QPointF *points, int pointCount) |
Draws the polyline defined by the first pointCount points in points using the current pen. More... | |
void | drawPolyline (const QPolygonF &polyline) |
Draws the polyline defined by the given points using the current pen. More... | |
void | drawPolyline (const QPoint *points, int pointCount) |
Draws the polyline defined by the first pointCount points in points using the current pen. More... | |
void | drawPolyline (const QPolygon &polygon) |
Draws the polyline defined by the given points using the current pen. More... | |
void | drawRect (const QRectF &rect) |
Draws the current rectangle with the current pen and brush. More... | |
void | drawRect (int x1, int y1, int w, int h) |
Draws a rectangle with upper left corner at ({x}, {y}) and with the given width and height. More... | |
void | drawRect (const QRect &rect) |
Draws the current rectangle with the current pen and brush. More... | |
void | drawRects (const QRectF *rects, int rectCount) |
Draws the first rectCount of the given rectangles using the current pen and brush. More... | |
void | drawRects (const QVector< QRectF > &rectangles) |
Draws the given rectangles using the current pen and brush. More... | |
void | drawRects (const QRect *rects, int rectCount) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Draws the first rectCount of the given rectangles using the current pen and brush. More... | |
void | drawRects (const QVector< QRect > &rectangles) |
Draws the given rectangles using the current pen and brush. More... | |
void | drawRoundedRect (const QRectF &rect, qreal xRadius, qreal yRadius, Qt::SizeMode mode=Qt::AbsoluteSize) |
Draws the given rectangle rect with rounded corners. More... | |
void | drawRoundedRect (int x, int y, int w, int h, qreal xRadius, qreal yRadius, Qt::SizeMode mode=Qt::AbsoluteSize) |
void | drawRoundedRect (const QRect &rect, qreal xRadius, qreal yRadius, Qt::SizeMode mode=Qt::AbsoluteSize) |
void | drawRoundRect (const QRectF &r, int xround=25, int yround=25) |
Draws a rectangle r with rounded corners. More... | |
void | drawRoundRect (int x, int y, int w, int h, int=25, int=25) |
Draws the rectangle x, y, w, h with rounded corners. More... | |
void | drawRoundRect (const QRect &r, int xround=25, int yround=25) |
Draws the rectangle r with rounded corners. More... | |
void | drawStaticText (const QPointF &topLeftPosition, const QStaticText &staticText) |
Draws the given staticText at the given topLeftPosition. More... | |
void | drawStaticText (const QPoint &topLeftPosition, const QStaticText &staticText) |
Draws the staticText at the topLeftPosition. More... | |
void | drawStaticText (int left, int top, const QStaticText &staticText) |
Draws the staticText at coordinates left and top. More... | |
void | drawText (const QPointF &p, const QString &s) |
Draws the given text with the currently defined text direction, beginning at the given position. More... | |
void | drawText (const QPoint &p, const QString &s) |
Draws the given text with the currently defined text direction, beginning at the given position. More... | |
void | drawText (int x, int y, const QString &s) |
Draws the given text at position ({x}, {y}), using the painter's currently defined text direction. More... | |
void | drawText (const QPointF &p, const QString &str, int tf, int justificationPadding) |
void | drawText (const QRectF &r, int flags, const QString &text, QRectF *br=0) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Draws the given text within the provided rectangle. More... | |
void | drawText (const QRect &r, int flags, const QString &text, QRect *br=0) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Draws the given text within the provided rectangle according to the specified flags. More... | |
void | drawText (int x, int y, int w, int h, int flags, const QString &text, QRect *br=0) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Draws the given text within the rectangle with origin ({x}, {y}), width and height. More... | |
void | drawText (const QRectF &r, const QString &text, const QTextOption &o=QTextOption()) |
Draws the given text in the rectangle specified using the option to control its positioning and orientation. More... | |
void | drawTextItem (const QPointF &p, const QTextItem &ti) |
Draws the text item ti at position p. More... | |
void | drawTextItem (int x, int y, const QTextItem &ti) |
void | drawTextItem (const QPoint &p, const QTextItem &ti) |
Draws the text item ti at position p. More... | |
void | drawTiledPixmap (const QRectF &rect, const QPixmap &pm, const QPointF &offset=QPointF()) |
Draws a tiled pixmap, inside the given rectangle with its origin at the given position. More... | |
void | drawTiledPixmap (int x, int y, int w, int h, const QPixmap &, int sx=0, int sy=0) |
void | drawTiledPixmap (const QRect &, const QPixmap &, const QPoint &=QPoint()) |
Draws a tiled pixmap, inside the given rectangle with its origin at the given position. More... | |
bool | end () |
Ends painting. More... | |
void | endNativePainting () |
Restores the painter after manually issuing native painting commands. More... | |
void | eraseRect (const QRectF &) |
Erases the area inside the given rectangle. More... | |
void | eraseRect (int x, int y, int w, int h) |
Erases the area inside the rectangle beginning at (x, y) with the given width and height. More... | |
void | eraseRect (const QRect &) |
Erases the area inside the given rectangle. More... | |
void | fillPath (const QPainterPath &path, const QBrush &brush) |
Fills the given path using the given brush. More... | |
void | fillRect (const QRectF &, const QBrush &) |
Fills the given rectangle with the brush specified. More... | |
void | fillRect (int x, int y, int w, int h, const QBrush &) |
Fills the rectangle beginning at ({x}, {y}) with the given width and height, using the given brush. More... | |
void | fillRect (const QRect &, const QBrush &) |
Fills the given rectangle with the specified brush. More... | |
void | fillRect (const QRectF &, const QColor &color) |
Fills the given rectangle with the color specified. More... | |
void | fillRect (int x, int y, int w, int h, const QColor &color) |
Fills the rectangle beginning at ({x}, {y}) with the given width and height, using the given color. More... | |
void | fillRect (const QRect &, const QColor &color) |
Fills the given rectangle with the color specified. More... | |
void | fillRect (int x, int y, int w, int h, Qt::GlobalColor c) |
Fills the rectangle beginning at ({x}, {y}) with the given width and height, using the given color. More... | |
void | fillRect (const QRect &r, Qt::GlobalColor c) |
Fills the given rectangle with the specified color. More... | |
void | fillRect (const QRectF &r, Qt::GlobalColor c) |
Fills the given rectangle with the specified color. More... | |
void | fillRect (int x, int y, int w, int h, Qt::BrushStyle style) |
Fills the rectangle beginning at ({x}, {y}) with the given width and height, using the brush style specified. More... | |
void | fillRect (const QRect &r, Qt::BrushStyle style) |
Fills the given rectangle with the brush style specified. More... | |
void | fillRect (const QRectF &r, Qt::BrushStyle style) |
Fills the given rectangle with the brush style specified. More... | |
const QFont & | font () const |
Returns the currently set font used for drawing text. More... | |
QFontInfo | fontInfo () const |
Returns the font info for the painter if the painter is active. More... | |
QFontMetrics | fontMetrics () const |
Returns the font metrics for the painter if the painter is active. More... | |
bool | hasClipping () const |
Returns true if clipping has been set; otherwise returns false. More... | |
void | initFrom (const QWidget *widget) |
Initializes the painters pen, background and font to the same as the given widget. More... | |
bool | isActive () const |
Returns true if begin() has been called and end() has not yet been called; otherwise returns false. More... | |
Qt::LayoutDirection | layoutDirection () const |
Returns the layout direction used by the painter when drawing text. More... | |
const QMatrix & | matrix () const |
Use worldTransform() instead. More... | |
bool | matrixEnabled () const |
qreal | opacity () const |
Returns the opacity of the painter. More... | |
QPaintEngine * | paintEngine () const |
Returns the paint engine that the painter is currently operating on if the painter is active; otherwise 0. More... | |
const QPen & | pen () const |
Returns the painter's current pen. More... | |
QPainter () | |
Constructs a painter. More... | |
QPainter (QPaintDevice *) | |
Constructs a painter that begins painting the paint device immediately. More... | |
RenderHints | renderHints () const |
Returns a flag that specifies the rendering hints that are set for this painter. More... | |
void | resetMatrix () |
Resets any transformations that were made using translate(), scale(), shear(), rotate(), setWorldMatrix(), setViewport() and setWindow(). More... | |
void | resetTransform () |
Resets any transformations that were made using translate(), scale(), shear(), rotate(), setWorldTransform(), setViewport() and setWindow(). More... | |
void | restore () |
Restores the current painter state (pops a saved state off the stack). More... | |
void | rotate (qreal a) |
Rotates the coordinate system the given angle clockwise. More... | |
void | save () |
Saves the current painter state (pushes the state onto a stack). More... | |
void | scale (qreal sx, qreal sy) |
Scales the coordinate system by ({sx}, {sy}). More... | |
void | setBackground (const QBrush &bg) |
Sets the background brush of the painter to the given brush. More... | |
void | setBackgroundMode (Qt::BGMode mode) |
Sets the background mode of the painter to the given mode. More... | |
void | setBrush (const QBrush &brush) |
Sets the painter's brush to the given brush. More... | |
void | setBrush (Qt::BrushStyle style) |
Sets the painter's brush to black color and the specified style. More... | |
void | setBrushOrigin (int x, int y) |
Sets the brush's origin to point (x, y). More... | |
void | setBrushOrigin (const QPoint &) |
Sets the brush's origin to the given position. More... | |
void | setBrushOrigin (const QPointF &) |
Sets the brush origin to position. More... | |
void | setClipPath (const QPainterPath &path, Qt::ClipOperation op=Qt::ReplaceClip) |
Enables clipping, and sets the clip path for the painter to the given path, with the clip operation. More... | |
void | setClipping (bool enable) |
Enables clipping if enable is true, or disables clipping if enable is false. More... | |
void | setClipRect (const QRectF &, Qt::ClipOperation op=Qt::ReplaceClip) |
Enables clipping, and sets the clip region to the given rectangle using the given clip operation. More... | |
void | setClipRect (const QRect &, Qt::ClipOperation op=Qt::ReplaceClip) |
Enables clipping, and sets the clip region to the given rectangle using the given clip operation. More... | |
void | setClipRect (int x, int y, int w, int h, Qt::ClipOperation op=Qt::ReplaceClip) |
Enables clipping, and sets the clip region to the rectangle beginning at (x, y) with the given width and height. More... | |
void | setClipRegion (const QRegion &, Qt::ClipOperation op=Qt::ReplaceClip) |
Sets the clip region to the given region using the specified clip operation. More... | |
void | setCompositionMode (CompositionMode mode) |
Sets the composition mode to the given mode. More... | |
void | setFont (const QFont &f) |
Sets the painter's font to the given font. More... | |
void | setLayoutDirection (Qt::LayoutDirection direction) |
Sets the layout direction used by the painter when drawing text, to the specified direction. More... | |
void | setMatrix (const QMatrix &matrix, bool combine=false) |
Use setWorldTransform() instead. More... | |
void | setMatrixEnabled (bool enabled) |
Use setWorldMatrixEnabled() instead. More... | |
void | setOpacity (qreal opacity) |
Sets the opacity of the painter to opacity. More... | |
void | setPen (const QColor &color) |
Sets the painter's pen to have style Qt::SolidLine, width 0 and the specified color. More... | |
void | setPen (const QPen &pen) |
Sets the painter's pen to be the given pen. More... | |
void | setPen (Qt::PenStyle style) |
Sets the painter's pen to have the given style, width 0 and black color. More... | |
void | setRenderHint (RenderHint hint, bool on=true) |
Sets the given render hint on the painter if on is true; otherwise clears the render hint. More... | |
void | setRenderHints (RenderHints hints, bool on=true) |
Sets the given render hints on the painter if on is true; otherwise clears the render hints. More... | |
void | setTransform (const QTransform &transform, bool combine=false) |
Sets the world transformation matrix. More... | |
void | setViewport (const QRect &viewport) |
Sets the painter's viewport rectangle to the given rectangle, and enables view transformations. More... | |
void | setViewport (int x, int y, int w, int h) |
Sets the painter's viewport rectangle to be the rectangle beginning at (x, y) with the given width and height. More... | |
void | setViewTransformEnabled (bool enable) |
Enables view transformations if enable is true, or disables view transformations if enable is false. More... | |
void | setWindow (const QRect &window) |
Sets the painter's window to the given rectangle, and enables view transformations. More... | |
void | setWindow (int x, int y, int w, int h) |
Sets the painter's window to the rectangle beginning at (x, y) and the given width and height. More... | |
void | setWorldMatrix (const QMatrix &matrix, bool combine=false) |
Sets the transformation matrix to matrix and enables transformations. More... | |
void | setWorldMatrixEnabled (bool enabled) |
Enables transformations if enable is true, or disables transformations if enable is false. More... | |
void | setWorldTransform (const QTransform &matrix, bool combine=false) |
Sets the world transformation matrix. More... | |
void | shear (qreal sh, qreal sv) |
Shears the coordinate system by ({sh}, {sv}). More... | |
void | strokePath (const QPainterPath &path, const QPen &pen) |
Draws the outline (strokes) the path path with the pen specified by pen. More... | |
bool | testRenderHint (RenderHint hint) const |
Returns true if hint is set; otherwise returns false. More... | |
const QTransform & | transform () const |
Returns the world transformation matrix. More... | |
void | translate (const QPointF &offset) |
Translates the coordinate system by the given offset; i.e. More... | |
void | translate (const QPoint &offset) |
Translates the coordinate system by the given offset. More... | |
void | translate (qreal dx, qreal dy) |
Translates the coordinate system by the vector (dx, dy). More... | |
QRect | viewport () const |
Returns the viewport rectangle. More... | |
bool | viewTransformEnabled () const |
Returns true if view transformation is enabled; otherwise returns false. More... | |
QRect | window () const |
Returns the window rectangle. More... | |
const QMatrix & | worldMatrix () const |
Returns the world transformation matrix. More... | |
bool | worldMatrixEnabled () const |
Returns true if world transformation is enabled; otherwise returns false. More... | |
const QTransform & | worldTransform () const |
Returns the world transformation matrix. More... | |
~QPainter () | |
Destroys the painter. More... | |
Static Public Functions | |
static QPaintDevice * | redirected (const QPaintDevice *device, QPoint *offset=0) |
Using QWidget::render() obsoletes the use of this function. More... | |
static void | restoreRedirected (const QPaintDevice *device) |
Using QWidget::render() obsoletes the use of this function. More... | |
static void | setRedirected (const QPaintDevice *device, QPaintDevice *replacement, const QPoint &offset=QPoint()) |
Please use QWidget::render() instead. More... | |
Properties | |
QScopedPointer< QPainterPrivate > | d_ptr |
The QPainter class performs low-level painting on widgets and other paint devices.
QPainter provides highly optimized functions to do most of the drawing GUI programs require. It can draw everything from simple lines to complex shapes like pies and chords. It can also draw aligned text and pixmaps. Normally, it draws in a "natural" coordinate system, but it can also do view and world transformation. QPainter can operate on any object that inherits the QPaintDevice class.
The common use of QPainter is inside a widget's paint event: Construct and customize (e.g. set the pen or the brush) the painter. Then draw. Remember to destroy the QPainter object after drawing. For example:
The core functionality of QPainter is drawing, but the class also provide several functions that allows you to customize QPainter's settings and its rendering quality, and others that enable clipping. In addition you can control how different shapes are merged together by specifying the painter's composition mode.
The isActive() function indicates whether the painter is active. A painter is activated by the begin() function and the constructor that takes a QPaintDevice argument. The end() function, and the destructor, deactivates it.
Together with the QPaintDevice and QPaintEngine classes, QPainter form the basis for Qt's paint system. QPainter is the class used to perform drawing operations. QPaintDevice represents a device that can be painted on using a QPainter. QPaintEngine provides the interface that the painter uses to draw onto different types of devices. If the painter is active, device() returns the paint device on which the painter paints, and paintEngine() returns the paint engine that the painter is currently operating on. For more information, see the Paint System.
Sometimes it is desirable to make someone else paint on an unusual QPaintDevice. QPainter supports a static function to do this, setRedirected().
There are several settings that you can customize to make QPainter draw according to your preferences:
font() is the font used for drawing text. If the painter isActive(), you can retrieve information about the currently set font, and its metrics, using the fontInfo() and fontMetrics() functions respectively.
brush() defines the color or pattern that is used for filling shapes.
pen() defines the color or stipple that is used for drawing lines or boundaries.
backgroundMode() defines whether there is a background() or not, i.e it is either Qt::OpaqueMode or Qt::TransparentMode.
background() only applies when backgroundMode() is Qt::OpaqueMode and pen() is a stipple. In that case, it describes the color of the background pixels in the stipple.
brushOrigin() defines the origin of the tiled brushes, normally the origin of widget's background.
viewport(), window(), worldTransform() make up the painter's coordinate transformation system. For more information, see the Coordinate Transformations section and the Coordinate System documentation.
hasClipping() tells whether the painter clips at all. (The paint device clips, too.) If the painter clips, it clips to clipRegion().
layoutDirection() defines the layout direction used by the painter when drawing text.
worldMatrixEnabled() tells whether world transformation is enabled.
viewTransformEnabled() tells whether view transformation is enabled.
Note that some of these settings mirror settings in some paint devices, e.g. QWidget::font(). The QPainter::begin() function (or equivalently the QPainter constructor) copies these attributes from the paint device.
You can at any time save the QPainter's state by calling the save() function which saves all the available settings on an internal stack. The restore() function pops them back.
QPainter provides functions to draw most primitives: drawPoint(), drawPoints(), drawLine(), drawRect(), drawRoundedRect(), drawEllipse(), drawArc(), drawPie(), drawChord(), drawPolyline(), drawPolygon(), drawConvexPolygon() and drawCubicBezier(). The two convenience functions, drawRects() and drawLines(), draw the given number of rectangles or lines in the given array of QRects or QLine using the current pen and brush.
The QPainter class also provides the fillRect() function which fills the given QRect, with the given QBrush, and the eraseRect() function that erases the area inside the given rectangle.
All of these functions have both integer and floating point versions.
Basic Drawing Example The painting/basicdrawing{Basic Drawing} example shows how to display basic graphics primitives in a variety of styles using the QPainter class. |
If you need to draw a complex shape, especially if you need to do so repeatedly, consider creating a QPainterPath and drawing it using drawPath().
Painter Paths example The QPainterPath class provides a container for painting operations, enabling graphical shapes to be constructed and reused. The painting/painterpaths{Painter Paths} example shows how painter paths can be used to build complex shapes for rendering. |
QPainter also provides the fillPath() function which fills the given QPainterPath with the given QBrush, and the strokePath() function that draws the outline of the given path (i.e. strokes the path).
See also the demos/deform{Vector Deformation} demo which shows how to use advanced vector techniques to draw text using a QPainterPath, the demos/gradients{Gradients} demo which shows the different types of gradients that are available in Qt, and the Path Stroking demo which shows Qt's built-in dash patterns and shows how custom patterns can be used to extend the range of available patterns.
demos/deform{Vector Deformation} | demos/gradients{Gradients} | demos/pathstroke{Path Stroking} |
There are functions to draw pixmaps/images, namely drawPixmap(), drawImage() and drawTiledPixmap(). Both drawPixmap() and drawImage() produce the same result, except that drawPixmap() is faster on-screen while drawImage() may be faster on a QPrinter or other devices.
Text drawing is done using drawText(). When you need fine-grained positioning, boundingRect() tells you where a given drawText() command will draw.
There is a drawPicture() function that draws the contents of an entire QPicture. The drawPicture() function is the only function that disregards all the painter's settings as QPicture has its own settings.
To get the optimal rendering result using QPainter, you should use the platform independent QImage as paint device; i.e. using QImage will ensure that the result has an identical pixel representation on any platform.
The QPainter class also provides a means of controlling the rendering quality through its RenderHint enum and the support for floating point precision: All the functions for drawing primitives has a floating point version. These are often used in combination with the RenderHint{QPainter::Antialiasing} render hint.
Concentric Circles Example The painting/concentriccircles{Concentric Circles} example shows the improved rendering quality that can be obtained using floating point precision and anti-aliasing when drawing custom widgets. The application's main window displays several widgets which are drawn using the various combinations of precision and anti-aliasing. |
The RenderHint enum specifies flags to QPainter that may or may not be respected by any given engine. QPainter::Antialiasing indicates that the engine should antialias edges of primitives if possible, QPainter::TextAntialiasing indicates that the engine should antialias text if possible, and the QPainter::SmoothPixmapTransform indicates that the engine should use a smooth pixmap transformation algorithm. RenderHint {HighQualityAntialiasing} is an OpenGL-specific rendering hint indicating that the engine should use fragment programs and offscreen rendering for antialiasing.
The renderHints() function returns a flag that specifies the rendering hints that are set for this painter. Use the setRenderHint() function to set or clear the currently set RenderHints.
Normally, the QPainter operates on the device's own coordinate system (usually pixels), but QPainter has good support for coordinate transformations.
nop | rotate() | scale() | translate() |
The most commonly used transformations are scaling, rotation, translation and shearing. Use the scale() function to scale the coordinate system by a given offset, the rotate() function to rotate it clockwise and translate() to translate it (i.e. adding a given offset to the points). You can also twist the coordinate system around the origin using the shear() function. See the Affine Transformations demo for a visualization of a sheared coordinate system.
See also the painting/transformations{Transformations} example which shows how transformations influence the way that QPainter renders graphics primitives. In particular it shows how the order of transformations affects the result.
Affine Transformations Demo The demos/affine{Affine Transformations} demo show Qt's ability to perform affine transformations on painting operations. The demo also allows the user to experiment with the transformation operations and see the results immediately. |
All the tranformation operations operate on the transformation worldTransform(). A matrix transforms a point in the plane to another point. For more information about the transformation matrix, see the Coordinate System and QTransform documentation.
The setWorldTransform() function can replace or add to the currently set worldTransform(). The resetTransform() function resets any transformations that were made using translate(), scale(), shear(), rotate(), setWorldTransform(), setViewport() and setWindow() functions. The deviceTransform() returns the matrix that transforms from logical coordinates to device coordinates of the platform dependent paint device. The latter function is only needed when using platform painting commands on the platform dependent handle, and the platform does not do transformations nativly.
When drawing with QPainter, we specify points using logical coordinates which then are converted into the physical coordinates of the paint device. The mapping of the logical coordinates to the physical coordinates are handled by QPainter's combinedTransform(), a combination of viewport() and window() and worldTransform(). The viewport() represents the physical coordinates specifying an arbitrary rectangle, the window() describes the same rectangle in logical coordinates, and the worldTransform() is identical with the transformation matrix.
See also Coordinate System
QPainter can clip any drawing operation to a rectangle, a region, or a vector path. The current clip is available using the functions clipRegion() and clipPath(). Whether paths or regions are preferred (faster) depends on the underlying paintEngine(). For example, the QImage paint engine prefers paths while the X11 paint engine prefers regions. Setting a clip is done in the painters logical coordinates.
After QPainter's clipping, the paint device may also clip. For example, most widgets clip away the pixels used by child widgets, and most printers clip away an area near the edges of the paper. This additional clipping is not reflected by the return value of clipRegion() or hasClipping().
QPainter provides the CompositionMode enum which defines the Porter-Duff rules for digital image compositing; it describes a model for combining the pixels in one image, the source, with the pixels in another image, the destination.
The two most common forms of composition are QPainter::CompositionMode and QPainter::CompositionMode . QPainter::CompositionMode is used to draw opaque objects onto a paint device. In this mode, each pixel in the source replaces the corresponding pixel in the destination. In QPainter::CompositionMode composition mode, the source object is transparent and is drawn on top of the destination.
Note that composition transformation operates pixelwise. For that reason, there is a difference between using the graphic primitive itself and its bounding rectangle: The bounding rect contains pixels with alpha == 0 (i.e the pixels surrounding the primitive). These pixels will overwrite the other image's pixels, affectively clearing those, while the primitive only overwrites its own area.
Composition Modes Demo The demos/composition{Composition Modes} demo, available in Qt's demo directory, allows you to experiment with the various composition modes and see the results immediately. |
If you are using coordinates with Qt's raster-based paint engine, it is important to note that, while coordinates greater than +/- 2 15 can be used, any painting performed with coordinates outside this range is not guaranteed to be shown; the drawing may be clipped. This is due to the use of short int
in the implementation.
The outlines generated by Qt's stroker are only an approximation when dealing with curved shapes. It is in most cases impossible to represent the outline of a bezier curve segment using another bezier curve segment, and so Qt approximates the curve outlines by using several smaller curves. For performance reasons there is a limit to how many curves Qt uses for these outlines, and thus when using large pen widths or scales the outline error increases. To generate outlines with smaller errors it is possible to use the QPainterPathStroker class, which has the setCurveThreshold member function which let's the user specify the error tolerance. Another workaround is to convert the paths to polygons first and then draw the polygons instead.
QPainter is a rich framework that allows developers to do a great variety of graphical operations, such as gradients, composition modes and vector graphics. And QPainter can do this across a variety of different hardware and software stacks. Naturally the underlying combination of hardware and software has some implications for performance, and ensuring that every single operation is fast in combination with all the various combinations of composition modes, brushes, clipping, transformation, etc, is close to an impossible task because of the number of permutations. As a compromise we have selected a subset of the QPainter API and backends, where performance is guaranteed to be as good as we can sensibly get it for the given combination of hardware and software.
The backends we focus on as high-performance engines are:
Raster - This backend implements all rendering in pure software and is always used to render into QImages. For optimal performance only use the format types QImage::Format_ARGB32_Premultiplied, QImage::Format_RGB32 or QImage::Format_RGB16. Any other format, including QImage::Format_ARGB32, has significantly worse performance. This engine is also used by default on Windows and on QWS. It can be used as default graphics system on any OS/hardware/software combination by passing {-graphicssystem
raster} on the command line
OpenGL 2.0 (ES) - This backend is the primary backend for hardware accelerated graphics. It can be run on desktop machines and embedded devices supporting the OpenGL 2.0 or OpenGL/ES 2.0 specification. This includes most graphics chips produced in the last couple of years. The engine can be enabled by using QPainter onto a QGLWidget or by passing {-graphicssystem
opengl} on the command line when the underlying system supports it.
OpenVG - This backend implements the Khronos standard for 2D and Vector Graphics. It is primarily for embedded devices with hardware support for OpenVG. The engine can be enabled by passing {-graphicssystem
openvg} on the command line when the underlying system supports it.
These operations are:
Simple transformations, meaning translation and scaling, pluss 0, 90, 180, 270 degree rotations.
drawPixmap()
in combination with simple transformations and opacity with non-smooth transformation mode (QPainter::SmoothPixmapTransform
not enabled as a render hint).
Rectangle fills with solid color, two-color linear gradients and simple transforms.
Rectangular clipping with simple transformations and intersect clip.
Composition Modes QPainter::CompositionMode_Source
and QPainter::CompositionMode_SourceOver
Rounded rectangle filling using solid color and two-color linear gradients fills.
3x3 patched pixmaps, via qDrawBorderPixmap.
This list gives an indication of which features to safely use in an application where performance is critical. For certain setups, other operations may be fast too, but before making extensive use of them, it is recommended to benchmark and verify them on the system where the software will run in the end. There are also cases where expensive operations are ok to use, for instance when the result is cached in a QPixmap.
Definition at line 86 of file qpainter.h.
Defines the modes supported for digital image compositing.
Composition modes are used to specify how the pixels in one image, the source, are merged with the pixel in another image, the destination.
Please note that the bitwise raster operation modes, denoted with a RasterOp prefix, are only natively supported in the X11 and raster paint engines. This means that the only way to utilize these modes on the Mac is via a QImage. The RasterOp denoted blend modes are not supported for pens and brushes with alpha components. Also, turning on the QPainter::Antialiasing render hint will effectively disable the RasterOp modes.
The most common type is SourceOver (often referred to as just alpha blending) where the source pixel is blended on top of the destination pixel in such a way that the alpha component of the source defines the translucency of the pixel.
When the paint device is a QImage, the image format must be set to QImage::Format{Format_ARGB32Premultiplied} or QImage::Format{Format_ARGB32} for the composition modes to have any effect. For performance the premultiplied version is the preferred format.
When a composition mode is set it applies to all painting operator, pens, brushes, gradients and pixmap/image drawing.
Definition at line 138 of file qpainter.h.
Enumerator | |
---|---|
OpaqueHint |
Definition at line 120 of file qpainter.h.
enum QPainter::RenderHint |
Renderhints are used to specify flags to QPainter that may or may not be respected by any given engine.
Enumerator | |
---|---|
Antialiasing | |
TextAntialiasing | |
SmoothPixmapTransform | |
HighQualityAntialiasing | |
NonCosmeticDefaultPen |
Definition at line 93 of file qpainter.h.
QPainter::QPainter | ( | ) |
|
explicit |
Constructs a painter that begins painting the paint device immediately.
This constructor is convenient for short-lived painters, e.g. in a QWidget::paintEvent() and should be used only once. The constructor calls begin() for you and the QPainter destructor automatically calls end().
Here's an example using begin() and end():
The same example using this constructor:
Since the constructor cannot provide feedback when the initialization of the painter failed you should rather use begin() and end() to paint on external devices, e.g. printers.
Definition at line 1488 of file qpainter.cpp.
QPainter::~QPainter | ( | ) |
Destroys the painter.
Definition at line 1502 of file qpainter.cpp.
const QBrush & QPainter::background | ( | ) | const |
Returns the current background brush.
Definition at line 2482 of file qpainter.cpp.
Referenced by QMotifStyle::drawComplexControl(), QWindowsCEStyle::drawControl(), QWindowsStyle::drawControl(), QMotifStyle::drawControl(), QStyle::drawItemText(), QWindowsMobileStyle::drawPrimitive(), QCDEStyle::drawPrimitive(), QWindowsStyle::drawPrimitive(), and QMotifStyle::drawPrimitive().
Qt::BGMode QPainter::backgroundMode | ( | ) | const |
Returns the current background mode.
Definition at line 4026 of file qpainter.cpp.
Referenced by QWindowsCEStyle::drawComplexControl(), QWindowsMobileStyle::drawComplexControl(), QWindowsStyle::drawComplexControl(), QWindowsCEStyle::drawControl(), and QWindowsStyle::drawControl().
bool QPainter::begin | ( | QPaintDevice * | device | ) |
Begins painting the paint device and returns true if successful; otherwise returns false.
Use begin() instead.
Notice that all painter settings (setPen(), setBrush() etc.) are reset to default values when begin() is called.
The errors that can occur are serious problems, such as these:
Note that most of the time, you can use one of the constructors instead of begin(), and that end() is automatically done at destruction.
If the paint device is a QWidget, QPainter is initialized after the widget's settings automatically. Otherwise, you must call the initFrom() function to initialize the painters pen, background and font to the same as any given widget.
QPainter painter(this); painter.begin(device, init); QPainter painter(this); painter.begin(device); painter.initFrom(init);
Definition at line 1723 of file qpainter.cpp.
Referenced by _q_paintIntoCache(), QStylePainter::begin(), QWindowsStyle::drawComplexControl(), QPainter(), toVGImageWithOpacity(), and toVGImageWithOpacitySubRect().
void QPainter::beginNativePainting | ( | ) |
Flushes the painting pipeline and prepares for the user issuing commands directly to the underlying graphics context.
Must be followed by a call to endNativePainting().
Note that only the states the underlying paint engine changes will be reset to their respective default states. The states we reset may change from release to release. The following states are currently reset in the OpenGL 2 engine:
If, for example, the OpenGL polygon mode is changed by the user inside a beginNativePaint()/endNativePainting() block, it will not be reset to the default state by endNativePainting(). Here is an example that shows intermixing of painter commands and raw OpenGL commands:
Definition at line 2032 of file qpainter.cpp.
Referenced by ShaderEffectItem::paint().
Returns the bounding rectangle of the text as it will appear when drawn inside the given rectangle with the specified flags using the currently set font(); i.
e the function tells you where the drawText() function will draw when given the same arguments.
If the text does not fit within the given rectangle using the specified flags, the function returns the required rectangle.
The flags argument is a bitwise OR of the following flags:
If several of the horizontal or several of the vertical alignment flags are set, the resulting alignment is undefined.
Definition at line 7093 of file qpainter.cpp.
Referenced by qDrawPlainRect().
Returns the bounding rectangle of the text as it will appear when drawn inside the given rectangle with the specified flags using the currently set font().
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 7082 of file qpainter.cpp.
Returns the bounding rectangle of the given text as it will appear when drawn inside the rectangle beginning at the point ({x}, {y}) with width w and height h.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 970 of file qpainter.h.
QRectF QPainter::boundingRect | ( | const QRectF & | rectangle, |
const QString & | text, | ||
const QTextOption & | option = QTextOption() |
||
) |
Instead of specifying flags as a bitwise OR of the Qt::AlignmentFlag and Qt::TextFlag, this overloaded function takes an option argument.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
The QTextOption class provides a description of general rich text properties.
Definition at line 7118 of file qpainter.cpp.
const QBrush & QPainter::brush | ( | ) | const |
Returns the painter's current brush.
Definition at line 4232 of file qpainter.cpp.
Referenced by QSvgFillStyle::apply(), QSvgViewportFillStyle::apply(), QSvgAnimateColor::apply(), QSvgPolyline::draw(), QTextLayout::draw(), QSvgText::draw(), QGraphicsScenePrivate::draw(), QWindowsCEStyle::drawComplexControl(), QWindowsMobileStyle::drawComplexControl(), QCleanlooksStyle::drawComplexControl(), QWindowsStyle::drawComplexControl(), QGtkStyle::drawComplexControl(), QCommonStyle::drawControl(), QMacStyle::drawControl(), drawImage(), drawPixmap(), QCommonStyle::drawPrimitive(), QCleanlooksStyle::drawPrimitive(), QCDEStyle::drawPrimitive(), QMotifStyle::drawPrimitive(), QTextDocumentLayoutPrivate::drawTableCell(), QCoreGraphicsPaintEngine::drawTextItem(), drawTextItemDecoration(), QVGPaintEngine::fill(), QOpenGLPaintEngine::fill(), fillRect(), qDrawPlainRect(), qDrawShadeRect(), and setBrush().
QPoint QPainter::brushOrigin | ( | ) | const |
Returns the currently set brush origin.
Definition at line 2168 of file qpainter.cpp.
Referenced by QItemDelegate::drawBackground(), QTreeView::drawBranches(), QWindowsStyle::drawControl(), QMotifStyle::drawControl(), QCommonStyle::drawPrimitive(), QWindowsVistaStyle::drawPrimitive(), QWindowsMobileStyle::drawPrimitive(), QGtkStyle::drawPrimitive(), QTextDocumentLayoutPrivate::drawTableCell(), QCoreGraphicsPaintEngine::drawTextItem(), drawTextItemDecoration(), QWidgetPrivate::paintBackground(), QHeaderView::paintSection(), and qDrawPlainRect().
QRectF QPainter::clipBoundingRect | ( | ) | const |
Returns the bounding rectangle of the current clip if there is a clip; otherwise returns an empty rectangle.
Note that the clip region is given in logical coordinates.
The bounding rectangle is not guaranteed to be tight.
Definition at line 2741 of file qpainter.cpp.
QPainterPath QPainter::clipPath | ( | ) | const |
Returns the currently clip as a path.
Note that the clip path is given in logical coordinates.
Definition at line 2690 of file qpainter.cpp.
Referenced by QX11PaintEnginePrivate::systemStateChanged(), QPdfBaseEngine::updateClipPath(), QWin32PrintEngine::updateState(), and QCoreGraphicsPaintEngine::updateState().
QRegion QPainter::clipRegion | ( | ) | const |
Returns the currently set clip region.
Note that the clip region is given in logical coordinates.
Definition at line 2562 of file qpainter.cpp.
Referenced by clipPath(), QWindowsXPStylePrivate::drawBackgroundDirectly(), QWindowsXPStylePrivate::drawBackgroundThruNativeBuffer(), QMacStyle::drawComplexControl(), QCommonStyle::drawControl(), QWindowsMobileStyle::drawControl(), QDecorationStyled::paint(), QDecorationWindows::paint(), QDecorationDefault::paint(), QDeclarativePaintedItem::paint(), QMacCGContext::QMacCGContext(), QWidget::render(), QOpenGLPaintEngine::updateState(), and QPicturePaintEngine::writeCmdLength().
QMatrix QPainter::combinedMatrix | ( | ) | const |
Returns the transformation matrix combining the current window/viewport and world transformation.
It is advisable to use combinedTransform() instead of this function to preserve the properties of perspective transformations.
Definition at line 3082 of file qpainter.cpp.
Referenced by setViewTransformEnabled().
QTransform QPainter::combinedTransform | ( | ) | const |
Returns the transformation matrix combining the current window/viewport and world transformation.
Definition at line 9669 of file qpainter.cpp.
Referenced by combinedMatrix(), QPixmapConvolutionFilter::draw(), qDrawBorderPixmap(), and QMacCGContext::QMacCGContext().
QPainter::CompositionMode QPainter::compositionMode | ( | ) | const |
Returns the current composition mode.
Definition at line 2466 of file qpainter.cpp.
Referenced by QSvgCompOpStyle::apply(), QDeclarativePaintedItem::paint(), and QWidgetPrivate::paintBackground().
QPaintDevice * QPainter::device | ( | ) | const |
Returns the paint device on which this painter is currently painting, or 0 if the painter is not active.
Definition at line 1530 of file qpainter.cpp.
Referenced by begin(), QWindowsXPStylePrivate::drawBackground(), QRasterPaintEngine::drawCachedGlyphs(), QTextDocumentLayoutPrivate::drawFrameDecoration(), QGraphicsView::drawItems(), QEmulationPaintEngine::drawTextItem(), QPicture::exec(), QEmulationPaintEngine::fill(), fillRegion(), QSvgTinyDocument::mapSourceToTarget(), QDeclarativePaintedItem::paint(), ShaderEffect::prepareBufferedDraw(), QMacCGContext::QMacCGContext(), qt_mac_fill_background(), redirected(), QGraphicsScene::render(), QGraphicsView::render(), QWidgetPrivate::render_helper(), ShaderEffectItem::renderEffect(), restoreRedirected(), setFont(), QPainterReplayer::setupTransform(), and QEmulationPaintEngine::stroke().
const QMatrix & QPainter::deviceMatrix | ( | ) | const |
Returns the matrix that transforms from logical coordinates to device coordinates of the platform dependent paint device.
This function is only needed when using platform painting commands on the platform dependent handle (Qt::HANDLE), and the platform does not do transformations nativly.
The QPaintEngine::PaintEngineFeature enum can be queried to determine whether the platform performs the transformations or not.
Definition at line 3110 of file qpainter.cpp.
Referenced by QWindowsXPStylePrivate::drawBackgroundDirectly().
const QTransform & QPainter::deviceTransform | ( | ) | const |
Returns the matrix that transforms from logical coordinates to device coordinates of the platform dependent paint device.
This function is only needed when using platform painting commands on the platform dependent handle (Qt::HANDLE), and the platform does not do transformations nativly.
The QPaintEngine::PaintEngineFeature enum can be queried to determine whether the platform performs the transformations or not.
Definition at line 9579 of file qpainter.cpp.
Referenced by QPixmapConvolutionFilter::draw(), QWindowsXPStylePrivate::drawBackground(), QDeclarativePaintedItem::paint(), QMacCGContext::QMacCGContext(), qt_plastique_draw_gradient(), and QWidget::render().
void QPainter::drawArc | ( | const QRectF & | rectangle, |
int | startAngle, | ||
int | spanAngle | ||
) |
Draws the arc defined by the given rectangle, startAngle and spanAngle.
The startAngle and spanAngle must be specified in 1/16th of a degree, i.e. a full circle equals 5760 (16 * 360). Positive values for the angles mean counter-clockwise while negative values mean the clockwise direction. Zero degrees is at the 3 o'clock position.
Definition at line 4602 of file qpainter.cpp.
Referenced by QCommonStyle::drawComplexControl(), QWindowsCEStyle::drawPrimitive(), QCommonStyle::drawPrimitive(), drawTabShape(), QPicture::exec(), and qDrawRoundedCorners().
|
inline |
Draws the arc defined by the given rectangle, startAngle and spanAngle.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 739 of file qpainter.h.
|
inline |
Draws the arc defined by the rectangle beginning at (x, y) with the specified width and height, and the given startAngle and spanAngle.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 744 of file qpainter.h.
void QPainter::drawChord | ( | const QRectF & | rectangle, |
int | startAngle, | ||
int | spanAngle | ||
) |
Draws the chord defined by the given rectangle, startAngle and spanAngle.
The chord is filled with the current brush().
The startAngle and spanAngle must be specified in 1/16th of a degree, i.e. a full circle equals 5760 (16 * 360). Positive values for the angles mean counter-clockwise while negative values mean the clockwise direction. Zero degrees is at the 3 o'clock position.
Definition at line 4744 of file qpainter.cpp.
Referenced by QPicture::exec().
|
inline |
Draws the chord defined by the rectangle beginning at (x, y) with the specified width and height, and the given startAngle and spanAngle.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 764 of file qpainter.h.
|
inline |
Draws the chord defined by the given rectangle, startAngle and spanAngle.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 759 of file qpainter.h.
void QPainter::drawConvexPolygon | ( | const QPointF * | points, |
int | pointCount | ||
) |
Draws the convex polygon defined by the first pointCount points in the array points using the current pen.
The first point is implicitly connected to the last point, and the polygon is filled with the current brush(). If the supplied polygon is not convex, i.e. it contains at least one angle larger than 180 degrees, the results are undefined.
On some platforms (e.g. X11), the drawConvexPolygon() function can be faster than the drawPolygon() function.
Definition at line 5484 of file qpainter.cpp.
Referenced by QPainterReplayer::process(), and qDrawEdge().
|
inline |
Draws the convex polygon defined by polygon using the current pen and brush.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 640 of file qpainter.h.
void QPainter::drawConvexPolygon | ( | const QPoint * | points, |
int | pointCount | ||
) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Draws the convex polygon defined by the first pointCount points in the array points using the current pen.
Definition at line 5450 of file qpainter.cpp.
|
inline |
Draws the convex polygon defined by polygon using the current pen and brush.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 645 of file qpainter.h.
void QPainter::drawEllipse | ( | const QRectF & | rectangle | ) |
Draws the ellipse defined by the given rectangle.
A filled ellipse has a size of {rectangle}.QRect::size() . A stroked ellipse has a size of {rectangle}.QRect::size(){size()} plus the pen width.
Definition at line 4464 of file qpainter.cpp.
Referenced by QSvgEllipse::draw(), QCommonStyle::drawComplexControl(), QCleanlooksStyle::drawControl(), QStyleHelper::drawDial(), QTextDocumentLayoutPrivate::drawListItem(), QPaintEngine::drawPoints(), QWindowsCEStyle::drawPrimitive(), QCommonStyle::drawPrimitive(), QCleanlooksStyle::drawPrimitive(), drawTabCloseButton(), QPicture::exec(), QGraphicsEllipseItem::paint(), and QPainterReplayer::process().
void QPainter::drawEllipse | ( | const QRect & | rectangle | ) |
Draws the ellipse defined by the given rectangle.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 4508 of file qpainter.cpp.
|
inline |
Draws the ellipse defined by the rectangle beginning at ({x}, {y}) with the given width and height.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 724 of file qpainter.h.
Draws the ellipse positioned at {center} with radii {rx} and {ry}.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 729 of file qpainter.h.
|
inline |
Draws the ellipse positioned at {center} with radii {rx} and {ry}.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 734 of file qpainter.h.
Draws the specified glyphs at the given position.
The position gives the edge of the baseline for the string of glyphs. The glyphs will be retrieved from the font selected by glyphs and at offsets given by the positions in glyphs.
Definition at line 6064 of file qpainter.cpp.
Referenced by QPainterReplayer::process().
void QPainter::drawImage | ( | const QRectF & | targetRect, |
const QImage & | image, | ||
const QRectF & | sourceRect, | ||
Qt::ImageConversionFlags | flags = Qt::AutoColor |
||
) |
Definition at line 5936 of file qpainter.cpp.
Referenced by blendCursor(), buttonChange(), QLinuxFbScreen::doRedraw(), QFbScreen::doRedraw(), QSvgImage::draw(), QPixmapConvolutionFilter::draw(), QPixmapColorizeFilter::draw(), QPixmapDropShadowFilter::draw(), QWindowsXPStylePrivate::drawBackgroundThruNativeBuffer(), QWindowsVistaAnimation::drawBlendedImage(), QPlastiqueStyle::drawComplexControl(), QCleanlooksStyle::drawComplexControl(), QPlastiqueStyle::drawControl(), QCleanlooksStyle::drawControl(), QPlatformSoftwareCursor::drawCursor(), QTextImageHandler::drawObject(), QWindowsMobileStylePrivate::drawPanelItemViewSelected(), QWindowsMobileStyle::drawPrimitive(), QPlastiqueStyle::drawPrimitive(), QCleanlooksStyle::drawPrimitive(), QWindowsMobileStylePrivate::drawScrollbarGrip(), QWindowsMobileStylePrivate::drawScrollbarHandleDown(), QWindowsMobileStylePrivate::drawScrollbarHandleUp(), QWindowsMobileStylePrivate::drawTabBarTab(), QPicture::exec(), operator>>(), QBlittablePixmapData::paintEngine(), QPainterReplayer::process(), qt_blurImage(), qt_plastique_draw_handle(), toVGImageWithOpacity(), toVGImageWithOpacitySubRect(), and QImage::transformed().
|
inline |
Definition at line 897 of file qpainter.h.
|
inline |
Definition at line 903 of file qpainter.h.
|
inline |
Definition at line 909 of file qpainter.h.
Draws the given image into the given rectangle.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 916 of file qpainter.h.
Draws the given image into the given rectangle.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 921 of file qpainter.h.
Draws the given image at the given point.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 5881 of file qpainter.cpp.
Draws the given image at the given point.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 926 of file qpainter.h.
|
inline |
Definition at line 931 of file qpainter.h.
|
inline |
Draws a line defined by line.
Definition at line 573 of file qpainter.h.
Referenced by QSvgLine::draw(), QPainterPrivate::draw_helper(), QTextDocumentLayoutPrivate::drawBlock(), QCommonStyle::drawComplexControl(), QWindowsCEStyle::drawComplexControl(), QPlastiqueStyle::drawComplexControl(), QWindowsMobileStyle::drawComplexControl(), QCleanlooksStyle::drawComplexControl(), QWindowsStyle::drawComplexControl(), QWindowsXPStyle::drawComplexControl(), QGtkStyle::drawComplexControl(), QMotifStyle::drawComplexControl(), QMacStyle::drawComplexControl(), QCommonStyle::drawControl(), QWindowsCEStyle::drawControl(), QPlastiqueStyle::drawControl(), QWindowsMobileStyle::drawControl(), QCleanlooksStyle::drawControl(), QWindowsXPStyle::drawControl(), QWindowsStyle::drawControl(), QMotifStyle::drawControl(), QMacStyle::drawControl(), QTextLayout::drawCursor(), QStyleHelper::drawDial(), QPlastiqueStylePrivate::drawPartialFrame(), QWindowsCEStyle::drawPrimitive(), QCommonStyle::drawPrimitive(), QWindowsVistaStyle::drawPrimitive(), QWindowsMobileStyle::drawPrimitive(), QPlastiqueStyle::drawPrimitive(), QCleanlooksStyle::drawPrimitive(), QWindowsXPStyle::drawPrimitive(), QWindowsStyle::drawPrimitive(), QGtkStyle::drawPrimitive(), QMotifStyle::drawPrimitive(), QMacStyle::drawPrimitive(), QWindowsMobileStylePrivate::drawScrollbarGrip(), QWindowsMobileStylePrivate::drawScrollbarHandleDown(), QWindowsMobileStylePrivate::drawScrollbarHandleUp(), QWindowsMobileStylePrivate::drawTabBarTab(), drawTabBase(), drawTabCloseButton(), drawTabShape(), drawTextItemDecoration(), QPicture::exec(), QScriptEdit::extraAreaPaintEvent(), QTriangulator< T >::ComplexToSimple::Event::operator<(), QGraphicsLineItem::paint(), QWellArray::paintCellContents(), QTableView::paintEvent(), QPagePreview::paintEvent(), QWhatsThat::paintEvent(), QWizardHeader::paintEvent(), QWizardAntiFlickerWidget::paintEvent(), qDrawEdge(), qDrawPlainRect(), qDrawShadeLine(), and qt_cleanlooks_draw_mdibutton().
|
inline |
Draws a line defined by line.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 578 of file qpainter.h.
|
inline |
Draws a line from (x1, y1) to (x2, y2) and sets the current pen position to (x2, y2).
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 583 of file qpainter.h.
Draws a line from p1 to p2.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 589 of file qpainter.h.
Draws a line from p1 to p2.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 595 of file qpainter.h.
void QPainter::drawLines | ( | const QLineF * | lines, |
int | lineCount | ||
) |
Draws the first lineCount lines in the array lines using the current pen.
Definition at line 4873 of file qpainter.cpp.
Referenced by QCommonStyle::drawComplexControl(), QPlastiqueStyle::drawComplexControl(), QCleanlooksStyle::drawComplexControl(), QWindowsXPStyle::drawComplexControl(), QPlastiqueStyle::drawControl(), QCleanlooksStyle::drawControl(), QStyleHelper::drawDial(), drawLines(), QWindowsCEStyle::drawPrimitive(), QCommonStyle::drawPrimitive(), QWindowsMobileStyle::drawPrimitive(), QPlastiqueStyle::drawPrimitive(), QCleanlooksStyle::drawPrimitive(), QWindowsStyle::drawPrimitive(), QMacStyle::drawPrimitive(), QPicture::exec(), QPainterReplayer::process(), qDrawPlainRect(), qDrawShadePanel(), qDrawShadeRect(), qt_cleanlooks_draw_mdibutton(), qt_plastique_draw_frame(), qt_plastique_draw_mdibutton(), and qt_plastique_drawFrame().
Draws the set of lines defined by the list lines using the current pen and brush.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 600 of file qpainter.h.
void QPainter::drawLines | ( | const QPointF * | pointPairs, |
int | lineCount | ||
) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Draws the first lineCount lines in the array pointPairs using the current pen.
The lines are specified as pairs of points so the number of entries in pointPairs must be at least lineCount * 2.
Definition at line 4972 of file qpainter.cpp.
Draws a line for each pair of points in the vector pointPairs using the current pen.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
If there is an odd number of points in the array, the last point will be ignored.
Definition at line 610 of file qpainter.h.
void QPainter::drawLines | ( | const QLine * | lines, |
int | lineCount | ||
) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Draws the first lineCount lines in the array lines using the current pen.
Definition at line 4922 of file qpainter.cpp.
Draws the set of lines defined by the list lines using the current pen and brush.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 605 of file qpainter.h.
void QPainter::drawLines | ( | const QPoint * | pointPairs, |
int | lineCount | ||
) |
Draws the first lineCount lines in the array pointPairs using the current pen.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 4988 of file qpainter.cpp.
Draws a line for each pair of points in the vector pointPairs using the current pen.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 615 of file qpainter.h.
void QPainter::drawPath | ( | const QPainterPath & | path | ) |
Draws the given painter path using the current pen for outline and the current brush for filling.
QPainterPath path; path.moveTo(20, 80); path.lineTo(20, 30); path.cubicTo(80, 0, 50, 50, 80, 80); QPainter painter(this); painter.drawPath(path); |
Definition at line 3502 of file qpainter.cpp.
Referenced by QFontEngine::alphaMapForGlyph(), alphaMapFromPath(), QBalloonTip::balloon(), QSvgArc::draw(), QSvgFont::draw(), QSvgPath::draw(), QTextLayout::draw(), QTextLine::draw(), QPainterPrivate::draw_helper(), drawChord(), QPlastiqueStyle::drawComplexControl(), QCommonStyle::drawControl(), QX11PaintEngine::drawFreetype(), drawPie(), QWindowsCEStyle::drawPrimitive(), QCommonStyle::drawPrimitive(), QWindowsMobileStyle::drawPrimitive(), QMacStyle::drawPrimitive(), drawRoundedRect(), QPicture::exec(), fillPath(), generateWavyPixmap(), QGraphicsPathItem::paint(), QPainterReplayer::process(), and strokePath().
Replays the given picture at the given point.
The QPicture class is a paint device that records and replays QPainter commands. A picture serializes the painter commands to an IO device in a platform-independent format. Everything that can be painted on a widget or pixmap can also be stored in a picture.
This function does exactly the same as QPicture::play() when called with point = QPoint(0, 0).
QPicture picture; QPointF point(10.0, 20.0) picture.load("drawing.pic"); QPainter painter(this); painter.drawPicture(0, 0, picture); |
Definition at line 7282 of file qpainter.cpp.
Referenced by QAlphaPaintEnginePrivate::drawAlphaImage(), QAlphaPaintEngine::flushAndInit(), and QLabel::paintEvent().
|
inline |
Draws the given picture at point (x, y).
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 996 of file qpainter.h.
Replays the given picture at the given point.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 1001 of file qpainter.h.
void QPainter::drawPie | ( | const QRectF & | rectangle, |
int | startAngle, | ||
int | spanAngle | ||
) |
Draws a pie defined by the given rectangle, startAngle and and spanAngle.
The pie is filled with the current brush().
The startAngle and spanAngle must be specified in 1/16th of a degree, i.e. a full circle equals 5760 (16 * 360). Positive values for the angles mean counter-clockwise while negative values mean the clockwise direction. Zero degrees is at the 3 o'clock position.
Definition at line 4670 of file qpainter.cpp.
Referenced by QPicture::exec(), and QGraphicsEllipseItem::paint().
|
inline |
Definition at line 754 of file qpainter.h.
|
inline |
Draws a pie defined by the given rectangle, startAngle and and spanAngle.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 749 of file qpainter.h.
Draws the rectangular portion source of the given pixmap into the given target in the paint device.
If pixmap is a QBitmap it is drawn with the bits that are "set" using the pens color. If backgroundMode is Qt::OpaqueMode, the "unset" bits are drawn using the color of the background brush; if backgroundMode is Qt::TransparentMode, the "unset" bits are transparent. Drawing bitmaps with gradient or texture colors is not supported.
Definition at line 5619 of file qpainter.cpp.
Referenced by _q_paintIntoCache(), QOleDropSource::createCursors(), QPixmap::depth(), QGraphicsEffectSource::draw(), QGraphicsShaderEffect::draw(), QVGPixmapDropShadowFilter::draw(), QPixmapBlurFilter::draw(), QPixmapColorizeFilter::draw(), QPixmapDropShadowFilter::draw(), QGraphicsOpacityEffect::draw(), QTreeViewPrivate::drawAnimatedOperation(), QRenderRule::drawBackgroundImage(), QWindowsXPStylePrivate::drawBackgroundThruNativeBuffer(), QStyleHelper::drawBorderPixmap(), QMacStylePrivate::drawColorlessButton(), QMacStylePrivate::drawCombobox(), QPlastiqueStyle::drawComplexControl(), QCleanlooksStyle::drawComplexControl(), QWindowsStyle::drawComplexControl(), QMacStyle::drawComplexControl(), QWindowsCEStyle::drawControl(), QWindowsVistaStyle::drawControl(), QCommonStyle::drawControl(), QPlastiqueStyle::drawControl(), QWindowsMobileStyle::drawControl(), QCleanlooksStyle::drawControl(), QWindowsXPStyle::drawControl(), QWindowsStyle::drawControl(), QGtkStyle::drawControl(), QMotifStyle::drawControl(), QMacStyle::drawControl(), QStyleSheetStyle::drawControl(), QItemDelegate::drawDecoration(), QGraphicsScenePrivate::drawItemHelper(), QStyle::drawItemPixmap(), QTextImageHandler::drawObject(), QDeclarativeTextPrivate::drawOutline(), QOpenGLPaintEngine::drawPixmap(), QCommonStyle::drawPrimitive(), QWindowsVistaStyle::drawPrimitive(), QPlastiqueStyle::drawPrimitive(), QWindowsStyle::drawPrimitive(), QGtkStyle::drawPrimitive(), QMacStylePrivate::drawTableHeader(), QPSPrintEngine::drawTiledPixmap(), QOpenGLPaintEngine::drawTiledPixmap(), QSplashScreen::event(), QPicture::exec(), QPainterState::init(), QMacPixmapData::macCreatePixels(), QSvgIconEngine::paint(), QDeclarativeImage::paint(), QDeclarativePaintedItem::paint(), QPixmapIconEngine::paint(), QIconLoaderEngine::paint(), QDeclarativeText::paint(), QGraphicsPixmapItem::paint(), QGtkPainter::paintArrow(), QGtkPainter::paintBox(), QGtkPainter::paintBoxGap(), QDecorationWindows::paintButton(), QDecorationDefault::paintButton(), QGtkPainter::paintCheckbox(), QAlphaWidget::paintEvent(), QCommandLinkButton::paintEvent(), QShapedPixmapWidget::paintEvent(), QBalloonTip::paintEvent(), QAxHostWidget::paintEvent(), QWhatsThat::paintEvent(), QWizard::paintEvent(), QGraphicsView::paintEvent(), QWizardHeader::paintEvent(), QRollEffect::paintEvent(), QMdi::ControlLabel::paintEvent(), QColorPicker::paintEvent(), QColorLuminancePicker::paintEvent(), QGtkPainter::paintExpander(), QGtkPainter::paintExtention(), QGtkPainter::paintFlatBox(), QGtkPainter::paintFocus(), QGtkPainter::paintHandle(), QGtkPainter::paintHline(), QGtkPainter::paintOption(), QGtkPainter::paintResizeGrip(), QGtkPainter::paintShadow(), QGtkPainter::paintSlider(), QGtkPainter::paintVline(), QGraphicsWidget::paintWindowFrame(), QPainterReplayer::process(), QGLPixmapColorizeFilter::processGL(), QGLPixmapConvolutionFilter::processGL(), QGLPixmapBlurFilter::processGL(), QGLPixmapDropShadowFilter::processGL(), qDrawPlainRect(), qt_fill_tile(), qt_mac_constructQIconFromIconRef(), qt_mac_grabDisplayRect(), qt_plastique_draw_gradient(), QWidgetPrivate::render_helper(), QPixmap::scroll(), QWindowsStyle::standardIconImplementation(), QCommonStyle::standardIconImplementation(), QMacStyle::standardIconImplementation(), QCommonStyle::standardPixmap(), and QWindowsStyle::standardPixmap().
|
inline |
Draws the rectangular portion source of the given pixmap into the given target in the paint device.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 845 of file qpainter.h.
|
inline |
Draws the rectangular portion with the origin ({sx}, {sy}), width sw and height sh, of the given pixmap , at the point ({x}, {y}), with a width of w and a height of h.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
If sw or sh are equal to zero the width/height of the pixmap is used and adjusted by the offset sx/sy;
Definition at line 870 of file qpainter.h.
|
inline |
Draws a pixmap at ({x}, {y}) by copying a part of the given pixmap into the paint device.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
({x}, {y}) specifies the top-left point in the paint device that is to be drawn onto. ({sx}, {sy}) specifies the top-left point in pixmap that is to be drawn. The default is (0, 0).
({sw}, {sh}) specifies the size of the pixmap that is to be drawn. The default, (0, 0) (and negative) means all the way to the bottom-right of the pixmap.
Definition at line 876 of file qpainter.h.
|
inline |
Draws the rectangular portion source of the given pixmap with its origin at the given point.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 882 of file qpainter.h.
|
inline |
Draws the rectangular portion source of the given pixmap with its origin at the given point.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 887 of file qpainter.h.
Draws the given pixmap with its origin at the given point.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 5548 of file qpainter.cpp.
Draws the given pixmap with its origin at the given point.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 850 of file qpainter.h.
|
inline |
Draws the given pixmap at position ({x}, {y}).
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 860 of file qpainter.h.
Draws the given pixmap into the given rectangle.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 855 of file qpainter.h.
|
inline |
Draws the pixmap into the rectangle at position ({x}, {y}) with the given width and height.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 865 of file qpainter.h.
void QPainter::drawPixmapFragments | ( | const PixmapFragment * | fragments, |
int | fragmentCount, | ||
const QPixmap & | pixmap, | ||
PixmapFragmentHints | hints = 0 |
||
) |
This function is used to draw pixmap, or a sub-rectangle of pixmap, at multiple positions with different scale, rotation and opacity.
fragments is an array of fragmentCount elements specifying the parameters used to draw each pixmap fragment. The hints parameter can be used to pass in drawing hints.
This function is potentially faster than multiple calls to drawPixmap(), since the backend can optimize state changes.
Definition at line 9697 of file qpainter.cpp.
Referenced by QDeclarativeParticlesPainter::paint(), and qDrawBorderPixmap().
void QPainter::drawPixmapFragments | ( | const QRectF * | targetRects, |
const QRectF * | sourceRects, | ||
int | fragmentCount, | ||
const QPixmap & | pixmap, | ||
PixmapFragmentHints | hints = 0 |
||
) |
This function is used to draw the same pixmap with multiple target and source rectangles specified by targetRects.
If sourceRects is 0, the whole pixmap will be rendered at each of the target rectangles. The hints parameter can be used to pass in drawing hints.
This function is potentially faster than multiple calls to drawPixmap(), since the backend can optimize state changes.
Definition at line 9763 of file qpainter.cpp.
|
inline |
Draws a single point at the given position using the current pen's color.
Definition at line 676 of file qpainter.h.
Referenced by QPlastiqueStyle::drawComplexControl(), QWindowsCEStyle::drawControl(), QPlastiqueStyle::drawControl(), QCleanlooksStyle::drawControl(), QWindowsStyle::drawControl(), QMotifStyle::drawControl(), QWindowsCEStyle::drawPrimitive(), QWindowsMobileStyle::drawPrimitive(), QCleanlooksStyle::drawPrimitive(), QWindowsXPStyle::drawPrimitive(), QPicture::exec(), QWhatsThat::paintEvent(), QWizardHeader::paintEvent(), qDrawPlainRect(), and qt_cleanlooks_draw_mdibutton().
|
inline |
Draws a single point at the given position using the current pen's color.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 687 of file qpainter.h.
|
inline |
Draws a single point at position (x, y).
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 681 of file qpainter.h.
void QPainter::drawPoints | ( | const QPointF * | points, |
int | pointCount | ||
) |
Draws the first pointCount points in the array points using the current pen's color.
Definition at line 3816 of file qpainter.cpp.
Referenced by QPlastiqueStyle::drawComplexControl(), QCleanlooksStyle::drawComplexControl(), QWindowsStyle::drawComplexControl(), QPlastiqueStyle::drawControl(), QCleanlooksStyle::drawControl(), QPlastiqueStyle::drawPrimitive(), QCleanlooksStyle::drawPrimitive(), QMotifStyle::drawPrimitive(), QPainterReplayer::process(), qt_cleanlooks_draw_mdibutton(), qt_plastique_draw_frame(), qt_plastique_draw_mdibutton(), and qt_plastique_drawFrame().
|
inline |
Draws the points in the vector points.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 692 of file qpainter.h.
void QPainter::drawPoints | ( | const QPoint * | points, |
int | pointCount | ||
) |
Draws the first pointCount points in the array points using the current pen's color.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 3881 of file qpainter.cpp.
|
inline |
Draws the points in the vector points.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 697 of file qpainter.h.
void QPainter::drawPolygon | ( | const QPointF * | points, |
int | pointCount, | ||
Qt::FillRule | fillRule = Qt::OddEvenFill |
||
) |
Draws the polygon defined by the first pointCount points in the array points using the current pen and brush.
The first point is implicitly connected to the last point, and the polygon is filled with the current brush().
If fillRule is Qt::WindingFill, the polygon is filled using the winding fill algorithm. If fillRule is Qt::OddEvenFill, the polygon is filled using the odd-even fill algorithm. See Qt::FillRule for a more detailed description of these fill rules.
Definition at line 5205 of file qpainter.cpp.
Referenced by QSvgPolygon::draw(), QSvgPolyline::draw(), QCommonStyle::drawComplexControl(), QWindowsCEStyle::drawComplexControl(), QWindowsMobileStyle::drawComplexControl(), QWindowsStyle::drawComplexControl(), QMotifStyle::drawComplexControl(), QCommonStyle::drawControl(), QMotifStyle::drawControl(), QCommonStyle::drawPrimitive(), QCDEStyle::drawPrimitive(), QWindowsStyle::drawPrimitive(), QMotifStyle::drawPrimitive(), QLCDNumberPrivate::drawSegment(), QPicture::exec(), QX11PaintEnginePrivate::fillPolygon_dev(), QGraphicsPolygonItem::paint(), QColorLuminancePicker::paintEvent(), QPainterReplayer::process(), and qDrawPlainRect().
|
inline |
Draws the polygon defined by the given points using the fill rule fillRule.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 630 of file qpainter.h.
void QPainter::drawPolygon | ( | const QPoint * | points, |
int | pointCount, | ||
Qt::FillRule | fillRule = Qt::OddEvenFill |
||
) |
Draws the polygon defined by the first pointCount points in the array points.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 5247 of file qpainter.cpp.
|
inline |
Draws the polygon defined by the given points using the fill rule fillRule.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 635 of file qpainter.h.
void QPainter::drawPolyline | ( | const QPointF * | points, |
int | pointCount | ||
) |
Draws the polyline defined by the first pointCount points in points using the current pen.
Note that unlike the drawPolygon() function the last point is not connected to the first, neither is the polyline filled.
Definition at line 5055 of file qpainter.cpp.
Referenced by QSvgPolyline::draw(), QCommonStyle::drawPrimitive(), QCDEStyle::drawPrimitive(), QWindowsStyle::drawPrimitive(), QMotifStyle::drawPrimitive(), QWindowsCEStylePrivate::drawWinCEShades(), QWindowsCEStylePrivate::drawWinCEShadesSunken(), QWindowsCEStylePrivate::drawWinShades(), QPicture::exec(), QPainterReplayer::process(), qDrawShadeLine(), and qDrawWinShades().
|
inline |
Draws the polyline defined by the given points using the current pen.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 620 of file qpainter.h.
void QPainter::drawPolyline | ( | const QPoint * | points, |
int | pointCount | ||
) |
Draws the polyline defined by the first pointCount points in points using the current pen.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 5099 of file qpainter.cpp.
|
inline |
Draws the polyline defined by the given points using the current pen.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 625 of file qpainter.h.
|
inline |
Draws the current rectangle with the current pen and brush.
A filled rectangle has a size of {rectangle}.size(). A stroked rectangle has a size of {rectangle}.size() plus the pen width.
Definition at line 650 of file qpainter.h.
Referenced by QFontEngineBox::boundingBox(), QmlJSDebugger::ToolBarColorBox::createDragPixmap(), QSvgRect::draw(), QGraphicsScenePrivate::draw(), QTextDocumentLayoutPrivate::drawBorder(), QPaintEnginePrivate::drawBoxTextItem(), QWindowsCEStyle::drawComplexControl(), QPlastiqueStyle::drawComplexControl(), QWindowsMobileStyle::drawComplexControl(), QCleanlooksStyle::drawComplexControl(), QWindowsStyle::drawComplexControl(), QMotifStyle::drawComplexControl(), QWindowsCEStyle::drawControl(), QWindowsVistaStyle::drawControl(), QCommonStyle::drawControl(), QCleanlooksStyle::drawControl(), QWindowsXPStyle::drawControl(), QWindowsStyle::drawControl(), QMotifStyle::drawControl(), QMacStyle::drawControl(), QItemDelegate::drawDisplay(), drawImage(), drawPixmap(), QPaintEngine::drawPoints(), QWindowsCEStyle::drawPrimitive(), QCommonStyle::drawPrimitive(), QWindowsVistaStyle::drawPrimitive(), QWindowsMobileStyle::drawPrimitive(), QPlastiqueStyle::drawPrimitive(), QCleanlooksStyle::drawPrimitive(), QWindowsXPStyle::drawPrimitive(), QWindowsStyle::drawPrimitive(), QMacStyle::drawPrimitive(), QDeclarativeRectangle::drawRect(), drawRoundedRect(), QWindowsMobileStylePrivate::drawScrollbarGrip(), drawTiledPixmap(), QPicture::exec(), fillRect(), QDeclarativeRectangle::generateBorderedRect(), QColorWell::mouseMoveEvent(), QColorShowLabel::mouseMoveEvent(), QFontFamilyDelegate::paint(), QGraphicsRectItem::paint(), QGraphicsItemGroup::paint(), QPagePreview::paintEvent(), QWhatsThat::paintEvent(), qDrawEdge(), qDrawPlainRect(), qDrawShadeRect(), and qt_graphicsItem_highlightSelected().
|
inline |
Draws a rectangle with upper left corner at ({x}, {y}) and with the given width and height.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 655 of file qpainter.h.
|
inline |
Draws the current rectangle with the current pen and brush.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 661 of file qpainter.h.
void QPainter::drawRects | ( | const QRectF * | rectangles, |
int | rectCount | ||
) |
Draws the first rectCount of the given rectangles using the current pen and brush.
Definition at line 3641 of file qpainter.cpp.
Referenced by QCleanlooksStyle::drawPrimitive(), QPainterReplayer::process(), and QWidgetPrivate::setWindowOpacity_sys().
Draws the given rectangles using the current pen and brush.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 666 of file qpainter.h.
void QPainter::drawRects | ( | const QRect * | rects, |
int | rectCount | ||
) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Draws the first rectCount of the given rectangles using the current pen and brush.
Definition at line 3701 of file qpainter.cpp.
Draws the given rectangles using the current pen and brush.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 671 of file qpainter.h.
void QPainter::drawRoundedRect | ( | const QRectF & | rect, |
qreal | xRadius, | ||
qreal | yRadius, | ||
Qt::SizeMode | mode = Qt::AbsoluteSize |
||
) |
Draws the given rectangle rect with rounded corners.
The xRadius and yRadius arguments specify the radii of the ellipses defining the corners of the rounded rectangle. When mode is Qt::RelativeSize, xRadius and yRadius are specified in percentage of half the rectangle's width and height respectively, and should be in the range 0.0 to 100.0.
A filled rectangle has a size of rect.size(). A stroked rectangle has a size of rect.size() plus the pen width.
Definition at line 4348 of file qpainter.cpp.
Referenced by QSvgRect::draw(), QDeclarativeRectangle::drawRect(), drawRoundRect(), QPicture::exec(), and QDeclarativeRectangle::generateRoundedRect().
|
inline |
Definition at line 712 of file qpainter.h.
|
inline |
Definition at line 718 of file qpainter.h.
void QPainter::drawRoundRect | ( | const QRectF & | r, |
int | xRnd = 25 , |
||
int | yRnd = 25 |
||
) |
Draws a rectangle r with rounded corners.
The xRnd and yRnd arguments specify how rounded the corners should be. 0 is angled corners, 99 is maximum roundedness.
A filled rectangle has a size of r.size(). A stroked rectangle has a size of r.size() plus the pen width.
Definition at line 4414 of file qpainter.cpp.
|
inline |
Draws the rectangle x, y, w, h with rounded corners.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 702 of file qpainter.h.
|
inline |
Draws the rectangle r with rounded corners.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 707 of file qpainter.h.
void QPainter::drawStaticText | ( | const QPointF & | topLeftPosition, |
const QStaticText & | staticText | ||
) |
Draws the given staticText at the given topLeftPosition.
The text will be drawn using the font and the transformation set on the painter. If the font and/or transformation set on the painter are different from the ones used to initialize the layout of the QStaticText, then the layout will have to be recalculated. Use QStaticText::prepare() to initialize staticText with the font and transformation with which it will later be drawn.
If topLeftPosition is not the same as when staticText was initialized, or when it was last drawn, then there will be a slight overhead when translating the text to its new position.
Definition at line 6260 of file qpainter.cpp.
|
inline |
Draws the staticText at the topLeftPosition.
Definition at line 940 of file qpainter.h.
|
inline |
Draws the staticText at coordinates left and top.
Definition at line 945 of file qpainter.h.
Draws the given text with the currently defined text direction, beginning at the given position.
This function does not handle the newline character (
), as it cannot break text into multiple lines, and it cannot display the newline character. Use the QPainter::drawText() overload that takes a rectangle instead if you want to draw multiple lines of text with the newline character, or if you want the text to be wrapped.
By default, QPainter draws text anti-aliased.
Definition at line 6231 of file qpainter.cpp.
Referenced by boundingRect(), QDragManager::drag(), QTextLine::draw(), QCommonStyle::drawComplexControl(), QPlastiqueStyle::drawComplexControl(), QCleanlooksStyle::drawComplexControl(), QWindowsXPStyle::drawComplexControl(), QGtkStyle::drawComplexControl(), QStyleSheetStyle::drawComplexControl(), QSplashScreen::drawContents(), QWindowsCEStyle::drawControl(), QWindowsVistaStyle::drawControl(), QPlastiqueStyle::drawControl(), QCleanlooksStyle::drawControl(), QWindowsXPStyle::drawControl(), QWindowsStyle::drawControl(), QGtkStyle::drawControl(), QMotifStyle::drawControl(), QMacStyle::drawControl(), QStyleSheetStyle::drawControl(), QWindowsCEStyle::drawItemText(), QCleanlooksStyle::drawItemText(), QStyle::drawItemText(), QDeclarativeTextPrivate::drawTextLayout(), QVistaHelper::drawTitleText(), QPicture::exec(), QScriptEdit::extraAreaPaintEvent(), QDecorationWindows::paint(), QDecorationDefault::paint(), QFontFamilyDelegate::paint(), QStatusBar::paintEvent(), QPagePreview::paintEvent(), QWhatsThat::paintEvent(), QLineEdit::paintEvent(), printPage(), QPainterReplayer::process(), qDrawPlainRect(), qt_mac_read_fontsmoothing_settings(), QWidget::update(), and QCommonStylePrivate::viewItemDrawText().
Draws the given text with the currently defined text direction, beginning at the given position.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
By default, QPainter draws text anti-aliased.
Definition at line 955 of file qpainter.h.
|
inline |
Draws the given text at position ({x}, {y}), using the painter's currently defined text direction.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
By default, QPainter draws text anti-aliased.
Definition at line 965 of file qpainter.h.
void QPainter::drawText | ( | const QPointF & | p, |
const QString & | str, | ||
int | tf, | ||
int | justificationPadding | ||
) |
Definition at line 6368 of file qpainter.cpp.
void QPainter::drawText | ( | const QRectF & | rectangle, |
int | flags, | ||
const QString & | text, | ||
QRectF * | boundingRect = 0 |
||
) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Draws the given text within the provided rectangle.
QPainter painter(this); painter.drawText(rect, Qt::AlignCenter, tr("Qt by\nNokia")); |
The boundingRect (if not null) is set to the what the bounding rectangle should be in order to enclose the whole text. The flags argument is a bitwise OR of the following flags:
By default, QPainter draws text anti-aliased.
Definition at line 6528 of file qpainter.cpp.
void QPainter::drawText | ( | const QRect & | rectangle, |
int | flags, | ||
const QString & | text, | ||
QRect * | boundingRect = 0 |
||
) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Draws the given text within the provided rectangle according to the specified flags.
The boundingRect (if not null) is set to the what the bounding rectangle should be in order to enclose the whole text.
By default, QPainter draws text anti-aliased.
Definition at line 6450 of file qpainter.cpp.
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Draws the given text within the rectangle with origin ({x}, {y}), width and height.
The boundingRect (if not null) is set to the actual bounding rectangle of the output. The flags argument is a bitwise OR of the following flags:
By default, QPainter draws text anti-aliased.
Definition at line 960 of file qpainter.h.
void QPainter::drawText | ( | const QRectF & | rectangle, |
const QString & | text, | ||
const QTextOption & | option = QTextOption() |
||
) |
Draws the given text in the rectangle specified using the option to control its positioning and orientation.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
By default, QPainter draws text anti-aliased.
Definition at line 6627 of file qpainter.cpp.
Draws the text item ti at position p.
This method ignores the painters background mode and color. drawText and qt_format_text have to do it themselves, as only they know the extents of the complete string.
It ignores the font set on the painter as the text item has one of its own.
The underline and strikeout parameters of the text items font are ignored aswell. You'll need to pass in the correct flags to get underlining and strikeout.
Definition at line 6864 of file qpainter.cpp.
Referenced by QFontEngineXLFD::bitmapForGlyphs(), QTextLine::draw(), drawMenuText(), and drawText().
|
inline |
Definition at line 892 of file qpainter.h.
Draws the text item ti at position p.
Definition at line 950 of file qpainter.h.
void QPainter::drawTiledPixmap | ( | const QRectF & | rectangle, |
const QPixmap & | pixmap, | ||
const QPointF & | position = QPointF() |
||
) |
Draws a tiled pixmap, inside the given rectangle with its origin at the given position.
Calling drawTiledPixmap() is similar to calling drawPixmap() several times to fill (tile) an area with a pixmap, but is potentially much more efficient depending on the underlying window system.
Definition at line 7146 of file qpainter.cpp.
Referenced by QRenderRule::drawBackgroundImage(), QCommonStyle::drawControl(), QWindowsStyle::drawControl(), QMotifStyle::drawControl(), QWidgetPrivate::drawWidget(), QPicture::exec(), fillRegion(), QDeclarativeImage::paint(), QGtkPainter::paintBox(), QGtkPainter::paintBoxGap(), QPainterReplayer::process(), and qt_mac_fill_background().
|
inline |
Definition at line 840 of file qpainter.h.
|
inline |
Draws a tiled pixmap, inside the given rectangle with its origin at the given position.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 835 of file qpainter.h.
bool QPainter::end | ( | ) |
Ends painting.
Any resources used while painting are released. You don't normally need to call this since it is called by the destructor.
Returns true if the painter is no longer active; otherwise returns false.
Definition at line 1929 of file qpainter.cpp.
Referenced by _q_paintIntoCache(), QFontEngine::alphaMapForGlyph(), alphaMapFromPath(), begin(), QFontEngineXLFD::bitmapForGlyphs(), blendCursor(), QGraphicsItem::boundingRegion(), buttonChange(), QDragManager::drag(), QPixmapColorizeFilter::draw(), QPixmapDropShadowFilter::draw(), QPainterPrivate::draw_helper(), QAlphaPaintEnginePrivate::drawAlphaImage(), QMacStylePrivate::drawCombobox(), QCleanlooksStyle::drawComplexControl(), QWindowsStyle::drawComplexControl(), QCommonStyle::drawControl(), QWindowsVistaStyle::drawControl(), QPlastiqueStyle::drawControl(), QWindowsStyle::drawControl(), QGtkStyle::drawControl(), QMotifStyle::drawControl(), QGraphicsScenePrivate::drawItemHelper(), QDeclarativeTextPrivate::drawOutline(), QOpenGLPaintEngine::drawPixmap(), QPlastiqueStyle::drawPrimitive(), QWindowsStyle::drawPrimitive(), QMacStylePrivate::drawTableHeader(), drawTextItem(), QOpenGLPaintEngine::drawTiledPixmap(), QTraceWindowSurface::endPaint(), QX11PaintEnginePrivate::fillPolygon_dev(), QDeclarativeRectangle::generateBorderedRect(), QCommonStyle::generatedIconPixmap(), QDeclarativeRectangle::generateRoundedRect(), make_widget_eventUPP(), QColorWell::mouseMoveEvent(), QColorShowLabel::mouseMoveEvent(), QBlittablePixmapData::paintEngine(), QTipLabel::paintEvent(), QGraphicsView::paintEvent(), QSvgIconEngine::pixmap(), QGraphicsItemEffectSourcePrivate::pixmap(), qt_mac_read_fontsmoothing_settings(), qt_plastique_draw_gradient(), QSvgIOHandler::read(), QWidgetPrivate::render_helper(), QTreeViewPrivate::renderTreeToPixmapForAnimation(), QPixmap::scroll(), QItemDelegate::selected(), QTabBarPrivate::setupMovableTab(), QHeaderViewPrivate::setupSectionIndicator(), QWidgetPrivate::setWindowOpacity_sys(), QWidgetBackingStore::showYellowThing(), QMacStyle::styleHint(), toVGImageWithOpacity(), toVGImageWithOpacitySubRect(), ShaderEffect::updateRenderTargets(), and ~QPainter().
void QPainter::endNativePainting | ( | ) |
Restores the painter after manually issuing native painting commands.
Lets the painter restore any native state that it relies on before calling any other painter commands.
Definition at line 2056 of file qpainter.cpp.
Referenced by ShaderEffectItem::paint().
void QPainter::eraseRect | ( | const QRectF & | rectangle | ) |
Erases the area inside the given rectangle.
Equivalent to calling
Definition at line 7332 of file qpainter.cpp.
Referenced by QCommonStyle::drawControl(), QWindowsCEStyle::drawControl(), QWindowsXPStyle::drawControl(), QWindowsStyle::drawControl(), QComboBoxPrivateScroller::paintEvent(), QColorLuminancePicker::paintEvent(), and QWidget::update().
|
inline |
Erases the area inside the rectangle beginning at (x, y) with the given width and height.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 779 of file qpainter.h.
|
inline |
Erases the area inside the given rectangle.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 774 of file qpainter.h.
void QPainter::fillPath | ( | const QPainterPath & | path, |
const QBrush & | brush | ||
) |
Fills the given path using the given brush.
The outline is not drawn.
Alternatively, you can specify a QColor instead of a QBrush; the QBrush constructor (taking a QColor argument) will automatically create a solid pattern brush.
Definition at line 3456 of file qpainter.cpp.
Referenced by QRenderRule::drawBackground(), QCDEStyle::drawControl(), QMacStyle::drawPrimitive(), QPaintEngine::drawTextItem(), QGraphicsWidget::paintWindowFrame(), and QPainterReplayer::process().
Fills the given rectangle with the brush specified.
Alternatively, you can specify a QColor instead of a QBrush; the QBrush constructor (taking a QColor argument) will automatically create a solid pattern brush.
Definition at line 7420 of file qpainter.cpp.
Referenced by _q_paintItem(), QXlibWindowSurface::beginPaint(), QRasterWindowSurface::beginPaint(), QWSMemorySurface::beginPaint(), QFontEngineXLFD::bitmapForGlyphs(), QmlJSDebugger::ToolBarColorBox::createDragPixmap(), QFbScreen::doRedraw(), QDragManager::drag(), QPixmapDropShadowFilter::draw(), QTextLine::draw(), QGraphicsOpacityEffect::draw(), QPainterPrivate::draw_helper(), QItemDelegate::drawBackground(), QGraphicsView::drawBackground(), QGraphicsScene::drawBackground(), QRenderRule::drawBackground(), QWindowsCEStyle::drawComplexControl(), QCommonStyle::drawComplexControl(), QPlastiqueStyle::drawComplexControl(), QWindowsMobileStyle::drawComplexControl(), QCleanlooksStyle::drawComplexControl(), QWindowsStyle::drawComplexControl(), QWindowsXPStyle::drawComplexControl(), QGtkStyle::drawComplexControl(), QMotifStyle::drawComplexControl(), QStyleSheetStyle::drawComplexControl(), QMacStyle::drawComplexControl(), QCommonStyle::drawControl(), QWindowsCEStyle::drawControl(), QWindowsVistaStyle::drawControl(), QCDEStyle::drawControl(), QPlastiqueStyle::drawControl(), QWindowsMobileStyle::drawControl(), QCleanlooksStyle::drawControl(), QWindowsXPStyle::drawControl(), QWindowsStyle::drawControl(), QGtkStyle::drawControl(), QMotifStyle::drawControl(), QMacStyle::drawControl(), QTextLayout::drawCursor(), QItemDelegate::drawDisplay(), QGraphicsView::drawForeground(), QGraphicsScene::drawForeground(), QStyle::drawItemText(), QTextDocumentLayoutPrivate::drawListItem(), QWindowsMobileStylePrivate::drawPanelItemViewSelected(), drawPixmap(), QWindowsCEStyle::drawPrimitive(), QWindowsVistaStyle::drawPrimitive(), QCommonStyle::drawPrimitive(), QWindowsMobileStyle::drawPrimitive(), QPlastiqueStyle::drawPrimitive(), QCleanlooksStyle::drawPrimitive(), QCDEStyle::drawPrimitive(), QWindowsXPStyle::drawPrimitive(), QWindowsStyle::drawPrimitive(), QGtkStyle::drawPrimitive(), QMotifStyle::drawPrimitive(), QMacStyle::drawPrimitive(), QStyleSheetStyle::drawPrimitive(), QWindowsMobileStylePrivate::drawScrollbarGrip(), QWindowsMobileStylePrivate::drawScrollbarGroove(), QWindowsMobileStylePrivate::drawScrollbarHandleDown(), QWindowsMobileStylePrivate::drawScrollbarHandleUp(), QWindowsMobileStylePrivate::drawTabBarTab(), drawTabBase(), drawTabShape(), drawTextItem(), drawTextItemDecoration(), drawTiledPixmap(), QWidgetPrivate::drawWidget(), QWindowsCEStylePrivate::drawWinCEShades(), QWindowsCEStylePrivate::drawWinCEShadesSunken(), QWindowsCEStylePrivate::drawWinShades(), eraseRect(), QScriptEdit::extraAreaPaintEvent(), QImage::fill(), fillBackground(), fillRect(), fillRegion(), QCommonStyle::generatedIconPixmap(), make_widget_eventUPP(), QTriangulator< T >::ComplexToSimple::Event::operator<(), QDecorationWindows::paint(), QDecorationStyled::paint(), QDeclarativePaintedItem::paint(), QDeclarativeRectangle::paint(), QComboMenuDelegate::paint(), QDecorationWindows::paintButton(), QDecorationDefault::paintButton(), QWellArray::paintCellContents(), QColorWell::paintCellContents(), QBlittablePixmapData::paintEngine(), QWorkspace::paintEvent(), QToolBar::paintEvent(), QMdiArea::paintEvent(), QPagePreview::paintEvent(), QSystemTrayIconSys::paintEvent(), QWizard::paintEvent(), QHeaderView::paintEvent(), QPlainTextEdit::paintEvent(), QGraphicsView::paintEvent(), QWizardAntiFlickerWidget::paintEvent(), QColorPicker::paintEvent(), QColorShowLabel::paintEvent(), QGraphicsWidget::paintWindowFrame(), QPainterReplayer::process(), qDrawPlainRect(), qDrawShadePanel(), qDrawWinShades(), qt_cleanlooks_draw_buttongradient(), qt_cleanlooks_draw_gradient(), qt_cleanlooks_draw_mdibutton(), qt_plastique_draw_gradient(), QTreeViewPrivate::renderTreeToPixmapForAnimation(), QItemDelegate::selected(), setPenAndDrawBackground(), QWidgetBackingStore::showYellowThing(), and ShaderEffect::updateRenderTargets().
|
inline |
Fills the rectangle beginning at ({x}, {y}) with the given width and height, using the given brush.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 784 of file qpainter.h.
Fills the given rectangle with the specified brush.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 7461 of file qpainter.cpp.
Fills the given rectangle with the color specified.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 7532 of file qpainter.cpp.
|
inline |
Fills the rectangle beginning at ({x}, {y}) with the given width and height, using the given color.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 789 of file qpainter.h.
Fills the given rectangle with the color specified.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 7505 of file qpainter.cpp.
|
inline |
Fills the rectangle beginning at ({x}, {y}) with the given width and height, using the given color.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 794 of file qpainter.h.
|
inline |
Fills the given rectangle with the specified color.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 799 of file qpainter.h.
|
inline |
Fills the given rectangle with the specified color.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 804 of file qpainter.h.
|
inline |
Fills the rectangle beginning at ({x}, {y}) with the given width and height, using the brush style specified.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 809 of file qpainter.h.
|
inline |
Fills the given rectangle with the brush style specified.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 814 of file qpainter.h.
|
inline |
Fills the given rectangle with the brush style specified.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 819 of file qpainter.h.
const QFont & QPainter::font | ( | ) | const |
Returns the currently set font used for drawing text.
Definition at line 4312 of file qpainter.cpp.
Referenced by QSvgFontStyle::apply(), QDeclarativeTextLayout::draw(), QSvgText::draw(), QWindowsCEStyle::drawComplexControl(), QPlastiqueStyle::drawComplexControl(), QWindowsMobileStyle::drawComplexControl(), QCleanlooksStyle::drawComplexControl(), QGtkStyle::drawComplexControl(), QCommonStyle::drawControl(), QWindowsCEStyle::drawControl(), QPlastiqueStyle::drawControl(), QWindowsMobileStyle::drawControl(), QWindowsXPStyle::drawControl(), QWindowsStyle::drawControl(), QMotifStyle::drawControl(), QMacStyle::drawControl(), QStyleSheetStyle::drawControl(), drawGlyphRun(), drawStaticText(), and QFontFamilyDelegate::paint().
QFontInfo QPainter::fontInfo | ( | ) | const |
Returns the font info for the painter if the painter is active.
Otherwise, the return value is undefined.
Definition at line 2095 of file qpainter.cpp.
QFontMetrics QPainter::fontMetrics | ( | ) | const |
Returns the font metrics for the painter if the painter is active.
Otherwise, the return value is undefined.
Definition at line 2077 of file qpainter.cpp.
Referenced by QWindowsStyle::drawComplexControl(), QMotifStyle::drawComplexControl(), QMacStyle::drawComplexControl(), QCommonStyle::drawControl(), QWindowsVistaStyle::drawControl(), QCleanlooksStyle::drawControl(), QWindowsXPStyle::drawControl(), QGtkStyle::drawControl(), QMacStyle::drawControl(), QFontFamilyDelegate::paint(), and printPage().
bool QPainter::hasClipping | ( | ) | const |
Returns true if clipping has been set; otherwise returns false.
Definition at line 2499 of file qpainter.cpp.
Referenced by QWindowsXPStylePrivate::drawBackgroundDirectly(), QMacPrintEnginePrivate::newPage_helper(), QMacCGContext::QMacCGContext(), QWidget::render(), setClipping(), and QX11PaintEnginePrivate::systemStateChanged().
void QPainter::initFrom | ( | const QWidget * | widget | ) |
Initializes the painters pen, background and font to the same as the given widget.
This function is called automatically when the painter is opened on a QWidget.
Definition at line 1558 of file qpainter.cpp.
Referenced by QPainterPrivate::attachPainterPrivate(), begin(), and QTabBarPrivate::setupMovableTab().
bool QPainter::isActive | ( | ) | const |
Returns true if begin() has been called and end() has not yet been called; otherwise returns false.
Definition at line 1545 of file qpainter.cpp.
Referenced by QPainterPrivate::attachPainterPrivate(), device(), QPixmapConvolutionFilter::draw(), QPixmapBlurFilter::draw(), QWindowsXPStylePrivate::drawBackground(), QWidgetPrivate::drawWidget(), QTextDocument::print(), QPaintBuffer::processCommands(), qDrawBorderPixmap(), QGraphicsView::render(), QWidget::render(), QWidgetPrivate::render(), and ~QPainter().
Qt::LayoutDirection QPainter::layoutDirection | ( | ) | const |
Returns the layout direction used by the painter when drawing text.
Definition at line 8729 of file qpainter.cpp.
Referenced by _q_paintItem(), QIcon::paint(), and qt_format_text().
const QMatrix & QPainter::matrix | ( | ) | const |
Use worldTransform() instead.
Definition at line 3061 of file qpainter.cpp.
Referenced by clipPath(), and clipRegion().
bool QPainter::matrixEnabled | ( | ) | const |
Use worldMatrixEnabled() instead
Definition at line 3222 of file qpainter.cpp.
qreal QPainter::opacity | ( | ) | const |
Returns the opacity of the painter.
The default value is 1.
Definition at line 2115 of file qpainter.cpp.
Referenced by _q_paintItem(), QSvgOpacityStyle::apply(), QSvgArc::draw(), QSvgLine::draw(), QSvgPolyline::draw(), QSvgText::draw(), QWindowsXPStylePrivate::drawBackground(), QGraphicsScenePrivate::drawItemHelper(), QGraphicsScene::drawItems(), QWidget::render(), and setOpacity().
QPaintEngine * QPainter::paintEngine | ( | ) | const |
Returns the paint engine that the painter is currently operating on if the painter is active; otherwise 0.
Definition at line 1991 of file qpainter.cpp.
Referenced by QPainterPrivate::attachPainterPrivate(), QPixmapConvolutionFilter::draw(), QPixmapBlurFilter::draw(), QPixmapColorizeFilter::draw(), QPixmapDropShadowFilter::draw(), QGraphicsBlurEffect::draw(), QGraphicsDropShadowEffect::draw(), QWindowsXPStylePrivate::drawBackground(), QWindowsXPStylePrivate::drawBackgroundDirectly(), QCommonStyle::drawComplexControl(), QMacStyle::drawComplexControl(), drawTextItemDecoration(), QVistaHelper::drawTitleBar(), XPThemeData::mask(), QPreviewPaintEngine::newPage(), QDecorationStyled::paint(), QDecorationDefault::paint(), QDeclarativePaintedItem::paint(), QDecorationDefault::paintButton(), QVistaBackButton::paintEvent(), QSystemTrayIconSys::paintEvent(), QPainterReplayer::process(), QPaintEngineExReplayer::process(), QPaintBuffer::processCommands(), QGLPixmapBlurFilter::processGL(), QGLPixmapDropShadowFilter::processGL(), qDrawBorderPixmap(), QMacCGContext::QMacCGContext(), qt_vg_drawVGImage(), qt_vg_drawVGImageStencil(), qt_x11_get_brush_gc(), qt_x11_get_pen_gc(), QGLCustomShaderStage::removeFromPainter(), QWidget::render(), and QGLCustomShaderStage::setOnPainter().
const QPen & QPainter::pen | ( | ) | const |
Returns the painter's current pen.
Definition at line 4152 of file qpainter.cpp.
Referenced by QSvgStrokeStyle::apply(), QSvgAnimateColor::apply(), QFontEngineBox::boundingBox(), QSvgArc::draw(), QSvgFont::draw(), QSvgLine::draw(), QSvgPolyline::draw(), QTextLayout::draw(), QSvgText::draw(), QGraphicsScenePrivate::draw(), QTextLine::draw(), QTextDocumentLayoutPrivate::drawBlock(), QPaintEnginePrivate::drawBoxTextItem(), QPlastiqueStyle::drawComplexControl(), QWindowsMobileStyle::drawComplexControl(), QCleanlooksStyle::drawComplexControl(), QGtkStyle::drawComplexControl(), QMacStyle::drawComplexControl(), QCommonStyle::drawControl(), QPlastiqueStyle::drawControl(), QWindowsMobileStyle::drawControl(), QCleanlooksStyle::drawControl(), QWindowsXPStyle::drawControl(), QWindowsStyle::drawControl(), QMacStyle::drawControl(), QTextLayout::drawCursor(), QTextDocumentLayoutPrivate::drawFrame(), QWindowsCEStyle::drawItemText(), QCleanlooksStyle::drawItemText(), QStyle::drawItemText(), QPaintEngine::drawPoints(), drawPoints(), QWindowsVistaStyle::drawPrimitive(), QCommonStyle::drawPrimitive(), QWindowsMobileStyle::drawPrimitive(), QPlastiqueStyle::drawPrimitive(), QCleanlooksStyle::drawPrimitive(), QCDEStyle::drawPrimitive(), QWindowsXPStyle::drawPrimitive(), QWindowsStyle::drawPrimitive(), QMotifStyle::drawPrimitive(), QMacStyle::drawPrimitive(), drawStaticText(), QWindowsMobileStylePrivate::drawTabBarTab(), QTextDocumentLayoutPrivate::drawTableCell(), drawText(), QCoreGraphicsPaintEngine::drawTextItem(), drawTextItem(), drawTextItemDecoration(), QWindowsCEStylePrivate::drawWinCEShades(), QWindowsCEStylePrivate::drawWinCEShadesSunken(), QWindowsCEStylePrivate::drawWinShades(), QPicture::exec(), fillRect(), generateWavyPixmap(), QTableView::paintEvent(), QLineEdit::paintEvent(), QStaticTextPrivate::paintText(), qDrawPlainRect(), qDrawShadeLine(), qDrawShadePanel(), qDrawShadeRect(), qDrawWinShades(), qt_plastique_draw_frame(), qt_plastique_drawFrame(), qt_plastique_drawShadedPanel(), setPen(), QSvgNode::strokeWidth(), and QPicturePaintEngine::writeCmdLength().
|
static |
Using QWidget::render() obsoletes the use of this function.
Returns the replacement for given device. The optional out parameter offset returns the offset within the replaced device.
Definition at line 8391 of file qpainter.cpp.
Referenced by begin(), QAxHostWidget::paintEvent(), qt_mac_fill_background(), and QWidgetPrivate::render().
QPainter::RenderHints QPainter::renderHints | ( | ) | const |
Returns a flag that specifies the rendering hints that are set for this painter.
Definition at line 7675 of file qpainter.cpp.
Referenced by _q_paintIntoCache(), QGraphicsOpacityEffect::draw(), QRenderRule::drawBackground(), QTextDocumentLayoutPrivate::drawBorder(), QRenderRule::drawBorder(), QRenderRule::drawBorderImage(), QTextLayout::drawCursor(), drawImage(), QGraphicsScenePrivate::drawItemHelper(), QRenderRule::drawOutline(), drawPixmap(), QPlastiqueStyle::drawPrimitive(), drawTiledPixmap(), QGraphicsProxyWidget::paint(), QGraphicsView::paintEvent(), QPainterReplayer::process(), and QWidgetPrivate::render_helper().
void QPainter::resetMatrix | ( | ) |
Resets any transformations that were made using translate(), scale(), shear(), rotate(), setWorldMatrix(), setViewport() and setWindow().
It is advisable to use resetTransform() instead of this function to preserve the properties of perspective transformations.
Definition at line 3137 of file qpainter.cpp.
void QPainter::resetTransform | ( | ) |
Resets any transformations that were made using translate(), scale(), shear(), rotate(), setWorldTransform(), setViewport() and setWindow().
Definition at line 9598 of file qpainter.cpp.
Referenced by QPainterPrivate::draw_helper(), and resetMatrix().
void QPainter::restore | ( | ) |
Restores the current painter state (pops a saved state off the stack).
Definition at line 1620 of file qpainter.cpp.
Referenced by _q_paintItem(), QFontEngineBox::boundingBox(), QPainterPrivate::detachPainterPrivate(), QSvgFont::draw(), QSvgTinyDocument::draw(), QTextLayout::draw(), QGraphicsScenePrivate::draw(), QTextLine::draw(), QGraphicsOpacityEffect::draw(), QGraphicsScene::drawBackground(), QWindowsXPStylePrivate::drawBackground(), QRenderRule::drawBackgroundImage(), QTextDocumentLayoutPrivate::drawBorder(), QPaintEnginePrivate::drawBoxTextItem(), QWindowsVistaStyle::drawComplexControl(), QWindowsCEStyle::drawComplexControl(), QCommonStyle::drawComplexControl(), QPlastiqueStyle::drawComplexControl(), QWindowsMobileStyle::drawComplexControl(), QCleanlooksStyle::drawComplexControl(), QWindowsXPStyle::drawComplexControl(), QGtkStyle::drawComplexControl(), QMotifStyle::drawComplexControl(), QStyleSheetStyle::drawComplexControl(), QMacStyle::drawComplexControl(), QSplashScreen::drawContents(), QDeclarativeTextInput::drawContents(), QTextDocument::drawContents(), QTextControl::drawContents(), QWindowsCEStyle::drawControl(), QWindowsVistaStyle::drawControl(), QCommonStyle::drawControl(), QCDEStyle::drawControl(), QWindowsMobileStyle::drawControl(), QPlastiqueStyle::drawControl(), QCleanlooksStyle::drawControl(), QWindowsXPStyle::drawControl(), QWindowsStyle::drawControl(), QGtkStyle::drawControl(), QMotifStyle::drawControl(), QMacStyle::drawControl(), QStyleSheetStyle::drawControl(), QStyleHelper::drawDial(), QItemDelegate::drawDisplay(), QGraphicsScene::drawForeground(), QTextDocumentLayoutPrivate::drawFrameDecoration(), QX11PaintEngine::drawFreetype(), drawImage(), QTextDocumentLayoutPrivate::drawListItem(), QPlastiqueStylePrivate::drawPartialFrame(), drawPicture(), drawPixmap(), QPaintEngine::drawPoints(), drawPoints(), QWindowsCEStyle::drawPrimitive(), QCommonStyle::drawPrimitive(), QWindowsVistaStyle::drawPrimitive(), QWindowsMobileStyle::drawPrimitive(), QPlastiqueStyle::drawPrimitive(), QCleanlooksStyle::drawPrimitive(), QWindowsXPStyle::drawPrimitive(), QWindowsStyle::drawPrimitive(), QGtkStyle::drawPrimitive(), QMotifStyle::drawPrimitive(), QMacStyle::drawPrimitive(), QTreeView::drawRow(), QWindowsMobileStylePrivate::drawTabBarTab(), QPaintEngine::drawTextItem(), drawTextItemDecoration(), drawTiledPixmap(), QWidgetPrivate::drawWidget(), QPaintBufferEngine::end(), QPicture::exec(), fillBackground(), fillRegion(), QAlphaPaintEngine::flushAndInit(), QDecorationStyled::paint(), ShaderEffectItem::paint(), QItemDelegate::paint(), QDeclarativeImage::paint(), QFontFamilyDelegate::paint(), QDeclarativeText::paint(), QGraphicsTextItem::paint(), QCommandLinkButton::paintEvent(), QLabel::paintEvent(), QListView::paintEvent(), QHeaderView::paintEvent(), QGraphicsView::paintEvent(), QStaticTextPrivate::paintText(), QGraphicsWidget::paintWindowFrame(), printPage(), QPainterReplayer::process(), qDrawEdge(), qDrawRoundedCorners(), qt_format_text(), QGraphicsScene::render(), QGraphicsView::render(), QRenderRule::unsetClip(), and QCommonStylePrivate::viewItemDrawText().
|
static |
Using QWidget::render() obsoletes the use of this function.
Restores the previous redirection for the given device after a call to setRedirected().
Definition at line 8344 of file qpainter.cpp.
void QPainter::rotate | ( | qreal | angle | ) |
Rotates the coordinate system the given angle clockwise.
Definition at line 3287 of file qpainter.cpp.
Referenced by QCommonStyle::drawControl(), QWindowsVistaStyle::drawControl(), QWindowsMobileStyle::drawControl(), QPlastiqueStyle::drawControl(), QCleanlooksStyle::drawControl(), QWindowsXPStyle::drawControl(), QWindowsStyle::drawControl(), QGtkStyle::drawControl(), QMotifStyle::drawControl(), QMacStyle::drawControl(), QStyleSheetStyle::drawControl(), and QMacStyle::standardIconImplementation().
void QPainter::save | ( | ) |
Saves the current painter state (pushes the state onto a stack).
A save() must be followed by a corresponding restore(); the end() function unwinds the stack.
Definition at line 1590 of file qpainter.cpp.
Referenced by _q_paintItem(), QPainterPrivate::attachPainterPrivate(), QPaintBufferEngine::begin(), QFontEngineBox::boundingBox(), QSvgFont::draw(), QSvgTinyDocument::draw(), QTextLayout::draw(), QGraphicsScenePrivate::draw(), QTextLine::draw(), QGraphicsOpacityEffect::draw(), QGraphicsScene::drawBackground(), QWindowsXPStylePrivate::drawBackground(), QRenderRule::drawBackgroundImage(), QTextDocumentLayoutPrivate::drawBorder(), QPaintEnginePrivate::drawBoxTextItem(), QWindowsVistaStyle::drawComplexControl(), QWindowsCEStyle::drawComplexControl(), QCommonStyle::drawComplexControl(), QPlastiqueStyle::drawComplexControl(), QWindowsMobileStyle::drawComplexControl(), QCleanlooksStyle::drawComplexControl(), QWindowsXPStyle::drawComplexControl(), QGtkStyle::drawComplexControl(), QMotifStyle::drawComplexControl(), QStyleSheetStyle::drawComplexControl(), QMacStyle::drawComplexControl(), QSplashScreen::drawContents(), QDeclarativeTextInput::drawContents(), QTextDocument::drawContents(), QTextControl::drawContents(), QWindowsCEStyle::drawControl(), QWindowsVistaStyle::drawControl(), QCommonStyle::drawControl(), QCDEStyle::drawControl(), QWindowsMobileStyle::drawControl(), QPlastiqueStyle::drawControl(), QCleanlooksStyle::drawControl(), QWindowsXPStyle::drawControl(), QWindowsStyle::drawControl(), QGtkStyle::drawControl(), QMotifStyle::drawControl(), QMacStyle::drawControl(), QStyleSheetStyle::drawControl(), QStyleHelper::drawDial(), QItemDelegate::drawDisplay(), QGraphicsScene::drawForeground(), QTextDocumentLayoutPrivate::drawFrameDecoration(), QX11PaintEngine::drawFreetype(), drawImage(), QTextDocumentLayoutPrivate::drawListItem(), QPlastiqueStylePrivate::drawPartialFrame(), drawPicture(), drawPixmap(), QPaintEngine::drawPoints(), drawPoints(), QWindowsCEStyle::drawPrimitive(), QWindowsVistaStyle::drawPrimitive(), QCommonStyle::drawPrimitive(), QWindowsMobileStyle::drawPrimitive(), QPlastiqueStyle::drawPrimitive(), QCleanlooksStyle::drawPrimitive(), QWindowsXPStyle::drawPrimitive(), QWindowsStyle::drawPrimitive(), QGtkStyle::drawPrimitive(), QMotifStyle::drawPrimitive(), QMacStyle::drawPrimitive(), QTreeView::drawRow(), QWindowsMobileStylePrivate::drawTabBarTab(), QPaintEngine::drawTextItem(), drawTextItemDecoration(), drawTiledPixmap(), QWidgetPrivate::drawWidget(), QPicture::exec(), fillBackground(), fillRegion(), QAlphaPaintEngine::flushAndInit(), QDecorationStyled::paint(), ShaderEffectItem::paint(), QItemDelegate::paint(), QDeclarativeImage::paint(), QFontFamilyDelegate::paint(), QDeclarativeText::paint(), QGraphicsTextItem::paint(), QCommandLinkButton::paintEvent(), QLabel::paintEvent(), QListView::paintEvent(), QHeaderView::paintEvent(), QGraphicsView::paintEvent(), QStaticTextPrivate::paintText(), QGraphicsWidget::paintWindowFrame(), printPage(), QPainterReplayer::process(), qDrawEdge(), qDrawRoundedCorners(), qt_format_text(), QGraphicsScene::render(), QGraphicsView::render(), QRenderRule::setClip(), setClip(), and QCommonStylePrivate::viewItemDrawText().
Scales the coordinate system by ({sx}, {sy}).
Definition at line 3234 of file qpainter.cpp.
Referenced by QGraphicsItem::boundingRegion(), QSvgFont::draw(), QSvgText::draw(), drawImage(), drawPixmap(), QSvgTinyDocument::mapSourceToTarget(), QDeclarativePaintedItem::paint(), QLabel::paintEvent(), qt_blurImage(), qt_format_text(), and ShaderEffect::updateRenderTargets().
void QPainter::setBackground | ( | const QBrush & | brush | ) |
Sets the background brush of the painter to the given brush.
The background brush is the brush that is filled in when drawing opaque text, stippled lines and bitmaps. The background brush has no effect in transparent background mode (which is the default).
Definition at line 4258 of file qpainter.cpp.
Referenced by QPainterPrivate::draw_helper(), QWindowsCEStyle::drawComplexControl(), QWindowsMobileStyle::drawComplexControl(), QWindowsStyle::drawComplexControl(), QWindowsXPStyle::drawComplexControl(), QCommonStyle::drawControl(), QWindowsCEStyle::drawControl(), QWindowsStyle::drawControl(), QMotifStyle::drawControl(), QPicture::exec(), and QAlphaPaintEnginePrivate::resetState().
void QPainter::setBackgroundMode | ( | Qt::BGMode | mode | ) |
Sets the background mode of the painter to the given mode.
Qt::TransparentMode (the default) draws stippled lines and text without setting the background pixels. Qt::OpaqueMode fills these space with the current background color.
Note that in order to draw a bitmap or pixmap transparently, you must use QPixmap::setMask().
Definition at line 3998 of file qpainter.cpp.
Referenced by QPainterPrivate::draw_helper(), QWindowsCEStyle::drawComplexControl(), QWindowsMobileStyle::drawComplexControl(), QWindowsStyle::drawComplexControl(), QCommonStyle::drawControl(), QWindowsCEStyle::drawControl(), QWindowsStyle::drawControl(), QMotifStyle::drawControl(), drawImage(), drawPixmap(), QWindowsMobileStyle::drawPrimitive(), QCleanlooksStyle::drawPrimitive(), QWindowsStyle::drawPrimitive(), drawTiledPixmap(), QPicture::exec(), and QPainterReplayer::process().
void QPainter::setBrush | ( | const QBrush & | brush | ) |
Sets the painter's brush to the given brush.
The painter's brush defines how shapes are filled.
Definition at line 4171 of file qpainter.cpp.
Referenced by QFontEngine::alphaMapForGlyph(), alphaMapFromPath(), QSvgFillStyle::apply(), QSvgViewportFillStyle::apply(), QSvgAnimateColor::apply(), QBalloonTip::balloon(), QFontEngineBox::boundingBox(), QmlJSDebugger::ToolBarColorBox::createDragPixmap(), QSvgTinyDocument::draw(), QTextLayout::draw(), QGraphicsScenePrivate::draw(), QTextLine::draw(), QPainterPrivate::draw_helper(), QTextDocumentLayoutPrivate::drawBorder(), QPaintEnginePrivate::drawBoxTextItem(), QCommonStyle::drawComplexControl(), QWindowsCEStyle::drawComplexControl(), QPlastiqueStyle::drawComplexControl(), QWindowsMobileStyle::drawComplexControl(), QCleanlooksStyle::drawComplexControl(), QWindowsStyle::drawComplexControl(), QGtkStyle::drawComplexControl(), QMotifStyle::drawComplexControl(), QCommonStyle::drawControl(), QWindowsCEStyle::drawControl(), QWindowsVistaStyle::drawControl(), QCleanlooksStyle::drawControl(), QWindowsXPStyle::drawControl(), QWindowsStyle::drawControl(), QMotifStyle::drawControl(), QMacStyle::drawControl(), QStyleHelper::drawDial(), QTextDocumentLayoutPrivate::drawFrameDecoration(), QX11PaintEngine::drawFreetype(), drawImage(), QTextDocumentLayoutPrivate::drawListItem(), drawPixmap(), QPaintEngine::drawPoints(), QWindowsCEStyle::drawPrimitive(), QCommonStyle::drawPrimitive(), QWindowsMobileStyle::drawPrimitive(), QCleanlooksStyle::drawPrimitive(), QCDEStyle::drawPrimitive(), QWindowsStyle::drawPrimitive(), QMotifStyle::drawPrimitive(), QMacStyle::drawPrimitive(), QDeclarativeRectangle::drawRect(), QLCDNumberPrivate::drawSegment(), drawTabCloseButton(), QTextDocumentLayoutPrivate::drawTableCell(), drawTextItemDecoration(), drawTiledPixmap(), QPicture::exec(), QVGPaintEngine::fill(), QOpenGLPaintEngine::fill(), fillPath(), QX11PaintEnginePrivate::fillPolygon_dev(), fillRect(), QDeclarativeRectangle::generateBorderedRect(), QDeclarativeRectangle::generateRoundedRect(), QFontFamilyDelegate::paint(), QGraphicsPathItem::paint(), QGraphicsRectItem::paint(), QGraphicsEllipseItem::paint(), QGraphicsPolygonItem::paint(), QGraphicsSimpleTextItem::paint(), QGraphicsItemGroup::paint(), QBlittablePixmapData::paintEngine(), QWhatsThat::paintEvent(), QColorLuminancePicker::paintEvent(), QPainterReplayer::process(), qDrawEdge(), qDrawPlainRect(), qDrawRoundedCorners(), qDrawShadeRect(), qt_graphicsItem_highlightSelected(), QAlphaPaintEnginePrivate::resetState(), QSvgFillStyle::revert(), QSvgViewportFillStyle::revert(), QSvgAnimateColor::revert(), QWidgetPrivate::setWindowOpacity_sys(), and strokePath().
void QPainter::setBrush | ( | Qt::BrushStyle | style | ) |
Sets the painter's brush to black color and the specified style.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 4208 of file qpainter.cpp.
|
inline |
Sets the brush's origin to point (x, y).
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 825 of file qpainter.h.
Referenced by QPainterPrivate::draw_helper(), QItemDelegate::drawBackground(), QGraphicsScene::drawBackground(), QTreeView::drawBranches(), QPlastiqueStyle::drawComplexControl(), QMotifStyle::drawComplexControl(), QPlastiqueStyle::drawControl(), QWindowsStyle::drawControl(), QMotifStyle::drawControl(), QGraphicsScene::drawForeground(), drawImage(), drawPixmap(), QWindowsCEStyle::drawPrimitive(), QCommonStyle::drawPrimitive(), QWindowsVistaStyle::drawPrimitive(), QWindowsMobileStyle::drawPrimitive(), QPlastiqueStyle::drawPrimitive(), QCleanlooksStyle::drawPrimitive(), QWindowsStyle::drawPrimitive(), QGtkStyle::drawPrimitive(), QTextDocumentLayoutPrivate::drawTableCell(), drawTextItemDecoration(), drawTiledPixmap(), QPicture::exec(), fillBackground(), QX11PaintEnginePrivate::fillPolygon_dev(), QWidgetPrivate::paintBackground(), QPlainTextEdit::paintEvent(), QHeaderView::paintSection(), QPainterReplayer::process(), qDrawPlainRect(), and QAlphaPaintEnginePrivate::resetState().
|
inline |
Sets the brush's origin to the given position.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 830 of file qpainter.h.
void QPainter::setBrushOrigin | ( | const QPointF & | position | ) |
Sets the brush origin to position.
The brush origin specifies the (0, 0) coordinate of the painter's brush.
Note that while the brushOrigin() was necessary to adopt the parent's background for a widget in Qt 3, this is no longer the case since the Qt 4 painter doesn't paint the background unless you explicitly tell it to do so by setting the widget's QWidget::autoFillBackground property to true.
Definition at line 2198 of file qpainter.cpp.
void QPainter::setClipPath | ( | const QPainterPath & | path, |
Qt::ClipOperation | operation = Qt::ReplaceClip |
||
) |
Enables clipping, and sets the clip path for the painter to the given path, with the clip operation.
Note that the clip path is specified in logical (painter) coordinates.
Definition at line 3365 of file qpainter.cpp.
Referenced by QTextLayout::draw(), QPicture::exec(), QPainterReplayer::process(), QGraphicsView::render(), QAlphaPaintEnginePrivate::resetState(), QRenderRule::setClip(), setClip(), and setClipRect().
void QPainter::setClipping | ( | bool | enable | ) |
Enables clipping if enable is true, or disables clipping if enable is false.
Definition at line 2517 of file qpainter.cpp.
Referenced by QWindowsXPStylePrivate::drawBackgroundThruNativeBuffer(), QWindowsMobileStyle::drawComplexControl(), QCDEStyle::drawControl(), QWindowsMobileStyle::drawControl(), QWindowsMobileStyle::drawPrimitive(), QPicture::exec(), make_widget_eventUPP(), printPage(), QPainterReplayer::process(), qDrawPlainRect(), and QAlphaPaintEnginePrivate::resetState().
void QPainter::setClipRect | ( | const QRectF & | rectangle, |
Qt::ClipOperation | operation = Qt::ReplaceClip |
||
) |
Enables clipping, and sets the clip region to the given rectangle using the given clip operation.
The default operation is to replace the current clip rectangle.
Note that the clip rectangle is specified in logical (painter) coordinates.
Definition at line 2801 of file qpainter.cpp.
Referenced by QTextLine::draw(), QRenderRule::drawBackgroundImage(), QCleanlooksStyle::drawComplexControl(), QWindowsXPStyle::drawComplexControl(), QMacStyle::drawComplexControl(), QTextDocument::drawContents(), QTextControl::drawContents(), QCommonStyle::drawControl(), QWindowsVistaStyle::drawControl(), QPlastiqueStyle::drawControl(), QWindowsMobileStyle::drawControl(), QCleanlooksStyle::drawControl(), QWindowsStyle::drawControl(), QGtkStyle::drawControl(), QMotifStyle::drawControl(), QStyleSheetStyle::drawControl(), QItemDelegate::drawDisplay(), QPlastiqueStylePrivate::drawPartialFrame(), QWindowsXPStyle::drawPrimitive(), QGtkStyle::drawPrimitive(), QTreeView::drawRow(), QItemDelegate::paint(), QDeclarativeImage::paint(), QDeclarativePaintedItem::paint(), QDeclarativeText::paint(), QFocusFrame::paintEvent(), QMdiSubWindow::paintEvent(), QMenuBar::paintEvent(), QLabel::paintEvent(), QPagePreview::paintEvent(), QWhatsThat::paintEvent(), QMenu::paintEvent(), QLineEdit::paintEvent(), QPlainTextEdit::paintEvent(), QGraphicsWidget::paintWindowFrame(), printPage(), QPainterReplayer::process(), qDrawPlainRect(), qt_format_text(), QGraphicsScene::render(), QGraphicsView::render(), and setClip().
void QPainter::setClipRect | ( | const QRect & | rectangle, |
Qt::ClipOperation | operation = Qt::ReplaceClip |
||
) |
Enables clipping, and sets the clip region to the given rectangle using the given clip operation.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 2858 of file qpainter.cpp.
|
inline |
Enables clipping, and sets the clip region to the rectangle beginning at (x, y) with the given width and height.
Definition at line 769 of file qpainter.h.
void QPainter::setClipRegion | ( | const QRegion & | region, |
Qt::ClipOperation | operation = Qt::ReplaceClip |
||
) |
Sets the clip region to the given region using the specified clip operation.
The default clip operation is to replace the current clip region.
Note that the clip region is given in logical coordinates.
Definition at line 2917 of file qpainter.cpp.
Referenced by _q_paintIntoCache(), QTableViewPrivate::drawAndClipSpans(), QWindowsXPStylePrivate::drawBackgroundThruNativeBuffer(), QWindowsVistaStyle::drawComplexControl(), QCommonStyle::drawComplexControl(), QWindowsCEStyle::drawComplexControl(), QPlastiqueStyle::drawComplexControl(), QCleanlooksStyle::drawComplexControl(), QWindowsXPStyle::drawComplexControl(), QStyleSheetStyle::drawComplexControl(), QCommonStyle::drawControl(), QPlastiqueStyle::drawControl(), QWindowsMobileStyle::drawControl(), QWindowsStyle::drawControl(), QGtkStyle::drawControl(), QMotifStyle::drawControl(), QWindowsVistaStyle::drawPrimitive(), QPlastiqueStyle::drawPrimitive(), QCleanlooksStyle::drawPrimitive(), QWindowsXPStyle::drawPrimitive(), QMacStyle::drawPrimitive(), QWidgetPrivate::drawWidget(), QPicture::exec(), fillRegion(), QDecorationStyled::paint(), QDecorationWindows::paint(), QDecorationDefault::paint(), QWidgetPrivate::paintBackground(), QMenuBar::paintEvent(), QMenu::paintEvent(), QGraphicsView::paintEvent(), QGraphicsWidget::paintWindowFrame(), QPainterReplayer::process(), qt_mac_fill_background(), QAlphaPaintEnginePrivate::resetState(), setClipRect(), QWidgetBackingStore::showYellowThing(), and QWidget::update().
void QPainter::setCompositionMode | ( | CompositionMode | mode | ) |
Sets the composition mode to the given mode.
Definition at line 2422 of file qpainter.cpp.
Referenced by _q_paintIntoCache(), QSvgCompOpStyle::apply(), QXcbWindowSurface::beginPaint(), QXlibWindowSurface::beginPaint(), QRasterWindowSurface::beginPaint(), QWSMemorySurface::beginPaint(), QPixmapDropShadowFilter::draw(), QGraphicsOpacityEffect::draw(), QPainterPrivate::draw_helper(), QWindowsVistaStyle::drawControl(), QPicture::exec(), QImage::fill(), QCommonStyle::generatedIconPixmap(), QDecorationStyled::paint(), QDecorationDefault::paint(), QDeclarativePaintedItem::paint(), QWidgetPrivate::paintBackground(), QDecorationDefault::paintButton(), QBlittablePixmapData::paintEngine(), QSystemTrayIconSys::paintEvent(), QPainterReplayer::process(), QSvgCompOpStyle::revert(), QPixmap::scroll(), QItemDelegate::selected(), and ShaderEffect::updateRenderTargets().
void QPainter::setFont | ( | const QFont & | font | ) |
Sets the painter's font to the given font.
This font is used by subsequent drawText() functions. The text color is the same as the pen color.
If you set a font that isn't available, Qt finds a close match. font() will return what you set using setFont() and fontInfo() returns the font actually being used (which may be the same).
Definition at line 4288 of file qpainter.cpp.
Referenced by QSvgFontStyle::apply(), QDragManager::drag(), QWindowsCEStyle::drawComplexControl(), QPlastiqueStyle::drawComplexControl(), QWindowsMobileStyle::drawComplexControl(), QCleanlooksStyle::drawComplexControl(), QGtkStyle::drawComplexControl(), QWindowsCEStyle::drawControl(), QWindowsVistaStyle::drawControl(), QCommonStyle::drawControl(), QPlastiqueStyle::drawControl(), QWindowsMobileStyle::drawControl(), QCleanlooksStyle::drawControl(), QWindowsXPStyle::drawControl(), QWindowsStyle::drawControl(), QGtkStyle::drawControl(), QMotifStyle::drawControl(), QMacStyle::drawControl(), QStyleSheetStyle::drawControl(), QDeclarativeTextPrivate::drawTextLayout(), QPicture::exec(), QStaticTextPrivate::init(), QFontFamilyDelegate::paint(), QGraphicsSimpleTextItem::paint(), QCommandLinkButton::paintEvent(), QMdiSubWindow::paintEvent(), QPagePreview::paintEvent(), QHeaderView::paintEvent(), QGraphicsWidget::paintWindowFrame(), printPage(), QPainterReplayer::process(), QWidgetBackingStore::removeDirtyWidget(), QAlphaPaintEnginePrivate::resetState(), QSvgFontStyle::revert(), and QCommonStylePrivate::viewItemDrawText().
void QPainter::setLayoutDirection | ( | Qt::LayoutDirection | direction | ) |
Sets the layout direction used by the painter when drawing text, to the specified direction.
The default is Qt::LayoutDirectionAuto, which will implicitly determine the direction from the text drawn.
Definition at line 8717 of file qpainter.cpp.
Referenced by _q_paintItem().
void QPainter::setMatrix | ( | const QMatrix & | matrix, |
bool | combine = false |
||
) |
Use setWorldTransform() instead.
Definition at line 3045 of file qpainter.cpp.
Referenced by QMacStyle::drawPrimitive(), and rotateTabPainter().
void QPainter::setMatrixEnabled | ( | bool | enable | ) |
Use setWorldMatrixEnabled() instead.
Definition at line 3209 of file qpainter.cpp.
Referenced by QPicture::exec().
void QPainter::setOpacity | ( | qreal | opacity | ) |
Sets the opacity of the painter to opacity.
The value should be in the range 0.0 to 1.0, where 0.0 is fully transparent and 1.0 is fully opaque.
Opacity set on the painter will apply to all drawing operations individually.
Definition at line 2139 of file qpainter.cpp.
Referenced by _q_paintItem(), QSvgOpacityStyle::apply(), QSvgArc::draw(), QSvgLine::draw(), QSvgPolyline::draw(), QPixmapColorizeFilter::draw(), QSvgText::draw(), QGraphicsScenePrivate::draw(), QGraphicsOpacityEffect::draw(), QPainterPrivate::draw_helper(), QGraphicsScenePrivate::drawItemHelper(), QGraphicsScene::drawItems(), QGraphicsScenePrivate::drawSubtreeRecursive(), QPicture::exec(), QTriangulator< T >::ComplexToSimple::Event::operator<(), QGraphicsView::paintEvent(), QPainterReplayer::process(), QAlphaPaintEnginePrivate::resetState(), QSvgOpacityStyle::revert(), QHeaderViewPrivate::setupSectionIndicator(), toVGImageWithOpacity(), and toVGImageWithOpacitySubRect().
void QPainter::setPen | ( | const QColor & | color | ) |
Sets the painter's pen to have style Qt::SolidLine, width 0 and the specified color.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 4047 of file qpainter.cpp.
Referenced by QFontEngine::alphaMapForGlyph(), alphaMapFromPath(), QSvgStrokeStyle::apply(), QSvgAnimateColor::apply(), QBalloonTip::balloon(), QFontEngineXLFD::bitmapForGlyphs(), QFontEngineBox::boundingBox(), QmlJSDebugger::ToolBarColorBox::createDragPixmap(), QDragManager::drag(), QDeclarativeTextLayout::draw(), QSvgFont::draw(), QSvgTinyDocument::draw(), QSvgPolyline::draw(), QTextLayout::draw(), QGraphicsScenePrivate::draw(), QTextLine::draw(), QPainterPrivate::draw_helper(), QTextDocumentLayoutPrivate::drawBlock(), QTextDocumentLayoutPrivate::drawBorder(), QPaintEnginePrivate::drawBoxTextItem(), QWindowsCEStyle::drawComplexControl(), QCommonStyle::drawComplexControl(), QPlastiqueStyle::drawComplexControl(), QWindowsMobileStyle::drawComplexControl(), QCleanlooksStyle::drawComplexControl(), QWindowsStyle::drawComplexControl(), QWindowsXPStyle::drawComplexControl(), QGtkStyle::drawComplexControl(), QMotifStyle::drawComplexControl(), QStyleSheetStyle::drawComplexControl(), QMacStyle::drawComplexControl(), QSplashScreen::drawContents(), QDeclarativeTextInput::drawContents(), QWindowsCEStyle::drawControl(), QWindowsVistaStyle::drawControl(), QCommonStyle::drawControl(), QPlastiqueStyle::drawControl(), QWindowsMobileStyle::drawControl(), QCleanlooksStyle::drawControl(), QWindowsXPStyle::drawControl(), QWindowsStyle::drawControl(), QGtkStyle::drawControl(), QMotifStyle::drawControl(), QMacStyle::drawControl(), QStyleSheetStyle::drawControl(), QStyleHelper::drawDial(), QItemDelegate::drawDisplay(), QTextDocumentLayoutPrivate::drawFrame(), QTextDocumentLayoutPrivate::drawFrameDecoration(), QX11PaintEngine::drawFreetype(), drawImage(), QWindowsCEStyle::drawItemText(), QCleanlooksStyle::drawItemText(), QStyle::drawItemText(), QTextDocumentLayoutPrivate::drawListItem(), QWindowsMobileStylePrivate::drawPanelItemViewSelected(), QPlastiqueStylePrivate::drawPartialFrame(), QOpenGLPaintEngine::drawPixmap(), drawPixmap(), QPaintEngine::drawPoints(), drawPoints(), QWindowsCEStyle::drawPrimitive(), QWindowsVistaStyle::drawPrimitive(), QCommonStyle::drawPrimitive(), QWindowsMobileStyle::drawPrimitive(), QPlastiqueStyle::drawPrimitive(), QCleanlooksStyle::drawPrimitive(), QCDEStyle::drawPrimitive(), QWindowsXPStyle::drawPrimitive(), QWindowsStyle::drawPrimitive(), QGtkStyle::drawPrimitive(), QMotifStyle::drawPrimitive(), QMacStyle::drawPrimitive(), QDeclarativeRectangle::drawRect(), QLCDNumberPrivate::drawSegment(), drawStaticText(), QWindowsMobileStylePrivate::drawTabBarTab(), drawTabBase(), drawTabCloseButton(), QTextDocumentLayoutPrivate::drawTableCell(), drawTabShape(), drawTextItemDecoration(), QDeclarativeTextPrivate::drawTextLayout(), QOpenGLPaintEngine::drawTiledPixmap(), drawTiledPixmap(), QWindowsCEStylePrivate::drawWinCEShades(), QWindowsCEStylePrivate::drawWinCEShadesSunken(), QWindowsCEStylePrivate::drawWinShades(), QPicture::exec(), QScriptEdit::extraAreaPaintEvent(), fillPath(), QX11PaintEnginePrivate::fillPolygon_dev(), fillRect(), QDeclarativeRectangle::generateBorderedRect(), QDeclarativeRectangle::generateRoundedRect(), generateWavyPixmap(), QTriangulator< T >::ComplexToSimple::Event::operator<(), QDecorationWindows::paint(), QDecorationDefault::paint(), QFontFamilyDelegate::paint(), QGraphicsPathItem::paint(), QGraphicsRectItem::paint(), QGraphicsEllipseItem::paint(), QGraphicsPolygonItem::paint(), QGraphicsLineItem::paint(), QGraphicsSimpleTextItem::paint(), QWellArray::paintCellContents(), QStatusBar::paintEvent(), QTableView::paintEvent(), QPagePreview::paintEvent(), QWhatsThat::paintEvent(), QLineEdit::paintEvent(), QComboBox::paintEvent(), QWizardHeader::paintEvent(), QFileDialogComboBox::paintEvent(), QWizardAntiFlickerWidget::paintEvent(), QColorPicker::paintEvent(), QColorLuminancePicker::paintEvent(), QPainterReplayer::process(), qDrawEdge(), qDrawPlainRect(), qDrawRoundedCorners(), qDrawShadeLine(), qDrawShadePanel(), qDrawShadeRect(), qDrawWinShades(), qt_cleanlooks_draw_mdibutton(), qt_graphicsItem_highlightSelected(), qt_plastique_draw_frame(), qt_plastique_draw_mdibutton(), qt_plastique_drawFrame(), qt_plastique_drawShadedPanel(), QAlphaPaintEnginePrivate::resetState(), QSvgStrokeStyle::revert(), QSvgAnimateColor::revert(), setPenAndDrawBackground(), QWidgetPrivate::setWindowOpacity_sys(), strokePath(), and QSvgNode::transformedBounds().
void QPainter::setPen | ( | const QPen & | pen | ) |
Sets the painter's pen to be the given pen.
The pen defines how to draw lines and outlines, and it also defines the text color.
Definition at line 4083 of file qpainter.cpp.
void QPainter::setPen | ( | Qt::PenStyle | style | ) |
Sets the painter's pen to have the given style, width 0 and black color.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 4121 of file qpainter.cpp.
|
static |
Please use QWidget::render() instead.
Redirects all paint commands for the given paint device, to the replacement device. The optional point offset defines an offset within the source device.
The redirection will not be effective until the begin() function has been called; make sure to call end() for the given device's painter (if any) before redirecting. Call restoreRedirected() to restore the previous redirection.
Definition at line 8293 of file qpainter.cpp.
void QPainter::setRenderHint | ( | RenderHint | hint, |
bool | on = true |
||
) |
Sets the given render hint on the painter if on is true; otherwise clears the render hint.
Definition at line 7620 of file qpainter.cpp.
Referenced by QFontEngine::alphaMapForGlyph(), alphaMapFromPath(), QSvgTinyDocument::draw(), QTextLine::draw(), QPainterPrivate::draw_helper(), QRenderRule::drawBackground(), QTextDocumentLayoutPrivate::drawBorder(), QRenderRule::drawBorder(), QRenderRule::drawBorderImage(), QCommonStyle::drawComplexControl(), QCleanlooksStyle::drawComplexControl(), QMacStyle::drawComplexControl(), QDeclarativeTextInput::drawContents(), QDeclarativeTextEdit::drawContents(), QCommonStyle::drawControl(), QCleanlooksStyle::drawControl(), QMacStyle::drawControl(), QTextLayout::drawCursor(), QStyleHelper::drawDial(), drawImage(), QTextDocumentLayoutPrivate::drawListItem(), QRenderRule::drawOutline(), drawPixmap(), QWindowsCEStyle::drawPrimitive(), QCommonStyle::drawPrimitive(), QWindowsMobileStyle::drawPrimitive(), QPlastiqueStyle::drawPrimitive(), QCleanlooksStyle::drawPrimitive(), QMacStyle::drawPrimitive(), QDeclarativeRectangle::drawRect(), drawTabShape(), QPaintEngine::drawTextItem(), drawTextItem(), drawTiledPixmap(), QPicture::exec(), QScriptEdit::extraAreaPaintEvent(), QDeclarativeRectangle::generateBorderedRect(), QDeclarativeRectangle::generateRoundedRect(), generateWavyPixmap(), QMacPixmapData::macCreatePixels(), QTriangulator< T >::ComplexToSimple::Event::operator<(), QDeclarativeImage::paint(), QDeclarativeBorderImage::paint(), QDeclarativeRectangle::paint(), QDeclarativeText::paint(), QGraphicsPixmapItem::paint(), QLCDNumber::paintEvent(), QGraphicsWidget::paintWindowFrame(), QPainterReplayer::process(), QGLPixmapBlurFilter::processGL(), QGLPixmapDropShadowFilter::processGL(), qDrawBorderPixmap(), qt_blurImage(), and QImage::transformed().
void QPainter::setRenderHints | ( | RenderHints | hints, |
bool | on = true |
||
) |
Sets the given render hints on the painter if on is true; otherwise clears the render hints.
Definition at line 7649 of file qpainter.cpp.
Referenced by _q_paintIntoCache(), QGraphicsItem::boundingRegion(), QGraphicsOpacityEffect::draw(), QDeclarativeRectangle::drawRect(), drawTabCloseButton(), QGraphicsProxyWidget::paint(), QDeclarativeImage::paint(), QDeclarativeBorderImage::paint(), QDeclarativePaintedItem::paint(), QDeclarativeRectangle::paint(), QDeclarativeText::paint(), QGraphicsView::paintEvent(), QGraphicsItemEffectSourcePrivate::pixmap(), QWidgetPrivate::render_helper(), and setRenderHint().
void QPainter::setTransform | ( | const QTransform & | transform, |
bool | combine = false |
||
) |
Sets the world transformation matrix.
If combine is true, the specified transform is combined with the current matrix; otherwise it replaces the current matrix.
Definition at line 9547 of file qpainter.cpp.
Referenced by QPainterPrivate::draw_helper(), QAlphaPaintEnginePrivate::drawAlphaImage(), QCommonStyle::drawControl(), QPlastiqueStyle::drawControl(), QCleanlooksStyle::drawControl(), QGtkStyle::drawControl(), QMotifStyle::drawControl(), QPaintEngine::drawPoints(), QPicture::exec(), QAlphaPaintEngine::flushAndInit(), QStaticTextPrivate::init(), QMacPixmapData::macCreatePixels(), QGraphicsView::paintEvent(), QPainterReplayer::process(), qDrawPlainRect(), QGraphicsView::render(), QWidgetPrivate::render_helper(), QAlphaPaintEnginePrivate::resetState(), QPainterReplayer::setupTransform(), and QImage::transformed().
void QPainter::setViewport | ( | const QRect & | rectangle | ) |
Sets the painter's viewport rectangle to the given rectangle, and enables view transformations.
The viewport rectangle is part of the view transformation. The viewport specifies the device coordinate system. Its sister, the window(), specifies the logical coordinate system.
The default viewport rectangle is the same as the device's rectangle.
Definition at line 7815 of file qpainter.cpp.
Referenced by QPicture::exec().
|
inline |
Sets the painter's viewport rectangle to be the rectangle beginning at (x, y) with the given width and height.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 985 of file qpainter.h.
void QPainter::setViewTransformEnabled | ( | bool | enable | ) |
Enables view transformations if enable is true, or disables view transformations if enable is false.
Definition at line 7906 of file qpainter.cpp.
Referenced by QPicture::exec(), and QAlphaPaintEnginePrivate::resetState().
void QPainter::setWindow | ( | const QRect & | rectangle | ) |
Sets the painter's window to the given rectangle, and enables view transformations.
The window rectangle is part of the view transformation. The window specifies the logical coordinate system. Its sister, the viewport(), specifies the device coordinate system.
The default window rectangle is the same as the device's rectangle.
Definition at line 7745 of file qpainter.cpp.
Referenced by QPicture::exec(), and QTriangulator< T >::ComplexToSimple::Event::operator<().
|
inline |
Sets the painter's window to the rectangle beginning at (x, y) and the given width and height.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 990 of file qpainter.h.
void QPainter::setWorldMatrix | ( | const QMatrix & | matrix, |
bool | combine = false |
||
) |
Sets the transformation matrix to matrix and enables transformations.
If combine is true, then matrix is combined with the current transformation matrix; otherwise matrix replaces the current transformation matrix.
If matrix is the identity matrix and combine is false, this function calls setWorldMatrixEnabled(false). (The identity matrix is the matrix where QMatrix::m11() and QMatrix::m22() are 1.0 and the rest are 0.0.)
The following functions can transform the coordinate system without using a QMatrix:
They operate on the painter's worldMatrix() and are implemented like this:
Note that when using setWorldMatrix() function you should always have combine be true when you are drawing into a QPicture. Otherwise it may not be possible to replay the picture with additional transformations; using the translate(), scale(), etc. convenience functions is safe.
For more information about the coordinate system, transformations and window-viewport conversion, see Coordinate System.
Definition at line 3003 of file qpainter.cpp.
void QPainter::setWorldMatrixEnabled | ( | bool | enable | ) |
Enables transformations if enable is true, or disables transformations if enable is false.
The world transformation matrix is not changed.
Definition at line 3157 of file qpainter.cpp.
Referenced by setMatrixEnabled().
void QPainter::setWorldTransform | ( | const QTransform & | matrix, |
bool | combine = false |
||
) |
Sets the world transformation matrix.
If combine is true, the specified matrix is combined with the current matrix; otherwise it replaces the current matrix.
Definition at line 9630 of file qpainter.cpp.
Referenced by _q_paintIntoCache(), QSvgTransformStyle::apply(), QSvgAnimateTransform::apply(), QGraphicsItem::boundingRegion(), QGraphicsEffectSource::draw(), QGraphicsShaderEffect::draw(), QSvgTinyDocument::draw(), QPixmapBlurFilter::draw(), QGraphicsColorizeEffect::draw(), QSvgText::draw(), QGraphicsDropShadowEffect::draw(), QGraphicsOpacityEffect::draw(), QGraphicsScenePrivate::drawItemHelper(), QGraphicsScene::drawItems(), QGraphicsScenePrivate::drawSubtreeRecursive(), QDeclarativeImage::paint(), QDeclarativeBorderImage::paint(), QGraphicsView::paintEvent(), ShaderEffect::prepareBufferedDraw(), QGraphicsScene::render(), QSvgTransformStyle::revert(), QSvgAnimateTransform::revert(), setMatrix(), setWorldMatrix(), setWorldTransform(), and QSvgNode::transformedBounds().
Shears the coordinate system by ({sh}, {sv}).
Definition at line 3258 of file qpainter.cpp.
void QPainter::strokePath | ( | const QPainterPath & | path, |
const QPen & | pen | ||
) |
Draws the outline (strokes) the path path with the pen specified by pen.
Definition at line 3413 of file qpainter.cpp.
Referenced by drawArc(), QPicture::exec(), QPainterReplayer::process(), and setViewTransformEnabled().
|
inline |
Returns true if hint is set; otherwise returns false.
Definition at line 457 of file qpainter.h.
Referenced by QDeclarativeRectangle::drawRect(), QDeclarativeImage::paint(), QDeclarativeBorderImage::paint(), QDeclarativeRectangle::paint(), QDeclarativeText::paint(), and qDrawBorderPixmap().
const QTransform & QPainter::transform | ( | ) | const |
Returns the world transformation matrix.
Definition at line 9558 of file qpainter.cpp.
Referenced by QSvgArc::bounds(), QSvgEllipse::bounds(), QSvgImage::bounds(), QSvgLine::bounds(), QSvgPath::bounds(), QSvgPolygon::bounds(), QSvgPolyline::bounds(), QSvgRect::bounds(), boundsOnStroke(), QPixmapBlurFilter::draw(), QMotifStyle::drawControl(), QTextLayout::drawCursor(), QPaintEngine::drawPoints(), QPicture::exec(), ShaderEffectItem::paint(), QDeclarativeImage::paint(), QDeclarativeBorderImage::paint(), QPaintBufferEngine::penChanged(), qDrawPlainRect(), qt_format_text(), qt_graphicsItem_highlightSelected(), QPainterReplayer::setupTransform(), and QPicturePaintEngine::writeCmdLength().
void QPainter::translate | ( | const QPointF & | offset | ) |
Translates the coordinate system by the given offset; i.e.
the given offset is added to points.
Definition at line 3311 of file qpainter.cpp.
Referenced by _q_paintIntoCache(), QGraphicsItem::boundingRegion(), QSvgUse::bounds(), QSvgFont::draw(), QPixmapBlurFilter::draw(), QSvgUse::draw(), QGraphicsOpacityEffect::draw(), QPainterPrivate::draw_helper(), QCommonStyle::drawComplexControl(), QWindowsXPStyle::drawComplexControl(), QSplashScreen::drawContents(), QDeclarativeTextEdit::drawContents(), QWindowsVistaStyle::drawControl(), QCommonStyle::drawControl(), QPlastiqueStyle::drawControl(), QWindowsMobileStyle::drawControl(), QCleanlooksStyle::drawControl(), QWindowsXPStyle::drawControl(), QWindowsStyle::drawControl(), QGtkStyle::drawControl(), QMotifStyle::drawControl(), QMacStyle::drawControl(), QStyleSheetStyle::drawControl(), drawImage(), drawPicture(), drawPixmap(), QWindowsCEStyle::drawPrimitive(), QCommonStyle::drawPrimitive(), QWindowsMobileStyle::drawPrimitive(), QCDEStyle::drawPrimitive(), QWindowsXPStyle::drawPrimitive(), QWindowsStyle::drawPrimitive(), QMotifStyle::drawPrimitive(), QMacStyle::drawPrimitive(), QMacStylePrivate::drawTableHeader(), drawTabShape(), QPaintEngine::drawTextItem(), drawTextItemDecoration(), QWidgetPrivate::drawWidget(), QPixmap::fill(), QX11PaintEnginePrivate::fillPolygon_dev(), generateWavyPixmap(), QSvgTinyDocument::mapSourceToTarget(), QTextEditPrivate::paint(), QDeclarativePaintedItem::paint(), QDeclarativeText::paint(), QGraphicsTextItem::paint(), QLCDNumber::paintEvent(), QLabel::paintEvent(), QWhatsThat::paintEvent(), QStaticTextPrivate::paintText(), QGraphicsWidget::paintWindowFrame(), printPage(), QPainterReplayer::process(), QTreeViewPrivate::renderTreeToPixmapForAnimation(), QMacStyle::standardIconImplementation(), and ShaderEffect::updateRenderTargets().
|
inline |
Translates the coordinate system by the given offset.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 980 of file qpainter.h.
Translates the coordinate system by the vector (dx, dy).
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 975 of file qpainter.h.
QRect QPainter::viewport | ( | ) | const |
Returns the viewport rectangle.
Definition at line 7844 of file qpainter.cpp.
bool QPainter::viewTransformEnabled | ( | ) | const |
Returns true if view transformation is enabled; otherwise returns false.
Definition at line 7704 of file qpainter.cpp.
QRect QPainter::window | ( | ) | const |
Returns the window rectangle.
Definition at line 7774 of file qpainter.cpp.
const QMatrix & QPainter::worldMatrix | ( | ) | const |
Returns the world transformation matrix.
It is advisable to use worldTransform() because worldMatrix() does not preserve the properties of perspective transformations.
Definition at line 3024 of file qpainter.cpp.
Referenced by matrix(), and qt_plastique_draw_gradient().
bool QPainter::worldMatrixEnabled | ( | ) | const |
Returns true if world transformation is enabled; otherwise returns false.
Definition at line 3188 of file qpainter.cpp.
Referenced by matrixEnabled().
const QTransform & QPainter::worldTransform | ( | ) | const |
Returns the world transformation matrix.
Definition at line 9652 of file qpainter.cpp.
Referenced by QSvgTransformStyle::apply(), QSvgAnimateTransform::apply(), QGraphicsEffectSource::draw(), QGraphicsShaderEffect::draw(), QSvgTinyDocument::draw(), QPixmapBlurFilter::draw(), QGraphicsColorizeEffect::draw(), QSvgText::draw(), QGraphicsDropShadowEffect::draw(), QGraphicsOpacityEffect::draw(), QGraphicsItemEffectSourcePrivate::draw(), QGraphicsScenePrivate::drawItemHelper(), QGraphicsScene::drawItems(), QGraphicsScenePrivate::drawSubtreeRecursive(), QWidgetPrivate::drawWidget(), QGraphicsView::paintEvent(), ShaderEffect::prepareBufferedDraw(), and QWidgetPrivate::render_helper().
|
friend |
Definition at line 544 of file qpainter.h.
|
friend |
Definition at line 564 of file qpainter.h.
|
friend |
Definition at line 548 of file qpainter.h.
|
friend |
Definition at line 549 of file qpainter.h.
|
friend |
Definition at line 550 of file qpainter.h.
|
friend |
Definition at line 551 of file qpainter.h.
|
friend |
Definition at line 552 of file qpainter.h.
|
friend |
Definition at line 553 of file qpainter.h.
|
friend |
Definition at line 557 of file qpainter.h.
|
friend |
Definition at line 555 of file qpainter.h.
|
friend |
Definition at line 556 of file qpainter.h.
|
friend |
Definition at line 565 of file qpainter.h.
|
friend |
Definition at line 563 of file qpainter.h.
|
friend |
Definition at line 558 of file qpainter.h.
|
friend |
Definition at line 561 of file qpainter.h.
|
friend |
Definition at line 562 of file qpainter.h.
|
friend |
Definition at line 554 of file qpainter.h.
|
friend |
Definition at line 559 of file qpainter.h.
|
friend |
Definition at line 560 of file qpainter.h.
|
private |
Definition at line 546 of file qpainter.h.
Referenced by QPainterPrivate::attachPainterPrivate(), begin(), clipBoundingRect(), clipPath(), clipRegion(), QPainterPrivate::detachPainterPrivate(), QPainterPrivate::draw_helper(), QVGPaintEngine::fill(), QOpenGLPaintEngine::fill(), QPaintEngineExPrivate::hasClipOperations(), QPainter(), QPaintEngineExPrivate::replayClipOperations(), and ~QPainter().