Logo Search packages:      
Sourcecode: qt4-x11 version File versions  Download package

QPainterPathStroker Class Reference

List of all members.


Detailed Description

The QPainterPathStroker class is used to generate fillable outlines for a given painter path.

Since:
4.1
By calling the createStroke() function, passing a given QPainterPath 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:

setWidth() setCapStyle() setJoinStyle() setDashPattern()

The setDashPattern() function accepts both a Qt::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 the setCurveThreshold() 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 the setMiterLimit() 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 be {miterlimit * width}. This value is only used if the join style is Qt::MiterJoin.

The painter path generated by the createStroke() function should only be used for outlining the given painter path. Otherwise it may cause unexpected behavior. Generated outlines also require the Qt::WindingFill rule which is set by default.

See also:
QPen, QBrush

Definition at line 226 of file qpainterpath.h.


Public Member Functions

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
 QPainterPathStroker ()
void setCapStyle (Qt::PenCapStyle style)
void setCurveThreshold (qreal threshold)
void setDashOffset (qreal offset)
void setDashPattern (const QVector< qreal > &dashPattern)
void setDashPattern (Qt::PenStyle)
void setJoinStyle (Qt::PenJoinStyle style)
void setMiterLimit (qreal length)
void setWidth (qreal width)
qreal width () const
 ~QPainterPathStroker ()

Private Attributes

QPainterPathStrokerPrivate * d_ptr

The documentation for this class was generated from the following files:

Generated by  Doxygen 1.6.0   Back to index