Skip to content

PythonQt.QtGui.QPainter · declarations 003

Back to PythonQt.QtGui.QPainter

drawPoints

drawPoints(points: Any) -> None

X.drawPoints(points)

Supplemental documentation: Qt 5 reference:

void QPainter::drawPoints(const QPointF *points, int pointCount)

Draws the first pointCount points in the array points using the current pen's color.

See also Coordinate System.

void QPainter::drawPoints(const QPolygonF \&points)

This is an overloaded function.

Draws the points in the vector points.

void QPainter::drawPoints(const QPoint *points, int pointCount)

This is an overloaded function.

Draws the first pointCount points in the array points using the current pen's color.

void QPainter::drawPoints(const QPolygon \&points)

This is an overloaded function.

Draws the points in the vector points.

Upstream PySide2 reference signatures (binding differences may apply):

drawPoints(self, arg__1: typing.List[PySide2.QtCore.QPointF]) -> None
drawPoints(self, arg__1: typing.List[PySide2.QtCore.QPoint]) -> None
drawPoints(self, points: PySide2.QtGui.QPolygon) -> None
drawPoints(self, points: PySide2.QtGui.QPolygonF) -> None

Source: https://doc.qt.io/archives/qt-5.15/qpainter.html#drawPoints

drawPolygon

drawPolygon(polygon: Any, fillRule: Any) -> None

X.drawPolygon(polygon, fillRule)

Supplemental documentation: Qt 5 reference:

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.

static const QPointF points[4] = { QPointF(10.0, 80.0), QPointF(20.0, 10.0), QPointF(80.0, 30.0), QPointF(90.0, 70.0) }; QPainter painter(this); painter.drawPolygon(points, 4);

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.

See also drawConvexPolygon(), drawPolyline(), and Coordinate System.

void QPainter::drawPolygon(const QPolygonF \&points, Qt::FillRule fillRule \= Qt::OddEvenFill)

This is an overloaded function.

Draws the polygon defined by the given points using the fill rule fillRule.

void QPainter::drawPolygon(const QPoint *points, int pointCount, Qt::FillRule fillRule \= Qt::OddEvenFill)

This is an overloaded function.

Draws the polygon defined by the first pointCount points in the array points.

void QPainter::drawPolygon(const QPolygon \&points, Qt::FillRule fillRule \= Qt::OddEvenFill)

This is an overloaded function.

Draws the polygon defined by the given points using the fill rule fillRule.

Upstream PySide2 reference signatures (binding differences may apply):

drawPolygon(self, arg__1: typing.List[PySide2.QtCore.QPointF], arg__2: PySide2.QtCore.Qt.FillRule) -> None
drawPolygon(self, arg__1: typing.List[PySide2.QtCore.QPoint], arg__2: PySide2.QtCore.Qt.FillRule) -> None
drawPolygon(self, polygon: PySide2.QtGui.QPolygon, fillRule: PySide2.QtCore.Qt.FillRule=...) -> None
drawPolygon(self, polygon: PySide2.QtGui.QPolygonF, fillRule: PySide2.QtCore.Qt.FillRule=...) -> None

Source: https://doc.qt.io/archives/qt-5.15/qpainter.html#drawPolygon

drawPolyline

drawPolyline(polygon: Any) -> None

X.drawPolyline(polygon)

Supplemental documentation: Qt 5 reference:

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.

static const QPointF points[3] = { QPointF(10.0, 80.0), QPointF(20.0, 10.0), QPointF(80.0, 30.0), }; QPainter painter(this); painter.drawPolyline(points, 3);

See also drawLines(), drawPolygon(), and Coordinate System.

void QPainter::drawPolyline(const QPolygonF \&points)

This is an overloaded function.

Draws the polyline defined by the given points using the current pen.

void QPainter::drawPolyline(const QPoint *points, int pointCount)

This is an overloaded function.

Draws the polyline defined by the first pointCount points in points using the current pen.

void QPainter::drawPolyline(const QPolygon \&points)

This is an overloaded function.

Draws the polyline defined by the given points using the current pen.

Upstream PySide2 reference signatures (binding differences may apply):

drawPolyline(self, arg__1: typing.List[PySide2.QtCore.QPointF]) -> None
drawPolyline(self, arg__1: typing.List[PySide2.QtCore.QPoint]) -> None
drawPolyline(self, polygon: PySide2.QtGui.QPolygon) -> None
drawPolyline(self, polyline: PySide2.QtGui.QPolygonF) -> None

Source: https://doc.qt.io/archives/qt-5.15/qpainter.html#drawPolyline

drawRect

drawRect(x1: Any, y1: Any, w: Any, h: Any) -> None

X.drawRect(x1, y1, w, h)

Supplemental documentation: Qt 5 reference:

