[][src]Struct qt_gui::QPainterPath

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

The QPainterPath class provides a container for painting operations, enabling graphical shapes to be constructed and reused.

C++ class: QPainterPath.

C++ documentation:

The QPainterPath class provides a container for painting operations, enabling graphical shapes to be constructed and reused.

A painter path is an object composed of a number of graphical building blocks, such as rectangles, ellipses, lines, and curves. Building blocks can be joined in closed subpaths, for example as a rectangle or an ellipse. A closed path has coinciding start and end points. Or they can exist independently as unclosed subpaths, such as lines and curves.

A QPainterPath object can be used for filling, outlining, and clipping. To generate fillable outlines for a given painter path, use the QPainterPathStroker class. The main advantage of painter paths over normal drawing operations is that complex shapes only need to be created once; then they can be drawn many times using only calls to the QPainter::drawPath() function.

QPainterPath provides a collection of functions that can be used to obtain information about the path and its elements. In addition it is possible to reverse the order of the elements using the toReversed() function. There are also several functions to convert this painter path object into a polygon representation.

Methods

impl QPainterPath[src]

pub unsafe fn add_assign(
    &self,
    other: impl CastInto<Ref<QPainterPath>>
) -> Ref<QPainterPath>
[src]

Unites this path with other, and returns a reference to this path. This is equivalent to operator|=().

Calls C++ function: QPainterPath& QPainterPath::operator+=(const QPainterPath& other).

C++ documentation:

Unites this path with other, and returns a reference to this path. This is equivalent to operator|=().

This function was introduced in Qt 4.5.

See also united(), operator+(), and operator-=().

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

Creates an ellipse within the specified boundingRectangle and adds it to the painter path as a closed subpath.

Calls C++ function: void QPainterPath::addEllipse(const QRectF& rect).

C++ documentation:

Creates an ellipse within the specified boundingRectangle and adds it to the painter path as a closed subpath.

