
We bake cookies in your browser for a better experience. Using this site means that you consent.Read More
TheQPainterPathStroker class is used to generate fillable outlines for a given painter path.More...
| Header: | #include <QPainterPathStroker> |
| Since: | Qt 4.1 |
| QPainterPathStroker() | |
| ~QPainterPathStroker() | |
| Qt::PenCapStyle | capStyle() const |
| QPainterPath | createStroke(const QPainterPath & path) const |
| qreal | curveThreshold() const |
| qreal | dashOffset() const |
| QVector<qreal> | dashPattern() const |
| Qt::PenJoinStyle | joinStyle() const |
| qreal | miterLimit() const |
| void | setCapStyle(Qt::PenCapStyle style) |
| void | setCurveThreshold(qreal threshold) |
| void | setDashOffset(qreal offset) |
| void | setDashPattern(Qt::PenStyle style) |
| void | setDashPattern(const QVector<qreal> & dashPattern) |
| void | setJoinStyle(Qt::PenJoinStyle style) |
| void | setMiterLimit(qreal limit) |
| void | setWidth(qreal width) |
| qreal | width() const |
TheQPainterPathStroker class is used to generate fillable outlines for a given painter path.
By calling thecreateStroke() function, passing a givenQPainterPath as argument, a new painter path representing the outline of the given path is created. The newly created painter path can then be filled to draw the original painter path's outline.
You can control the various design aspects (width, cap styles, join styles and dash pattern) of the outlining using the following functions:
ThesetDashPattern() function accepts both aQt::PenStyle object and a vector representation of the pattern as argument.
In addition you can specify a curve's threshold, controlling the granularity with which a curve is drawn, using thesetCurveThreshold() function. The default threshold is a well adjusted value (0.25), and normally you should not need to modify it. However, you can make the curve's appearance smoother by decreasing its value.
You can also control the miter limit for the generated outline using thesetMiterLimit() function. The miter limit describes how far from each join the miter join can extend. The limit is specified in the units of width so the pixelwise miter limit will bemiterlimit * width. This value is only used if the join style isQt::MiterJoin.
The painter path generated by thecreateStroke() function should only be used for outlining the given painter path. Otherwise it may cause unexpected behavior. Generated outlines also require theQt::WindingFill rule which is set by default.
Creates a new stroker.
Destroys the stroker.
Returns the cap style of the generated outlines.
See alsosetCapStyle().
Generates a new path that is a fillable area representing the outline of the givenpath.
The various design aspects of the outline are based on the stroker's properties:width(),capStyle(),joinStyle(),dashPattern(),curveThreshold() andmiterLimit().
The generated path should only be used for outlining the given painter path. Otherwise it may cause unexpected behavior. Generated outlines also require theQt::WindingFill rule which is set by default.
Returns the curve flattening threshold for the generated outlines.
See alsosetCurveThreshold().
Returns the dash offset for the generated outlines.
See alsosetDashOffset().
Returns the dash pattern for the generated outlines.
See alsosetDashPattern().
Returns the join style of the generated outlines.
See alsosetJoinStyle().
Returns the miter limit for the generated outlines.
See alsosetMiterLimit().
Sets the cap style of the generated outlines tostyle. If a dash pattern is set, each segment of the pattern is subject to the capstyle.
See alsocapStyle().
Specifies the curve flatteningthreshold, controlling the granularity with which the generated outlines' curve is drawn.
The default threshold is a well adjusted value (0.25), and normally you should not need to modify it. However, you can make the curve's appearance smoother by decreasing its value.
See alsocurveThreshold().
Sets the dash offset for the generated outlines tooffset.
See the documentation forQPen::setDashOffset() for a description of the dash offset.
See alsodashOffset().
Sets the dash pattern for the generated outlines tostyle.
See alsodashPattern().
This is an overloaded function.
Sets the dash pattern for the generated outlines todashPattern. This function makes it possible to specify custom dash patterns.
Each element in the vector contains the lengths of the dashes and spaces in the stroke, beginning with the first dash in the first element, the first space in the second element, and alternating between dashes and spaces for each following pair of elements.
The vector can contain an odd number of elements, in which case the last element will be extended by the length of the first element when the pattern repeats.
Sets the join style of the generated outlines tostyle.
See alsojoinStyle().
Sets the miter limit of the generated outlines tolimit.
The miter limit describes how far from each join the miter join can extend. The limit is specified in units of the currently set width. So the pixelwise miter limit will bemiterlimit * width.
This value is only used if the join style isQt::MiterJoin.
See alsomiterLimit().
Sets the width of the generated outline painter path towidth.
The generated outlines will extend approximately 50% ofwidth to each side of the given input path's original outline.
See alsowidth().
Returns the width of the generated outlines.
See alsosetWidth().
© 2016 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of theGNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.