[][src]Struct qt_widgets::QStylePainter

#[repr(C)]pub struct QStylePainter { /* fields omitted */ }

The QStylePainter class is a convenience class for drawing QStyle elements inside a widget.

C++ class: QStylePainter.

C++ documentation:

The QStylePainter class is a convenience class for drawing QStyle elements inside a widget.

QStylePainter extends QPainter with a set of high-level draw...() functions implemented on top of QStyle's API. The advantage of using QStylePainter is that the parameter lists get considerably shorter. Whereas a QStyle object must be able to draw on any widget using any painter (because the application normally has one QStyle object shared by all widget), a QStylePainter is initialized with a widget, eliminating the need to specify the QWidget, the QPainter, and the QStyle for every function call.

Example using QStyle directly:

void MyWidget::paintEvent(QPaintEvent / event */) { QPainter painter(this);

QStyleOptionFocusRect option; option.initFrom(this); option.backgroundColor = palette().color(QPalette::Background);

style()->drawPrimitive(QStyle::PE_FrameFocusRect, &option, &painter, this); }

Example using QStylePainter:

void MyWidget::paintEvent(QPaintEvent / event */) { QStylePainter painter(this);

QStyleOptionFocusRect option; option.initFrom(this); option.backgroundColor = palette().color(QPalette::Background);

painter.drawPrimitive(QStyle::PE_FrameFocusRect, option); }

Methods

impl QStylePainter[src]

pub unsafe fn begin_1a(&self, w: impl CastInto<Ptr<QWidget>>) -> bool[src]

Begin painting operations on the specified widget. Returns true if the painter is ready to use; otherwise returns false.

Calls C++ function: bool QStylePainter::begin(QWidget* w).

C++ documentation:

Begin painting operations on the specified widget. Returns true if the painter is ready to use; otherwise returns false.

This is automatically called by the constructor that takes a QWidget.

pub unsafe fn begin_2a(
    &self,
    pd: impl CastInto<Ptr<QPaintDevice>>,
    w: impl CastInto<Ptr<QWidget>>
) -> bool
[src]

This is an overloaded function.

Calls C++ function: bool QStylePainter::begin(QPaintDevice* pd, QWidget* w).

C++ documentation:

This is an overloaded function.

Begin painting operations on paint device pd as if it was widget.

This is automatically called by the constructor that takes a QPaintDevice and a QWidget.

pub unsafe fn draw_complex_control(
    &self,
    cc: ComplexControl,
    opt: impl CastInto<Ref<QStyleOptionComplex>>
)
[src]

Use the widget's style to draw a complex control cc specified by the QStyleOptionComplex option.

Calls C++ function: void QStylePainter::drawComplexControl(QStyle::ComplexControl cc, const QStyleOptionComplex& opt).

C++ documentation:

Use the widget's style to draw a complex control cc specified by the QStyleOptionComplex option.

See also QStyle::drawComplexControl().

pub unsafe fn draw_control(
    &self,
    ce: ControlElement,
    opt: impl CastInto<Ref<QStyleOption>>
)
[src]

Use the widget's style to draw a control element ce specified by QStyleOption option.

Calls C++ function: void QStylePainter::drawControl(QStyle::ControlElement ce, const QStyleOption& opt).

C++ documentation:

Use the widget's style to draw a control element ce specified by QStyleOption option.

See also QStyle::drawControl().

pub unsafe fn draw_item_pixmap(
    &self,
    r: impl CastInto<Ref<QRect>>,
    flags: c_int,
    pixmap: impl CastInto<Ref<QPixmap>>
)
[src]

Draws the pixmap in rectangle rect. The pixmap is aligned according to flags.

Calls C++ function: void QStylePainter::drawItemPixmap(const QRect& r, int flags, const QPixmap& pixmap).

C++ documentation:

Draws the pixmap in rectangle rect. The pixmap is aligned according to flags.

See also QStyle::drawItemPixmap() and Qt::Alignment.

pub unsafe fn draw_item_text_6a(
    &self,
    r: impl CastInto<Ref<QRect>>,
    flags: c_int,
    pal: impl CastInto<Ref<QPalette>>,
    enabled: bool,
    text: impl CastInto<Ref<QString>>,
    text_role: ColorRole
)
[src]

Draws the text in rectangle rect and palette pal. The text is aligned and wrapped according to flags.

Calls C++ function: void QStylePainter::drawItemText(const QRect& r, int flags, const QPalette& pal, bool enabled, const QString& text, QPalette::ColorRole textRole = …).

C++ documentation:

Draws the text in rectangle rect and palette pal. The text is aligned and wrapped according to flags.

The pen color is specified with textRole. The enabled bool indicates whether or not the item is enabled; when reimplementing this bool should influence how the item is drawn.

See also QStyle::drawItemText() and Qt::Alignment.

pub unsafe fn draw_item_text_5a(
    &self,
    r: impl CastInto<Ref<QRect>>,
    flags: c_int,
    pal: impl CastInto<Ref<QPalette>>,
    enabled: bool,
    text: impl CastInto<Ref<QString>>
)
[src]

Draws the text in rectangle rect and palette pal. The text is aligned and wrapped according to flags.

Calls C++ function: void QStylePainter::drawItemText(const QRect& r, int flags, const QPalette& pal, bool enabled, const QString& text).

C++ documentation:

Draws the text in rectangle rect and palette pal. The text is aligned and wrapped according to flags.

The pen color is specified with textRole. The enabled bool indicates whether or not the item is enabled; when reimplementing this bool should influence how the item is drawn.

See also QStyle::drawItemText() and Qt::Alignment.

pub unsafe fn draw_primitive(
    &self,
    pe: PrimitiveElement,
    opt: impl CastInto<Ref<QStyleOption>>
)
[src]

Use the widget's style to draw a primitive element pe specified by QStyleOption option.

Calls C++ function: void QStylePainter::drawPrimitive(QStyle::PrimitiveElement pe, const QStyleOption& opt).

C++ documentation:

Use the widget's style to draw a primitive element pe specified by QStyleOption option.

See also QStyle::drawPrimitive().

pub unsafe fn new_0a() -> CppBox<QStylePainter>[src]

Constructs a QStylePainter.

Calls C++ function: [constructor] void QStylePainter::QStylePainter().

C++ documentation:

Constructs a QStylePainter.

pub unsafe fn new_1a(w: impl CastInto<Ptr<QWidget>>) -> CppBox<QStylePainter>[src]

Construct a QStylePainter using widget widget for its paint device.

Calls C++ function: [constructor] void QStylePainter::QStylePainter(QWidget* w).

C++ documentation:

Construct a QStylePainter using widget widget for its paint device.

pub unsafe fn new_2a(
    pd: impl CastInto<Ptr<QPaintDevice>>,
    w: impl CastInto<Ptr<QWidget>>
) -> CppBox<QStylePainter>
[src]

Construct a QStylePainter using pd for its paint device, and attributes from widget.

Calls C++ function: [constructor] void QStylePainter::QStylePainter(QPaintDevice* pd, QWidget* w).

C++ documentation:

Construct a QStylePainter using pd for its paint device, and attributes from widget.

pub unsafe fn style(&self) -> QPtr<QStyle>[src]

Return the current style used by the QStylePainter.

Calls C++ function: QStyle* QStylePainter::style() const.

C++ documentation:

Return the current style used by the QStylePainter.

Methods from Deref<Target = QPainter>

pub unsafe fn background(&self) -> Ref<QBrush>[src]

Returns the current background brush.

Calls C++ function: const QBrush& QPainter::background() const.

C++ documentation:

Returns the current background brush.

See also setBackground() and Settings.

pub unsafe fn background_mode(&self) -> BGMode[src]

Returns the current background mode.

Calls C++ function: Qt::BGMode QPainter::backgroundMode() const.

C++ documentation:

Returns the current background mode.

See also setBackgroundMode() and Settings.

pub unsafe fn begin(&self, arg1: impl CastInto<Ptr<QPaintDevice>>) -> bool[src]

Begins painting the paint device and returns true if successful; otherwise returns false.

Calls C++ function: bool QPainter::begin(QPaintDevice* arg1).

C++ documentation:

Begins painting the paint device and returns true if successful; otherwise returns false.

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:

painter->begin(0); // impossible - paint device cannot be 0

QPixmap image(0, 0); painter->begin(&image); // impossible - image.isNull() == true;

painter->begin(myWidget); painter2->begin(myWidget); // impossible - only one painter at a time

Note that most of the time, you can use one of the constructors instead of begin(), and that end() is automatically done at destruction.

Warning: A paint device can only be painted by one painter at a time.

Warning: Painting on a QImage with the format QImage::Format_Indexed8 is not supported.

See also end() and QPainter().

pub unsafe fn begin_native_painting(&self)[src]

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

Calls C++ function: void QPainter::beginNativePainting().

C++ documentation:

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:

  • blending is disabled
  • the depth, stencil and scissor tests are disabled
  • the active texture unit is reset to 0
  • the depth mask, depth function and the clear depth are reset to their default values
  • the stencil mask, stencil operation and stencil function are reset to their default values
  • the current color is reset to solid white

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:

QPainter painter(this); painter.fillRect(0, 0, 128, 128, Qt::green); painter.beginNativePainting();

glEnable(GL_SCISSOR_TEST); glScissor(0, 0, 64, 64);

glClearColor(1, 0, 0, 1); glClear(GL_COLOR_BUFFER_BIT);

glDisable(GL_SCISSOR_TEST);

painter.endNativePainting();

This function was introduced in Qt 4.6.

See also endNativePainting().

pub unsafe fn bounding_rect_q_rect_f_int_q_string(
    &self,
    rect: impl CastInto<Ref<QRectF>>,
    flags: i32,
    text: impl CastInto<Ref<QString>>
) -> CppBox<QRectF>
[src]

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.

Calls C++ function: QRectF QPainter::boundingRect(const QRectF& rect, int flags, const QString& text).

C++ documentation:

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.

See also drawText(), Qt::Alignment, and Qt::TextFlag.

pub unsafe fn bounding_rect_q_rect_int_q_string(
    &self,
    rect: impl CastInto<Ref<QRect>>,
    flags: i32,
    text: impl CastInto<Ref<QString>>
) -> CppBox<QRect>
[src]

This is an overloaded function.

Calls C++ function: QRect QPainter::boundingRect(const QRect& rect, int flags, const QString& text).

C++ documentation:

This is an overloaded function.

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

pub unsafe fn bounding_rect_5_int_q_string(
    &self,
    x: i32,
    y: i32,
    w: i32,
    h: i32,
    flags: i32,
    text: impl CastInto<Ref<QString>>
) -> CppBox<QRect>
[src]

This is an overloaded function.

Calls C++ function: QRect QPainter::boundingRect(int x, int y, int w, int h, int flags, const QString& text).

C++ documentation:

This is an overloaded function.

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.

pub unsafe fn bounding_rect_q_rect_f_q_string_q_text_option(
    &self,
    rect: impl CastInto<Ref<QRectF>>,
    text: impl CastInto<Ref<QString>>,
    o: impl CastInto<Ref<QTextOption>>
) -> CppBox<QRectF>
[src]

This is an overloaded function.

Calls C++ function: QRectF QPainter::boundingRect(const QRectF& rect, const QString& text, const QTextOption& o = …).

C++ documentation:

This is an overloaded function.

Instead of specifying flags as a bitwise OR of the Qt::AlignmentFlag and Qt::TextFlag, this overloaded function takes an option argument. The QTextOption class provides a description of general rich text properties.

See also QTextOption.

pub unsafe fn bounding_rect_q_rect_f_q_string(
    &self,
    rect: impl CastInto<Ref<QRectF>>,
    text: impl CastInto<Ref<QString>>
) -> CppBox<QRectF>
[src]

This is an overloaded function.

Calls C++ function: QRectF QPainter::boundingRect(const QRectF& rect, const QString& text).

C++ documentation:

This is an overloaded function.

Instead of specifying flags as a bitwise OR of the Qt::AlignmentFlag and Qt::TextFlag, this overloaded function takes an option argument. The QTextOption class provides a description of general rich text properties.

See also QTextOption.

pub unsafe fn brush(&self) -> Ref<QBrush>[src]

Returns the painter's current brush.

Calls C++ function: const QBrush& QPainter::brush() const.

C++ documentation:

Returns the painter's current brush.

See also QPainter::setBrush() and Settings.

pub unsafe fn brush_origin(&self) -> CppBox<QPoint>[src]

Returns the currently set brush origin.

Calls C++ function: QPoint QPainter::brushOrigin() const.

C++ documentation:

Returns the currently set brush origin.

See also setBrushOrigin() and Settings.

pub unsafe fn clip_bounding_rect(&self) -> CppBox<QRectF>[src]

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.

Calls C++ function: QRectF QPainter::clipBoundingRect() const.

C++ documentation:

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.

This function was introduced in Qt 4.8.

See also setClipRect(), setClipPath(), and setClipRegion().

pub unsafe fn clip_path(&self) -> CppBox<QPainterPath>[src]

Returns the current clip path in logical coordinates.

Calls C++ function: QPainterPath QPainter::clipPath() const.

C++ documentation:

Returns the current clip path in logical coordinates.

Warning: QPainter does not store the combined clip explicitly as this is handled by the underlying QPaintEngine, so the path is recreated on demand and transformed to the current logical coordinate system. This is potentially an expensive operation.

See also setClipPath(), clipRegion(), and setClipping().

pub unsafe fn clip_region(&self) -> CppBox<QRegion>[src]

Returns the currently set clip region. Note that the clip region is given in logical coordinates.

Calls C++ function: QRegion QPainter::clipRegion() const.

C++ documentation:

Returns the currently set clip region. Note that the clip region is given in logical coordinates.