void QPainter::drawRect(const QRectF \&rectangle)

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.

QRectF rectangle(10.0, 20.0, 80.0, 60.0); QPainter painter(this); painter.drawRect(rectangle);

See also drawRects(), drawPolygon(), and Coordinate System.

void QPainter::drawRect(int x, int y, int width, int height)

This is an overloaded function.

Draws a rectangle with upper left corner at (x, y) and with the given width and height.

void QPainter::drawRect(const QRect \&rectangle)

This is an overloaded function.

Draws the current rectangle with the current pen and brush.

Upstream PySide2 reference signatures (binding differences may apply):

drawRect(self, rect: PySide2.QtCore.QRect) -> None
drawRect(self, rect: PySide2.QtCore.QRectF) -> None
drawRect(self, x1: int, y1: int, w: int, h: int) -> None

Source: https://doc.qt.io/archives/qt-5.15/qpainter.html#drawRect

drawRects

drawRects(rectangles: Any) -> None

X.drawRects(rectangles)

Supplemental documentation: Qt 5 reference:

void QPainter::drawRects(const QRectF *rectangles, int rectCount)

Draws the first rectCount of the given rectangles using the current pen and brush.

See also drawRect().

void QPainter::drawRects(const QVector\<QRectF> \&rectangles)

This is an overloaded function.

Draws the given rectangles using the current pen and brush.

void QPainter::drawRects(const QRect *rectangles, int rectCount)

This is an overloaded function.

Draws the first rectCount of the given rectangles using the current pen and brush.

void QPainter::drawRects(const QVector\<QRect> \&rectangles)

This is an overloaded function.

Draws the given rectangles using the current pen and brush.

Upstream PySide2 reference signatures (binding differences may apply):

drawRects(self, rectangles: typing.List[PySide2.QtCore.QRectF]) -> None
drawRects(self, rectangles: typing.List[PySide2.QtCore.QRect]) -> None

Source: https://doc.qt.io/archives/qt-5.15/qpainter.html#drawRects

drawRoundRect

drawRoundRect(x: Any, y: Any, w: Any, h: Any, arg__5: Any, arg__6: Any) -> None

X.drawRoundRect(x, y, w, h, arg__5, arg__6)

Upstream PySide2 reference signatures (binding differences may apply):

drawRoundRect(self, r: PySide2.QtCore.QRect, xround: int=..., yround: int=...) -> None
drawRoundRect(self, r: PySide2.QtCore.QRectF, xround: int=..., yround: int=...) -> None
drawRoundRect(self, x: int, y: int, w: int, h: int, xRound: int=..., yRound: int=...) -> None

Source: https://doc.qt.io/archives/qt-5.15/qpainter.html#drawRoundRect

drawRoundedRect

drawRoundedRect(x: Any, y: Any, w: Any, h: Any, xRadius: float, yRadius: float, mode: Any) -> None

X.drawRoundedRect(x, y, w, h, xRadius, yRadius, mode)

Supplemental documentation: Qt 5 reference:

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.

QRectF rectangle(10.0, 20.0, 80.0, 60.0); QPainter painter(this); painter.drawRoundedRect(rectangle, 20.0, 15.0);

This function was introduced in Qt 4.4.

See also drawRect() and QPen.

void QPainter::drawRoundedRect(int x, int y, int w, int h, qreal xRadius, qreal yRadius, Qt::SizeMode mode \= Qt::AbsoluteSize)

This is an overloaded function.

Draws the given rectangle x, y, w, h with rounded corners.

This function was introduced in Qt 4.4.

void QPainter::drawRoundedRect(const QRect \&rect, qreal xRadius, qreal yRadius, Qt::SizeMode mode \= Qt::AbsoluteSize)

This is an overloaded function.

Draws the given rectangle rect with rounded corners.

This function was introduced in Qt 4.4.

Upstream PySide2 reference signatures (binding differences may apply):

drawRoundedRect(self, rect: PySide2.QtCore.QRect, xRadius: float, yRadius: float, mode: PySide2.QtCore.Qt.SizeMode=...) -> None
drawRoundedRect(self, rect: PySide2.QtCore.QRectF, xRadius: float, yRadius: float, mode: PySide2.QtCore.Qt.SizeMode=...) -> None
drawRoundedRect(self, x: int, y: int, w: int, h: int, xRadius: float, yRadius: float, mode: PySide2.QtCore.Qt.SizeMode=...) -> None

Source: https://doc.qt.io/archives/qt-5.15/qpainter.html#drawRoundedRect

drawStaticText

drawStaticText(left: Any, top: Any, staticText: Any) -> None

X.drawStaticText(left, top, staticText)

Supplemental documentation: Qt 5 reference:

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.

