~oif-team/ubuntu/natty/qt4-x11/xi2.1

« back to all changes in this revision

Viewing changes to doc/html/q3painter.html

  • Committer: Bazaar Package Importer
  • Author(s): Adam Conrad
  • Date: 2005-08-24 04:09:09 UTC
  • Revision ID: james.westby@ubuntu.com-20050824040909-xmxe9jfr4a0w5671
Tags: upstream-4.0.0
ImportĀ upstreamĀ versionĀ 4.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?xml version="1.0" encoding="iso-8859-1"?>
 
2
<!DOCTYPE html
 
3
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
 
4
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
 
5
<!-- /tmp/qt-4.0.0-espenr-1119621036935/qt-x11-opensource-desktop-4.0.0/src/qt3support/painting/q3painter.cpp -->
 
6
<head>
 
7
    <title>Qt 4.0: Q3Painter Class Reference</title>
 
8
    <style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm; }
 
9
a:link { color: #004faf; text-decoration: none }
 
10
a:visited { color: #672967; text-decoration: none }
 
11
td.postheader { font-family: sans-serif }
 
12
tr.address { font-family: sans-serif }
 
13
body { background: #ffffff; color: black; }</style>
 
14
</head>
 
15
<body>
 
16
<table border="0" cellpadding="0" cellspacing="0" width="100%">
 
17
<tr>
 
18
<td align="left" valign="top" width="32"><img src="images/qt-logo.png" align="left" width="32" height="32" border="0" /></td>
 
19
<td width="1">&nbsp;&nbsp;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a>&nbsp;&middot; <a href="classes.html"><font color="#004faf">All&nbsp;Classes</font></a>&nbsp;&middot; <a href="mainclasses.html"><font color="#004faf">Main&nbsp;Classes</font></a>&nbsp;&middot; <a href="annotated.html"><font color="#004faf">Annotated</font></a>&nbsp;&middot; <a href="groups.html"><font color="#004faf">Grouped&nbsp;Classes</font></a>&nbsp;&middot; <a href="functions.html"><font color="#004faf">Functions</font></a></td>
 
20
<td align="right" valign="top" width="230"><img src="images/trolltech-logo.png" align="right" width="203" height="32" border="0" /></td></tr></table><h1 align="center">Q3Painter Class Reference</h1>
 
21
<p>Q3Painter is the compat version of <a href="qpainter.html">QPainter</a>. <a href="#details">More...</a></p>
 
22
<pre>#include &lt;Q3Painter&gt;</pre><p><b>This class is part of the Qt 3 support library.</b> It is provided to keep old source code working. We strongly advise against using it in new code. See the <a href="porting4.html">Porting Guide</a> for more information.</p>
 
23
<p>Part of the <a href="qt3support.html">Qt3Support</a> module.</p>
 
24
<p>Inherits <a href="qpainter.html">QPainter</a>.</p>
 
25
<ul>
 
26
<li><a href="q3painter-members.html">List of all members, including inherited members</a></li>
 
27
</ul>
 
28
<a name="public-functions"></a>
 
29
<h3>Public Functions</h3>
 
30
<ul>
 
31
<li><div class="fn"/><b><a href="q3painter.html#Q3Painter">Q3Painter</a></b> ()</li>
 
32
<li><div class="fn"/><b><a href="q3painter.html#Q3Painter-2">Q3Painter</a></b> ( QPaintDevice * <i>pdev</i> )</li>
 
33
<li><div class="fn"/>void <b><a href="q3painter.html#drawArc">drawArc</a></b> ( const QRect &amp; <i>r</i>, int <i>a</i>, int <i>alen</i> )</li>
 
34
<li><div class="fn"/>void <b><a href="q3painter.html#drawArc-2">drawArc</a></b> ( int <i>x</i>, int <i>y</i>, int <i>w</i>, int <i>h</i>, int <i>startAngle</i>, int <i>spanAngle</i> )</li>
 
35
<li><div class="fn"/>void <b><a href="q3painter.html#drawChord">drawChord</a></b> ( const QRect &amp; <i>r</i>, int <i>a</i>, int <i>alen</i> )</li>
 
36
<li><div class="fn"/>void <b><a href="q3painter.html#drawChord-2">drawChord</a></b> ( int <i>x</i>, int <i>y</i>, int <i>w</i>, int <i>h</i>, int <i>startAngle</i>, int <i>spanAngle</i> )</li>
 
37
<li><div class="fn"/>void <b><a href="q3painter.html#drawEllipse">drawEllipse</a></b> ( const QRect &amp; <i>r</i> )</li>
 
38
<li><div class="fn"/>void <b><a href="q3painter.html#drawEllipse-2">drawEllipse</a></b> ( int <i>x</i>, int <i>y</i>, int <i>width</i>, int <i>height</i> )</li>
 
39
<li><div class="fn"/>void <b><a href="q3painter.html#drawPie">drawPie</a></b> ( const QRect &amp; <i>r</i>, int <i>a</i>, int <i>alen</i> )</li>
 
40
<li><div class="fn"/>void <b><a href="q3painter.html#drawPie-2">drawPie</a></b> ( int <i>x</i>, int <i>y</i>, int <i>w</i>, int <i>h</i>, int <i>startAngle</i>, int <i>spanAngle</i> )</li>
 
41
<li><div class="fn"/>void <b><a href="q3painter.html#drawRect">drawRect</a></b> ( const QRect &amp; <i>r</i> )</li>
 
42
<li><div class="fn"/>void <b><a href="q3painter.html#drawRect-2">drawRect</a></b> ( int <i>x</i>, int <i>y</i>, int <i>w</i>, int <i>h</i> )</li>
 
43
<li><div class="fn"/>void <b><a href="q3painter.html#drawRoundRect">drawRoundRect</a></b> ( const QRect &amp; <i>r</i>, int <i>xrnd</i> = 25, int <i>yrnd</i> = 25 )</li>
 
44
<li><div class="fn"/>void <b><a href="q3painter.html#drawRoundRect-2">drawRoundRect</a></b> ( int <i>x</i>, int <i>y</i>, int <i>w</i>, int <i>h</i>, int <i>xrnd</i> = 25, int <i>yrnd</i> = 25 )</li>
 
45
</ul>
 
46
<ul>
 
47
<li><div class="fn"/>162 public functions inherited from <a href="qpainter.html#public-functions">QPainter</a></li>
 
48
</ul>
 
49
<a name="details"></a>
 
50
<hr />
 
51
<h2>Detailed Description</h2>
 
52
<p>Q3Painter is the compat version of <a href="qpainter.html">QPainter</a>.</p>
 
53
<p>Prior to Qt 4, <a href="qpainter.html">QPainter</a> specialized the pen drawing for rectangle based functions (in particular: drawRect, drawEllipse, drawRoundRect, drawArc, drawChord and drawPie). When stroking a rectangle of width 10, the pen would draw a rectangle of width 10. Drawing a polygon defined by the corner points of the same rectangle the stroke would have a width of 11.</p>
 
54
<p>The reason for this is best explained using the picture below:</p>
 
55
<center><img src="images/q3painter_rationale.png" /></center><p>As we can see, stroking the rectangle so it gets a width of 10, means the pen is drawn on a rectangle on width 9. The polygon, however follows a consistent model.</p>
 
56
<p>In Qt 4, all rectangle based functions have changed to follow the polygon approach, which means that the rectangle defines the size of the fill, and the pen follows the edges of the shape. For pen widths of 0 and 1 this means that the stroke will be inside the shape on the left and the top and outside on the bottom and right.</p>
 
57
<p>The reason for the change in Qt 4 is so that we provide consistency for all drawing functions even with complex transformations.</p>
 
58
<hr />
 
59
<h2>Member Function Documentation</h2>
 
60
<h3 class="fn"><a name="Q3Painter"></a>Q3Painter::Q3Painter ()</h3>
 
61
<p>Constructs a <a href="q3painter.html">Q3Painter</a>.</p>
 
62
<h3 class="fn"><a name="Q3Painter-2"></a>Q3Painter::Q3Painter ( <a href="qpaintdevice.html">QPaintDevice</a> * <i>pdev</i> )</h3>
 
63
<p>Constructs a <a href="q3painter.html">Q3Painter</a> that operates on device <i>pdev</i>.</p>
 
64
<h3 class="fn"><a name="drawArc"></a>void Q3Painter::drawArc ( const <a href="qrect.html">QRect</a> &amp; <i>r</i>, int <i>a</i>, int <i>alen</i> )</h3>
 
65
<p>Draws an arc defined by the rectangle <i>r</i>, the start angle <i>a</i> and the arc length <i>alen</i>.</p>
 
66
<p>The angles <i>a</i> and <i>alen</i> are 1/16th of a degree, i.e. a full circle equals 5760 (16*360). Positive values of <i>a</i> and <i>alen</i> mean counter-clockwise while negative values mean the clockwise direction. Zero degrees is at the 3 o'clock position.</p>
 
67
<p>Example:</p>
 
68
<pre>&nbsp;   QPainter p(myWidget);
 
69
    p.drawArc(QRect(10,10, 70,100), 100*16, 160*16); // draws a &quot;(&quot; arc</pre>
 
70
<p>See also <a href="q3painter.html#drawPie">drawPie</a>() and <a href="q3painter.html#drawChord">drawChord</a>().</p>
 
71
<h3 class="fn"><a name="drawArc-2"></a>void Q3Painter::drawArc ( int <i>x</i>, int <i>y</i>, int <i>w</i>, int <i>h</i>, int <i>startAngle</i>, int <i>spanAngle</i> )</h3>
 
72
<p>This is an overloaded member function, provided for convenience. It behaves essentially like the above function.</p>
 
73
<p>Draws the arc that fits inside the rectangle (<i>x</i>, <i>y</i>, <i>w</i>, <i>h</i>), with the given <i>startAngle</i> and <i>spanAngle</i>.</p>
 
74
<h3 class="fn"><a name="drawChord"></a>void Q3Painter::drawChord ( const <a href="qrect.html">QRect</a> &amp; <i>r</i>, int <i>a</i>, int <i>alen</i> )</h3>
 
75
<p>Draws a chord defined by the rectangle <i>r</i>, the start angle <i>a</i> and the arc length <i>alen</i>.</p>
 
76
<p>The chord is filled with the current <a href="qpainter.html#brush">brush</a>().</p>
 
77
<p>The angles <i>a</i> and <i>alen</i> are 1/16th of a degree, i.e. a full circle equals 5760 (16*360). Positive values of <i>a</i> and <i>alen</i> mean counter-clockwise while negative values mean the clockwise direction. Zero degrees is at the 3 o'clock position.</p>
 
78
<p>See also <a href="q3painter.html#drawArc">drawArc</a>() and <a href="q3painter.html#drawPie">drawPie</a>().</p>
 
79
<h3 class="fn"><a name="drawChord-2"></a>void Q3Painter::drawChord ( int <i>x</i>, int <i>y</i>, int <i>w</i>, int <i>h</i>, int <i>startAngle</i>, int <i>spanAngle</i> )</h3>
 
80
<p>This is an overloaded member function, provided for convenience. It behaves essentially like the above function.</p>
 
81
<p>Draws a chord that fits inside the rectangle (<i>x</i>, <i>y</i>, <i>w</i>, <i>h</i>) with the given <i>startAngle</i> and <i>spanAngle</i>.</p>
 
82
<h3 class="fn"><a name="drawEllipse"></a>void Q3Painter::drawEllipse ( const <a href="qrect.html">QRect</a> &amp; <i>r</i> )</h3>
 
83
<p>Draws the ellipse that fits inside the bounds <i>r</i> using the current pen and brush.</p>
 
84
<h3 class="fn"><a name="drawEllipse-2"></a>void Q3Painter::drawEllipse ( int <i>x</i>, int <i>y</i>, int <i>width</i>, int <i>height</i> )</h3>
 
85
<p>This is an overloaded member function, provided for convenience. It behaves essentially like the above function.</p>
 
86
<p>Draws an ellipse that fits inside the bounds specified by <i>x</i>, <i>y</i>, <i>width</i> and <i>height</i> using the current pen and brush.</p>
 
87
<h3 class="fn"><a name="drawPie"></a>void Q3Painter::drawPie ( const <a href="qrect.html">QRect</a> &amp; <i>r</i>, int <i>a</i>, int <i>alen</i> )</h3>
 
88
<p>Draws a pie defined by the rectangle <i>r</i>, the start angle <i>a</i> and the arc length <i>alen</i>.</p>
 
89
<p>The pie is filled with the current <a href="qpainter.html#brush">brush</a>().</p>
 
90
<p>The angles <i>a</i> and <i>alen</i> are 1/16th of a degree, i.e. a full circle equals 5760 (16*360). Positive values of <i>a</i> and <i>alen</i> mean counter-clockwise while negative values mean the clockwise direction. Zero degrees is at the 3 o'clock position.</p>
 
91
<p>See also <a href="q3painter.html#drawArc">drawArc</a>() and <a href="q3painter.html#drawChord">drawChord</a>().</p>
 
92
<h3 class="fn"><a name="drawPie-2"></a>void Q3Painter::drawPie ( int <i>x</i>, int <i>y</i>, int <i>w</i>, int <i>h</i>, int <i>startAngle</i>, int <i>spanAngle</i> )</h3>
 
93
<p>This is an overloaded member function, provided for convenience. It behaves essentially like the above function.</p>
 
94
<p>Draws a pie segment that fits inside the bounds (<i>x</i>, <i>y</i>, <i>w</i>, <i>h</i>) with the given <i>startAngle</i> and <i>spanAngle</i>.</p>
 
95
<h3 class="fn"><a name="drawRect"></a>void Q3Painter::drawRect ( const <a href="qrect.html">QRect</a> &amp; <i>r</i> )</h3>
 
96
<p>Draws a rectangle that fits inside the rectangle <i>r</i> using the current pen and brush.</p>
 
97
<h3 class="fn"><a name="drawRect-2"></a>void Q3Painter::drawRect ( int <i>x</i>, int <i>y</i>, int <i>w</i>, int <i>h</i> )</h3>
 
98
<p>This is an overloaded member function, provided for convenience. It behaves essentially like the above function.</p>
 
99
<p>Draws the rectangle that fits inside the bounds specified by <i>x</i>, <i>y</i>, <i>w</i> and <i>h</i> using the current pen and brush.</p>
 
100
<h3 class="fn"><a name="drawRoundRect"></a>void Q3Painter::drawRoundRect ( const <a href="qrect.html">QRect</a> &amp; <i>r</i>, int <i>xrnd</i> = 25, int <i>yrnd</i> = 25 )</h3>
 
101
<p>Draws a rounded rect that fits into the bounds <i>r</i> using the current pen and brush. The parameters <i>xrnd</i> and <i>yrnd</i> specifies the roundness in x and y direction.</p>
 
102
<h3 class="fn"><a name="drawRoundRect-2"></a>void Q3Painter::drawRoundRect ( int <i>x</i>, int <i>y</i>, int <i>w</i>, int <i>h</i>, int <i>xrnd</i> = 25, int <i>yrnd</i> = 25 )</h3>
 
103
<p>This is an overloaded member function, provided for convenience. It behaves essentially like the above function.</p>
 
104
<p>Draws a rounded rect that fits into the bounds <i>x</i>, <i>y</i>, <i>w</i> and <i>h</i> using the current pen and brush. The parameters <i>xrnd</i> and <i>yrnd</i> specifies the roundness in x and y direction.</p>
 
105
<p /><address><hr /><div align="center">
 
106
<table width="100%" cellspacing="0" border="0"><tr class="address">
 
107
<td width="30%">Copyright &copy; 2005 <a href="trolltech.html">Trolltech</a></td>
 
108
<td width="40%" align="center"><a href="trademarks.html">Trademarks</a></td>
 
109
<td width="30%" align="right"><div align="right">Qt 4.0.0</div></td>
 
110
</tr></table></div></address></body>
 
111
</html>