[][src]Struct qt_gui::QPaintEngine

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

The QPaintEngine class provides an abstract definition of how QPainter draws to a given device on a given platform.

C++ class: QPaintEngine.

C++ documentation:

The QPaintEngine class provides an abstract definition of how QPainter draws to a given device on a given platform.

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.

Methods

impl QPaintEngine[src]

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

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.

Calls C++ function: pure virtual bool QPaintEngine::begin(QPaintDevice* pdev).

C++ documentation:

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

pub unsafe fn clear_dirty(&mut self, df: QFlags<DirtyFlag>)[src]

Calls C++ function: void QPaintEngine::clearDirty(QFlags<QPaintEngine::DirtyFlag> df).

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

Calls C++ function: virtual QPoint QPaintEngine::coordinateOffset() const.

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

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

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

C++ documentation:

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

The default implementation calls drawPolygon().

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

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

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

C++ documentation:

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

pub unsafe fn draw_image_4a(
    &mut self,
    r: impl CastInto<Ref<QRectF>>,
    pm: impl CastInto<Ref<QImage>>,
    sr: impl CastInto<Ref<QRectF>>,
    flags: QFlags<ImageConversionFlag>
)
[src]

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.

Calls C++ function: virtual void QPaintEngine::drawImage(const QRectF& r, const QImage& pm, const QRectF& sr, QFlags<Qt::ImageConversionFlag> flags = …).

C++ documentation:

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.

pub unsafe fn draw_image_3a(
    &mut self,
    r: impl CastInto<Ref<QRectF>>,
    pm: impl CastInto<Ref<QImage>>,
    sr: impl CastInto<Ref<QRectF>>
)
[src]

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.

Calls C++ function: virtual void QPaintEngine::drawImage(const QRectF& r, const QImage& pm, const QRectF& sr).

C++ documentation:

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.

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

This is an overloaded function.

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

C++ documentation:

This is an overloaded function.

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

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

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.

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

C++ documentation:

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.

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

The default implementation ignores the path and does nothing.

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

C++ documentation:

The default implementation ignores the path and does nothing.

pub unsafe fn draw_pixmap(
    &mut self,
    r: impl CastInto<Ref<QRectF>>,
    pm: impl CastInto<Ref<QPixmap>>,
    sr: impl CastInto<Ref<QRectF>>
)
[src]

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

Calls C++ function: pure virtual void QPaintEngine::drawPixmap(const QRectF& r, const QPixmap& pm, const QRectF& sr).

C++ documentation:

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

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

Draws the first pointCount points in the buffer points

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

C++ documentation:

Draws the first pointCount points in the buffer points

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

Draws the first pointCount points in the buffer points

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

C++ documentation:

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.

pub unsafe fn draw_polygon_q_point_f_int_polygon_draw_mode(
    &mut self,
    points: impl CastInto<Ptr<QPointF>>,
    point_count: c_int,
    mode: PolygonDrawMode
)
[src]

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

Calls C++ function: virtual void QPaintEngine::drawPolygon(const QPointF* points, int pointCount, QPaintEngine::PolygonDrawMode mode).

C++ documentation:

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.

pub unsafe fn draw_polygon_q_point_int_polygon_draw_mode(
    &mut self,
    points: impl CastInto<Ptr<QPoint>>,
    point_count: c_int,
    mode: PolygonDrawMode
)
[src]

This is an overloaded function.

Calls C++ function: virtual void QPaintEngine::drawPolygon(const QPoint* points, int pointCount, QPaintEngine::PolygonDrawMode mode).

C++ documentation:

This is an overloaded function.

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.

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

This is an overloaded function.

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

C++ documentation:

This is an overloaded function.

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

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

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.

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

C++ documentation:

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.

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

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.

Calls C++ function: virtual void QPaintEngine::drawTextItem(const QPointF& p, const QTextItem& textItem).

C++ documentation:

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.

pub unsafe fn draw_tiled_pixmap(
    &mut self,
    r: impl CastInto<Ref<QRectF>>,
    pixmap: impl CastInto<Ref<QPixmap>>,
    s: impl CastInto<Ref<QPointF>>
)
[src]

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.

