内容表

上一话题

QPainterPath

下一话题

QPalette

QPainterPathStroker

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

Inheritance diagram of PySide2.QtGui.QPainterPathStroker

概要

函数

详细描述

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:

setDashPattern() function accepts both a 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 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 WindingFill rule which is set by default.

另请参阅

QPen QBrush

class QPainterPathStroker

QPainterPathStroker(pen)

param pen

QPen

Creates a new stroker.

PySide2.QtGui.QPainterPathStroker. capStyle ( )
返回类型

PenCapStyle

Returns the cap style of the generated outlines.

另请参阅

setCapStyle()

PySide2.QtGui.QPainterPathStroker. createStroke ( path )
参数

path QPainterPath

返回类型

QPainterPath

Generates a new path that is a fillable area representing the outline of the given path .

The various design aspects of the outline are based on the stroker’s properties: width() , capStyle() , joinStyle() , dashPattern() , curveThreshold() and miterLimit() .

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

PySide2.QtGui.QPainterPathStroker. curveThreshold ( )
返回类型

qreal

Returns the curve flattening threshold for the generated outlines.

PySide2.QtGui.QPainterPathStroker. dashOffset ( )
返回类型

qreal

Returns the dash offset for the generated outlines.

另请参阅

setDashOffset()

PySide2.QtGui.QPainterPathStroker. dashPattern ( )
返回类型

Returns the dash pattern for the generated outlines.

另请参阅

setDashPattern()

PySide2.QtGui.QPainterPathStroker. joinStyle ( )
返回类型

PenJoinStyle

Returns the join style of the generated outlines.

另请参阅

setJoinStyle()

PySide2.QtGui.QPainterPathStroker. miterLimit ( )
返回类型

qreal

Returns the miter limit for the generated outlines.

另请参阅

setMiterLimit()

PySide2.QtGui.QPainterPathStroker. setCapStyle ( style )
参数

style PenCapStyle

Sets the cap style of the generated outlines to style . If a dash pattern is set, each segment of the pattern is subject to the cap style .

另请参阅

capStyle()

PySide2.QtGui.QPainterPathStroker. setCurveThreshold ( threshold )
参数

threshold qreal

Specifies the curve flattening threshold , 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.

另请参阅

curveThreshold()

PySide2.QtGui.QPainterPathStroker. setDashOffset ( offset )
参数

offset qreal

Sets the dash offset for the generated outlines to offset .

See the documentation for setDashOffset() for a description of the dash offset.

另请参阅

dashOffset()

PySide2.QtGui.QPainterPathStroker. setDashPattern ( arg__1 )
参数

arg__1 PenStyle

Sets the dash pattern for the generated outlines to style .

另请参阅

dashPattern()

PySide2.QtGui.QPainterPathStroker. setDashPattern ( dashPattern )
参数

dashPattern

PySide2.QtGui.QPainterPathStroker. setJoinStyle ( style )
参数

style PenJoinStyle

Sets the join style of the generated outlines to style .

另请参阅

joinStyle()

PySide2.QtGui.QPainterPathStroker. setMiterLimit ( length )
参数

length qreal

Sets the miter limit of the generated outlines to limit .

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 be miterlimit * width .

This value is only used if the join style is MiterJoin .

另请参阅

miterLimit()

PySide2.QtGui.QPainterPathStroker. setWidth ( width )
参数

width qreal

Sets the width of the generated outline painter path to width .

The generated outlines will extend approximately 50% of width to each side of the given input path’s original outline.

另请参阅

width()

PySide2.QtGui.QPainterPathStroker. width ( )
返回类型

qreal

Returns the width of the generated outlines.

另请参阅

setWidth()