Note: If the painter's transformation is not affine, then staticText will be drawn using regular calls to drawText(), losing any potential for performance improvement.

Note: The y-position is used as the top of the font.

This function was introduced in Qt 4.7.

See also QStaticText.

void QPainter::drawStaticText(const QPoint \&topLeftPosition, const QStaticText \&staticText)

This is an overloaded function.

Draws the staticText at the topLeftPosition.

Note: The y-position is used as the top of the font.

This function was introduced in Qt 4.7.

void QPainter::drawStaticText(int left, int top, const QStaticText \&staticText)

This is an overloaded function.

Draws the staticText at coordinates left and top.

Note: The y-position is used as the top of the font.

This function was introduced in Qt 4.7.

Upstream PySide2 reference signatures (binding differences may apply):

drawStaticText(self, left: int, top: int, staticText: PySide2.QtGui.QStaticText) -> None
drawStaticText(self, topLeftPosition: PySide2.QtCore.QPoint, staticText: PySide2.QtGui.QStaticText) -> None
drawStaticText(self, topLeftPosition: PySide2.QtCore.QPointF, staticText: PySide2.QtGui.QStaticText) -> None

Source: https://doc.qt.io/archives/qt-5.15/qpainter.html#drawStaticText

drawText

drawText(x: Any, y: Any, w: Any, h: Any, arg4: flags, text: Any, br: Any) -> None

X.drawText(x, y, w, h, flags, text, br)

Supplemental documentation: Qt 5 reference:

void QPainter::drawText(const QRectF \&rectangle, int flags, const QString \&text, QRectF *boundingRect \= nullptr)

This is an overloaded function.

Draws the given text within the provided rectangle. The rectangle along with alignment flags defines the anchors for the text.

QPainter painter(this); painter.drawText(rect, Qt::AlignCenter, tr("Qt\nProject"));

The boundingRect (if not null) is set to what the bounding rectangle should be in order to enclose the whole text. For example, in the following image, the dotted line represents boundingRect as calculated by the function, and the dashed line represents rectangle:

QPainter painter(this); QFont font = painter.font(); font.setPixelSize(48); painter.setFont(font); const QRect rectangle = QRect(0, 0, 100, 50); QRect boundingRect; painter.drawText(rectangle, 0, tr("Hello"), &boundingRect); QPen pen = painter.pen(); pen.setStyle(Qt::DotLine); painter.setPen(pen); painter.drawRect(boundingRect.adjusted(0, 0, -pen.width(), -pen.width())); pen.setStyle(Qt::DashLine); painter.setPen(pen); painter.drawRect(rectangle.adjusted(0, 0, -pen.width(), -pen.width()));

The flags argument is a bitwise OR of the following flags:

By default, QPainter draws text anti-aliased.

Note: The y-coordinate of rectangle is used as the top of the font.

See also Qt::AlignmentFlag, Qt::TextFlag, boundingRect(), and layoutDirection().

void QPainter::drawText(const QPointF \&position, const QString \&text)

Draws the given text with the currently defined text direction, beginning at the given position.

This function does not handle the newline character (\n), 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.

Note: The y-position is used as the baseline of the font.

See also setFont() and setPen().

void QPainter::drawText(const QPoint \&position, const QString \&text)

This is an overloaded function.

Draws the given text with the currently defined text direction, beginning at the given position.

By default, QPainter draws text anti-aliased.

Note: The y-position is used as the baseline of the font.

See also setFont() and setPen().

void QPainter::drawText(int x, int y, const QString \&text)

This is an overloaded function.

Draws the given text at position (x, y), using the painter's currently defined text direction.

By default, QPainter draws text anti-aliased.

Note: The y-position is used as the baseline of the font.

See also setFont() and setPen().

void QPainter::drawText(const QRect \&rectangle, int flags, const QString \&text, QRect *boundingRect \= nullptr)

This is an overloaded function.

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. For example, in the following image, the dotted line represents boundingRect as calculated by the function, and the dashed line represents rectangle:

QPainter painter(this); QFont font = painter.font(); font.setPixelSize(48); painter.setFont(font); const QRect rectangle = QRect(0, 0, 100, 50); QRect boundingRect; painter.drawText(rectangle, 0, tr("Hello"), &boundingRect); QPen pen = painter.pen(); pen.setStyle(Qt::DotLine); painter.setPen(pen); painter.drawRect(boundingRect.adjusted(0, 0, -pen.width(), -pen.width())); pen.setStyle(Qt::DashLine); painter.setPen(pen); painter.drawRect(rectangle.adjusted(0, 0, -pen.width(), -pen.width()));

By default, QPainter draws text anti-aliased.

Note: The y-coordinate of rectangle is used as the top of the font.

See also setFont() and setPen().

void QPainter::drawText(int x, int y, int width, int height, int flags, const QString \&text, QRect *boundingRect \= nullptr)