Warning: QPainter does not store the combined clip explicitly as this is handled by the underlying QPaintEngine, so the path is recreated on demand and transformed to the current logical coordinate system. This is potentially an expensive operation.

See also setClipRegion(), clipPath(), and setClipping().

pub unsafe fn combined_matrix(&self) -> CppBox<QMatrix>[src]

Returns the transformation matrix combining the current window/viewport and world transformation.

Calls C++ function: QMatrix QPainter::combinedMatrix() const.

C++ documentation:

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.

This function was introduced in Qt 4.2.

See also setWorldTransform(), setWindow(), and setViewport().

pub unsafe fn combined_transform(&self) -> CppBox<QTransform>[src]

Returns the transformation matrix combining the current window/viewport and world transformation.

Calls C++ function: QTransform QPainter::combinedTransform() const.

C++ documentation:

Returns the transformation matrix combining the current window/viewport and world transformation.

See also setWorldTransform(), setWindow(), and setViewport().

pub unsafe fn composition_mode(&self) -> CompositionMode[src]

Returns the current composition mode.

Calls C++ function: QPainter::CompositionMode QPainter::compositionMode() const.

C++ documentation:

Returns the current composition mode.

See also CompositionMode and setCompositionMode().

pub unsafe fn device(&self) -> Ptr<QPaintDevice>[src]

Returns the paint device on which this painter is currently painting, or 0 if the painter is not active.

Calls C++ function: QPaintDevice* QPainter::device() const.

C++ documentation:

Returns the paint device on which this painter is currently painting, or 0 if the painter is not active.

See also isActive().

pub unsafe fn device_matrix(&self) -> Ref<QMatrix>[src]

Returns the matrix that transforms from logical coordinates to device coordinates of the platform dependent paint device.

Calls C++ function: const QMatrix& QPainter::deviceMatrix() const.

C++ documentation:

Returns the matrix that transforms from logical coordinates to device coordinates of the platform dependent paint device.

Note: It is advisable to use deviceTransform() instead of this function to preserve the properties of perspective transformations.

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.

See also worldMatrix() and QPaintEngine::hasFeature().

pub unsafe fn device_transform(&self) -> Ref<QTransform>[src]

Returns the matrix that transforms from logical coordinates to device coordinates of the platform dependent paint device.

Calls C++ function: const QTransform& QPainter::deviceTransform() const.

C++ documentation:

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.

See also worldTransform() and QPaintEngine::hasFeature().

pub unsafe fn draw_arc_q_rect_f2_int(
    &self,
    rect: impl CastInto<Ref<QRectF>>,
    a: i32,
    alen: i32
)
[src]

Draws the arc defined by the given rectangle, startAngle and spanAngle.

Calls C++ function: void QPainter::drawArc(const QRectF& rect, int a, int alen).

C++ documentation:

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.

QRectF rectangle(10.0, 20.0, 80.0, 60.0); int startAngle = 30 16; int spanAngle = 120 16;

QPainter painter(this); painter.drawArc(rectangle, startAngle, spanAngle);

See also drawPie(), drawChord(), and Coordinate System.

pub unsafe fn draw_arc_q_rect2_int(
    &self,
    arg1: impl CastInto<Ref<QRect>>,
    a: i32,
    alen: i32
)
[src]

This is an overloaded function.

Calls C++ function: void QPainter::drawArc(const QRect& arg1, int a, int alen).

C++ documentation:

This is an overloaded function.

Draws the arc defined by the given rectangle, startAngle and spanAngle.

pub unsafe fn draw_arc_6_int(
    &self,
    x: i32,
    y: i32,
    w: i32,
    h: i32,
    a: i32,
    alen: i32
)
[src]

This is an overloaded function.

Calls C++ function: void QPainter::drawArc(int x, int y, int w, int h, int a, int alen).

C++ documentation:

This is an overloaded function.

Draws the arc defined by the rectangle beginning at (x, y) with the specified width and height, and the given startAngle and spanAngle.

pub unsafe fn draw_chord_q_rect_f2_int(
    &self,
    rect: impl CastInto<Ref<QRectF>>,
    a: i32,
    alen: i32
)
[src]

Draws the chord defined by the given rectangle, startAngle and spanAngle. The chord is filled with the current brush().

Calls C++ function: void QPainter::drawChord(const QRectF& rect, int a, int alen).

C++ documentation:

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.

QRectF rectangle(10.0, 20.0, 80.0, 60.0); int startAngle = 30 16; int spanAngle = 120 16;

QPainter painter(this); painter.drawChord(rect, startAngle, spanAngle);

See also drawArc(), drawPie(), and Coordinate System.

pub unsafe fn draw_chord_6_int(
    &self,
    x: i32,
    y: i32,
    w: i32,
    h: i32,
    a: i32,
    alen: i32
)
[src]

This is an overloaded function.

Calls C++ function: void QPainter::drawChord(int x, int y, int w, int h, int a, int alen).

C++ documentation:

This is an overloaded function.

Draws the chord defined by the rectangle beginning at (x, y) with the specified width and height, and the given startAngle and spanAngle.

pub unsafe fn draw_chord_q_rect2_int(
    &self,
    arg1: impl CastInto<Ref<QRect>>,
    a: i32,
    alen: i32
)
[src]

This is an overloaded function.

Calls C++ function: void QPainter::drawChord(const QRect& arg1, int a, int alen).

C++ documentation:

This is an overloaded function.

Draws the chord defined by the given rectangle, startAngle and spanAngle.

pub unsafe fn draw_convex_polygon_q_point_f_int(
    &self,
    points: impl CastInto<Ptr<QPointF>>,
    point_count: i32
)
[src]

Draws the convex polygon defined by the first pointCount points in the array points using the current pen.

Calls C++ function: void QPainter::drawConvexPolygon(const QPointF* points, int pointCount).

C++ documentation:

Draws the convex polygon defined by the first pointCount points in the array points using the current pen.

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.drawConvexPolygon(points, 4);

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.

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

pub unsafe fn draw_convex_polygon_q_polygon_f(
    &self,
    polygon: impl CastInto<Ref<QPolygonF>>
)
[src]

This is an overloaded function.

Calls C++ function: void QPainter::drawConvexPolygon(const QPolygonF& polygon).

C++ documentation:

This is an overloaded function.

Draws the convex polygon defined by polygon using the current pen and brush.

pub unsafe fn draw_convex_polygon_q_point_int(
    &self,
    points: impl CastInto<Ptr<QPoint>>,
    point_count: i32
)
[src]

This is an overloaded function.

Calls C++ function: void QPainter::drawConvexPolygon(const QPoint* points, int pointCount).

C++ documentation:

This is an overloaded function.

Draws the convex polygon defined by the first pointCount points in the array points using the current pen.

pub unsafe fn draw_convex_polygon_q_polygon(
    &self,
    polygon: impl CastInto<Ref<QPolygon>>
)
[src]

This is an overloaded function.

Calls C++ function: void QPainter::drawConvexPolygon(const QPolygon& polygon).

C++ documentation:

This is an overloaded function.

Draws the convex polygon defined by polygon using the current pen and brush.

pub unsafe fn draw_ellipse_q_rect_f(&self, r: impl CastInto<Ref<QRectF>>)[src]

Draws the ellipse defined by the given rectangle.

Calls C++ function: void QPainter::drawEllipse(const QRectF& r).

C++ documentation:

Draws the ellipse defined by the given rectangle.

A filled ellipse has a size of rectangle.size(). A stroked ellipse has a size of rectangle.size() plus the pen width.

QRectF rectangle(10.0, 20.0, 80.0, 60.0);

QPainter painter(this); painter.drawEllipse(rectangle);

See also drawPie() and Coordinate System.

pub unsafe fn draw_ellipse_q_rect(&self, r: impl CastInto<Ref<QRect>>)[src]

This is an overloaded function.

Calls C++ function: void QPainter::drawEllipse(const QRect& r).

C++ documentation:

This is an overloaded function.

Draws the ellipse defined by the given rectangle.

pub unsafe fn draw_ellipse_4_int(&self, x: i32, y: i32, w: i32, h: i32)[src]

This is an overloaded function.

Calls C++ function: void QPainter::drawEllipse(int x, int y, int w, int h).

C++ documentation:

This is an overloaded function.

Draws the ellipse defined by the rectangle beginning at (x, y) with the given width and height.

pub unsafe fn draw_ellipse_q_point_f2_double(
    &self,
    center: impl CastInto<Ref<QPointF>>,
    rx: f64,
    ry: f64
)
[src]

This is an overloaded function.

Calls C++ function: void QPainter::drawEllipse(const QPointF& center, double rx, double ry).

C++ documentation:

This is an overloaded function.

Draws the ellipse positioned at center with radii rx and ry.

This function was introduced in Qt 4.4.

pub unsafe fn draw_ellipse_q_point2_int(
    &self,
    center: impl CastInto<Ref<QPoint>>,
    rx: i32,
    ry: i32
)
[src]

This is an overloaded function.

Calls C++ function: void QPainter::drawEllipse(const QPoint& center, int rx, int ry).

C++ documentation:

This is an overloaded function.

Draws the ellipse positioned at center with radii rx and ry.

This function was introduced in Qt 4.4.

pub unsafe fn draw_glyph_run(
    &self,
    position: impl CastInto<Ref<QPointF>>,
    glyph_run: impl CastInto<Ref<QGlyphRun>>
)
[src]

Draws the glyphs represented by glyphs at position. The position gives the edge of the baseline for the string of glyphs. The glyphs will be retrieved from the font selected on glyphs and at offsets given by the positions in glyphs.

Calls C++ function: void QPainter::drawGlyphRun(const QPointF& position, const QGlyphRun& glyphRun).

C++ documentation:

Draws the glyphs represented by glyphs at position. The position gives the edge of the baseline for the string of glyphs. The glyphs will be retrieved from the font selected on glyphs and at offsets given by the positions in glyphs.

This function was introduced in Qt 4.8.

See also QGlyphRun::setRawFont(), QGlyphRun::setPositions(), and QGlyphRun::setGlyphIndexes().

pub unsafe fn draw_image_q_rect_f_q_image_q_rect_f_q_flags_image_conversion_flag(
    &self,
    target_rect: impl CastInto<Ref<QRectF>>,
    image: impl CastInto<Ref<QImage>>,
    source_rect: impl CastInto<Ref<QRectF>>,
    flags: QFlags<ImageConversionFlag>
)
[src]

Draws the rectangular portion source of the given image into the target rectangle in the paint device.

Calls C++ function: void QPainter::drawImage(const QRectF& targetRect, const QImage& image, const QRectF& sourceRect, QFlags<Qt::ImageConversionFlag> flags = …).

C++ documentation:

Draws the rectangular portion source of the given image into the target rectangle in the paint device.

Note: The image is scaled to fit the rectangle, if both the image and rectangle size disagree.

Note: See Drawing High Resolution Versions of Pixmaps and Images on how this is affected by QImage::devicePixelRatio().

If the image needs to be modified to fit in a lower-resolution result (e.g. converting from 32-bit to 8-bit), use the flags to specify how you would prefer this to happen.

QRectF target(10.0, 20.0, 80.0, 60.0); QRectF source(0.0, 0.0, 70.0, 40.0); QImage image(":/images/myImage.png");

QPainter painter(this); painter.drawImage(target, image, source);

See also drawPixmap() and QImage::devicePixelRatio().

pub unsafe fn draw_image_q_rect_q_image_q_rect_q_flags_image_conversion_flag(
    &self,
    target_rect: impl CastInto<Ref<QRect>>,
    image: impl CastInto<Ref<QImage>>,
    source_rect: impl CastInto<Ref<QRect>>,
    flags: QFlags<ImageConversionFlag>
)
[src]

This is an overloaded function.

Calls C++ function: void QPainter::drawImage(const QRect& targetRect, const QImage& image, const QRect& sourceRect, QFlags<Qt::ImageConversionFlag> flags = …).

C++ documentation:

This is an overloaded function.

Draws the rectangular portion source of the given image into the target rectangle in the paint device.

Note: The image is scaled to fit the rectangle, if both the image and rectangle size disagree.

pub unsafe fn draw_image_q_point_f_q_image_q_rect_f_q_flags_image_conversion_flag(
    &self,
    p: impl CastInto<Ref<QPointF>>,
    image: impl CastInto<Ref<QImage>>,
    sr: impl CastInto<Ref<QRectF>>,
    flags: QFlags<ImageConversionFlag>
)
[src]

This is an overloaded function.

Calls C++ function: void QPainter::drawImage(const QPointF& p, const QImage& image, const QRectF& sr, QFlags<Qt::ImageConversionFlag> flags = …).

C++ documentation:

This is an overloaded function.

Draws the rectangular portion source of the given image with its origin at the given point.

pub unsafe fn draw_image_q_point_q_image_q_rect_q_flags_image_conversion_flag(
    &self,
    p: impl CastInto<Ref<QPoint>>,
    image: impl CastInto<Ref<QImage>>,
    sr: impl CastInto<Ref<QRect>>,
    flags: QFlags<ImageConversionFlag>
)
[src]

This is an overloaded function.

Calls C++ function: void QPainter::drawImage(const QPoint& p, const QImage& image, const QRect& sr, QFlags<Qt::ImageConversionFlag> flags = …).

C++ documentation:

This is an overloaded function.

Draws the rectangular portion source of the given image with its origin at the given point.

pub unsafe fn draw_image_q_rect_f_q_image(
    &self,
    r: impl CastInto<Ref<QRectF>>,
    image: impl CastInto<Ref<QImage>>
)
[src]

This is an overloaded function.

Calls C++ function: void QPainter::drawImage(const QRectF& r, const QImage& image).