Calls C++ function: virtual void QPaintEngine::drawTiledPixmap(const QRectF& r, const QPixmap& pixmap, const QPointF& s).

C++ documentation:

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.

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

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

Calls C++ function: pure virtual bool QPaintEngine::end().

C++ documentation:

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

See also begin() and isActive().

pub unsafe fn fix_neg_rect(
    &mut self,
    x: impl CastInto<MutPtr<c_int>>,
    y: impl CastInto<MutPtr<c_int>>,
    w: impl CastInto<MutPtr<c_int>>,
    h: impl CastInto<MutPtr<c_int>>
)
[src]

Calls C++ function: void QPaintEngine::fix_neg_rect(int* x, int* y, int* w, int* h).

pub unsafe fn has_feature(&self, feature: QFlags<PaintEngineFeature>) -> bool[src]

Returns true if the paint engine supports the specified feature; otherwise returns false.

Calls C++ function: bool QPaintEngine::hasFeature(QFlags<QPaintEngine::PaintEngineFeature> feature) const.

C++ documentation:

Returns true if the paint engine supports the specified feature; otherwise returns false.

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

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

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

C++ documentation:

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

See also setActive().

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

Calls C++ function: bool QPaintEngine::isExtended() const.

pub unsafe fn paint_device(&self) -> MutPtr<QPaintDevice>[src]

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

Calls C++ function: QPaintDevice* QPaintEngine::paintDevice() const.

C++ documentation:

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

pub unsafe fn painter(&self) -> MutPtr<QPainter>[src]

Returns the paint engine's painter.

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

C++ documentation:

Returns the paint engine's painter.

pub unsafe fn set_active(&mut self, new_state: bool)[src]

Sets the active state of the paint engine to state.

Calls C++ function: void QPaintEngine::setActive(bool newState).

C++ documentation:

Sets the active state of the paint engine to state.

See also isActive().

pub unsafe fn set_dirty(&mut self, df: QFlags<DirtyFlag>)[src]

Calls C++ function: void QPaintEngine::setDirty(QFlags<QPaintEngine::DirtyFlag> df).

pub unsafe fn set_paint_device(
    &mut self,
    device: impl CastInto<MutPtr<QPaintDevice>>
)
[src]

Calls C++ function: void QPaintEngine::setPaintDevice(QPaintDevice* device).

pub unsafe fn set_system_clip(&mut self, base_clip: impl CastInto<Ref<QRegion>>)[src]

Calls C++ function: void QPaintEngine::setSystemClip(const QRegion& baseClip).

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

Calls C++ function: void QPaintEngine::setSystemRect(const QRect& rect).

pub unsafe fn sync_state(&mut self)[src]

Calls C++ function: void QPaintEngine::syncState().

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

Calls C++ function: QRegion QPaintEngine::systemClip() const.

pub unsafe fn system_rect(&self) -> CppBox<QRect>[src]

Calls C++ function: QRect QPaintEngine::systemRect() const.

pub unsafe fn test_dirty(&mut self, df: QFlags<DirtyFlag>) -> bool[src]

Calls C++ function: bool QPaintEngine::testDirty(QFlags<QPaintEngine::DirtyFlag> df).

pub unsafe fn type_(&self) -> Type[src]

Reimplement this function to return the paint engine Type.

Calls C++ function: pure virtual QPaintEngine::Type QPaintEngine::type() const.

C++ documentation:

Reimplement this function to return the paint engine Type.

pub unsafe fn update_state(
    &mut self,
    state: impl CastInto<Ref<QPaintEngineState>>
)
[src]

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

Calls C++ function: pure virtual void QPaintEngine::updateState(const QPaintEngineState& state).

C++ documentation:

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

Trait Implementations

impl CppDeletable for QPaintEngine[src]

unsafe fn delete(&mut self)[src]

Destroys the paint engine.

Calls C++ function: virtual [destructor] void QPaintEngine::~QPaintEngine().

C++ documentation:

Destroys the paint engine.

impl EndMut for QPaintEngine[src]

type Output = bool

Output type.

unsafe fn end_mut(&mut self) -> bool[src]

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

Calls C++ function: pure virtual bool QPaintEngine::end().

C++ documentation:

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

See also begin() and isActive().

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.