This is an overloaded function.

Draws the given text within the rectangle with origin (x, y), width and height.

The boundingRect (if not null) is set to the what the bounding rectangle should be in order to enclose the whole text. For example, in the following image, the dotted line represents boundingRect as calculated by the function, and the dashed line represents the rectangle defined by x, y, width and height:

QPainter painter(this); QFont font = painter.font(); font.setPixelSize(48); painter.setFont(font); const QRect rectangle = QRect(0, 0, 100, 50); QRect boundingRect; painter.drawText(rectangle, 0, tr("Hello"), &boundingRect); QPen pen = painter.pen(); pen.setStyle(Qt::DotLine); painter.setPen(pen); painter.drawRect(boundingRect.adjusted(0, 0, -pen.width(), -pen.width())); pen.setStyle(Qt::DashLine); painter.setPen(pen); painter.drawRect(rectangle.adjusted(0, 0, -pen.width(), -pen.width()));

The flags argument is a bitwise OR of the following flags:

By default, QPainter draws text anti-aliased.

Note: The y-position is used as the top of the font.

See also Qt::AlignmentFlag, Qt::TextFlag, setFont(), and setPen().

void QPainter::drawText(const QRectF \&rectangle, const QString \&text, const QTextOption \&option \= QTextOption())

This is an overloaded function.

Draws the given text in the rectangle specified using the option to control its positioning, direction, and orientation. The options given in option override those set on the QPainter object itself.

By default, QPainter draws text anti-aliased.

Note: The y-coordinate of rectangle is used as the top of the font.

See also setFont() and setPen().

Upstream PySide2 reference signatures (binding differences may apply):

drawText(self, p: PySide2.QtCore.QPoint, s: str) -> None
drawText(self, p: PySide2.QtCore.QPointF, s: str) -> None
drawText(self, r: PySide2.QtCore.QRect, flags: int, text: str, br: PySide2.QtCore.QRect) -> None
drawText(self, r: PySide2.QtCore.QRectF, flags: int, text: str, br: PySide2.QtCore.QRectF) -> None
drawText(self, r: PySide2.QtCore.QRectF, text: str, o: PySide2.QtGui.QTextOption=...) -> None
drawText(self, x: int, y: int, s: str) -> None
drawText(self, x: int, y: int, w: int, h: int, flags: int, text: str, br: PySide2.QtCore.QRect) -> None

Source: https://doc.qt.io/archives/qt-5.15/qpainter.html#drawText

drawTextItem

drawTextItem(x: Any, y: Any, ti: Any) -> None

X.drawTextItem(x, y, ti)

Upstream PySide2 reference signatures (binding differences may apply):

drawTextItem(self, p: PySide2.QtCore.QPoint, ti: PySide2.QtGui.QTextItem) -> None
drawTextItem(self, p: PySide2.QtCore.QPointF, ti: PySide2.QtGui.QTextItem) -> None
drawTextItem(self, x: int, y: int, ti: PySide2.QtGui.QTextItem) -> None

Source: https://doc.qt.io/archives/qt-5.15/qpainter.html#drawTextItem

drawTiledPixmap

drawTiledPixmap(x: Any, y: Any, w: Any, h: Any, arg__5: Any, sx: Any, sy: Any) -> None

X.drawTiledPixmap(x, y, w, h, arg__5, sx, sy)

Supplemental documentation: Qt 5 reference:

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.

drawTiledPixmap() will produce the same visual tiling pattern on high-dpi displays (with devicePixelRatio > 1), compared to normal- dpi displays. Set the devicePixelRatio on the pixmap to control the tile size. For example, setting it to 2 halves the tile width and height (on both 1x and 2x displays), and produces high-resolution output on 2x displays.

The position offset is always in the painter coordinate system, indepentent of display devicePixelRatio.

See also drawPixmap().

void QPainter::drawTiledPixmap(int x, int y, int width, int height, const QPixmap \&pixmap, int sx \= 0, int sy \= 0)

This is an overloaded function.

Draws a tiled pixmap in the specified rectangle.

(x, y) specifies the top-left point in the paint device that is to be drawn onto; with the given width and height. (sx, sy) specifies the top-left point in the pixmap that is to be drawn; this defaults to (0, 0).

void QPainter::drawTiledPixmap(const QRect \&rectangle, const QPixmap \&pixmap, const QPoint \&position \= QPoint())

This is an overloaded function.

Draws a tiled pixmap, inside the given rectangle with its origin at the given position.

Upstream PySide2 reference signatures (binding differences may apply):