C++ documentation:

This is an overloaded function.

Draws the given image into the given rectangle.

Note: The image is scaled to fit the rectangle, if both the image and rectangle size disagree.

pub unsafe fn draw_image_q_rect_q_image(
    &self,
    r: impl CastInto<Ref<QRect>>,
    image: impl CastInto<Ref<QImage>>
)
[src]

This is an overloaded function.

Calls C++ function: void QPainter::drawImage(const QRect& r, const QImage& image).

C++ documentation:

This is an overloaded function.

Draws the given image into the given rectangle.

Note: The image is scaled to fit the rectangle, if both the image and rectangle size disagree.

pub unsafe fn draw_image_q_point_f_q_image(
    &self,
    p: impl CastInto<Ref<QPointF>>,
    image: impl CastInto<Ref<QImage>>
)
[src]

This is an overloaded function.

Calls C++ function: void QPainter::drawImage(const QPointF& p, const QImage& image).

C++ documentation:

This is an overloaded function.

Draws the given image at the given point.

pub unsafe fn draw_image_q_point_q_image(
    &self,
    p: impl CastInto<Ref<QPoint>>,
    image: impl CastInto<Ref<QImage>>
)
[src]

This is an overloaded function.

Calls C++ function: void QPainter::drawImage(const QPoint& p, const QImage& image).

C++ documentation:

This is an overloaded function.

Draws the given image at the given point.

pub unsafe fn draw_image_2_int_q_image4_int_q_flags_image_conversion_flag(
    &self,
    x: i32,
    y: i32,
    image: impl CastInto<Ref<QImage>>,
    sx: i32,
    sy: i32,
    sw: i32,
    sh: i32,
    flags: QFlags<ImageConversionFlag>
)
[src]

This is an overloaded function.

Calls C++ function: void QPainter::drawImage(int x, int y, const QImage& image, int sx = …, int sy = …, int sw = …, int sh = …, QFlags<Qt::ImageConversionFlag> flags = …).

C++ documentation:

This is an overloaded function.

Draws an image at (x, y) by copying a part of image into the paint device.

(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 image that is to be drawn. The default is (0, 0).

(sw, sh) specifies the size of the image that is to be drawn. The default, (0, 0) (and negative) means all the way to the bottom-right of the image.

pub unsafe fn draw_image_q_rect_f_q_image_q_rect_f(
    &self,
    target_rect: impl CastInto<Ref<QRectF>>,
    image: impl CastInto<Ref<QImage>>,
    source_rect: impl CastInto<Ref<QRectF>>
)
[src]

Draws the rectangular portion source of the given image into the target rectangle in the paint device.

Calls C++ function: void QPainter::drawImage(const QRectF& targetRect, const QImage& image, const QRectF& sourceRect).

C++ documentation:

Draws the rectangular portion source of the given image into the target rectangle in the paint device.

Note: The image is scaled to fit the rectangle, if both the image and rectangle size disagree.

Note: See Drawing High Resolution Versions of Pixmaps and Images on how this is affected by QImage::devicePixelRatio().

If the image needs to be modified to fit in a lower-resolution result (e.g. converting from 32-bit to 8-bit), use the flags to specify how you would prefer this to happen.

QRectF target(10.0, 20.0, 80.0, 60.0); QRectF source(0.0, 0.0, 70.0, 40.0); QImage image(":/images/myImage.png");

QPainter painter(this); painter.drawImage(target, image, source);

See also drawPixmap() and QImage::devicePixelRatio().

pub unsafe fn draw_image_q_rect_q_image_q_rect(
    &self,
    target_rect: impl CastInto<Ref<QRect>>,
    image: impl CastInto<Ref<QImage>>,
    source_rect: impl CastInto<Ref<QRect>>
)
[src]

This is an overloaded function.

Calls C++ function: void QPainter::drawImage(const QRect& targetRect, const QImage& image, const QRect& sourceRect).

C++ documentation:

This is an overloaded function.

Draws the rectangular portion source of the given image into the target rectangle in the paint device.

Note: The image is scaled to fit the rectangle, if both the image and rectangle size disagree.

pub unsafe fn draw_image_q_point_f_q_image_q_rect_f(
    &self,
    p: impl CastInto<Ref<QPointF>>,
    image: impl CastInto<Ref<QImage>>,
    sr: impl CastInto<Ref<QRectF>>
)
[src]

This is an overloaded function.

Calls C++ function: void QPainter::drawImage(const QPointF& p, const QImage& image, const QRectF& sr).

C++ documentation:

This is an overloaded function.

Draws the rectangular portion source of the given image with its origin at the given point.

pub unsafe fn draw_image_q_point_q_image_q_rect(
    &self,
    p: impl CastInto<Ref<QPoint>>,
    image: impl CastInto<Ref<QImage>>,
    sr: impl CastInto<Ref<QRect>>
)
[src]

This is an overloaded function.

Calls C++ function: void QPainter::drawImage(const QPoint& p, const QImage& image, const QRect& sr).

C++ documentation:

This is an overloaded function.

Draws the rectangular portion source of the given image with its origin at the given point.

pub unsafe fn draw_image_2_int_q_image4_int(
    &self,
    x: i32,
    y: i32,
    image: impl CastInto<Ref<QImage>>,
    sx: i32,
    sy: i32,
    sw: i32,
    sh: i32
)
[src]

This is an overloaded function.

Calls C++ function: void QPainter::drawImage(int x, int y, const QImage& image, int sx = …, int sy = …, int sw = …, int sh = …).

C++ documentation:

This is an overloaded function.

Draws an image at (x, y) by copying a part of image into the paint device.

(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 image that is to be drawn. The default is (0, 0).

(sw, sh) specifies the size of the image that is to be drawn. The default, (0, 0) (and negative) means all the way to the bottom-right of the image.

pub unsafe fn draw_image_2_int_q_image3_int(
    &self,
    x: i32,
    y: i32,
    image: impl CastInto<Ref<QImage>>,
    sx: i32,
    sy: i32,
    sw: i32
)
[src]

This is an overloaded function.

Calls C++ function: void QPainter::drawImage(int x, int y, const QImage& image, int sx = …, int sy = …, int sw = …).

C++ documentation:

This is an overloaded function.

Draws an image at (x, y) by copying a part of image into the paint device.

(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 image that is to be drawn. The default is (0, 0).

(sw, sh) specifies the size of the image that is to be drawn. The default, (0, 0) (and negative) means all the way to the bottom-right of the image.

pub unsafe fn draw_image_2_int_q_image2_int(
    &self,
    x: i32,
    y: i32,
    image: impl CastInto<Ref<QImage>>,
    sx: i32,
    sy: i32
)
[src]

This is an overloaded function.

Calls C++ function: void QPainter::drawImage(int x, int y, const QImage& image, int sx = …, int sy = …).

C++ documentation:

This is an overloaded function.

Draws an image at (x, y) by copying a part of image into the paint device.

(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 image that is to be drawn. The default is (0, 0).

(sw, sh) specifies the size of the image that is to be drawn. The default, (0, 0) (and negative) means all the way to the bottom-right of the image.

pub unsafe fn draw_image_2_int_q_image_int(
    &self,
    x: i32,
    y: i32,
    image: impl CastInto<Ref<QImage>>,
    sx: i32
)
[src]

This is an overloaded function.

Calls C++ function: void QPainter::drawImage(int x, int y, const QImage& image, int sx = …).

C++ documentation:

This is an overloaded function.

Draws an image at (x, y) by copying a part of image into the paint device.

(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 image that is to be drawn. The default is (0, 0).

(sw, sh) specifies the size of the image that is to be drawn. The default, (0, 0) (and negative) means all the way to the bottom-right of the image.

pub unsafe fn draw_image_2_int_q_image(
    &self,
    x: i32,
    y: i32,
    image: impl CastInto<Ref<QImage>>
)
[src]

This is an overloaded function.

Calls C++ function: void QPainter::drawImage(int x, int y, const QImage& image).

C++ documentation:

This is an overloaded function.

Draws an image at (x, y) by copying a part of image into the paint device.

(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 image that is to be drawn. The default is (0, 0).

(sw, sh) specifies the size of the image that is to be drawn. The default, (0, 0) (and negative) means all the way to the bottom-right of the image.

pub unsafe fn draw_line_q_line_f(&self, line: impl CastInto<Ref<QLineF>>)[src]

Draws a line defined by line.

Calls C++ function: void QPainter::drawLine(const QLineF& line).

C++ documentation:

Draws a line defined by line.

QLineF line(10.0, 80.0, 90.0, 20.0);

QPainter(this); painter.drawLine(line);

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

pub unsafe fn draw_line_q_line(&self, line: impl CastInto<Ref<QLine>>)[src]

This is an overloaded function.

Calls C++ function: void QPainter::drawLine(const QLine& line).

C++ documentation:

This is an overloaded function.

Draws a line defined by line.

pub unsafe fn draw_line_4_int(&self, x1: i32, y1: i32, x2: i32, y2: i32)[src]

This is an overloaded function.

Calls C++ function: void QPainter::drawLine(int x1, int y1, int x2, int y2).

C++ documentation:

This is an overloaded function.

Draws a line from (x1, y1) to (x2, y2).

pub unsafe fn draw_line_2_q_point(
    &self,
    p1: impl CastInto<Ref<QPoint>>,
    p2: impl CastInto<Ref<QPoint>>
)
[src]

This is an overloaded function.

Calls C++ function: void QPainter::drawLine(const QPoint& p1, const QPoint& p2).

C++ documentation:

This is an overloaded function.

Draws a line from p1 to p2.

pub unsafe fn draw_line_2_q_point_f(
    &self,
    p1: impl CastInto<Ref<QPointF>>,
    p2: impl CastInto<Ref<QPointF>>
)
[src]

This is an overloaded function.

Calls C++ function: void QPainter::drawLine(const QPointF& p1, const QPointF& p2).

C++ documentation:

This is an overloaded function.

Draws a line from p1 to p2.

pub unsafe fn draw_lines_q_line_f_int(
    &self,
    lines: impl CastInto<Ptr<QLineF>>,
    line_count: i32
)
[src]

Draws the first lineCount lines in the array lines using the current pen.

Calls C++ function: void QPainter::drawLines(const QLineF* lines, int lineCount).

C++ documentation:

Draws the first lineCount lines in the array lines using the current pen.

See also drawLine() and drawPolyline().

pub unsafe fn draw_lines_q_vector_of_q_line_f(
    &self,
    lines: impl CastInto<Ref<QVectorOfQLineF>>
)
[src]

This is an overloaded function.

Calls C++ function: void QPainter::drawLines(const QVector<QLineF>& lines).

C++ documentation:

This is an overloaded function.

Draws the set of lines defined by the list lines using the current pen and brush.

pub unsafe fn draw_lines_q_point_f_int(
    &self,
    point_pairs: impl CastInto<Ptr<QPointF>>,
    line_count: i32
)
[src]

This is an overloaded function.

Calls C++ function: void QPainter::drawLines(const QPointF* pointPairs, int lineCount).

C++ documentation:

This is an overloaded function.

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.

pub unsafe fn draw_lines_q_vector_of_q_point_f(
    &self,
    point_pairs: impl CastInto<Ref<QVectorOfQPointF>>
)
[src]

This is an overloaded function.

Calls C++ function: void QPainter::drawLines(const QVector<QPointF>& pointPairs).

C++ documentation:

This is an overloaded function.

Draws a line for each pair of points in the vector pointPairs using the current pen. If there is an odd number of points in the array, the last point will be ignored.

pub unsafe fn draw_lines_q_line_int(
    &self,
    lines: impl CastInto<Ptr<QLine>>,
    line_count: i32
)
[src]

This is an overloaded function.

Calls C++ function: void QPainter::drawLines(const QLine* lines, int lineCount).

C++ documentation:

This is an overloaded function.

Draws the first lineCount lines in the array lines using the current pen.

pub unsafe fn draw_lines_q_vector_of_q_line(
    &self,
    lines: impl CastInto<Ref<QVectorOfQLine>>
)
[src]

This is an overloaded function.

Calls C++ function: void QPainter::drawLines(const QVector<QLine>& lines).

C++ documentation:

This is an overloaded function.

Draws the set of lines defined by the list lines using the current pen and brush.

pub unsafe fn draw_lines_q_point_int(
    &self,
    point_pairs: impl CastInto<Ptr<QPoint>>,
    line_count: i32
)
[src]

This is an overloaded function.

Calls C++ function: void QPainter::drawLines(const QPoint* pointPairs, int lineCount).

C++ documentation:

This is an overloaded function.

Draws the first lineCount lines in the array pointPairs using the current pen.

pub unsafe fn draw_lines_q_vector_of_q_point(
    &self,
    point_pairs: impl CastInto<Ref<QVectorOfQPoint>>
)
[src]

This is an overloaded function.

Calls C++ function: void QPainter::drawLines(const QVector<QPoint>& pointPairs).

C++ documentation:

This is an overloaded function.

Draws a line for each pair of points in the vector pointPairs using the current pen.

pub unsafe fn draw_path(&self, path: impl CastInto<Ref<QPainterPath>>)[src]

Draws the given painter path using the current pen for outline and the current brush for filling.

Calls C++ function: void QPainter::drawPath(const QPainterPath& path).

C++ documentation:

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

See also the Painter Paths example and the Vector Deformation example.

pub unsafe fn draw_picture_q_point_f_q_picture(
    &self,
    p: impl CastInto<Ref<QPointF>>,
    picture: impl CastInto<Ref<QPicture>>
)
[src]

Replays the given picture at the given point.

Calls C++ function: void QPainter::drawPicture(const QPointF& p, const QPicture& picture).

C++ documentation:

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

See also QPicture::play().

pub unsafe fn draw_picture_2_int_q_picture(
    &self,
    x: i32,
    y: i32,
    picture: impl CastInto<Ref<QPicture>>
)
[src]

This is an overloaded function.

Calls C++ function: void QPainter::drawPicture(int x, int y, const QPicture& picture).

C++ documentation:

This is an overloaded function.

Draws the given picture at point (x, y).

pub unsafe fn draw_picture_q_point_q_picture(
    &self,
    p: impl CastInto<Ref<QPoint>>,
    picture: impl CastInto<Ref<QPicture>>
)
[src]

This is an overloaded function.

Calls C++ function: void QPainter::drawPicture(const QPoint& p, const QPicture& picture).

C++ documentation:

This is an overloaded function.

Replays the given picture at the given point.

pub unsafe fn draw_pie_q_rect_f2_int(
    &self,
    rect: impl CastInto<Ref<QRectF>>,
    a: i32,
    alen: i32
)
[src]

Draws a pie defined by the given rectangle, startAngle and spanAngle.

Calls C++ function: void QPainter::drawPie(const QRectF& rect, int a, int alen).

C++ documentation:

Draws a pie defined by the given rectangle, startAngle 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.

QRectF rectangle(10.0, 20.0, 80.0, 60.0); int startAngle = 30 16; int spanAngle = 120 16;

QPainter painter(this); painter.drawPie(rectangle, startAngle, spanAngle);

See also drawEllipse(), drawChord(), and Coordinate System.

pub unsafe fn draw_pie_6_int(
    &self,
    x: i32,
    y: i32,
    w: i32,
    h: i32,
    a: i32,
    alen: i32
)
[src]

This is an overloaded function.

Calls C++ function: void QPainter::drawPie(int x, int y, int w, int h, int a, int alen).

C++ documentation:

This is an overloaded function.

Draws the pie defined by the rectangle beginning at (x, y) with the specified width and height, and the given startAngle and spanAngle.

pub unsafe fn draw_pie_q_rect2_int(
    &self,
    arg1: impl CastInto<Ref<QRect>>,
    a: i32,
    alen: i32
)
[src]

This is an overloaded function.

Calls C++ function: void QPainter::drawPie(const QRect& arg1, int a, int alen).

C++ documentation:

This is an overloaded function.

Draws a pie defined by the given rectangle, startAngle and and spanAngle.

pub unsafe fn draw_pixmap_q_rect_f_q_pixmap_q_rect_f(
    &self,
    target_rect: impl CastInto<Ref<QRectF>>,
    pixmap: impl CastInto<Ref<QPixmap>>,
    source_rect: impl CastInto<Ref<QRectF>>
)
[src]

Draws the rectangular portion source of the given pixmap into the given target in the paint device.

Calls C++ function: void QPainter::drawPixmap(const QRectF& targetRect, const QPixmap& pixmap, const QRectF& sourceRect).

C++ documentation:

Draws the rectangular portion source of the given pixmap into the given target in the paint device.

Note: The pixmap is scaled to fit the rectangle, if both the pixmap and rectangle size disagree.

Note: See Drawing High Resolution Versions of Pixmaps and Images on how this is affected by QPixmap::devicePixelRatio().

QRectF target(10.0, 20.0, 80.0, 60.0); QRectF source(0.0, 0.0, 70.0, 40.0); QPixmap pixmap(":myPixmap.png");

QPainter(this); painter.drawPixmap(target, pixmap, source);

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.

See also drawImage() and QPixmap::devicePixelRatio().

pub unsafe fn draw_pixmap_q_rect_q_pixmap_q_rect(
    &self,
    target_rect: impl CastInto<Ref<QRect>>,
    pixmap: impl CastInto<Ref<QPixmap>>,
    source_rect: impl CastInto<Ref<QRect>>
)
[src]

This is an overloaded function.

Calls C++ function: void QPainter::drawPixmap(const QRect& targetRect, const QPixmap& pixmap, const QRect& sourceRect).

C++ documentation:

This is an overloaded function.

Draws the rectangular portion source of the given pixmap into the given target in the paint device.

Note: The pixmap is scaled to fit the rectangle, if both the pixmap and rectangle size disagree.

pub unsafe fn draw_pixmap_4_int_q_pixmap4_int(
    &self,
    x: i32,
    y: i32,
    w: i32,
    h: i32,
    pm: impl CastInto<Ref<QPixmap>>,
    sx: i32,
    sy: i32,
    sw: i32,
    sh: i32
)
[src]

This is an overloaded function.

Calls C++ function: void QPainter::drawPixmap(int x, int y, int w, int h, const QPixmap& pm, int sx, int sy, int sw, int sh).

C++ documentation:

This is an overloaded function.

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. If sw or sh are equal to zero the width/height of the pixmap is used and adjusted by the offset sx/sy;

pub unsafe fn draw_pixmap_2_int_q_pixmap4_int(
    &self,
    x: i32,
    y: i32,
    pm: impl CastInto<Ref<QPixmap>>,
    sx: i32,
    sy: i32,
    sw: i32,
    sh: i32
)
[src]

This is an overloaded function.

Calls C++ function: void QPainter::drawPixmap(int x, int y, const QPixmap& pm, int sx, int sy, int sw, int sh).

C++ documentation:

This is an overloaded function.

Draws a pixmap at (x, y) by copying a part of the given pixmap into the paint device.

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

pub unsafe fn draw_pixmap_q_point_f_q_pixmap_q_rect_f(
    &self,
    p: impl CastInto<Ref<QPointF>>,
    pm: impl CastInto<Ref<QPixmap>>,
    sr: impl CastInto<Ref<QRectF>>
)
[src]

This is an overloaded function.

Calls C++ function: void QPainter::drawPixmap(const QPointF& p, const QPixmap& pm, const QRectF& sr).

C++ documentation:

This is an overloaded function.

Draws the rectangular portion source of the given pixmap with its origin at the given point.

pub unsafe fn draw_pixmap_q_point_q_pixmap_q_rect(
    &self,
    p: impl CastInto<Ref<QPoint>>,
    pm: impl CastInto<Ref<QPixmap>>,
    sr: impl CastInto<Ref<QRect>>
)
[src]

This is an overloaded function.

Calls C++ function: void QPainter::drawPixmap(const QPoint& p, const QPixmap& pm, const QRect& sr).

C++ documentation:

This is an overloaded function.

Draws the rectangular portion source of the given pixmap with its origin at the given point.

pub unsafe fn draw_pixmap_q_point_f_q_pixmap(
    &self,
    p: impl CastInto<Ref<QPointF>>,
    pm: impl CastInto<Ref<QPixmap>>
)
[src]

This is an overloaded function.

Calls C++ function: void QPainter::drawPixmap(const QPointF& p, const QPixmap& pm).

C++ documentation:

This is an overloaded function.

Draws the given pixmap with its origin at the given point.

pub unsafe fn draw_pixmap_q_point_q_pixmap(
    &self,
    p: impl CastInto<Ref<QPoint>>,
    pm: impl CastInto<Ref<QPixmap>>
)
[src]

This is an overloaded function.

Calls C++ function: void QPainter::drawPixmap(const QPoint& p, const QPixmap& pm).

C++ documentation:

This is an overloaded function.

Draws the given pixmap with its origin at the given point.

pub unsafe fn draw_pixmap_2_int_q_pixmap(
    &self,
    x: i32,
    y: i32,
    pm: impl CastInto<Ref<QPixmap>>
)
[src]

This is an overloaded function.

Calls C++ function: void QPainter::drawPixmap(int x, int y, const QPixmap& pm).

C++ documentation:

This is an overloaded function.

Draws the given pixmap at position (x, y).

pub unsafe fn draw_pixmap_q_rect_q_pixmap(
    &self,
    r: impl CastInto<Ref<QRect>>,
    pm: impl CastInto<Ref<QPixmap>>
)
[src]

This is an overloaded function.

Calls C++ function: void QPainter::drawPixmap(const QRect& r, const QPixmap& pm).

C++ documentation:

This is an overloaded function.

Draws the given pixmap into the given rectangle.

Note: The pixmap is scaled to fit the rectangle, if both the pixmap and rectangle size disagree.

pub unsafe fn draw_pixmap_4_int_q_pixmap(
    &self,
    x: i32,
    y: i32,
    w: i32,
    h: i32,
    pm: impl CastInto<Ref<QPixmap>>
)
[src]

This is an overloaded function.

Calls C++ function: void QPainter::drawPixmap(int x, int y, int w, int h, const QPixmap& pm).

C++ documentation:

This is an overloaded function.

Draws the pixmap into the rectangle at position (x, y) with the given width and height.

pub unsafe fn draw_pixmap_fragments_4a(
    &self,
    fragments: impl CastInto<Ptr<PixmapFragment>>,
    fragment_count: i32,
    pixmap: impl CastInto<Ref<QPixmap>>,
    hints: QFlags<PixmapFragmentHint>
)
[src]

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.

Calls C++ function: void QPainter::drawPixmapFragments(const QPainter::PixmapFragment* fragments, int fragmentCount, const QPixmap& pixmap, QFlags<QPainter::PixmapFragmentHint> hints = …).

C++ documentation:

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.

This function was introduced in Qt 4.7.

See also QPainter::PixmapFragment and QPainter::PixmapFragmentHint.

pub unsafe fn draw_pixmap_fragments_3a(
    &self,
    fragments: impl CastInto<Ptr<PixmapFragment>>,
    fragment_count: i32,
    pixmap: impl CastInto<Ref<QPixmap>>
)
[src]

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.

Calls C++ function: void QPainter::drawPixmapFragments(const QPainter::PixmapFragment* fragments, int fragmentCount, const QPixmap& pixmap).

C++ documentation:

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.

This function was introduced in Qt 4.7.

See also QPainter::PixmapFragment and QPainter::PixmapFragmentHint.

pub unsafe fn draw_point_q_point_f(&self, pt: impl CastInto<Ref<QPointF>>)[src]

Draws a single point at the given position using the current pen's color.

Calls C++ function: void QPainter::drawPoint(const QPointF& pt).

C++ documentation:

Draws a single point at the given position using the current pen's color.

See also Coordinate System.

pub unsafe fn draw_point_q_point(&self, p: impl CastInto<Ref<QPoint>>)[src]

This is an overloaded function.

Calls C++ function: void QPainter::drawPoint(const QPoint& p).

C++ documentation:

This is an overloaded function.

Draws a single point at the given position using the current pen's color.

pub unsafe fn draw_point_2_int(&self, x: i32, y: i32)[src]

This is an overloaded function.

Calls C++ function: void QPainter::drawPoint(int x, int y).

C++ documentation:

This is an overloaded function.

Draws a single point at position (x, y).

pub unsafe fn draw_points_q_point_f_int(
    &self,
    points: impl CastInto<Ptr<QPointF>>,
    point_count: i32
)
[src]

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

Calls C++ function: void QPainter::drawPoints(const QPointF* points, int pointCount).

C++ documentation:

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

See also Coordinate System.

pub unsafe fn draw_points_q_polygon_f(
    &self,
    points: impl CastInto<Ref<QPolygonF>>
)
[src]

This is an overloaded function.

Calls C++ function: void QPainter::drawPoints(const QPolygonF& points).

C++ documentation:

This is an overloaded function.

Draws the points in the vector points.

pub unsafe fn draw_points_q_point_int(
    &self,
    points: impl CastInto<Ptr<QPoint>>,
    point_count: i32
)
[src]

This is an overloaded function.

Calls C++ function: void QPainter::drawPoints(const QPoint* points, int pointCount).

C++ documentation:

This is an overloaded function.

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

pub unsafe fn draw_points_q_polygon(&self, points: impl CastInto<Ref<QPolygon>>)[src]

This is an overloaded function.

Calls C++ function: void QPainter::drawPoints(const QPolygon& points).

C++ documentation:

This is an overloaded function.

Draws the points in the vector points.

pub unsafe fn draw_polygon_q_point_f_int_fill_rule(
    &self,
    points: impl CastInto<Ptr<QPointF>>,
    point_count: i32,
    fill_rule: FillRule
)
[src]

Draws the polygon defined by the first pointCount points in the array points using the current pen and brush.

Calls C++ function: void QPainter::drawPolygon(const QPointF* points, int pointCount, Qt::FillRule fillRule = …).

C++ documentation:

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.

pub unsafe fn draw_polygon_q_polygon_f_fill_rule(
    &self,
    polygon: impl CastInto<Ref<QPolygonF>>,
    fill_rule: FillRule
)
[src]

This is an overloaded function.

Calls C++ function: void QPainter::drawPolygon(const QPolygonF& polygon, Qt::FillRule fillRule = …).

C++ documentation:

This is an overloaded function.

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

pub unsafe fn draw_polygon_q_point_int_fill_rule(
    &self,
    points: impl CastInto<Ptr<QPoint>>,
    point_count: i32,
    fill_rule: FillRule
)
[src]

This is an overloaded function.

Calls C++ function: void QPainter::drawPolygon(const QPoint* points, int pointCount, Qt::FillRule fillRule = …).

C++ documentation:

This is an overloaded function.

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

pub unsafe fn draw_polygon_q_polygon_fill_rule(
    &self,
    polygon: impl CastInto<Ref<QPolygon>>,
    fill_rule: FillRule
)
[src]

This is an overloaded function.

Calls C++ function: void QPainter::drawPolygon(const QPolygon& polygon, Qt::FillRule fillRule = …).

C++ documentation:

This is an overloaded function.

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

pub unsafe fn draw_polygon_q_point_f_int(
    &self,
    points: impl CastInto<Ptr<QPointF>>,
    point_count: i32
)
[src]

Draws the polygon defined by the first pointCount points in the array points using the current pen and brush.

Calls C++ function: void QPainter::drawPolygon(const QPointF* points, int pointCount).

C++ documentation:

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.

pub unsafe fn draw_polygon_q_polygon_f(
    &self,
    polygon: impl CastInto<Ref<QPolygonF>>
)
[src]

This is an overloaded function.

Calls C++ function: void QPainter::drawPolygon(const QPolygonF& polygon).

C++ documentation:

This is an overloaded function.

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

pub unsafe fn draw_polygon_q_point_int(
    &self,
    points: impl CastInto<Ptr<QPoint>>,
    point_count: i32
)
[src]

This is an overloaded function.

Calls C++ function: void QPainter::drawPolygon(const QPoint* points, int pointCount).

C++ documentation:

This is an overloaded function.

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

pub unsafe fn draw_polygon_q_polygon(
    &self,
    polygon: impl CastInto<Ref<QPolygon>>
)
[src]

This is an overloaded function.

Calls C++ function: void QPainter::drawPolygon(const QPolygon& polygon).

C++ documentation:

This is an overloaded function.

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

pub unsafe fn draw_polyline_q_point_f_int(
    &self,
    points: impl CastInto<Ptr<QPointF>>,
    point_count: i32
)
[src]

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

Calls C++ function: void QPainter::drawPolyline(const QPointF* points, int pointCount).

C++ documentation:

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.

pub unsafe fn draw_polyline_q_polygon_f(
    &self,
    polyline: impl CastInto<Ref<QPolygonF>>
)
[src]

This is an overloaded function.

Calls C++ function: void QPainter::drawPolyline(const QPolygonF& polyline).

C++ documentation:

This is an overloaded function.

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

pub unsafe fn draw_polyline_q_point_int(
    &self,
    points: impl CastInto<Ptr<QPoint>>,
    point_count: i32
)
[src]

This is an overloaded function.

Calls C++ function: void QPainter::drawPolyline(const QPoint* points, int pointCount).

C++ documentation:

This is an overloaded function.

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

pub unsafe fn draw_polyline_q_polygon(
    &self,
    polygon: impl CastInto<Ref<QPolygon>>
)
[src]

This is an overloaded function.

Calls C++ function: void QPainter::drawPolyline(const QPolygon& polygon).

C++ documentation:

This is an overloaded function.

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

pub unsafe fn draw_rect_q_rect_f(&self, rect: impl CastInto<Ref<QRectF>>)[src]

Draws the current rectangle with the current pen and brush.

Calls C++ function: void QPainter::drawRect(const QRectF& rect).

C++ documentation:

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.

pub unsafe fn draw_rect_4_int(&self, x1: i32, y1: i32, w: i32, h: i32)[src]

This is an overloaded function.

Calls C++ function: void QPainter::drawRect(int x1, int y1, int w, int h).

C++ documentation:

This is an overloaded function.

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

pub unsafe fn draw_rect_q_rect(&self, rect: impl CastInto<Ref<QRect>>)[src]

This is an overloaded function.

Calls C++ function: void QPainter::drawRect(const QRect& rect).

C++ documentation:

This is an overloaded function.

Draws the current rectangle with the current pen and brush.

pub unsafe fn draw_rects_q_rect_f_int(
    &self,
    rects: impl CastInto<Ptr<QRectF>>,
    rect_count: i32
)
[src]

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

Calls C++ function: void QPainter::drawRects(const QRectF* rects, int rectCount).

C++ documentation:

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

See also drawRect().

pub unsafe fn draw_rects_q_vector_of_q_rect_f(
    &self,
    rectangles: impl CastInto<Ref<QVectorOfQRectF>>
)
[src]

This is an overloaded function.

Calls C++ function: void QPainter::drawRects(const QVector<QRectF>& rectangles).

C++ documentation:

This is an overloaded function.

Draws the given rectangles using the current pen and brush.

pub unsafe fn draw_rects_q_rect_int(
    &self,
    rects: impl CastInto<Ptr<QRect>>,
    rect_count: i32
)
[src]

This is an overloaded function.

Calls C++ function: void QPainter::drawRects(const QRect* rects, int rectCount).

C++ documentation:

This is an overloaded function.

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

pub unsafe fn draw_rects_q_vector_of_q_rect(
    &self,
    rectangles: impl CastInto<Ref<QVectorOfQRect>>
)
[src]

This is an overloaded function.

Calls C++ function: void QPainter::drawRects(const QVector<QRect>& rectangles).

C++ documentation:

This is an overloaded function.

Draws the given rectangles using the current pen and brush.

pub unsafe fn draw_round_rect_q_rect_f2_int(
    &self,
    r: impl CastInto<Ref<QRectF>>,
    xround: i32,
    yround: i32
)
[src]

Draws a rectangle r with rounded corners.

Calls C++ function: void QPainter::drawRoundRect(const QRectF& r, int xround = …, int yround = …).

C++ documentation:

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.

See also drawRoundedRect().

pub unsafe fn draw_round_rect_6_int(
    &self,
    x: i32,
    y: i32,
    w: i32,
    h: i32,
    arg5: i32,
    arg6: i32
)
[src]

This is an overloaded function.

Calls C++ function: void QPainter::drawRoundRect(int x, int y, int w, int h, int arg5 = …, int arg6 = …).

C++ documentation:

This is an overloaded function.

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

pub unsafe fn draw_round_rect_q_rect2_int(
    &self,
    r: impl CastInto<Ref<QRect>>,
    xround: i32,
    yround: i32
)
[src]

This is an overloaded function.

Calls C++ function: void QPainter::drawRoundRect(const QRect& r, int xround = …, int yround = …).

C++ documentation:

This is an overloaded function.

Draws the rectangle r with rounded corners.

pub unsafe fn draw_round_rect_q_rect_f_int(
    &self,
    r: impl CastInto<Ref<QRectF>>,
    xround: i32
)
[src]

Draws a rectangle r with rounded corners.

Calls C++ function: void QPainter::drawRoundRect(const QRectF& r, int xround = …).

C++ documentation:

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.

See also drawRoundedRect().

pub unsafe fn draw_round_rect_q_rect_f(&self, r: impl CastInto<Ref<QRectF>>)[src]

Draws a rectangle r with rounded corners.

Calls C++ function: void QPainter::drawRoundRect(const QRectF& r).

C++ documentation:

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.

See also drawRoundedRect().

pub unsafe fn draw_round_rect_5_int(
    &self,
    x: i32,
    y: i32,
    w: i32,
    h: i32,
    arg5: i32
)
[src]

This is an overloaded function.

Calls C++ function: void QPainter::drawRoundRect(int x, int y, int w, int h, int arg5 = …).

C++ documentation:

This is an overloaded function.

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

pub unsafe fn draw_round_rect_4_int(&self, x: i32, y: i32, w: i32, h: i32)[src]

This is an overloaded function.

Calls C++ function: void QPainter::drawRoundRect(int x, int y, int w, int h).

C++ documentation:

This is an overloaded function.

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

pub unsafe fn draw_round_rect_q_rect_int(
    &self,
    r: impl CastInto<Ref<QRect>>,
    xround: i32
)
[src]

This is an overloaded function.

Calls C++ function: void QPainter::drawRoundRect(const QRect& r, int xround = …).

C++ documentation:

This is an overloaded function.

Draws the rectangle r with rounded corners.

pub unsafe fn draw_round_rect_q_rect(&self, r: impl CastInto<Ref<QRect>>)[src]

This is an overloaded function.

Calls C++ function: void QPainter::drawRoundRect(const QRect& r).

C++ documentation:

This is an overloaded function.

Draws the rectangle r with rounded corners.

pub unsafe fn draw_rounded_rect_q_rect_f2_double_size_mode(
    &self,
    rect: impl CastInto<Ref<QRectF>>,
    x_radius: f64,
    y_radius: f64,
    mode: SizeMode
)
[src]

Draws the given rectangle rect with rounded corners.

Calls C++ function: void QPainter::drawRoundedRect(const QRectF& rect, double xRadius, double yRadius, Qt::SizeMode mode = …).

C++ documentation:

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.

pub unsafe fn draw_rounded_rect_4_int2_double_size_mode(
    &self,
    x: i32,
    y: i32,
    w: i32,
    h: i32,
    x_radius: f64,
    y_radius: f64,
    mode: SizeMode
)
[src]

This is an overloaded function.

Calls C++ function: void QPainter::drawRoundedRect(int x, int y, int w, int h, double xRadius, double yRadius, Qt::SizeMode mode = …).

C++ documentation:

This is an overloaded function.

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

This function was introduced in Qt 4.4.

pub unsafe fn draw_rounded_rect_q_rect2_double_size_mode(
    &self,
    rect: impl CastInto<Ref<QRect>>,
    x_radius: f64,
    y_radius: f64,
    mode: SizeMode
)
[src]

This is an overloaded function.

Calls C++ function: void QPainter::drawRoundedRect(const QRect& rect, double xRadius, double yRadius, Qt::SizeMode mode = …).

C++ documentation:

This is an overloaded function.

Draws the given rectangle rect with rounded corners.

This function was introduced in Qt 4.4.

pub unsafe fn draw_rounded_rect_q_rect_f2_double(
    &self,
    rect: impl CastInto<Ref<QRectF>>,
    x_radius: f64,
    y_radius: f64
)
[src]

Draws the given rectangle rect with rounded corners.

Calls C++ function: void QPainter::drawRoundedRect(const QRectF& rect, double xRadius, double yRadius).

C++ documentation:

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.

pub unsafe fn draw_rounded_rect_4_int2_double(
    &self,
    x: i32,
    y: i32,
    w: i32,
    h: i32,
    x_radius: f64,
    y_radius: f64
)
[src]

This is an overloaded function.

Calls C++ function: void QPainter::drawRoundedRect(int x, int y, int w, int h, double xRadius, double yRadius).

C++ documentation:

This is an overloaded function.

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

This function was introduced in Qt 4.4.

pub unsafe fn draw_rounded_rect_q_rect2_double(
    &self,
    rect: impl CastInto<Ref<QRect>>,
    x_radius: f64,
    y_radius: f64
)
[src]

This is an overloaded function.

Calls C++ function: void QPainter::drawRoundedRect(const QRect& rect, double xRadius, double yRadius).

C++ documentation:

This is an overloaded function.

Draws the given rectangle rect with rounded corners.

This function was introduced in Qt 4.4.

pub unsafe fn draw_static_text_q_point_f_q_static_text(
    &self,
    top_left_position: impl CastInto<Ref<QPointF>>,
    static_text: impl CastInto<Ref<QStaticText>>
)
[src]

Draws the given staticText at the given topLeftPosition.

Calls C++ function: void QPainter::drawStaticText(const QPointF& topLeftPosition, const QStaticText& staticText).

C++ documentation:

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.

pub unsafe fn draw_static_text_q_point_q_static_text(
    &self,
    top_left_position: impl CastInto<Ref<QPoint>>,
    static_text: impl CastInto<Ref<QStaticText>>
)
[src]

This is an overloaded function.

Calls C++ function: void QPainter::drawStaticText(const QPoint& topLeftPosition, const QStaticText& staticText).

C++ documentation:

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.

pub unsafe fn draw_static_text_2_int_q_static_text(
    &self,
    left: i32,
    top: i32,
    static_text: impl CastInto<Ref<QStaticText>>
)
[src]

This is an overloaded function.

Calls C++ function: void QPainter::drawStaticText(int left, int top, const QStaticText& staticText).

C++ documentation:

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.

pub unsafe fn draw_text_q_point_f_q_string(
    &self,
    p: impl CastInto<Ref<QPointF>>,
    s: impl CastInto<Ref<QString>>
)
[src]

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

Calls C++ function: void QPainter::drawText(const QPointF& p, const QString& s).

C++ documentation:

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

pub unsafe fn draw_text_q_point_q_string(
    &self,
    p: impl CastInto<Ref<QPoint>>,
    s: impl CastInto<Ref<QString>>
)
[src]

This is an overloaded function.

Calls C++ function: void QPainter::drawText(const QPoint& p, const QString& s).

C++ documentation:

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

pub unsafe fn draw_text_2_int_q_string(
    &self,
    x: i32,
    y: i32,
    s: impl CastInto<Ref<QString>>
)
[src]

This is an overloaded function.

Calls C++ function: void QPainter::drawText(int x, int y, const QString& s).

C++ documentation:

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

pub unsafe fn draw_text_q_point_f_q_string2_int(
    &self,
    p: impl CastInto<Ref<QPointF>>,
    str: impl CastInto<Ref<QString>>,
    tf: i32,
    justification_padding: i32
)
[src]

Calls C++ function: void QPainter::drawText(const QPointF& p, const QString& str, int tf, int justificationPadding).

pub unsafe fn draw_text_q_rect_f_int_q_string_q_rect_f(
    &self,
    r: impl CastInto<Ref<QRectF>>,
    flags: i32,
    text: impl CastInto<Ref<QString>>,
    br: impl CastInto<Ptr<QRectF>>
)
[src]

This is an overloaded function.

Calls C++ function: void QPainter::drawText(const QRectF& r, int flags, const QString& text, QRectF* br = …).

C++ documentation:

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

pub unsafe fn draw_text_q_rect_int_q_string_q_rect(
    &self,
    r: impl CastInto<Ref<QRect>>,
    flags: i32,
    text: impl CastInto<Ref<QString>>,
    br: impl CastInto<Ptr<QRect>>
)
[src]

This is an overloaded function.

Calls C++ function: void QPainter::drawText(const QRect& r, int flags, const QString& text, QRect* br = …).

C++ documentation:

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

pub unsafe fn draw_text_5_int_q_string_q_rect(
    &self,
    x: i32,
    y: i32,
    w: i32,
    h: i32,
    flags: i32,
    text: impl CastInto<Ref<QString>>,
    br: impl CastInto<Ptr<QRect>>
)
[src]

This is an overloaded function.

Calls C++ function: void QPainter::drawText(int x, int y, int w, int h, int flags, const QString& text, QRect* br = …).

C++ documentation:

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

pub unsafe fn draw_text_q_rect_f_q_string_q_text_option(
    &self,
    r: impl CastInto<Ref<QRectF>>,
    text: impl CastInto<Ref<QString>>,
    o: impl CastInto<Ref<QTextOption>>
)
[src]

This is an overloaded function.

Calls C++ function: void QPainter::drawText(const QRectF& r, const QString& text, const QTextOption& o = …).

C++ documentation:

This is an overloaded function.

Draws the given text in the rectangle specified using the option to control its positioning and orientation.

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

pub unsafe fn draw_text_q_rect_f_int_q_string(
    &self,
    r: impl CastInto<Ref<QRectF>>,
    flags: i32,
    text: impl CastInto<Ref<QString>>
)
[src]

This is an overloaded function.

Calls C++ function: void QPainter::drawText(const QRectF& r, int flags, const QString& text).

C++ documentation:

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

pub unsafe fn draw_text_q_rect_int_q_string(
    &self,
    r: impl CastInto<Ref<QRect>>,
    flags: i32,
    text: impl CastInto<Ref<QString>>
)
[src]

This is an overloaded function.

Calls C++ function: void QPainter::drawText(const QRect& r, int flags, const QString& text).

C++ documentation:

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

pub unsafe fn draw_text_5_int_q_string(
    &self,
    x: i32,
    y: i32,
    w: i32,
    h: i32,
    flags: i32,
    text: impl CastInto<Ref<QString>>
)
[src]

This is an overloaded function.

Calls C++ function: void QPainter::drawText(int x, int y, int w, int h, int flags, const QString& text).

C++ documentation:

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

pub unsafe fn draw_text_q_rect_f_q_string(
    &self,
    r: impl CastInto<Ref<QRectF>>,
    text: impl CastInto<Ref<QString>>
)
[src]

This is an overloaded function.

Calls C++ function: void QPainter::drawText(const QRectF& r, const QString& text).

C++ documentation:

This is an overloaded function.

Draws the given text in the rectangle specified using the option to control its positioning and orientation.

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

pub unsafe fn draw_text_item_q_point_f_q_text_item(
    &self,
    p: impl CastInto<Ref<QPointF>>,
    ti: impl CastInto<Ref<QTextItem>>
)
[src]

Calls C++ function: void QPainter::drawTextItem(const QPointF& p, const QTextItem& ti).

pub unsafe fn draw_text_item_2_int_q_text_item(
    &self,
    x: i32,
    y: i32,
    ti: impl CastInto<Ref<QTextItem>>
)
[src]

Calls C++ function: void QPainter::drawTextItem(int x, int y, const QTextItem& ti).

pub unsafe fn draw_text_item_q_point_q_text_item(
    &self,
    p: impl CastInto<Ref<QPoint>>,
    ti: impl CastInto<Ref<QTextItem>>
)
[src]

Calls C++ function: void QPainter::drawTextItem(const QPoint& p, const QTextItem& ti).

pub unsafe fn draw_tiled_pixmap_q_rect_f_q_pixmap_q_point_f(
    &self,
    rect: impl CastInto<Ref<QRectF>>,
    pm: impl CastInto<Ref<QPixmap>>,
    offset: impl CastInto<Ref<QPointF>>
)
[src]

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

Calls C++ function: void QPainter::drawTiledPixmap(const QRectF& rect, const QPixmap& pm, const QPointF& offset = …).

C++ documentation:

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.

See also drawPixmap().

pub unsafe fn draw_tiled_pixmap_4_int_q_pixmap2_int(
    &self,
    x: i32,
    y: i32,
    w: i32,
    h: i32,
    arg5: impl CastInto<Ref<QPixmap>>,
    sx: i32,
    sy: i32
)
[src]

This is an overloaded function.

Calls C++ function: void QPainter::drawTiledPixmap(int x, int y, int w, int h, const QPixmap& arg5, int sx = …, int sy = …).

C++ documentation:

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

pub unsafe fn draw_tiled_pixmap_q_rect_q_pixmap_q_point(
    &self,
    arg1: impl CastInto<Ref<QRect>>,
    arg2: impl CastInto<Ref<QPixmap>>,
    arg3: impl CastInto<Ref<QPoint>>
)
[src]

This is an overloaded function.

Calls C++ function: void QPainter::drawTiledPixmap(const QRect& arg1, const QPixmap& arg2, const QPoint& arg3 = …).

C++ documentation:

This is an overloaded function.

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

pub unsafe fn draw_tiled_pixmap_q_rect_f_q_pixmap(
    &self,
    rect: impl CastInto<Ref<QRectF>>,
    pm: impl CastInto<Ref<QPixmap>>
)
[src]

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

Calls C++ function: void QPainter::drawTiledPixmap(const QRectF& rect, const QPixmap& pm).

C++ documentation:

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.

See also drawPixmap().

pub unsafe fn draw_tiled_pixmap_4_int_q_pixmap_int(
    &self,
    x: i32,
    y: i32,
    w: i32,
    h: i32,
    arg5: impl CastInto<Ref<QPixmap>>,
    sx: i32
)
[src]

This is an overloaded function.

Calls C++ function: void QPainter::drawTiledPixmap(int x, int y, int w, int h, const QPixmap& arg5, int sx = …).

C++ documentation:

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

pub unsafe fn draw_tiled_pixmap_4_int_q_pixmap(
    &self,
    x: i32,
    y: i32,
    w: i32,
    h: i32,
    arg5: impl CastInto<Ref<QPixmap>>
)
[src]

This is an overloaded function.

Calls C++ function: void QPainter::drawTiledPixmap(int x, int y, int w, int h, const QPixmap& arg5).

C++ documentation:

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

pub unsafe fn draw_tiled_pixmap_q_rect_q_pixmap(
    &self,
    arg1: impl CastInto<Ref<QRect>>,
    arg2: impl CastInto<Ref<QPixmap>>
)
[src]

This is an overloaded function.

Calls C++ function: void QPainter::drawTiledPixmap(const QRect& arg1, const QPixmap& arg2).

C++ documentation:

This is an overloaded function.

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

pub unsafe fn end(&self) -> bool[src]

Ends painting. Any resources used while painting are released. You don't normally need to call this since it is called by the destructor.

Calls C++ function: bool QPainter::end().

C++ documentation:

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

pub unsafe fn end_native_painting(&self)[src]

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.

Calls C++ function: void QPainter::endNativePainting().

C++ documentation:

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

pub unsafe fn erase_rect_q_rect_f(&self, arg1: impl CastInto<Ref<QRectF>>)[src]

Erases the area inside the given rectangle. Equivalent to calling

Calls C++ function: void QPainter::eraseRect(const QRectF& arg1).

C++ documentation:

Erases the area inside the given rectangle. Equivalent to calling


  fillRect(rectangle, background()).

See also fillRect().

pub unsafe fn erase_rect_4_int(&self, x: i32, y: i32, w: i32, h: i32)[src]

This is an overloaded function.

Calls C++ function: void QPainter::eraseRect(int x, int y, int w, int h).

C++ documentation:

This is an overloaded function.

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

pub unsafe fn erase_rect_q_rect(&self, arg1: impl CastInto<Ref<QRect>>)[src]

This is an overloaded function.

Calls C++ function: void QPainter::eraseRect(const QRect& arg1).

C++ documentation:

This is an overloaded function.

Erases the area inside the given rectangle.

pub unsafe fn fill_path(
    &self,
    path: impl CastInto<Ref<QPainterPath>>,
    brush: impl CastInto<Ref<QBrush>>
)
[src]

Fills the given path using the given brush. The outline is not drawn.

Calls C++ function: void QPainter::fillPath(const QPainterPath& path, const QBrush& brush).

C++ documentation:

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

pub unsafe fn fill_rect_q_rect_f_q_brush(
    &self,
    arg1: impl CastInto<Ref<QRectF>>,
    arg2: impl CastInto<Ref<QBrush>>
)
[src]

Fills the given rectangle with the brush specified.

Calls C++ function: void QPainter::fillRect(const QRectF& arg1, const QBrush& arg2).

C++ documentation:

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

pub unsafe fn fill_rect_4_int_q_brush(
    &self,
    x: i32,
    y: i32,
    w: i32,
    h: i32,
    arg5: impl CastInto<Ref<QBrush>>
)
[src]

This is an overloaded function.

Calls C++ function: void QPainter::fillRect(int x, int y, int w, int h, const QBrush& arg5).

C++ documentation:

This is an overloaded function.

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

pub unsafe fn fill_rect_q_rect_q_brush(
    &self,
    arg1: impl CastInto<Ref<QRect>>,
    arg2: impl CastInto<Ref<QBrush>>
)
[src]

This is an overloaded function.

Calls C++ function: void QPainter::fillRect(const QRect& arg1, const QBrush& arg2).

C++ documentation:

This is an overloaded function.

Fills the given rectangle with the specified brush.

pub unsafe fn fill_rect_q_rect_f_q_color(
    &self,
    arg1: impl CastInto<Ref<QRectF>>,
    color: impl CastInto<Ref<QColor>>
)
[src]

This is an overloaded function.

Calls C++ function: void QPainter::fillRect(const QRectF& arg1, const QColor& color).

C++ documentation:

This is an overloaded function.

Fills the given rectangle with the color specified.

This function was introduced in Qt 4.5.

pub unsafe fn fill_rect_4_int_q_color(
    &self,
    x: i32,
    y: i32,
    w: i32,
    h: i32,
    color: impl CastInto<Ref<QColor>>
)
[src]

This is an overloaded function.

Calls C++ function: void QPainter::fillRect(int x, int y, int w, int h, const QColor& color).

C++ documentation:

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.

pub unsafe fn fill_rect_q_rect_q_color(
    &self,
    arg1: impl CastInto<Ref<QRect>>,
    color: impl CastInto<Ref<QColor>>
)
[src]

This is an overloaded function.

Calls C++ function: void QPainter::fillRect(const QRect& arg1, const QColor& color).

C++ documentation:

This is an overloaded function.

Fills the given rectangle with the color specified.

This function was introduced in Qt 4.5.

pub unsafe fn fill_rect_4_int_global_color(
    &self,
    x: i32,
    y: i32,
    w: i32,
    h: i32,
    c: GlobalColor
)
[src]

This is an overloaded function.

Calls C++ function: void QPainter::fillRect(int x, int y, int w, int h, Qt::GlobalColor c).

C++ documentation:

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.

pub unsafe fn fill_rect_q_rect_global_color(
    &self,
    r: impl CastInto<Ref<QRect>>,
    c: GlobalColor
)
[src]

This is an overloaded function.

Calls C++ function: void QPainter::fillRect(const QRect& r, Qt::GlobalColor c).

C++ documentation:

This is an overloaded function.

Fills the given rectangle with the specified color.

This function was introduced in Qt 4.5.

pub unsafe fn fill_rect_q_rect_f_global_color(
    &self,
    r: impl CastInto<Ref<QRectF>>,
    c: GlobalColor
)
[src]

This is an overloaded function.

Calls C++ function: void QPainter::fillRect(const QRectF& r, Qt::GlobalColor c).

C++ documentation:

This is an overloaded function.

Fills the given rectangle with the specified color.

This function was introduced in Qt 4.5.

pub unsafe fn fill_rect_4_int_brush_style(
    &self,
    x: i32,
    y: i32,
    w: i32,
    h: i32,
    style: BrushStyle
)
[src]

This is an overloaded function.

Calls C++ function: void QPainter::fillRect(int x, int y, int w, int h, Qt::BrushStyle style).

C++ documentation:

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.

pub unsafe fn fill_rect_q_rect_brush_style(
    &self,
    r: impl CastInto<Ref<QRect>>,
    style: BrushStyle
)
[src]

This is an overloaded function.

Calls C++ function: void QPainter::fillRect(const QRect& r, Qt::BrushStyle style).

C++ documentation:

This is an overloaded function.

Fills the given rectangle with the brush style specified.

This function was introduced in Qt 4.5.

pub unsafe fn fill_rect_q_rect_f_brush_style(
    &self,
    r: impl CastInto<Ref<QRectF>>,
    style: BrushStyle
)
[src]

This is an overloaded function.

Calls C++ function: void QPainter::fillRect(const QRectF& r, Qt::BrushStyle style).

C++ documentation:

This is an overloaded function.

Fills the given rectangle with the brush style specified.

This function was introduced in Qt 4.5.

pub unsafe fn fill_rect_4_int_preset(
    &self,
    x: i32,
    y: i32,
    w: i32,
    h: i32,
    preset: Preset
)
[src]

This is supported on cpp_lib_version="5.12.2" or cpp_lib_version="5.13.0" or cpp_lib_version="5.14.0" only.

This is an overloaded function.

Calls C++ function: void QPainter::fillRect(int x, int y, int w, int h, QGradient::Preset preset).

C++ documentation:

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.

pub unsafe fn fill_rect_q_rect_preset(
    &self,
    r: impl CastInto<Ref<QRect>>,
    preset: Preset
)
[src]

This is supported on cpp_lib_version="5.12.2" or cpp_lib_version="5.13.0" or cpp_lib_version="5.14.0" only.

This is an overloaded function.

Calls C++ function: void QPainter::fillRect(const QRect& r, QGradient::Preset preset).

C++ documentation:

This is an overloaded function.

Fills the given rectangle with the specified gradient preset.

This function was introduced in Qt 5.12.

pub unsafe fn fill_rect_q_rect_f_preset(
    &self,
    r: impl CastInto<Ref<QRectF>>,
    preset: Preset
)
[src]

This is supported on cpp_lib_version="5.12.2" or cpp_lib_version="5.13.0" or cpp_lib_version="5.14.0" only.

This is an overloaded function.

Calls C++ function: void QPainter::fillRect(const QRectF& r, QGradient::Preset preset).

C++ documentation:

This is an overloaded function.

Fills the given rectangle with the specified gradient preset.

This function was introduced in Qt 5.12.

pub unsafe fn font(&self) -> Ref<QFont>[src]

Returns the currently set font used for drawing text.

Calls C++ function: const QFont& QPainter::font() const.

C++ documentation:

Returns the currently set font used for drawing text.

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

pub unsafe fn font_info(&self) -> CppBox<QFontInfo>[src]

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

Calls C++ function: QFontInfo QPainter::fontInfo() const.

C++ documentation:

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

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

pub unsafe fn font_metrics(&self) -> CppBox<QFontMetrics>[src]

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

Calls C++ function: QFontMetrics QPainter::fontMetrics() const.

C++ documentation:

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

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

pub unsafe fn has_clipping(&self) -> bool[src]

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

Calls C++ function: bool QPainter::hasClipping() const.

C++ documentation:

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

See also setClipping() and Clipping.

pub unsafe fn init_from(&self, device: impl CastInto<Ptr<QPaintDevice>>)[src]

Initializes the painters pen, background and font to the same as the given device.

Calls C++ function: void QPainter::initFrom(const QPaintDevice* device).

C++ documentation:

Initializes the painters pen, background and font to the same as the given device.

See also begin() and Settings.

pub unsafe fn is_active(&self) -> bool[src]

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

Calls C++ function: bool QPainter::isActive() const.

C++ documentation:

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

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

pub unsafe fn layout_direction(&self) -> LayoutDirection[src]

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

Calls C++ function: Qt::LayoutDirection QPainter::layoutDirection() const.

C++ documentation:

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

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

pub unsafe fn matrix(&self) -> Ref<QMatrix>[src]

Use worldTransform() instead.

Calls C++ function: const QMatrix& QPainter::matrix() const.

C++ documentation:

Use worldTransform() instead.

See also setMatrix() and worldTransform().

pub unsafe fn matrix_enabled(&self) -> bool[src]

Use worldMatrixEnabled() instead

Calls C++ function: bool QPainter::matrixEnabled() const.

C++ documentation:

Use worldMatrixEnabled() instead

See also setMatrixEnabled() and worldMatrixEnabled().

pub unsafe fn opacity(&self) -> f64[src]

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

Calls C++ function: double QPainter::opacity() const.

C++ documentation:

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

This function was introduced in Qt 4.2.

See also setOpacity().

pub unsafe fn paint_engine(&self) -> Ptr<QPaintEngine>[src]

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

Calls C++ function: QPaintEngine* QPainter::paintEngine() const.

C++ documentation:

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

See also isActive().

pub unsafe fn pen(&self) -> Ref<QPen>[src]

Returns the painter's current pen.

Calls C++ function: const QPen& QPainter::pen() const.

C++ documentation:

Returns the painter's current pen.

See also setPen() and Settings.

pub unsafe fn render_hints(&self) -> QFlags<RenderHint>[src]

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

Calls C++ function: QFlags<QPainter::RenderHint> QPainter::renderHints() const.

C++ documentation:

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

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

pub unsafe fn reset_matrix(&self)[src]

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

Calls C++ function: void QPainter::resetMatrix().

C++ documentation:

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.

See also Coordinate Transformations.

pub unsafe fn reset_transform(&self)[src]

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

Calls C++ function: void QPainter::resetTransform().

C++ documentation:

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

See also Coordinate Transformations.

pub unsafe fn restore(&self)[src]

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

Calls C++ function: void QPainter::restore().

C++ documentation:

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

See also save().

pub unsafe fn rotate(&self, a: f64)[src]

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

Calls C++ function: void QPainter::rotate(double a).

C++ documentation:

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

See also setWorldTransform() and Coordinate Transformations.

pub unsafe fn save(&self)[src]

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.

Calls C++ function: void QPainter::save().

C++ documentation:

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

pub unsafe fn scale(&self, sx: f64, sy: f64)[src]

Scales the coordinate system by (sx, sy).

Calls C++ function: void QPainter::scale(double sx, double sy).

C++ documentation:

Scales the coordinate system by (sx, sy).

See also setWorldTransform() and Coordinate Transformations.

pub unsafe fn set_background(&self, bg: impl CastInto<Ref<QBrush>>)[src]

Sets the background brush of the painter to the given brush.

Calls C++ function: void QPainter::setBackground(const QBrush& bg).

C++ documentation:

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.

pub unsafe fn set_background_mode(&self, mode: BGMode)[src]

Sets the background mode of the painter to the given mode

Calls C++ function: void QPainter::setBackgroundMode(Qt::BGMode mode).

C++ documentation:

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.

pub unsafe fn set_brush_q_brush(&self, brush: impl CastInto<Ref<QBrush>>)[src]

Sets the painter's brush to the given brush.

Calls C++ function: void QPainter::setBrush(const QBrush& brush).

C++ documentation:

Sets the painter's brush to the given brush.

The painter's brush defines how shapes are filled.

See also brush() and Settings.

pub unsafe fn set_brush_brush_style(&self, style: BrushStyle)[src]

This is an overloaded function.

Calls C++ function: void QPainter::setBrush(Qt::BrushStyle style).

C++ documentation:

This is an overloaded function.

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

pub unsafe fn set_brush_origin_2_int(&self, x: i32, y: i32)[src]

This is an overloaded function.

Calls C++ function: void QPainter::setBrushOrigin(int x, int y).

C++ documentation:

This is an overloaded function.

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

pub unsafe fn set_brush_origin_q_point(&self, arg1: impl CastInto<Ref<QPoint>>)[src]

This is an overloaded function.

Calls C++ function: void QPainter::setBrushOrigin(const QPoint& arg1).

C++ documentation:

This is an overloaded function.

Sets the brush's origin to the given position.

pub unsafe fn set_brush_origin_q_point_f(
    &self,
    arg1: impl CastInto<Ref<QPointF>>
)
[src]

Sets the brush origin to position.

Calls C++ function: void QPainter::setBrushOrigin(const QPointF& arg1).

C++ documentation:

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.

pub unsafe fn set_clip_path_2a(
    &self,
    path: impl CastInto<Ref<QPainterPath>>,
    op: ClipOperation
)
[src]

Enables clipping, and sets the clip path for the painter to the given path, with the clip operation.

Calls C++ function: void QPainter::setClipPath(const QPainterPath& path, Qt::ClipOperation op = …).

C++ documentation:

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.

pub unsafe fn set_clip_path_1a(&self, path: impl CastInto<Ref<QPainterPath>>)[src]

Enables clipping, and sets the clip path for the painter to the given path, with the clip operation.

Calls C++ function: void QPainter::setClipPath(const QPainterPath& path).

C++ documentation:

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.

pub unsafe fn set_clip_rect_q_rect_f_clip_operation(
    &self,
    arg1: impl CastInto<Ref<QRectF>>,
    op: ClipOperation
)
[src]

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.

Calls C++ function: void QPainter::setClipRect(const QRectF& arg1, Qt::ClipOperation op = …).

C++ documentation:

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.

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

pub unsafe fn set_clip_rect_q_rect_clip_operation(
    &self,
    arg1: impl CastInto<Ref<QRect>>,
    op: ClipOperation
)
[src]

This is an overloaded function.

Calls C++ function: void QPainter::setClipRect(const QRect& arg1, Qt::ClipOperation op = …).

C++ documentation:

This is an overloaded function.

Enables clipping, and sets the clip region to the given rectangle using the given clip operation.

pub unsafe fn set_clip_rect_4_int_clip_operation(
    &self,
    x: i32,
    y: i32,
    w: i32,
    h: i32,
    op: ClipOperation
)
[src]

Enables clipping, and sets the clip region to the rectangle beginning at (x, y) with the given width and height.

Calls C++ function: void QPainter::setClipRect(int x, int y, int w, int h, Qt::ClipOperation op = …).

C++ documentation:

Enables clipping, and sets the clip region to the rectangle beginning at (x, y) with the given width and height.

pub unsafe fn set_clip_rect_q_rect_f(&self, arg1: impl CastInto<Ref<QRectF>>)[src]

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.

Calls C++ function: void QPainter::setClipRect(const QRectF& arg1).

C++ documentation:

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.

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

pub unsafe fn set_clip_rect_q_rect(&self, arg1: impl CastInto<Ref<QRect>>)[src]

This is an overloaded function.

Calls C++ function: void QPainter::setClipRect(const QRect& arg1).

C++ documentation:

This is an overloaded function.

Enables clipping, and sets the clip region to the given rectangle using the given clip operation.

pub unsafe fn set_clip_rect_4_int(&self, x: i32, y: i32, w: i32, h: i32)[src]

Enables clipping, and sets the clip region to the rectangle beginning at (x, y) with the given width and height.

Calls C++ function: void QPainter::setClipRect(int x, int y, int w, int h).

C++ documentation:

Enables clipping, and sets the clip region to the rectangle beginning at (x, y) with the given width and height.

pub unsafe fn set_clip_region_2a(
    &self,
    arg1: impl CastInto<Ref<QRegion>>,
    op: ClipOperation
)
[src]

Sets the clip region to the given region using the specified clip operation. The default clip operation is to replace the current clip region.

Calls C++ function: void QPainter::setClipRegion(const QRegion& arg1, Qt::ClipOperation op = …).

C++ documentation:

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.

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

pub unsafe fn set_clip_region_1a(&self, arg1: impl CastInto<Ref<QRegion>>)[src]

Sets the clip region to the given region using the specified clip operation. The default clip operation is to replace the current clip region.

Calls C++ function: void QPainter::setClipRegion(const QRegion& arg1).

C++ documentation:

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.

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

pub unsafe fn set_clipping(&self, enable: bool)[src]

Enables clipping if enable is true, or disables clipping if enable is false.

Calls C++ function: void QPainter::setClipping(bool enable).

C++ documentation:

Enables clipping if enable is true, or disables clipping if enable is false.

See also hasClipping() and Clipping.

pub unsafe fn set_composition_mode(&self, mode: CompositionMode)[src]

Sets the composition mode to the given mode.

Calls C++ function: void QPainter::setCompositionMode(QPainter::CompositionMode mode).

C++ documentation:

Sets the composition mode to the given mode.

Warning: Only a QPainter operating on a QImage fully supports all composition modes. The RasterOp modes are supported for X11 as described in compositionMode().

See also compositionMode().

pub unsafe fn set_font(&self, f: impl CastInto<Ref<QFont>>)[src]

Sets the painter's font to the given font.

Calls C++ function: void QPainter::setFont(const QFont& f).

C++ documentation:

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

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

pub unsafe fn set_layout_direction(&self, direction: LayoutDirection)[src]

Sets the layout direction used by the painter when drawing text, to the specified direction.

Calls C++ function: void QPainter::setLayoutDirection(Qt::LayoutDirection direction).

C++ documentation:

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.

See also QTextOption::setTextDirection(), layoutDirection(), drawText(), and Settings.

pub unsafe fn set_matrix_2a(
    &self,
    matrix: impl CastInto<Ref<QMatrix>>,
    combine: bool
)
[src]

Use setWorldTransform() instead.

Calls C++ function: void QPainter::setMatrix(const QMatrix& matrix, bool combine = …).

C++ documentation:

Use setWorldTransform() instead.

See also matrix() and setWorldTransform().

pub unsafe fn set_matrix_1a(&self, matrix: impl CastInto<Ref<QMatrix>>)[src]

Use setWorldTransform() instead.

Calls C++ function: void QPainter::setMatrix(const QMatrix& matrix).

C++ documentation:

Use setWorldTransform() instead.

See also matrix() and setWorldTransform().

pub unsafe fn set_matrix_enabled(&self, enabled: bool)[src]

Use setWorldMatrixEnabled() instead.

Calls C++ function: void QPainter::setMatrixEnabled(bool enabled).

C++ documentation:

Use setWorldMatrixEnabled() instead.

See also matrixEnabled() and setWorldMatrixEnabled().

pub unsafe fn set_opacity(&self, opacity: f64)[src]

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.

Calls C++ function: void QPainter::setOpacity(double opacity).

C++ documentation:

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.

This function was introduced in Qt 4.2.

See also opacity().

pub unsafe fn set_pen_q_color(&self, color: impl CastInto<Ref<QColor>>)[src]

This is an overloaded function.

Calls C++ function: void QPainter::setPen(const QColor& color).

C++ documentation:

This is an overloaded function.

Sets the painter's pen to have style Qt::SolidLine, width 1 and the specified color.

pub unsafe fn set_pen_q_pen(&self, pen: impl CastInto<Ref<QPen>>)[src]

Sets the painter's pen to be the given pen.

Calls C++ function: void QPainter::setPen(const QPen& pen).

C++ documentation:

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.

See also pen() and Settings.

pub unsafe fn set_pen_pen_style(&self, style: PenStyle)[src]

This is an overloaded function.

Calls C++ function: void QPainter::setPen(Qt::PenStyle style).

C++ documentation:

This is an overloaded function.

Sets the painter's pen to have the given style, width 1 and black color.

pub unsafe fn set_render_hint_2a(&self, hint: RenderHint, on: bool)[src]

Sets the given render hint on the painter if on is true; otherwise clears the render hint.

Calls C++ function: void QPainter::setRenderHint(QPainter::RenderHint hint, bool on = …).

C++ documentation:

Sets the given render hint on the painter if on is true; otherwise clears the render hint.

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

pub unsafe fn set_render_hint_1a(&self, hint: RenderHint)[src]

Sets the given render hint on the painter if on is true; otherwise clears the render hint.

Calls C++ function: void QPainter::setRenderHint(QPainter::RenderHint hint).

C++ documentation:

Sets the given render hint on the painter if on is true; otherwise clears the render hint.

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

pub unsafe fn set_render_hints_2a(&self, hints: QFlags<RenderHint>, on: bool)[src]

Sets the given render hints on the painter if on is true; otherwise clears the render hints.

Calls C++ function: void QPainter::setRenderHints(QFlags<QPainter::RenderHint> hints, bool on = …).

C++ documentation:

Sets the given render hints on the painter if on is true; otherwise clears the render hints.

This function was introduced in Qt 4.2.

See also setRenderHint(), renderHints(), and Rendering Quality.

pub unsafe fn set_render_hints_1a(&self, hints: QFlags<RenderHint>)[src]

Sets the given render hints on the painter if on is true; otherwise clears the render hints.

Calls C++ function: void QPainter::setRenderHints(QFlags<QPainter::RenderHint> hints).

C++ documentation:

Sets the given render hints on the painter if on is true; otherwise clears the render hints.

This function was introduced in Qt 4.2.

See also setRenderHint(), renderHints(), and Rendering Quality.

pub unsafe fn set_transform_2a(
    &self,
    transform: impl CastInto<Ref<QTransform>>,
    combine: bool
)
[src]

Sets the world transformation matrix. If combine is true, the specified transform is combined with the current matrix; otherwise it replaces the current matrix.

Calls C++ function: void QPainter::setTransform(const QTransform& transform, bool combine = …).

C++ documentation:

Sets the world transformation matrix. If combine is true, the specified transform is combined with the current matrix; otherwise it replaces the current matrix.

This function was introduced in Qt 4.3.

See also transform() and setWorldTransform().

pub unsafe fn set_transform_1a(&self, transform: impl CastInto<Ref<QTransform>>)[src]

Sets the world transformation matrix. If combine is true, the specified transform is combined with the current matrix; otherwise it replaces the current matrix.

Calls C++ function: void QPainter::setTransform(const QTransform& transform).

C++ documentation:

Sets the world transformation matrix. If combine is true, the specified transform is combined with the current matrix; otherwise it replaces the current matrix.

This function was introduced in Qt 4.3.

See also transform() and setWorldTransform().

pub unsafe fn set_view_transform_enabled(&self, enable: bool)[src]

Enables view transformations if enable is true, or disables view transformations if enable is false.

Calls C++ function: void QPainter::setViewTransformEnabled(bool enable).

C++ documentation:

Enables view transformations if enable is true, or disables view transformations if enable is false.

See also viewTransformEnabled() and Window-Viewport Conversion.

pub unsafe fn set_viewport_1a(&self, viewport: impl CastInto<Ref<QRect>>)[src]

Sets the painter's viewport rectangle to the given rectangle, and enables view transformations.

Calls C++ function: void QPainter::setViewport(const QRect& viewport).

C++ documentation:

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.

See also viewport(), viewTransformEnabled(), and Window-Viewport Conversion.

pub unsafe fn set_viewport_4a(&self, x: i32, y: i32, w: i32, h: i32)[src]

This is an overloaded function.

Calls C++ function: void QPainter::setViewport(int x, int y, int w, int h).

C++ documentation:

This is an overloaded function.

Sets the painter's viewport rectangle to be the rectangle beginning at (x, y) with the given width and height.

pub unsafe fn set_window_1a(&self, window: impl CastInto<Ref<QRect>>)[src]

Sets the painter's window to the given rectangle, and enables view transformations.

Calls C++ function: void QPainter::setWindow(const QRect& window).

C++ documentation:

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.

See also window(), viewTransformEnabled(), and Window-Viewport Conversion.

pub unsafe fn set_window_4a(&self, x: i32, y: i32, w: i32, h: i32)[src]

This is an overloaded function.

Calls C++ function: void QPainter::setWindow(int x, int y, int w, int h).

C++ documentation:

This is an overloaded function.

Sets the painter's window to the rectangle beginning at (x, y) and the given width and height.

pub unsafe fn set_world_matrix_2a(
    &self,
    matrix: impl CastInto<Ref<QMatrix>>,
    combine: bool
)
[src]

Sets the transformation matrix to matrix and enables transformations.

Calls C++ function: void QPainter::setWorldMatrix(const QMatrix& matrix, bool combine = …).

C++ documentation:

Sets the transformation matrix to matrix and enables transformations.

Note: It is advisable to use setWorldTransform() instead of this function to preserve the properties of perspective 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:

void QPainter::rotate(qreal angle) { QMatrix matrix; matrix.rotate(angle); setWorldMatrix(matrix, true); }

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.

This function was introduced in Qt 4.2.

See also worldMatrix(), setWorldTransform(), and QTransform.

pub unsafe fn set_world_matrix_1a(&self, matrix: impl CastInto<Ref<QMatrix>>)[src]

Sets the transformation matrix to matrix and enables transformations.

Calls C++ function: void QPainter::setWorldMatrix(const QMatrix& matrix).

C++ documentation:

Sets the transformation matrix to matrix and enables transformations.

Note: It is advisable to use setWorldTransform() instead of this function to preserve the properties of perspective 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:

void QPainter::rotate(qreal angle) { QMatrix matrix; matrix.rotate(angle); setWorldMatrix(matrix, true); }

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.

This function was introduced in Qt 4.2.

See also worldMatrix(), setWorldTransform(), and QTransform.

pub unsafe fn set_world_matrix_enabled(&self, enabled: bool)[src]

Enables transformations if enable is true, or disables transformations if enable is false. The world transformation matrix is not changed.

Calls C++ function: void QPainter::setWorldMatrixEnabled(bool enabled).

C++ documentation:

Enables transformations if enable is true, or disables transformations if enable is false. The world transformation matrix is not changed.

This function was introduced in Qt 4.2.

See also worldMatrixEnabled(), worldTransform(), and Coordinate Transformations.

pub unsafe fn set_world_transform_2a(
    &self,
    matrix: impl CastInto<Ref<QTransform>>,
    combine: bool
)
[src]

Sets the world transformation matrix. If combine is true, the specified matrix is combined with the current matrix; otherwise it replaces the current matrix.

Calls C++ function: void QPainter::setWorldTransform(const QTransform& matrix, bool combine = …).

C++ documentation:

Sets the world transformation matrix. If combine is true, the specified matrix is combined with the current matrix; otherwise it replaces the current matrix.

See also worldTransform(), transform(), and setTransform().

pub unsafe fn set_world_transform_1a(
    &self,
    matrix: impl CastInto<Ref<QTransform>>
)
[src]

Sets the world transformation matrix. If combine is true, the specified matrix is combined with the current matrix; otherwise it replaces the current matrix.

Calls C++ function: void QPainter::setWorldTransform(const QTransform& matrix).

C++ documentation:

Sets the world transformation matrix. If combine is true, the specified matrix is combined with the current matrix; otherwise it replaces the current matrix.

See also worldTransform(), transform(), and setTransform().

pub unsafe fn shear(&self, sh: f64, sv: f64)[src]

Shears the coordinate system by (sh, sv).

Calls C++ function: void QPainter::shear(double sh, double sv).

C++ documentation:

Shears the coordinate system by (sh, sv).

See also setWorldTransform() and Coordinate Transformations.

pub unsafe fn stroke_path(
    &self,
    path: impl CastInto<Ref<QPainterPath>>,
    pen: impl CastInto<Ref<QPen>>
)
[src]

Draws the outline (strokes) the path path with the pen specified by pen

Calls C++ function: void QPainter::strokePath(const QPainterPath& path, const QPen& pen).

C++ documentation:

Draws the outline (strokes) the path path with the pen specified by pen

See also fillPath() and Drawing.

pub unsafe fn test_render_hint(&self, hint: RenderHint) -> bool[src]

Returns true if hint is set; otherwise returns false.

Calls C++ function: bool QPainter::testRenderHint(QPainter::RenderHint hint) const.

C++ documentation:

Returns true if hint is set; otherwise returns false.

This function was introduced in Qt 4.3.

See also renderHints() and setRenderHint().

pub unsafe fn transform(&self) -> Ref<QTransform>[src]

Returns the world transformation matrix.

Calls C++ function: const QTransform& QPainter::transform() const.

C++ documentation:

Returns the world transformation matrix.

See also setTransform() and worldTransform().

pub unsafe fn translate_q_point_f(&self, offset: impl CastInto<Ref<QPointF>>)[src]

Translates the coordinate system by the given offset; i.e. the given offset is added to points.

Calls C++ function: void QPainter::translate(const QPointF& offset).

C++ documentation:

Translates the coordinate system by the given offset; i.e. the given offset is added to points.

See also setWorldTransform() and Coordinate Transformations.

pub unsafe fn translate_q_point(&self, offset: impl CastInto<Ref<QPoint>>)[src]

This is an overloaded function.

Calls C++ function: void QPainter::translate(const QPoint& offset).

C++ documentation:

This is an overloaded function.

Translates the coordinate system by the given offset.

pub unsafe fn translate_2_double(&self, dx: f64, dy: f64)[src]

This is an overloaded function.

Calls C++ function: void QPainter::translate(double dx, double dy).

C++ documentation:

This is an overloaded function.

Translates the coordinate system by the vector (dx, dy).

pub unsafe fn view_transform_enabled(&self) -> bool[src]

Returns true if view transformation is enabled; otherwise returns false.

Calls C++ function: bool QPainter::viewTransformEnabled() const.

C++ documentation:

Returns true if view transformation is enabled; otherwise returns false.

See also setViewTransformEnabled() and worldTransform().

pub unsafe fn viewport(&self) -> CppBox<QRect>[src]

Returns the viewport rectangle.

Calls C++ function: QRect QPainter::viewport() const.

C++ documentation:

Returns the viewport rectangle.

See also setViewport() and setViewTransformEnabled().

pub unsafe fn window(&self) -> CppBox<QRect>[src]

Returns the window rectangle.

Calls C++ function: QRect QPainter::window() const.

C++ documentation:

Returns the window rectangle.

See also setWindow() and setViewTransformEnabled().

pub unsafe fn world_matrix(&self) -> Ref<QMatrix>[src]

Returns the world transformation matrix.

Calls C++ function: const QMatrix& QPainter::worldMatrix() const.

C++ documentation:

Returns the world transformation matrix.

It is advisable to use worldTransform() because worldMatrix() does not preserve the properties of perspective transformations.

This function was introduced in Qt 4.2.

See also setWorldMatrix(), Coordinate Transformations, and Coordinate System.

pub unsafe fn world_matrix_enabled(&self) -> bool[src]

Returns true if world transformation is enabled; otherwise returns false.

Calls C++ function: bool QPainter::worldMatrixEnabled() const.

C++ documentation:

Returns true if world transformation is enabled; otherwise returns false.

This function was introduced in Qt 4.2.

See also setWorldMatrixEnabled(), worldTransform(), and Coordinate System.

pub unsafe fn world_transform(&self) -> Ref<QTransform>[src]

Returns the world transformation matrix.

Calls C++ function: const QTransform& QPainter::worldTransform() const.

C++ documentation:

Returns the world transformation matrix.

See also setWorldTransform().

Trait Implementations

impl CppDeletable for QStylePainter[src]

unsafe fn delete(&self)[src]

The QStylePainter class is a convenience class for drawing QStyle elements inside a widget.

Calls C++ function: [destructor] void QStylePainter::~QStylePainter().

C++ documentation:

The QStylePainter class is a convenience class for drawing QStyle elements inside a widget.

QStylePainter extends QPainter with a set of high-level draw...() functions implemented on top of QStyle's API. The advantage of using QStylePainter is that the parameter lists get considerably shorter. Whereas a QStyle object must be able to draw on any widget using any painter (because the application normally has one QStyle object shared by all widget), a QStylePainter is initialized with a widget, eliminating the need to specify the QWidget, the QPainter, and the QStyle for every function call.

Example using QStyle directly:

void MyWidget::paintEvent(QPaintEvent / event */) { QPainter painter(this);

QStyleOptionFocusRect option; option.initFrom(this); option.backgroundColor = palette().color(QPalette::Background);

style()->drawPrimitive(QStyle::PE_FrameFocusRect, &option, &painter, this); }

Example using QStylePainter:

void MyWidget::paintEvent(QPaintEvent / event */) { QStylePainter painter(this);

QStyleOptionFocusRect option; option.initFrom(this); option.backgroundColor = palette().color(QPalette::Background);

painter.drawPrimitive(QStyle::PE_FrameFocusRect, option); }

impl Deref for QStylePainter[src]

type Target = QPainter

The resulting type after dereferencing.

fn deref(&self) -> &QPainter[src]

Calls C++ function: QPainter* static_cast<QPainter*>(QStylePainter* ptr).

impl StaticDowncast<QStylePainter> for QPainter[src]

unsafe fn static_downcast(ptr: Ptr<QPainter>) -> Ptr<QStylePainter>[src]

Calls C++ function: QStylePainter* static_cast<QStylePainter*>(QPainter* ptr).

impl StaticUpcast<QPainter> for QStylePainter[src]

unsafe fn static_upcast(ptr: Ptr<QStylePainter>) -> Ptr<QPainter>[src]

Calls C++ function: QPainter* static_cast<QPainter*>(QStylePainter* ptr).

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T, U> CastInto<U> for T where
    U: CastFrom<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> StaticUpcast<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.