The ellipse is composed of a clockwise curve, starting and finishing at zero degrees (the 3 o'clock position).

QLinearGradient myGradient; QPen myPen; QRectF boundingRectangle;

QPainterPath myPath; myPath.addEllipse(boundingRectangle);

QPainter painter(this); painter.setBrush(myGradient); painter.setPen(myPen); painter.drawPath(myPath);

See also arcTo(), QPainter::drawEllipse(), and Composing a QPainterPath.

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

This is an overloaded function.

Calls C++ function: void QPainterPath::addEllipse(double x, double y, double w, double h).

C++ documentation:

This is an overloaded function.

Creates an ellipse within the bounding rectangle defined by its top-left corner at (x, y), width and height, and adds it to the painter path as a closed subpath.

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

This is an overloaded function.

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

C++ documentation:

This is an overloaded function.

Creates an ellipse positioned at center with radii rx and ry, and adds it to the painter path as a closed subpath.

This function was introduced in Qt 4.4.

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

Adds the given path to this path as a closed subpath.

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

C++ documentation:

Adds the given path to this path as a closed subpath.

See also connectPath() and Composing a QPainterPath.

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

Adds the given polygon to the path as an (unclosed) subpath.

Calls C++ function: void QPainterPath::addPolygon(const QPolygonF& polygon).

C++ documentation:

Adds the given polygon to the path as an (unclosed) subpath.

Note that the current position after the polygon has been added, is the last point in polygon. To draw a line back to the first point, use the closeSubpath() function.

QLinearGradient myGradient; QPen myPen; QPolygonF myPolygon;

QPainterPath myPath; myPath.addPolygon(myPolygon);

QPainter painter(this); painter.setBrush(myGradient); painter.setPen(myPen); painter.drawPath(myPath);

See also lineTo() and Composing a QPainterPath.

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

Adds the given rectangle to this path as a closed subpath.

Calls C++ function: void QPainterPath::addRect(const QRectF& rect).

C++ documentation:

Adds the given rectangle to this path as a closed subpath.

The rectangle is added as a clockwise set of lines. The painter path's current position after the rectangle has been added is at the top-left corner of the rectangle.

QLinearGradient myGradient; QPen myPen; QRectF myRectangle;

QPainterPath myPath; myPath.addRect(myRectangle);

QPainter painter(this); painter.setBrush(myGradient); painter.setPen(myPen); painter.drawPath(myPath);

See also addRegion(), lineTo(), and Composing a QPainterPath.

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

This is an overloaded function.

Calls C++ function: void QPainterPath::addRect(double x, double y, double w, double h).

C++ documentation:

This is an overloaded function.

Adds a rectangle at position (x, y), with the given width and height, as a closed subpath.

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

Adds the given region to the path by adding each rectangle in the region as a separate closed subpath.

Calls C++ function: void QPainterPath::addRegion(const QRegion& region).

C++ documentation:

Adds the given region to the path by adding each rectangle in the region as a separate closed subpath.

See also addRect() and Composing a QPainterPath.

pub unsafe fn add_round_rect_3a(
    &self,
    rect: impl CastInto<Ref<QRectF>>,
    x_rnd: c_int,
    y_rnd: c_int
)
[src]

Adds a rectangle r with rounded corners to the path.

Calls C++ function: void QPainterPath::addRoundRect(const QRectF& rect, int xRnd, int yRnd).

C++ documentation:

Adds a rectangle r with rounded corners to the path.

The xRnd and yRnd arguments specify how rounded the corners should be. 0 is angled corners, 99 is maximum roundedness.

See also addRoundedRect().

pub unsafe fn add_round_rect_6a(
    &self,
    x: c_double,
    y: c_double,
    w: c_double,
    h: c_double,
    x_rnd: c_int,
    y_rnd: c_int
)
[src]

This is an overloaded function.

Calls C++ function: void QPainterPath::addRoundRect(double x, double y, double w, double h, int xRnd, int yRnd).

C++ documentation:

This is an overloaded function.

Adds a rectangle with rounded corners to the path. The rectangle is constructed from x, y, and the width and height w and h.

The xRnd and yRnd arguments specify how rounded the corners should be. 0 is angled corners, 99 is maximum roundedness.

See also addRoundedRect().

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

This is an overloaded function.

Calls C++ function: void QPainterPath::addRoundRect(const QRectF& rect, int roundness).

C++ documentation:

This is an overloaded function.

Adds a rounded rectangle, rect, to the path.

The roundness argument specifies uniform roundness for the rectangle. Vertical and horizontal roundness factors will be adjusted accordingly to act uniformly around both axes. Use this method if you want a rectangle equally rounded across both the X and Y axis.

This function was introduced in Qt 4.3.

See also addRoundedRect().

pub unsafe fn add_round_rect_5a(
    &self,
    x: c_double,
    y: c_double,
    w: c_double,
    h: c_double,
    roundness: c_int
)
[src]

This is an overloaded function.

Calls C++ function: void QPainterPath::addRoundRect(double x, double y, double w, double h, int roundness).

C++ documentation:

This is an overloaded function.

Adds a rounded rectangle to the path, defined by the coordinates x and y with the specified width and height.

The roundness argument specifies uniform roundness for the rectangle. Vertical and horizontal roundness factors will be adjusted accordingly to act uniformly around both axes. Use this method if you want a rectangle equally rounded across both the X and Y axis.

This function was introduced in Qt 4.3.

See also addRoundedRect().

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

Adds the given rectangle rect with rounded corners to the path.

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

C++ documentation:

Adds the given rectangle rect with rounded corners to the path.

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.

This function was introduced in Qt 4.4.

See also addRect().

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

This is an overloaded function.

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

C++ documentation:

This is an overloaded function.

Adds the given rectangle x, y, w, h with rounded corners to the path.

This function was introduced in Qt 4.4.

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

Adds the given rectangle rect with rounded corners to the path.

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

C++ documentation:

Adds the given rectangle rect with rounded corners to the path.

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.

This function was introduced in Qt 4.4.

See also addRect().

pub unsafe fn add_rounded_rect_6a(
    &self,
    x: c_double,
    y: c_double,
    w: c_double,
    h: c_double,
    x_radius: c_double,
    y_radius: c_double
)
[src]

This is an overloaded function.

Calls C++ function: void QPainterPath::addRoundedRect(double x, double y, double w, double h, double xRadius, double yRadius).

C++ documentation:

This is an overloaded function.

Adds the given rectangle x, y, w, h with rounded corners to the path.

This function was introduced in Qt 4.4.

pub unsafe fn add_text_3a(
    &self,
    point: impl CastInto<Ref<QPointF>>,
    f: impl CastInto<Ref<QFont>>,
    text: impl CastInto<Ref<QString>>
)
[src]

Adds the given text to this path as a set of closed subpaths created from the font supplied. The subpaths are positioned so that the left end of the text's baseline lies at the specified point.

Calls C++ function: void QPainterPath::addText(const QPointF& point, const QFont& f, const QString& text).

C++ documentation:

Adds the given text to this path as a set of closed subpaths created from the font supplied. The subpaths are positioned so that the left end of the text's baseline lies at the specified point.

QLinearGradient myGradient; QPen myPen; QFont myFont; QPointF baseline(x, y);

QPainterPath myPath; myPath.addText(baseline, myFont, tr("Qt"));

QPainter painter(this); painter.setBrush(myGradient); painter.setPen(myPen); painter.drawPath(myPath);

See also QPainter::drawText() and Composing a QPainterPath.

pub unsafe fn add_text_4a(
    &self,
    x: c_double,
    y: c_double,
    f: impl CastInto<Ref<QFont>>,
    text: impl CastInto<Ref<QString>>
)
[src]

This is an overloaded function.

Calls C++ function: void QPainterPath::addText(double x, double y, const QFont& f, const QString& text).

C++ documentation:

This is an overloaded function.

Adds the given text to this path as a set of closed subpaths created from the font supplied. The subpaths are positioned so that the left end of the text's baseline lies at the point specified by (x, y).

pub unsafe fn angle_at_percent(&self, t: c_double) -> c_double[src]

Returns the angle of the path tangent at the percentage t. The argument t has to be between 0 and 1.

Calls C++ function: double QPainterPath::angleAtPercent(double t) const.

C++ documentation:

Returns the angle of the path tangent at the percentage t. The argument t has to be between 0 and 1.

Positive values for the angles mean counter-clockwise while negative values mean the clockwise direction. Zero degrees is at the 3 o'clock position.

Note that similarly to the other percent methods, the percentage measurement is not linear with regards to the length if curves are present in the path. When curves are present the percentage argument is mapped to the t parameter of the Bezier equations.

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

Creates a move to that lies on the arc that occupies the given rectangle at angle.

Calls C++ function: void QPainterPath::arcMoveTo(const QRectF& rect, double angle).

C++ documentation:

Creates a move to that lies on the arc that occupies the given rectangle at angle.

Angles are specified in degrees. Clockwise arcs can be specified using negative angles.

This function was introduced in Qt 4.2.

See also moveTo() and arcTo().

pub unsafe fn arc_move_to_5a(
    &self,
    x: c_double,
    y: c_double,
    w: c_double,
    h: c_double,
    angle: c_double
)
[src]

This is an overloaded function.

Calls C++ function: void QPainterPath::arcMoveTo(double x, double y, double w, double h, double angle).

C++ documentation:

This is an overloaded function.

Creates a move to that lies on the arc that occupies the QRectF(x, y, width, height) at angle.

This function was introduced in Qt 4.2.

pub unsafe fn arc_to_3a(
    &self,
    rect: impl CastInto<Ref<QRectF>>,
    start_angle: c_double,
    arc_length: c_double
)
[src]

Creates an arc that occupies the given rectangle, beginning at the specified startAngle and extending sweepLength degrees counter-clockwise.

Calls C++ function: void QPainterPath::arcTo(const QRectF& rect, double startAngle, double arcLength).

C++ documentation:

Creates an arc that occupies the given rectangle, beginning at the specified startAngle and extending sweepLength degrees counter-clockwise.

Angles are specified in degrees. Clockwise arcs can be specified using negative angles.

Note that this function connects the starting point of the arc to the current position if they are not already connected. After the arc has been added, the current position is the last point in arc. To draw a line back to the first point, use the closeSubpath() function.

QLinearGradient myGradient; QPen myPen;

QPointF center, startPoint;

QPainterPath myPath; myPath.moveTo(center); myPath.arcTo(boundingRect, startAngle, sweepLength);

QPainter painter(this); painter.setBrush(myGradient); painter.setPen(myPen); painter.drawPath(myPath);

See also arcMoveTo(), addEllipse(), QPainter::drawArc(), QPainter::drawPie(), and Composing a QPainterPath.

pub unsafe fn arc_to_6a(
    &self,
    x: c_double,
    y: c_double,
    w: c_double,
    h: c_double,
    start_angle: c_double,
    arc_length: c_double
)
[src]

This is an overloaded function.

Calls C++ function: void QPainterPath::arcTo(double x, double y, double w, double h, double startAngle, double arcLength).

C++ documentation:

This is an overloaded function.

Creates an arc that occupies the rectangle QRectF(x, y, width, height), beginning at the specified startAngle and extending sweepLength degrees counter-clockwise.

pub unsafe fn bit_and_assign(
    &self,
    other: impl CastInto<Ref<QPainterPath>>
) -> Ref<QPainterPath>
[src]

Intersects this path with other and returns a reference to this path.

Calls C++ function: QPainterPath& QPainterPath::operator&=(const QPainterPath& other).

C++ documentation:

Intersects this path with other and returns a reference to this path.

This function was introduced in Qt 4.5.

See also intersected(), operator&(), and operator|=().

pub unsafe fn bit_or_assign(
    &self,
    other: impl CastInto<Ref<QPainterPath>>
) -> Ref<QPainterPath>
[src]

Unites this path with other and returns a reference to this path.

Calls C++ function: QPainterPath& QPainterPath::operator|=(const QPainterPath& other).

C++ documentation:

Unites this path with other and returns a reference to this path.

This function was introduced in Qt 4.5.

See also united(), operator|(), and operator&=().

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

Returns the bounding rectangle of this painter path as a rectangle with floating point precision.

Calls C++ function: QRectF QPainterPath::boundingRect() const.

C++ documentation:

Returns the bounding rectangle of this painter path as a rectangle with floating point precision.

See also controlPointRect().

pub unsafe fn capacity(&self) -> c_int[src]

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

Returns the number of elements allocated by the QPainterPath.

Calls C++ function: int QPainterPath::capacity() const.

C++ documentation:

Returns the number of elements allocated by the QPainterPath.

This function was introduced in Qt 5.13.

See also clear() and reserve().

pub unsafe fn clear(&self)[src]

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

Clears the path elements stored.

Calls C++ function: void QPainterPath::clear().

C++ documentation:

Clears the path elements stored.

This allows the path to reuse previous memory allocations.

This function was introduced in Qt 5.13.

See also reserve() and capacity().

pub unsafe fn close_subpath(&self)[src]

Closes the current subpath by drawing a line to the beginning of the subpath, automatically starting a new path. The current point of the new path is (0, 0).

Calls C++ function: void QPainterPath::closeSubpath().

C++ documentation:

Closes the current subpath by drawing a line to the beginning of the subpath, automatically starting a new path. The current point of the new path is (0, 0).

If the subpath does not contain any elements, this function does nothing.

See also moveTo() and Composing a QPainterPath.

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

Connects the given path to this path by adding a line from the last element of this path to the first element of the given path.

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

C++ documentation:

Connects the given path to this path by adding a line from the last element of this path to the first element of the given path.

See also addPath() and Composing a QPainterPath.

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

Returns true if the given point is inside the path, otherwise returns false.

Calls C++ function: bool QPainterPath::contains(const QPointF& pt) const.

C++ documentation:

Returns true if the given point is inside the path, otherwise returns false.

See also intersects().

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

Returns true if the given rectangle is inside the path, otherwise returns false.

Calls C++ function: bool QPainterPath::contains(const QRectF& rect) const.

C++ documentation:

Returns true if the given rectangle is inside the path, otherwise returns false.

pub unsafe fn contains_q_painter_path(
    &self,
    p: impl CastInto<Ref<QPainterPath>>
) -> bool
[src]

Returns true if the given path p is contained within the current path. Returns false if any edges of the current path and p intersect.

Calls C++ function: bool QPainterPath::contains(const QPainterPath& p) const.

C++ documentation:

Returns true if the given path p is contained within the current path. Returns false if any edges of the current path and p intersect.

Set operations on paths will treat the paths as areas. Non-closed paths will be treated as implicitly closed.

This function was introduced in Qt 4.3.

See also intersects().

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

Returns the rectangle containing all the points and control points in this path.

Calls C++ function: QRectF QPainterPath::controlPointRect() const.

C++ documentation:

Returns the rectangle containing all the points and control points in this path.

This function is significantly faster to compute than the exact boundingRect(), and the returned rectangle is always a superset of the rectangle returned by boundingRect().

See also boundingRect().

pub unsafe fn copy_from(
    &self,
    other: impl CastInto<Ref<QPainterPath>>
) -> Ref<QPainterPath>
[src]

Assigns the given path to this painter path.

Calls C++ function: QPainterPath& QPainterPath::operator=(const QPainterPath& other).

C++ documentation:

Assigns the given path to this painter path.

See also QPainterPath().

pub unsafe fn cubic_to_3a(
    &self,
    ctrl_pt1: impl CastInto<Ref<QPointF>>,
    ctrl_pt2: impl CastInto<Ref<QPointF>>,
    end_pt: impl CastInto<Ref<QPointF>>
)
[src]

Adds a cubic Bezier curve between the current position and the given endPoint using the control points specified by c1, and c2.

Calls C++ function: void QPainterPath::cubicTo(const QPointF& ctrlPt1, const QPointF& ctrlPt2, const QPointF& endPt).

C++ documentation:

Adds a cubic Bezier curve between the current position and the given endPoint using the control points specified by c1, and c2.

After the curve is added, the current position is updated to be at the end point of the curve.

QLinearGradient myGradient; QPen myPen;

QPainterPath myPath; myPath.cubicTo(c1, c2, endPoint);

QPainter painter(this); painter.setBrush(myGradient); painter.setPen(myPen); painter.drawPath(myPath);

See also quadTo() and Composing a QPainterPath.

pub unsafe fn cubic_to_6a(
    &self,
    ctrl_pt_1x: c_double,
    ctrl_pt_1y: c_double,
    ctrl_pt_2x: c_double,
    ctrl_pt_2y: c_double,
    end_ptx: c_double,
    end_pty: c_double
)
[src]

This is an overloaded function.

Calls C++ function: void QPainterPath::cubicTo(double ctrlPt1x, double ctrlPt1y, double ctrlPt2x, double ctrlPt2y, double endPtx, double endPty).

C++ documentation:

This is an overloaded function.

Adds a cubic Bezier curve between the current position and the end point (endPointX, endPointY) with control points specified by (c1X, c1Y) and (c2X, c2Y).

pub unsafe fn current_position(&self) -> CppBox<QPointF>[src]

Returns the current position of the path.

Calls C++ function: QPointF QPainterPath::currentPosition() const.

C++ documentation:

Returns the current position of the path.

pub unsafe fn element_at(&self, i: c_int) -> CppBox<Element>[src]

Returns the element at the given index in the painter path.

Calls C++ function: QPainterPath::Element QPainterPath::elementAt(int i) const.

C++ documentation:

Returns the element at the given index in the painter path.

See also ElementType, elementCount(), and isEmpty().

pub unsafe fn element_count(&self) -> c_int[src]

Returns the number of path elements in the painter path.

Calls C++ function: int QPainterPath::elementCount() const.

C++ documentation:

Returns the number of path elements in the painter path.

See also ElementType, elementAt(), and isEmpty().

pub unsafe fn fill_rule(&self) -> FillRule[src]

Returns the painter path's currently set fill rule.

Calls C++ function: Qt::FillRule QPainterPath::fillRule() const.

C++ documentation:

Returns the painter path's currently set fill rule.

See also setFillRule().

pub unsafe fn intersected(
    &self,
    r: impl CastInto<Ref<QPainterPath>>
) -> CppBox<QPainterPath>
[src]

Returns a path which is the intersection of this path's fill area and p's fill area. Bezier curves may be flattened to line segments due to numerical instability of doing bezier curve intersections.

Calls C++ function: QPainterPath QPainterPath::intersected(const QPainterPath& r) const.

C++ documentation:

Returns a path which is the intersection of this path's fill area and p's fill area. Bezier curves may be flattened to line segments due to numerical instability of doing bezier curve intersections.

This function was introduced in Qt 4.3.

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

Returns true if any point in the given rectangle intersects the path; otherwise returns false.

Calls C++ function: bool QPainterPath::intersects(const QRectF& rect) const.

C++ documentation:

Returns true if any point in the given rectangle intersects the path; otherwise returns false.

There is an intersection if any of the lines making up the rectangle crosses a part of the path or if any part of the rectangle overlaps with any area enclosed by the path. This function respects the current fillRule to determine what is considered inside the path.

See also contains().

pub unsafe fn intersects_q_painter_path(
    &self,
    p: impl CastInto<Ref<QPainterPath>>
) -> bool
[src]

Returns true if the current path intersects at any point the given path p. Also returns true if the current path contains or is contained by any part of p.

Calls C++ function: bool QPainterPath::intersects(const QPainterPath& p) const.

C++ documentation:

Returns true if the current path intersects at any point the given path p. Also returns true if the current path contains or is contained by any part of p.

Set operations on paths will treat the paths as areas. Non-closed paths will be treated as implicitly closed.

This function was introduced in Qt 4.3.

See also contains().

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

Returns true if either there are no elements in this path, or if the only element is a MoveToElement; otherwise returns false.

Calls C++ function: bool QPainterPath::isEmpty() const.

C++ documentation:

Returns true if either there are no elements in this path, or if the only element is a MoveToElement; otherwise returns false.

See also elementCount().

pub unsafe fn length(&self) -> c_double[src]

Returns the length of the current path.

Calls C++ function: double QPainterPath::length() const.

C++ documentation:

Returns the length of the current path.

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

Adds a straight line from the current position to the given endPoint. After the line is drawn, the current position is updated to be at the end point of the line.

Calls C++ function: void QPainterPath::lineTo(const QPointF& p).

C++ documentation:

Adds a straight line from the current position to the given endPoint. After the line is drawn, the current position is updated to be at the end point of the line.

See also addPolygon(), addRect(), and Composing a QPainterPath.

pub unsafe fn line_to_2a(&self, x: c_double, y: c_double)[src]

This is an overloaded function.

Calls C++ function: void QPainterPath::lineTo(double x, double y).

C++ documentation:

This is an overloaded function.

Draws a line from the current position to the point (x, y).

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

Moves the current point to the given point, implicitly starting a new subpath and closing the previous one.

Calls C++ function: void QPainterPath::moveTo(const QPointF& p).

C++ documentation:

Moves the current point to the given point, implicitly starting a new subpath and closing the previous one.

See also closeSubpath() and Composing a QPainterPath.

pub unsafe fn move_to_2a(&self, x: c_double, y: c_double)[src]

This is an overloaded function.

Calls C++ function: void QPainterPath::moveTo(double x, double y).

C++ documentation:

This is an overloaded function.

Moves the current position to (x, y) and starts a new subpath, implicitly closing the previous path.

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

Constructs an empty QPainterPath object.

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

C++ documentation:

Constructs an empty QPainterPath object.

pub unsafe fn new_1a(
    start_point: impl CastInto<Ref<QPointF>>
) -> CppBox<QPainterPath>
[src]

Creates a QPainterPath object with the given startPoint as its current position.

Calls C++ function: [constructor] void QPainterPath::QPainterPath(const QPointF& startPoint).

C++ documentation:

Creates a QPainterPath object with the given startPoint as its current position.

pub unsafe fn new_copy(
    other: impl CastInto<Ref<QPainterPath>>
) -> CppBox<QPainterPath>
[src]

Creates a QPainterPath object that is a copy of the given path.

Calls C++ function: [constructor] void QPainterPath::QPainterPath(const QPainterPath& other).

C++ documentation:

Creates a QPainterPath object that is a copy of the given path.

See also operator=().

pub unsafe fn percent_at_length(&self, t: c_double) -> c_double[src]

Returns percentage of the whole path at the specified length len.

Calls C++ function: double QPainterPath::percentAtLength(double t) const.

C++ documentation:

Returns percentage of the whole path at the specified length len.

Note that similarly to other percent methods, the percentage measurement is not linear with regards to the length, if curves are present in the path. When curves are present the percentage argument is mapped to the t parameter of the Bezier equations.

pub unsafe fn point_at_percent(&self, t: c_double) -> CppBox<QPointF>[src]

Returns the point at at the percentage t of the current path. The argument t has to be between 0 and 1.

Calls C++ function: QPointF QPainterPath::pointAtPercent(double t) const.

C++ documentation:

Returns the point at at the percentage t of the current path. The argument t has to be between 0 and 1.

Note that similarly to other percent methods, the percentage measurement is not linear with regards to the length, if curves are present in the path. When curves are present the percentage argument is mapped to the t parameter of the Bezier equations.

pub unsafe fn quad_to_2a(
    &self,
    ctrl_pt: impl CastInto<Ref<QPointF>>,
    end_pt: impl CastInto<Ref<QPointF>>
)
[src]

Adds a quadratic Bezier curve between the current position and the given endPoint with the control point specified by c.

Calls C++ function: void QPainterPath::quadTo(const QPointF& ctrlPt, const QPointF& endPt).

C++ documentation:

Adds a quadratic Bezier curve between the current position and the given endPoint with the control point specified by c.

After the curve is added, the current point is updated to be at the end point of the curve.

See also cubicTo() and Composing a QPainterPath.

pub unsafe fn quad_to_4a(
    &self,
    ctrl_ptx: c_double,
    ctrl_pty: c_double,
    end_ptx: c_double,
    end_pty: c_double
)
[src]

This is an overloaded function.

Calls C++ function: void QPainterPath::quadTo(double ctrlPtx, double ctrlPty, double endPtx, double endPty).

C++ documentation:

This is an overloaded function.

Adds a quadratic Bezier curve between the current point and the endpoint (endPointX, endPointY) with the control point specified by (cx, cy).

pub unsafe fn reserve(&self, size: c_int)[src]

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

Reserves a given amount of elements in QPainterPath's internal memory.

Calls C++ function: void QPainterPath::reserve(int size).

C++ documentation:

Reserves a given amount of elements in QPainterPath's internal memory.

Attempts to allocate memory for at least size elements.

This function was introduced in Qt 5.13.

See also clear(), capacity(), and QVector::reserve().

pub unsafe fn set_element_position_at(&self, i: c_int, x: c_double, y: c_double)[src]

Sets the x and y coordinate of the element at index index to x and y.

Calls C++ function: void QPainterPath::setElementPositionAt(int i, double x, double y).

C++ documentation:

Sets the x and y coordinate of the element at index index to x and y.

This function was introduced in Qt 4.2.

pub unsafe fn set_fill_rule(&self, fill_rule: FillRule)[src]

Sets the fill rule of the painter path to the given fillRule. Qt provides two methods for filling paths:

Calls C++ function: void QPainterPath::setFillRule(Qt::FillRule fillRule).

C++ documentation:

Sets the fill rule of the painter path to the given fillRule. Qt provides two methods for filling paths:

See also fillRule().

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

Returns a simplified version of this path. This implies merging all subpaths that intersect, and returning a path containing no intersecting edges. Consecutive parallel lines will also be merged. The simplified path will always use the default fill rule, Qt::OddEvenFill. Bezier curves may be flattened to line segments due to numerical instability of doing bezier curve intersections.

Calls C++ function: QPainterPath QPainterPath::simplified() const.

C++ documentation:

Returns a simplified version of this path. This implies merging all subpaths that intersect, and returning a path containing no intersecting edges. Consecutive parallel lines will also be merged. The simplified path will always use the default fill rule, Qt::OddEvenFill. Bezier curves may be flattened to line segments due to numerical instability of doing bezier curve intersections.

This function was introduced in Qt 4.4.

pub unsafe fn slope_at_percent(&self, t: c_double) -> c_double[src]

Returns the slope of the path at the percentage t. The argument t has to be between 0 and 1.

Calls C++ function: double QPainterPath::slopeAtPercent(double t) const.

C++ documentation:

Returns the slope of the path at the percentage t. The argument t has to be between 0 and 1.

Note that similarly to other percent methods, the percentage measurement is not linear with regards to the length, if curves are present in the path. When curves are present the percentage argument is mapped to the t parameter of the Bezier equations.

pub unsafe fn sub_assign(
    &self,
    other: impl CastInto<Ref<QPainterPath>>
) -> Ref<QPainterPath>
[src]

Subtracts other from this path, and returns a reference to this path.

Calls C++ function: QPainterPath& QPainterPath::operator-=(const QPainterPath& other).

C++ documentation:

Subtracts other from this path, and returns a reference to this path.

This function was introduced in Qt 4.5.

See also subtracted(), operator-(), and operator+=().

pub unsafe fn subtracted(
    &self,
    r: impl CastInto<Ref<QPainterPath>>
) -> CppBox<QPainterPath>
[src]

Returns a path which is p's fill area subtracted from this path's fill area.

Calls C++ function: QPainterPath QPainterPath::subtracted(const QPainterPath& r) const.

C++ documentation:

Returns a path which is p's fill area subtracted from this path's fill area.

Set operations on paths will treat the paths as areas. Non-closed paths will be treated as implicitly closed. Bezier curves may be flattened to line segments due to numerical instability of doing bezier curve intersections.

This function was introduced in Qt 4.3.

pub unsafe fn subtracted_inverted(
    &self,
    r: impl CastInto<Ref<QPainterPath>>
) -> CppBox<QPainterPath>
[src]

Use subtracted() instead.

Calls C++ function: QPainterPath QPainterPath::subtractedInverted(const QPainterPath& r) const.

C++ documentation:

Use subtracted() instead.

This function was introduced in Qt 4.3.

See also subtracted().

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

Swaps painter path other with this painter path. This operation is very fast and never fails.

Calls C++ function: void QPainterPath::swap(QPainterPath& other).

C++ documentation:

Swaps painter path other with this painter path. This operation is very fast and never fails.

This function was introduced in Qt 4.8.

pub unsafe fn to_fill_polygon_q_matrix(
    &self,
    matrix: impl CastInto<Ref<QMatrix>>
) -> CppBox<QPolygonF>
[src]

This is an overloaded function.

Calls C++ function: QPolygonF QPainterPath::toFillPolygon(const QMatrix& matrix = …) const.

C++ documentation:

This is an overloaded function.

pub unsafe fn to_fill_polygon_q_transform(
    &self,
    matrix: impl CastInto<Ref<QTransform>>
) -> CppBox<QPolygonF>
[src]

Converts the path into a polygon using the QTransform matrix, and returns the polygon.

Calls C++ function: QPolygonF QPainterPath::toFillPolygon(const QTransform& matrix) const.

C++ documentation:

Converts the path into a polygon using the QTransform matrix, and returns the polygon.

The polygon is created by first converting all subpaths to polygons, then using a rewinding technique to make sure that overlapping subpaths can be filled using the correct fill rule.

Note that rewinding inserts addition lines in the polygon so the outline of the fill polygon does not match the outline of the path.

See also toSubpathPolygons(), toFillPolygons(), and QPainterPath Conversion.

pub unsafe fn to_fill_polygon(&self) -> CppBox<QPolygonF>[src]

This is an overloaded function.

Calls C++ function: QPolygonF QPainterPath::toFillPolygon() const.

C++ documentation:

This is an overloaded function.

pub unsafe fn to_fill_polygons_q_matrix(
    &self,
    matrix: impl CastInto<Ref<QMatrix>>
) -> CppBox<QListOfQPolygonF>
[src]

This is an overloaded function.

Calls C++ function: QList<QPolygonF> QPainterPath::toFillPolygons(const QMatrix& matrix = …) const.

C++ documentation:

This is an overloaded function.

pub unsafe fn to_fill_polygons_q_transform(
    &self,
    matrix: impl CastInto<Ref<QTransform>>
) -> CppBox<QListOfQPolygonF>
[src]

Converts the path into a list of polygons using the QTransform matrix, and returns the list.

Calls C++ function: QList<QPolygonF> QPainterPath::toFillPolygons(const QTransform& matrix) const.

C++ documentation:

Converts the path into a list of polygons using the QTransform matrix, and returns the list.

The function differs from the toFillPolygon() function in that it creates several polygons. It is provided because it is usually faster to draw several small polygons than to draw one large polygon, even though the total number of points drawn is the same.

The toFillPolygons() function differs from the toSubpathPolygons() function in that it create only polygon for subpaths that have overlapping bounding rectangles.

Like the toFillPolygon() function, this function uses a rewinding technique to make sure that overlapping subpaths can be filled using the correct fill rule. Note that rewinding inserts addition lines in the polygons so the outline of the fill polygon does not match the outline of the path.

See also toSubpathPolygons(), toFillPolygon(), and QPainterPath Conversion.

pub unsafe fn to_fill_polygons(&self) -> CppBox<QListOfQPolygonF>[src]

This is an overloaded function.

Calls C++ function: QList<QPolygonF> QPainterPath::toFillPolygons() const.

C++ documentation:

This is an overloaded function.

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

Creates and returns a reversed copy of the path.

Calls C++ function: QPainterPath QPainterPath::toReversed() const.

C++ documentation:

Creates and returns a reversed copy of the path.

It is the order of the elements that is reversed: If a QPainterPath is composed by calling the moveTo(), lineTo() and cubicTo() functions in the specified order, the reversed copy is composed by calling cubicTo(), lineTo() and moveTo().

pub unsafe fn to_subpath_polygons_q_matrix(
    &self,
    matrix: impl CastInto<Ref<QMatrix>>
) -> CppBox<QListOfQPolygonF>
[src]

This is an overloaded function.

Calls C++ function: QList<QPolygonF> QPainterPath::toSubpathPolygons(const QMatrix& matrix = …) const.

C++ documentation:

This is an overloaded function.

pub unsafe fn to_subpath_polygons_q_transform(
    &self,
    matrix: impl CastInto<Ref<QTransform>>
) -> CppBox<QListOfQPolygonF>
[src]

Converts the path into a list of polygons using the QTransform matrix, and returns the list.

Calls C++ function: QList<QPolygonF> QPainterPath::toSubpathPolygons(const QTransform& matrix) const.

C++ documentation:

Converts the path into a list of polygons using the QTransform matrix, and returns the list.

This function creates one polygon for each subpath regardless of intersecting subpaths (i.e. overlapping bounding rectangles). To make sure that such overlapping subpaths are filled correctly, use the toFillPolygons() function instead.

See also toFillPolygons(), toFillPolygon(), and QPainterPath Conversion.

pub unsafe fn to_subpath_polygons(&self) -> CppBox<QListOfQPolygonF>[src]

This is an overloaded function.

Calls C++ function: QList<QPolygonF> QPainterPath::toSubpathPolygons() const.

C++ documentation:

This is an overloaded function.

pub unsafe fn translate_2a(&self, dx: c_double, dy: c_double)[src]

Translates all elements in the path by (dx, dy).

Calls C++ function: void QPainterPath::translate(double dx, double dy).

C++ documentation:

Translates all elements in the path by (dx, dy).

This function was introduced in Qt 4.6.

See also translated().

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

This is an overloaded function.

Calls C++ function: void QPainterPath::translate(const QPointF& offset).

C++ documentation:

This is an overloaded function.

Translates all elements in the path by the given offset.

This function was introduced in Qt 4.6.

See also translated().

pub unsafe fn translated_2a(
    &self,
    dx: c_double,
    dy: c_double
) -> CppBox<QPainterPath>
[src]

Returns a copy of the path that is translated by (dx, dy).

Calls C++ function: QPainterPath QPainterPath::translated(double dx, double dy) const.

C++ documentation:

Returns a copy of the path that is translated by (dx, dy).

This function was introduced in Qt 4.6.

See also translate().

pub unsafe fn translated_1a(
    &self,
    offset: impl CastInto<Ref<QPointF>>
) -> CppBox<QPainterPath>
[src]

This is an overloaded function.

Calls C++ function: QPainterPath QPainterPath::translated(const QPointF& offset) const.

C++ documentation:

This is an overloaded function.

Returns a copy of the path that is translated by the given offset.

This function was introduced in Qt 4.6.

See also translate().

pub unsafe fn united(
    &self,
    r: impl CastInto<Ref<QPainterPath>>
) -> CppBox<QPainterPath>
[src]

Returns a path which is the union of this path's fill area and p's fill area.

Calls C++ function: QPainterPath QPainterPath::united(const QPainterPath& r) const.

C++ documentation:

Returns a path which is the union of this path's fill area and p's fill area.

Set operations on paths will treat the paths as areas. Non-closed paths will be treated as implicitly closed. Bezier curves may be flattened to line segments due to numerical instability of doing bezier curve intersections.

This function was introduced in Qt 4.3.

See also intersected() and subtracted().

Trait Implementations

impl<'_> Add<Ref<QPainterPath>> for &'_ QPainterPath[src]

type Output = CppBox<QPainterPath>

The resulting type after applying the + operator.

fn add(self, other: Ref<QPainterPath>) -> CppBox<QPainterPath>[src]

Returns the union of this path and the other path. This function is equivalent to operator|().

Calls C++ function: QPainterPath QPainterPath::operator+(const QPainterPath& other) const.

C++ documentation:

Returns the union of this path and the other path. This function is equivalent to operator|().

This function was introduced in Qt 4.5.

See also united(), operator+=(), and operator-().

impl<'_> BitAnd<Ref<QPainterPath>> for &'_ QPainterPath[src]

type Output = CppBox<QPainterPath>

The resulting type after applying the & operator.

fn bitand(self, other: Ref<QPainterPath>) -> CppBox<QPainterPath>[src]

Returns the intersection of this path and the other path.

Calls C++ function: QPainterPath QPainterPath::operator&(const QPainterPath& other) const.

C++ documentation:

Returns the intersection of this path and the other path.

This function was introduced in Qt 4.5.

See also intersected(), operator&=(), united(), and operator|().

impl<'_> BitOr<Ref<QPainterPath>> for &'_ QPainterPath[src]

type Output = CppBox<QPainterPath>

The resulting type after applying the | operator.

fn bitor(self, other: Ref<QPainterPath>) -> CppBox<QPainterPath>[src]

Returns the union of this path and the other path.

Calls C++ function: QPainterPath QPainterPath::operator|(const QPainterPath& other) const.

C++ documentation:

Returns the union of this path and the other path.

This function was introduced in Qt 4.5.

See also united(), operator|=(), intersected(), and operator&().

impl CppDeletable for QPainterPath[src]

unsafe fn delete(&self)[src]

Destroys this QPainterPath object.

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

C++ documentation:

Destroys this QPainterPath object.

impl<'_> Mul<Ref<QMatrix>> for &'_ QPainterPath[src]

type Output = CppBox<QPainterPath>

The resulting type after applying the * operator.

fn mul(self, m: Ref<QMatrix>) -> CppBox<QPainterPath>[src]

Calls C++ function: QPainterPath operator*(const QPainterPath& p, const QMatrix& m).

impl<'_> Mul<Ref<QTransform>> for &'_ QPainterPath[src]

type Output = CppBox<QPainterPath>

The resulting type after applying the * operator.

fn mul(self, m: Ref<QTransform>) -> CppBox<QPainterPath>[src]

Calls C++ function: QPainterPath operator*(const QPainterPath& p, const QTransform& m).

impl PartialEq<Ref<QPainterPath>> for QPainterPath[src]

fn eq(&self, other: &Ref<QPainterPath>) -> bool[src]

Returns true if this painterpath is equal to the given path.

Calls C++ function: bool QPainterPath::operator==(const QPainterPath& other) const.

C++ documentation:

Returns true if this painterpath is equal to the given path.

Note that comparing paths may involve a per element comparison which can be slow for complex paths.

See also operator!=().

impl<'_> Sub<Ref<QPainterPath>> for &'_ QPainterPath[src]

type Output = CppBox<QPainterPath>

The resulting type after applying the - operator.

fn sub(self, other: Ref<QPainterPath>) -> CppBox<QPainterPath>[src]

Subtracts the other path from a copy of this path, and returns the copy.

Calls C++ function: QPainterPath QPainterPath::operator-(const QPainterPath& other) const.

C++ documentation:

Subtracts the other path from a copy of this path, and returns the copy.

This function was introduced in Qt 4.5.

See also subtracted(), operator-=(), and operator+().

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.