drawTiledPixmap(self, arg__1: PySide2.QtCore.QRect, arg__2: PySide2.QtGui.QPixmap, pos: PySide2.QtCore.QPoint=...) -> None
drawTiledPixmap(self, rect: PySide2.QtCore.QRectF, pm: PySide2.QtGui.QPixmap, offset: PySide2.QtCore.QPointF=...) -> None
drawTiledPixmap(self, x: int, y: int, w: int, h: int, arg__5: PySide2.QtGui.QPixmap, sx: int=..., sy: int=...) -> None

Source: https://doc.qt.io/archives/qt-5.15/qpainter.html#drawTiledPixmap

end

end() -> bool

X.end() -> bool

Supplemental documentation: Qt 5 reference:

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.

See also begin() and isActive().

Upstream PySide2 reference signatures (binding differences may apply):

end(self) -> bool

Source: https://doc.qt.io/archives/qt-5.15/qpainter.html#end

endNativePainting

endNativePainting() -> None

X.endNativePainting()

Supplemental documentation: Qt 5 reference:

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.

This function was introduced in Qt 4.6.

See also beginNativePainting().

Upstream PySide2 reference signatures (binding differences may apply):

endNativePainting(self) -> None

Source: https://doc.qt.io/archives/qt-5.15/qpainter.html#endNativePainting

eraseRect

eraseRect(x: Any, y: Any, w: Any, h: Any) -> None

X.eraseRect(x, y, w, h)

Supplemental documentation: Qt 5 reference:

void QPainter::eraseRect(const QRectF \&rectangle)

Erases the area inside the given rectangle. Equivalent to calling

fillRect(rectangle, background()).

See also fillRect().

void QPainter::eraseRect(int x, int y, int width, int height)

This is an overloaded function.

Erases the area inside the rectangle beginning at (x, y) with the given width and height.

void QPainter::eraseRect(const QRect \&rectangle)

This is an overloaded function.

Erases the area inside the given rectangle.

Upstream PySide2 reference signatures (binding differences may apply):

eraseRect(self, arg__1: PySide2.QtCore.QRect) -> None
eraseRect(self, arg__1: PySide2.QtCore.QRectF) -> None
eraseRect(self, x: int, y: int, w: int, h: int) -> None

Source: https://doc.qt.io/archives/qt-5.15/qpainter.html#eraseRect

fillPath

fillPath(path: Any, brush: Any) -> None

X.fillPath(path, brush)

Supplemental documentation: Qt 5 reference:

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.

See also drawPath().

Upstream PySide2 reference signatures (binding differences may apply):

fillPath(self, path: PySide2.QtGui.QPainterPath, brush: PySide2.QtGui.QBrush) -> None

Source: https://doc.qt.io/archives/qt-5.15/qpainter.html#fillPath

fillRect

fillRect(x: Any, y: Any, w: Any, h: Any, style: Any) -> None

X.fillRect(x, y, w, h, style)

Supplemental documentation: Qt 5 reference:

void QPainter::fillRect(const QRectF \&rectangle, const QBrush \&brush)

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.

See also drawRect().

void QPainter::fillRect(int x, int y, int width, int height, const QBrush \&brush)

This is an overloaded function.

Fills the rectangle beginning at (x, y) with the given width and height, using the given brush.

void QPainter::fillRect(const QRect \&rectangle, const QBrush \&brush)

This is an overloaded function.

Fills the given rectangle with the specified brush.

void QPainter::fillRect(const QRectF \&rectangle, const QColor \&color)

This is an overloaded function.

Fills the given rectangle with the color specified.

This function was introduced in Qt 4.5.

void QPainter::fillRect(int x, int y, int width, int height, const QColor \&color)

This is an overloaded function.

Fills the rectangle beginning at (x, y) with the given width and height, using the given color.

This function was introduced in Qt 4.5.

void QPainter::fillRect(const QRect \&rectangle, const QColor \&color)

This is an overloaded function.

Fills the given rectangle with the color specified.

This function was introduced in Qt 4.5.

void QPainter::fillRect(int x, int y, int width, int height, Qt::GlobalColor color)

This is an overloaded function.

Fills the rectangle beginning at (x, y) with the given width and height, using the given color.

This function was introduced in Qt 4.5.

void QPainter::fillRect(const QRect \&rectangle, Qt::GlobalColor color)

This is an overloaded function.

Fills the given rectangle with the specified color.

This function was introduced in Qt 4.5.

void QPainter::fillRect(const QRectF \&rectangle, Qt::GlobalColor color)

This is an overloaded function.

Fills the given rectangle with the specified color.

This function was introduced in Qt 4.5.

void QPainter::fillRect(int x, int y, int width, int height, Qt::BrushStyle style)

This is an overloaded function.

Fills the rectangle beginning at (x, y) with the given width and height, using the brush style specified.

This function was introduced in Qt 4.5.

void QPainter::fillRect(const QRect \&rectangle, Qt::BrushStyle style)

