|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.trolltech.qt.QSignalEmitter
com.trolltech.qt.QtJambiObject
com.trolltech.qt.gui.QPainterPathStroker
public class QPainterPathStroker
The QPainterPathStroker
class is used to generate fillable outlines for a given painter path. 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:
ThesetDashPattern()
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.
QPen
, and QBrush
.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.trolltech.qt.QSignalEmitter |
---|
QSignalEmitter.Signal0, QSignalEmitter.Signal1, QSignalEmitter.Signal2, QSignalEmitter.Signal3, QSignalEmitter.Signal4, QSignalEmitter.Signal5, QSignalEmitter.Signal6, QSignalEmitter.Signal7, QSignalEmitter.Signal8, QSignalEmitter.Signal9 |
Constructor Summary | |
---|---|
QPainterPathStroker()
Creates a new stroker. |
Method Summary | |
---|---|
Qt.PenCapStyle |
capStyle()
Returns the cap style of the generated outlines. |
QPainterPath |
createStroke(QPainterPath path)
Generates a new path that is a fillable area representing the outline of the given path. |
double |
curveThreshold()
Returns the curve flattening threshold for the generated outlines. |
double |
dashOffset()
Returns the dash offset for the generated outlines. |
java.util.List |
dashPattern()
Returns the dash pattern for the generated outlines. |
static QPainterPathStroker |
fromNativePointer(QNativePointer nativePointer)
|
Qt.PenJoinStyle |
joinStyle()
Returns the join style of the generated outlines. |
double |
miterLimit()
Returns the miter limit for the generated outlines. |
void |
setCapStyle(Qt.PenCapStyle style)
Sets the cap style of the generated outlines to style. |
void |
setCurveThreshold(double threshold)
Specifies the curve flattening threshold, controlling the granularity with which the generated outlines' curve is drawn. |
void |
setDashOffset(double offset)
Sets the dash offset for the generated outlines to offset. |
void |
setDashPattern(java.util.List dashPattern)
Sets the dash pattern for the generated outlines to dashPattern. |
void |
setDashPattern(Qt.PenStyle arg__1)
Sets the dash pattern for the generated outlines to style. |
void |
setJoinStyle(Qt.PenJoinStyle style)
Sets the join style of the generated outlines to style. |
void |
setMiterLimit(double length)
Sets the miter limit of the generated outlines to limit. |
void |
setWidth(double width)
Sets the width of the generated outline painter path to width. |
double |
width()
Returns the width of the generated outlines. |
Methods inherited from class com.trolltech.qt.QtJambiObject |
---|
dispose, disposed, equals, finalize, reassignNativeResources, tr, tr, tr |
Methods inherited from class com.trolltech.qt.QSignalEmitter |
---|
blockSignals, disconnect, disconnect, signalsBlocked, signalSender, thread |
Methods inherited from class java.lang.Object |
---|
clone, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.trolltech.qt.QtJambiInterface |
---|
disableGarbageCollection, nativeId, nativePointer, reenableGarbageCollection, setJavaOwnership |
Constructor Detail |
---|
public QPainterPathStroker()
Method Detail |
---|
public final Qt.PenCapStyle capStyle()
setCapStyle()
.
public final QPainterPath createStroke(QPainterPath 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 Qt::WindingFill
rule which is set by default.
public final double curveThreshold()
setCurveThreshold()
.
public final double dashOffset()
setDashOffset()
.
public final java.util.List dashPattern()
setDashPattern()
.
public final Qt.PenJoinStyle joinStyle()
setJoinStyle()
.
public final double miterLimit()
setMiterLimit()
.
public final void setCapStyle(Qt.PenCapStyle style)
capStyle()
.
public final void setCurveThreshold(double threshold)
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()
.
public final void setDashOffset(double offset)
dashOffset()
.
public final void setDashPattern(Qt.PenStyle arg__1)
dashPattern()
.
public final void setDashPattern(java.util.List dashPattern)
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.
public final void setJoinStyle(Qt.PenJoinStyle style)
joinStyle()
.
public final void setMiterLimit(double length)
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 Qt::MiterJoin
.
miterLimit()
.
public final void setWidth(double width)
The generated outlines will extend approximately 50% of width to each side of the given input path's original outline.
width()
.
public final double width()
setWidth()
.
public static QPainterPathStroker fromNativePointer(QNativePointer nativePointer)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |