pub struct PaintEngine<'a> { /* private fields */ }
Expand description

Notice these docs are heavy WIP and not very relevent yet

Qt provides several premade implementations of QPaintEngine for the different painter backends we support. The primary paint engine provided is the raster paint engine, which contains a software rasterizer which supports the full feature set on all supported platforms. This is the default for painting on QWidget-based classes in e.g. on Windows, X11 and MacOS , it is the backend for painting on QImage and it is used as a fallback for paint engines that do not support a certain capability. In addition we provide QPaintEngine implementations for OpenGL (accessible through QGLWidget) and printing (which allows using QPainter to draw on a QPrinter object).

If one wants to use QPainter to draw to a different backend, one must subclass QPaintEngine and reimplement all its virtual functions. The QPaintEngine implementation is then made available by subclassing QPaintDevice and reimplementing the virtual function QPaintDevice::paintEngine().

QPaintEngine is created and owned by the QPaintDevice that created it.

See also: Painter PaintDevice::paint_engine {Paint System}

Licence

The documentation is an adoption of the original Qt Documentation and provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation.

Implementations

Returns true if the paint engine is actively drawing; otherwise returns false.

See also: [set_active()]

Sets the active state of the paint engine to state.

See also: [is_active()]

Reimplement this function to initialise your paint engine when painting is to start on the paint device pdev. Return true if the initialization was successful; otherwise return false.

See also: [end()] [is_active()]

Reimplement this function to finish painting on the current paint device. Return true if painting was finished successfully; otherwise return false.

See also: [begin()] [is_active()]

Reimplement this function to update the state of a paint engine.

When implemented, this function is responsible for checking the paint engine’s current state and update the properties that are changed. Use the QPaintEngineState::state() function to find out which properties that must be updated, then use the corresponding get function to retrieve the current values for the given properties.

See also: PaintEngineState

Overloads The default implementation converts the first rectCount rectangles in the buffer rects to a QRectF and calls the floating point version of this function.

Draws the first rectCount rectangles in the buffer rects. The default implementation of this function calls drawPath() or drawPolygon() depending on the feature set of the paint engine.

Overloads The default implementation converts the first rectCount rectangles in the buffer rects to a QRectF and calls the floating point version of this function.

Draws the first rectCount rectangles in the buffer rects. The default implementation of this function calls drawPath() or drawPolygon() depending on the feature set of the paint engine.

The default implementation splits the list of lines in lines into lineCount separate calls to drawPath() or drawPolygon() depending on the feature set of the paint engine.

Overloads The default implementation converts the first lineCount lines in lines to a QLineF and calls the floating point version of this function.

The default implementation splits the list of lines in lines into lineCount separate calls to drawPath() or drawPolygon() depending on the feature set of the paint engine.

Overloads The default implementation converts the first lineCount lines in lines to a QLineF and calls the floating point version of this function.

Reimplement this function to draw the largest ellipse that can be contained within rectangle rect.

The default implementation calls drawPolygon().

The default implementation of this function calls the floating point version of this function

Reimplement this function to draw the largest ellipse that can be contained within rectangle rect.

The default implementation calls drawPolygon().

The default implementation of this function calls the floating point version of this function

The default implementation ignores the path and does nothing.

Draws the first pointCount points in the buffer points

Draws the first pointCount points in the buffer points

The default implementation converts the first pointCount QPoints in points to QPointFs and calls the floating point version of drawPoints.

Draws the first pointCount points in the buffer points

Draws the first pointCount points in the buffer points

The default implementation converts the first pointCount QPoints in points to QPointFs and calls the floating point version of drawPoints.

PolygonDrawMode mode)

Reimplement this virtual function to draw the polygon defined by the pointCount first points in points, using mode mode.

Note: At least one of the drawPolygon() functions must be reimplemented.

Overloads Reimplement this virtual function to draw the polygon defined by the pointCount first points in points, using mode mode.

Note: At least one of the drawPolygon() functions must be reimplemented.

PolygonDrawMode mode)

Reimplement this virtual function to draw the polygon defined by the pointCount first points in points, using mode mode.

Note: At least one of the drawPolygon() functions must be reimplemented.

Overloads Reimplement this virtual function to draw the polygon defined by the pointCount first points in points, using mode mode.

Note: At least one of the drawPolygon() functions must be reimplemented.

&pm, const QRectF &sr)

Reimplement this function to draw the part of the pm specified by the sr rectangle in the given r.

This function draws the text item textItem at position p. The default implementation of this function converts the text to a QPainterPath and paints the resulting path.

Reimplement this function to draw the pixmap in the given rect, starting at the given p. The pixmap will be drawn repeatedly until the rect is filled.

&image, const QRectF &sr, Qt::ImageConversionFlags flags)

Reimplement this function to draw the part of the image specified by the sr rectangle in the given rectangle using the given conversion flags flags, to convert it to a pixmap.

Returns the device that this engine is painting on, if painting is active; otherwise returns 0.

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.