File: qpainterpathstroker.html

package info (click to toggle)
qt4-x11 4%3A4.8.2%2Bdfsg-11
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 701,696 kB
  • sloc: cpp: 2,686,179; ansic: 375,485; python: 25,859; sh: 19,349; xml: 17,091; perl: 14,765; yacc: 5,383; asm: 5,038; makefile: 1,259; lex: 555; ruby: 526; objc: 347; cs: 112; pascal: 112; php: 54; sed: 34
file content (207 lines) | stat: -rw-r--r-- 18,928 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en_US" lang="en_US">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- qpainterpath.cpp -->
  <title>Qt 4.8: QPainterPathStroker Class Reference</title>
  <link rel="stylesheet" type="text/css" href="style/offline.css" />
</head>
<body>
<div class="header" id="qtdocheader">
  <div class="content"> 
    <a href="index.html" class="qtref"><span>Qt Reference Documentation</span></a>
  </div>
  <div class="breadcrumb toolblock">
    <ul>
      <li class="first"><a href="index.html">Home</a></li>
      <!--  Breadcrumbs go here -->
<li><a href="modules.html">Modules</a></li>
<li><a href="qtgui.html">QtGui</a></li>
<li>QPainterPathStroker</li>
    </ul>
  </div>
</div>
<div class="content mainContent">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#public-functions">Public Functions</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
</ul>
</div>
<h1 class="title">QPainterPathStroker Class Reference</h1>
<!-- $$$QPainterPathStroker-brief -->
<p>The QPainterPathStroker class is used to generate fillable outlines for a given painter path. <a href="#details">More...</a></p>
<!-- @@@QPainterPathStroker -->
<pre class="cpp"> <span class="preprocessor">#include &lt;QPainterPathStroker&gt;</span></pre><p>This class was introduced in Qt 4.1.</p>
<ul>
<li><a href="qpainterpathstroker-members.html">List of all members, including inherited members</a></li>
</ul>
<a name="public-functions"></a>
<h2>Public Functions</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qpainterpathstroker.html#QPainterPathStroker">QPainterPathStroker</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qpainterpathstroker.html#dtor.QPainterPathStroker">~QPainterPathStroker</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> Qt::PenCapStyle </td><td class="memItemRight bottomAlign"><b><a href="qpainterpathstroker.html#capStyle">capStyle</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QPainterPath </td><td class="memItemRight bottomAlign"><b><a href="qpainterpathstroker.html#createStroke">createStroke</a></b> ( const QPainterPath &amp; <i>path</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> qreal </td><td class="memItemRight bottomAlign"><b><a href="qpainterpathstroker.html#curveThreshold">curveThreshold</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> qreal </td><td class="memItemRight bottomAlign"><b><a href="qpainterpathstroker.html#dashOffset">dashOffset</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QVector&lt;qreal&gt; </td><td class="memItemRight bottomAlign"><b><a href="qpainterpathstroker.html#dashPattern">dashPattern</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> Qt::PenJoinStyle </td><td class="memItemRight bottomAlign"><b><a href="qpainterpathstroker.html#joinStyle">joinStyle</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> qreal </td><td class="memItemRight bottomAlign"><b><a href="qpainterpathstroker.html#miterLimit">miterLimit</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qpainterpathstroker.html#setCapStyle">setCapStyle</a></b> ( Qt::PenCapStyle <i>style</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qpainterpathstroker.html#setCurveThreshold">setCurveThreshold</a></b> ( qreal <i>threshold</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qpainterpathstroker.html#setDashOffset">setDashOffset</a></b> ( qreal <i>offset</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qpainterpathstroker.html#setDashPattern">setDashPattern</a></b> ( Qt::PenStyle <i>style</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qpainterpathstroker.html#setDashPattern-2">setDashPattern</a></b> ( const QVector&lt;qreal&gt; &amp; <i>dashPattern</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qpainterpathstroker.html#setJoinStyle">setJoinStyle</a></b> ( Qt::PenJoinStyle <i>style</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qpainterpathstroker.html#setMiterLimit">setMiterLimit</a></b> ( qreal <i>limit</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qpainterpathstroker.html#setWidth">setWidth</a></b> ( qreal <i>width</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> qreal </td><td class="memItemRight bottomAlign"><b><a href="qpainterpathstroker.html#width">width</a></b> () const</td></tr>
</table>
<a name="details"></a>
<!-- $$$QPainterPathStroker-description -->
<div class="descr">
<h2>Detailed Description</h2>
<p>The QPainterPathStroker class is used to generate fillable outlines for a given painter path.</p>
<p>By calling the <a href="qpainterpathstroker.html#createStroke">createStroke</a>() function, passing a given <a href="qpainterpath.html">QPainterPath</a> 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.</p>
<p>You can control the various design aspects (width, cap styles, join styles and dash pattern) of the outlining using the following functions:</p>
<ul>
<li><a href="qpainterpathstroker.html#setWidth">setWidth</a>()</li>
<li><a href="qpainterpathstroker.html#setCapStyle">setCapStyle</a>()</li>
<li><a href="qpainterpathstroker.html#setJoinStyle">setJoinStyle</a>()</li>
<li><a href="qpainterpathstroker.html#setDashPattern">setDashPattern</a>()</li>
</ul>
<p>The <a href="qpainterpathstroker.html#setDashPattern">setDashPattern</a>() function accepts both a <a href="qt.html#PenStyle-enum">Qt::PenStyle</a> object and a vector representation of the pattern as argument.</p>
<p>In addition you can specify a curve's threshold, controlling the granularity with which a curve is drawn, using the <a href="qpainterpathstroker.html#setCurveThreshold">setCurveThreshold</a>() 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.</p>
<p>You can also control the miter limit for the generated outline using the <a href="qpainterpathstroker.html#setMiterLimit">setMiterLimit</a>() 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 <tt>miterlimit * width</tt>. This value is only used if the join style is <a href="qt.html#PenJoinStyle-enum">Qt::MiterJoin</a>.</p>
<p>The painter path generated by the <a href="qpainterpathstroker.html#createStroke">createStroke</a>() function should only be used for outlining the given painter path. Otherwise it may cause unexpected behavior. Generated outlines also require the <a href="qt.html#FillRule-enum">Qt::WindingFill</a> rule which is set by default.</p>
</div>
<p><b>See also </b><a href="qpen.html">QPen</a> and <a href="qbrush.html">QBrush</a>.</p>
<!-- @@@QPainterPathStroker -->
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QPainterPathStroker[overload1]$$$QPainterPathStroker -->
<h3 class="fn"><a name="QPainterPathStroker"></a>QPainterPathStroker::<span class="name">QPainterPathStroker</span> ()</h3>
<p>Creates a new stroker.</p>
<!-- @@@QPainterPathStroker -->
<!-- $$$~QPainterPathStroker[overload1]$$$~QPainterPathStroker -->
<h3 class="fn"><a name="dtor.QPainterPathStroker"></a>QPainterPathStroker::<span class="name">~QPainterPathStroker</span> ()</h3>
<p>Destroys the stroker.</p>
<!-- @@@~QPainterPathStroker -->
<!-- $$$capStyle[overload1]$$$capStyle -->
<h3 class="fn"><a name="capStyle"></a><span class="type"><a href="qt.html#PenCapStyle-enum">Qt::PenCapStyle</a></span> QPainterPathStroker::<span class="name">capStyle</span> () const</h3>
<p>Returns the cap style of the generated outlines.</p>
<p><b>See also </b><a href="qpainterpathstroker.html#setCapStyle">setCapStyle</a>().</p>
<!-- @@@capStyle -->
<!-- $$$createStroke[overload1]$$$createStrokeconstQPainterPath& -->
<h3 class="fn"><a name="createStroke"></a><span class="type"><a href="qpainterpath.html">QPainterPath</a></span> QPainterPathStroker::<span class="name">createStroke</span> ( const <span class="type"><a href="qpainterpath.html">QPainterPath</a></span> &amp; <i>path</i> ) const</h3>
<p>Generates a new path that is a fillable area representing the outline of the given <i>path</i>.</p>
<p>The various design aspects of the outline are based on the stroker's properties: <a href="qpainterpathstroker.html#width">width</a>(), <a href="qpainterpathstroker.html#capStyle">capStyle</a>(), <a href="qpainterpathstroker.html#joinStyle">joinStyle</a>(), <a href="qpainterpathstroker.html#dashPattern">dashPattern</a>(), <a href="qpainterpathstroker.html#curveThreshold">curveThreshold</a>() and <a href="qpainterpathstroker.html#miterLimit">miterLimit</a>().</p>
<p>The generated path should only be used for outlining the given painter path. Otherwise it may cause unexpected behavior. Generated outlines also require the <a href="qt.html#FillRule-enum">Qt::WindingFill</a> rule which is set by default.</p>
<!-- @@@createStroke -->
<!-- $$$curveThreshold[overload1]$$$curveThreshold -->
<h3 class="fn"><a name="curveThreshold"></a><span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> QPainterPathStroker::<span class="name">curveThreshold</span> () const</h3>
<p>Returns the curve flattening threshold for the generated outlines.</p>
<p><b>See also </b><a href="qpainterpathstroker.html#setCurveThreshold">setCurveThreshold</a>().</p>
<!-- @@@curveThreshold -->
<!-- $$$dashOffset[overload1]$$$dashOffset -->
<h3 class="fn"><a name="dashOffset"></a><span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> QPainterPathStroker::<span class="name">dashOffset</span> () const</h3>
<p>Returns the dash offset for the generated outlines.</p>
<p><b>See also </b><a href="qpainterpathstroker.html#setDashOffset">setDashOffset</a>().</p>
<!-- @@@dashOffset -->
<!-- $$$dashPattern[overload1]$$$dashPattern -->
<h3 class="fn"><a name="dashPattern"></a><span class="type"><a href="qvector.html">QVector</a></span>&lt;<span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span>&gt; QPainterPathStroker::<span class="name">dashPattern</span> () const</h3>
<p>Returns the dash pattern for the generated outlines.</p>
<p><b>See also </b><a href="qpainterpathstroker.html#setDashPattern">setDashPattern</a>().</p>
<!-- @@@dashPattern -->
<!-- $$$joinStyle[overload1]$$$joinStyle -->
<h3 class="fn"><a name="joinStyle"></a><span class="type"><a href="qt.html#PenJoinStyle-enum">Qt::PenJoinStyle</a></span> QPainterPathStroker::<span class="name">joinStyle</span> () const</h3>
<p>Returns the join style of the generated outlines.</p>
<p><b>See also </b><a href="qpainterpathstroker.html#setJoinStyle">setJoinStyle</a>().</p>
<!-- @@@joinStyle -->
<!-- $$$miterLimit[overload1]$$$miterLimit -->
<h3 class="fn"><a name="miterLimit"></a><span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> QPainterPathStroker::<span class="name">miterLimit</span> () const</h3>
<p>Returns the miter limit for the generated outlines.</p>
<p><b>See also </b><a href="qpainterpathstroker.html#setMiterLimit">setMiterLimit</a>().</p>
<!-- @@@miterLimit -->
<!-- $$$setCapStyle[overload1]$$$setCapStyleQt::PenCapStyle -->
<h3 class="fn"><a name="setCapStyle"></a><span class="type">void</span> QPainterPathStroker::<span class="name">setCapStyle</span> ( <span class="type"><a href="qt.html#PenCapStyle-enum">Qt::PenCapStyle</a></span> <i>style</i> )</h3>
<p>Sets the cap style of the generated outlines to <i>style</i>. If a dash pattern is set, each segment of the pattern is subject to the cap <i>style</i>.</p>
<p><b>See also </b><a href="qpainterpathstroker.html#capStyle">capStyle</a>().</p>
<!-- @@@setCapStyle -->
<!-- $$$setCurveThreshold[overload1]$$$setCurveThresholdqreal -->
<h3 class="fn"><a name="setCurveThreshold"></a><span class="type">void</span> QPainterPathStroker::<span class="name">setCurveThreshold</span> ( <span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> <i>threshold</i> )</h3>
<p>Specifies the curve flattening <i>threshold</i>, controlling the granularity with which the generated outlines' curve is drawn.</p>
<p>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.</p>
<p><b>See also </b><a href="qpainterpathstroker.html#curveThreshold">curveThreshold</a>().</p>
<!-- @@@setCurveThreshold -->
<!-- $$$setDashOffset[overload1]$$$setDashOffsetqreal -->
<h3 class="fn"><a name="setDashOffset"></a><span class="type">void</span> QPainterPathStroker::<span class="name">setDashOffset</span> ( <span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> <i>offset</i> )</h3>
<p>Sets the dash offset for the generated outlines to <i>offset</i>.</p>
<p>See the documentation for <a href="qpen.html#setDashOffset">QPen::setDashOffset</a>() for a description of the dash offset.</p>
<p><b>See also </b><a href="qpainterpathstroker.html#dashOffset">dashOffset</a>().</p>
<!-- @@@setDashOffset -->
<!-- $$$setDashPattern[overload1]$$$setDashPatternQt::PenStyle -->
<h3 class="fn"><a name="setDashPattern"></a><span class="type">void</span> QPainterPathStroker::<span class="name">setDashPattern</span> ( <span class="type"><a href="qt.html#PenStyle-enum">Qt::PenStyle</a></span> <i>style</i> )</h3>
<p>Sets the dash pattern for the generated outlines to <i>style</i>.</p>
<p><b>See also </b><a href="qpainterpathstroker.html#dashPattern">dashPattern</a>().</p>
<!-- @@@setDashPattern -->
<!-- $$$setDashPattern$$$setDashPatternconstQVector<qreal>& -->
<h3 class="fn"><a name="setDashPattern-2"></a><span class="type">void</span> QPainterPathStroker::<span class="name">setDashPattern</span> ( const <span class="type"><a href="qvector.html">QVector</a></span>&lt;<span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span>&gt; &amp; <i>dashPattern</i> )</h3>
<p>This is an overloaded function.</p>
<p>Sets the dash pattern for the generated outlines to <i>dashPattern</i>. This function makes it possible to specify custom dash patterns.</p>
<p>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.</p>
<p>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.</p>
<!-- @@@setDashPattern -->
<!-- $$$setJoinStyle[overload1]$$$setJoinStyleQt::PenJoinStyle -->
<h3 class="fn"><a name="setJoinStyle"></a><span class="type">void</span> QPainterPathStroker::<span class="name">setJoinStyle</span> ( <span class="type"><a href="qt.html#PenJoinStyle-enum">Qt::PenJoinStyle</a></span> <i>style</i> )</h3>
<p>Sets the join style of the generated outlines to <i>style</i>.</p>
<p><b>See also </b><a href="qpainterpathstroker.html#joinStyle">joinStyle</a>().</p>
<!-- @@@setJoinStyle -->
<!-- $$$setMiterLimit[overload1]$$$setMiterLimitqreal -->
<h3 class="fn"><a name="setMiterLimit"></a><span class="type">void</span> QPainterPathStroker::<span class="name">setMiterLimit</span> ( <span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> <i>limit</i> )</h3>
<p>Sets the miter limit of the generated outlines to <i>limit</i>.</p>
<p>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 <tt>miterlimit * width</tt>.</p>
<p>This value is only used if the join style is <a href="qt.html#PenJoinStyle-enum">Qt::MiterJoin</a>.</p>
<p><b>See also </b><a href="qpainterpathstroker.html#miterLimit">miterLimit</a>().</p>
<!-- @@@setMiterLimit -->
<!-- $$$setWidth[overload1]$$$setWidthqreal -->
<h3 class="fn"><a name="setWidth"></a><span class="type">void</span> QPainterPathStroker::<span class="name">setWidth</span> ( <span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> <i>width</i> )</h3>
<p>Sets the width of the generated outline painter path to <i>width</i>.</p>
<p>The generated outlines will extend approximately 50% of <i>width</i> to each side of the given input path's original outline.</p>
<p><b>See also </b><a href="qpainterpathstroker.html#width">width</a>().</p>
<!-- @@@setWidth -->
<!-- $$$width[overload1]$$$width -->
<h3 class="fn"><a name="width"></a><span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> QPainterPathStroker::<span class="name">width</span> () const</h3>
<p>Returns the width of the generated outlines.</p>
<p><b>See also </b><a href="qpainterpathstroker.html#setWidth">setWidth</a>().</p>
<!-- @@@width -->
</div>
  <div class="ft">
    <span></span>
  </div>
</div> 
<div class="footer">
    <p>
      <acronym title="Copyright">&copy;</acronym> 2012 Nokia Corporation and/or its
      subsidiaries. Documentation contributions included herein are the copyrights of
      their respective owners.</p>
    <br />
    <p>
      The documentation provided herein is licensed under the terms of the
      <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation
      License version 1.3</a> as published by the Free Software Foundation.</p>
    <p>
      Documentation sources may be obtained from <a href="http://www.qt-project.org">
      www.qt-project.org</a>.</p>
    <br />
    <p>
      Nokia, Qt and their respective logos are trademarks of Nokia Corporation 
      in Finland and/or other countries worldwide. All other trademarks are property
      of their respective owners. <a title="Privacy Policy"
      href="http://en.gitorious.org/privacy_policy/">Privacy Policy</a></p>
</div>
</body>
</html>