This is an overloaded function.

Fills the given rectangle with the brush style specified.

This function was introduced in Qt 4.5.

void QPainter::fillRect(const QRectF \&rectangle, Qt::BrushStyle style)

This is an overloaded function.

Fills the given rectangle with the brush style specified.

This function was introduced in Qt 4.5.

void QPainter::fillRect(int x, int y, int width, int height, QGradient::Preset preset)

This is an overloaded function.

Fills the rectangle beginning at (x, y) with the given width and height, using the given gradient preset.

This function was introduced in Qt 5.12.

void QPainter::fillRect(const QRect \&rectangle, QGradient::Preset preset)

This is an overloaded function.

Fills the given rectangle with the specified gradient preset.

This function was introduced in Qt 5.12.

void QPainter::fillRect(const QRectF \&rectangle, QGradient::Preset preset)

This is an overloaded function.

Fills the given rectangle with the specified gradient preset.

This function was introduced in Qt 5.12.

Upstream PySide2 reference signatures (binding differences may apply):

fillRect(self, arg__1: PySide2.QtCore.QRect, arg__2: PySide2.QtGui.QBrush) -> None
fillRect(self, arg__1: PySide2.QtCore.QRect, color: PySide2.QtGui.QColor) -> None
fillRect(self, arg__1: PySide2.QtCore.QRectF, arg__2: PySide2.QtGui.QBrush) -> None
fillRect(self, arg__1: PySide2.QtCore.QRectF, color: PySide2.QtGui.QColor) -> None
fillRect(self, r: PySide2.QtCore.QRect, c: PySide2.QtCore.Qt.GlobalColor) -> None
fillRect(self, r: PySide2.QtCore.QRect, preset: PySide2.QtGui.QGradient.Preset) -> None
fillRect(self, r: PySide2.QtCore.QRect, style: PySide2.QtCore.Qt.BrushStyle) -> None
fillRect(self, r: PySide2.QtCore.QRectF, c: PySide2.QtCore.Qt.GlobalColor) -> None
fillRect(self, r: PySide2.QtCore.QRectF, preset: PySide2.QtGui.QGradient.Preset) -> None
fillRect(self, r: PySide2.QtCore.QRectF, style: PySide2.QtCore.Qt.BrushStyle) -> None
fillRect(self, x: int, y: int, w: int, h: int, arg__5: PySide2.QtGui.QBrush) -> None
fillRect(self, x: int, y: int, w: int, h: int, c: PySide2.QtCore.Qt.GlobalColor) -> None
fillRect(self, x: int, y: int, w: int, h: int, color: PySide2.QtGui.QColor) -> None
fillRect(self, x: int, y: int, w: int, h: int, preset: PySide2.QtGui.QGradient.Preset) -> None
fillRect(self, x: int, y: int, w: int, h: int, style: PySide2.QtCore.Qt.BrushStyle) -> None

Source: https://doc.qt.io/archives/qt-5.15/qpainter.html#fillRect

font

font() -> Any

X.font() -> PythonQt.QtGui.QFont

Supplemental documentation: Qt 5 reference:

const QFont \&QPainter::font() const

Returns the currently set font used for drawing text.

See also setFont(), drawText(), and Settings.

Upstream PySide2 reference signatures (binding differences may apply):

font(self) -> PySide2.QtGui.QFont

Source: https://doc.qt.io/archives/qt-5.15/qpainter.html#font

fontInfo

fontInfo() -> Any

X.fontInfo() -> PythonQt.QtGui.QFontInfo

Supplemental documentation: Qt 5 reference:

QFontInfo QPainter::fontInfo() const

Returns the font info for the painter if the painter is active. Otherwise, the return value is undefined.

See also font(), isActive(), and Settings.

Upstream PySide2 reference signatures (binding differences may apply):

fontInfo(self) -> PySide2.QtGui.QFontInfo

Source: https://doc.qt.io/archives/qt-5.15/qpainter.html#fontInfo

fontMetrics

fontMetrics() -> Any

X.fontMetrics() -> PythonQt.QtGui.QFontMetrics

Supplemental documentation: Qt 5 reference:

QFontMetrics QPainter::fontMetrics() const

Returns the font metrics for the painter if the painter is active. Otherwise, the return value is undefined.

See also font(), isActive(), and Settings.

Upstream PySide2 reference signatures (binding differences may apply):

fontMetrics(self) -> PySide2.QtGui.QFontMetrics

Source: https://doc.qt.io/archives/qt-5.15/qpainter.html#fontMetrics

hasClipping

hasClipping() -> bool

X.hasClipping() -> bool

Supplemental documentation: Qt 5 reference:

bool QPainter::hasClipping() const

Returns true if clipping has been set; otherwise returns false.

See also setClipping() and Clipping.

Upstream PySide2 reference signatures (binding differences may apply):

hasClipping(self) -> bool

Source: https://doc.qt.io/archives/qt-5.15/qpainter.html#hasClipping

initFrom

initFrom(device: Any) -> None

X.initFrom(device)

Upstream PySide2 reference signatures (binding differences may apply):

initFrom(self, device: PySide2.QtGui.QPaintDevice) -> None

Source: https://doc.qt.io/archives/qt-5.15/qpainter.html#initFrom

isActive

isActive() -> bool

X.isActive() -> bool

Supplemental documentation: Qt 5 reference:

bool QPainter::isActive() const

Returns true if begin() has been called and end() has not yet been called; otherwise returns false.

See also begin() and QPaintDevice::paintingActive().

Upstream PySide2 reference signatures (binding differences may apply):

isActive(self) -> bool

Source: https://doc.qt.io/archives/qt-5.15/qpainter.html#isActive

layoutDirection

layoutDirection() -> Any

X.layoutDirection()

Supplemental documentation: Qt 5 reference:

Qt::LayoutDirection QPainter::layoutDirection() const

Returns the layout direction used by the painter when drawing text.

See also QTextOption::textDirection(), setLayoutDirection(), drawText(), and Settings.

Upstream PySide2 reference signatures (binding differences may apply):

layoutDirection(self) -> PySide2.QtCore.Qt.LayoutDirection

Source: https://doc.qt.io/archives/qt-5.15/qpainter.html#layoutDirection

opacity

opacity() -> float

X.opacity() -> float

Supplemental documentation: Qt 5 reference:

qreal QPainter::opacity() const

Returns the opacity of the painter. The default value is 1.

This function was introduced in Qt 4.2.

See also setOpacity().

Upstream PySide2 reference signatures (binding differences may apply):

opacity(self) -> float

Source: https://doc.qt.io/archives/qt-5.15/qpainter.html#opacity

paintEngine

paintEngine() -> Any

X.paintEngine() -> PythonQt.QtGui.QPaintEngine

Supplemental documentation: Qt 5 reference:

QPaintEngine *QPainter::paintEngine() const

Returns the paint engine that the painter is currently operating on if the painter is active; otherwise 0.

See also isActive().

Upstream PySide2 reference signatures (binding differences may apply):

paintEngine(self) -> PySide2.QtGui.QPaintEngine

Source: https://doc.qt.io/archives/qt-5.15/qpainter.html#paintEngine

pen

pen() -> Any

X.pen() -> PythonQt.QtGui.QPen

Supplemental documentation: Qt 5 reference:

const QPen \&QPainter::pen() const

Returns the painter's current pen.

See also setPen() and Settings.

Upstream PySide2 reference signatures (binding differences may apply):

pen(self) -> PySide2.QtGui.QPen

Source: https://doc.qt.io/archives/qt-5.15/qpainter.html#pen

redirected

redirected(device: Any, offset: Any) -> Any

X.redirected(device, offset) -> PythonQt.QtGui.QPaintDevice

Upstream PySide2 reference signatures (binding differences may apply):

redirected(device: PySide2.QtGui.QPaintDevice, offset: typing.Optional[PySide2.QtCore.QPoint]=...) -> PySide2.QtGui.QPaintDevice

Source: https://doc.qt.io/archives/qt-5.15/qpainter.html#redirected

renderHints

renderHints() -> Any

X.renderHints()

Supplemental documentation: Qt 5 reference:

QPainter::RenderHints QPainter::renderHints() const

Returns a flag that specifies the rendering hints that are set for this painter.

See also setRenderHints(), testRenderHint(), and Rendering Quality.

Upstream PySide2 reference signatures (binding differences may apply):

renderHints(self) -> PySide2.QtGui.QPainter.RenderHints

Source: https://doc.qt.io/archives/qt-5.15/qpainter.html#renderHints

resetMatrix

resetMatrix() -> None

X.resetMatrix()

Upstream PySide2 reference signatures (binding differences may apply):

resetMatrix(self) -> None

Source: https://doc.qt.io/archives/qt-5.15/qpainter.html#resetMatrix

resetTransform

resetTransform() -> None

X.resetTransform()

Supplemental documentation: Qt 5 reference:

void QPainter::resetTransform()

Resets any transformations that were made using translate(), scale(), shear(), rotate(), setWorldTransform(), setViewport() and setWindow().

See also Coordinate Transformations.

Upstream PySide2 reference signatures (binding differences may apply):

resetTransform(self) -> None

Source: https://doc.qt.io/archives/qt-5.15/qpainter.html#resetTransform

restore

restore() -> None

X.restore()

Supplemental documentation: Qt 5 reference:

void QPainter::restore()

Restores the current painter state (pops a saved state off the stack).

See also save().

Upstream PySide2 reference signatures (binding differences may apply):

restore(self) -> None

Source: https://doc.qt.io/archives/qt-5.15/qpainter.html#restore

restoreRedirected

restoreRedirected(device: Any) -> None

X.restoreRedirected(device)

Upstream PySide2 reference signatures (binding differences may apply):

restoreRedirected(device: PySide2.QtGui.QPaintDevice) -> None

Source: https://doc.qt.io/archives/qt-5.15/qpainter.html#restoreRedirected

rotate

rotate(a: float) -> None

X.rotate(a)

Supplemental documentation: Qt 5 reference:

void QPainter::rotate(qreal angle)

Rotates the coordinate system clockwise. The given angle parameter is in degrees.

See also setWorldTransform() and Coordinate Transformations.

Upstream PySide2 reference signatures (binding differences may apply):

rotate(self, a: float) -> None

Source: https://doc.qt.io/archives/qt-5.15/qpainter.html#rotate

save

save() -> None

X.save()

Supplemental documentation: Qt 5 reference:

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.

See also restore().

Upstream PySide2 reference signatures (binding differences may apply):

save(self) -> None

Source: https://doc.qt.io/archives/qt-5.15/qpainter.html#save

scale

scale(sx: float, sy: float) -> None

X.scale(sx, sy)

Supplemental documentation: Qt 5 reference:

void QPainter::scale(qreal sx, qreal sy)

Scales the coordinate system by (sx, sy).

See also setWorldTransform() and Coordinate Transformations.

Upstream PySide2 reference signatures (binding differences may apply):

scale(self, sx: float, sy: float) -> None

Source: https://doc.qt.io/archives/qt-5.15/qpainter.html#scale

setBackground

setBackground(bg: Any) -> None

X.setBackground(bg)

Supplemental documentation: Qt 5 reference:

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).

See also background(), setBackgroundMode(), and Settings.

Upstream PySide2 reference signatures (binding differences may apply):

setBackground(self, bg: PySide2.QtGui.QBrush) -> None

Source: https://doc.qt.io/archives/qt-5.15/qpainter.html#setBackground

setBackgroundMode

setBackgroundMode(mode: Any) -> None

X.setBackgroundMode(mode)

Supplemental documentation: Qt 5 reference:

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().

See also backgroundMode(), setBackground(), and Settings.

Upstream PySide2 reference signatures (binding differences may apply):

setBackgroundMode(self, mode: PySide2.QtCore.Qt.BGMode) -> None

Source: https://doc.qt.io/archives/qt-5.15/qpainter.html#setBackgroundMode

setBrush

setBrush(brush: Any) -> None

X.setBrush(brush)

Supplemental documentation: Qt 5 reference:

void QPainter::setBrush(const QBrush \&brush)

Sets the painter's brush to the given brush.

The painter's brush defines how shapes are filled.

See also brush() and Settings.

void QPainter::setBrush(Qt::BrushStyle style)

This is an overloaded function.

Sets the painter's brush to black color and the specified style.

Upstream PySide2 reference signatures (binding differences may apply):

setBrush(self, brush: PySide2.QtGui.QBrush) -> None
setBrush(self, style: PySide2.QtCore.Qt.BrushStyle) -> None

Source: https://doc.qt.io/archives/qt-5.15/qpainter.html#setBrush

setBrushOrigin

setBrushOrigin(x: Any, y: Any) -> None

X.setBrushOrigin(x, y)

Supplemental documentation: Qt 5 reference:

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 autoFillBackground property to true.

See also brushOrigin() and Settings.

void QPainter::setBrushOrigin(int x, int y)

This is an overloaded function.

Sets the brush's origin to point (x, y).

void QPainter::setBrushOrigin(const QPoint \&position)

This is an overloaded function.

Sets the brush's origin to the given position.

Upstream PySide2 reference signatures (binding differences may apply):

setBrushOrigin(self, arg__1: PySide2.QtCore.QPoint) -> None
setBrushOrigin(self, arg__1: PySide2.QtCore.QPointF) -> None
setBrushOrigin(self, x: int, y: int) -> None

Source: https://doc.qt.io/archives/qt-5.15/qpainter.html#setBrushOrigin

setClipPath

setClipPath(path: Any, op: Any) -> None

X.setClipPath(path, op)

Supplemental documentation: Qt 5 reference:

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.

See also clipPath(), clipRegion(), and Clipping.

Upstream PySide2 reference signatures (binding differences may apply):

setClipPath(self, path: PySide2.QtGui.QPainterPath, op: PySide2.QtCore.Qt.ClipOperation=...) -> None

Source: https://doc.qt.io/archives/qt-5.15/qpainter.html#setClipPath