|
1 <!DOCTYPE html> |
|
2 <html><head> |
|
3 <title>eric7.EricGraphics.EricArrowItem</title> |
|
4 <meta charset="UTF-8"> |
|
5 <link rel="stylesheet" href="styles.css"> |
|
6 </head> |
|
7 <body> |
|
8 <a NAME="top" ID="top"></a> |
|
9 <h1>eric7.EricGraphics.EricArrowItem</h1> |
|
10 |
|
11 <p> |
|
12 Module implementing a graphics item subclass for an arrow. |
|
13 </p> |
|
14 <h3>Global Attributes</h3> |
|
15 |
|
16 <table> |
|
17 <tr><td>ArrowheadAngleFactor</td></tr> |
|
18 </table> |
|
19 <h3>Classes</h3> |
|
20 |
|
21 <table> |
|
22 |
|
23 <tr> |
|
24 <td><a href="#EricArrowItem">EricArrowItem</a></td> |
|
25 <td>Class implementing an arrow graphics item subclass.</td> |
|
26 </tr> |
|
27 <tr> |
|
28 <td><a href="#EricArrowType">EricArrowType</a></td> |
|
29 <td>Class defining the arrow types.</td> |
|
30 </tr> |
|
31 </table> |
|
32 <h3>Functions</h3> |
|
33 |
|
34 <table> |
|
35 <tr><td>None</td></tr> |
|
36 </table> |
|
37 <hr /> |
|
38 <hr /> |
|
39 <a NAME="EricArrowItem" ID="EricArrowItem"></a> |
|
40 <h2>EricArrowItem</h2> |
|
41 |
|
42 <p> |
|
43 Class implementing an arrow graphics item subclass. |
|
44 </p> |
|
45 <h3>Derived from</h3> |
|
46 QAbstractGraphicsShapeItem |
|
47 <h3>Class Attributes</h3> |
|
48 |
|
49 <table> |
|
50 <tr><td>None</td></tr> |
|
51 </table> |
|
52 <h3>Class Methods</h3> |
|
53 |
|
54 <table> |
|
55 <tr><td>None</td></tr> |
|
56 </table> |
|
57 <h3>Methods</h3> |
|
58 |
|
59 <table> |
|
60 |
|
61 <tr> |
|
62 <td><a href="#EricArrowItem.__init__">EricArrowItem</a></td> |
|
63 <td>Constructor</td> |
|
64 </tr> |
|
65 <tr> |
|
66 <td><a href="#EricArrowItem.boundingRect">boundingRect</a></td> |
|
67 <td>Public method to return the bounding rectangle.</td> |
|
68 </tr> |
|
69 <tr> |
|
70 <td><a href="#EricArrowItem.paint">paint</a></td> |
|
71 <td>Public method to paint the item in local coordinates.</td> |
|
72 </tr> |
|
73 <tr> |
|
74 <td><a href="#EricArrowItem.setEndPoint">setEndPoint</a></td> |
|
75 <td>Public method to set the end point.</td> |
|
76 </tr> |
|
77 <tr> |
|
78 <td><a href="#EricArrowItem.setPoints">setPoints</a></td> |
|
79 <td>Public method to set the start and end points of the line.</td> |
|
80 </tr> |
|
81 <tr> |
|
82 <td><a href="#EricArrowItem.setStartPoint">setStartPoint</a></td> |
|
83 <td>Public method to set the start point.</td> |
|
84 </tr> |
|
85 </table> |
|
86 <h3>Static Methods</h3> |
|
87 |
|
88 <table> |
|
89 <tr><td>None</td></tr> |
|
90 </table> |
|
91 |
|
92 <a NAME="EricArrowItem.__init__" ID="EricArrowItem.__init__"></a> |
|
93 <h4>EricArrowItem (Constructor)</h4> |
|
94 <b>EricArrowItem</b>(<i>origin=None, end=None, filled=False, arrowType=EricArrowType.NORMAL, colors=None, parent=None</i>) |
|
95 |
|
96 <p> |
|
97 Constructor |
|
98 </p> |
|
99 <dl> |
|
100 |
|
101 <dt><i>origin</i> (QPointF)</dt> |
|
102 <dd> |
|
103 origin of the arrow |
|
104 </dd> |
|
105 <dt><i>end</i> (QPointF)</dt> |
|
106 <dd> |
|
107 end point of the arrow |
|
108 </dd> |
|
109 <dt><i>filled</i> (bool)</dt> |
|
110 <dd> |
|
111 flag indicating a filled arrow head |
|
112 </dd> |
|
113 <dt><i>arrowType</i> (EricArrowType)</dt> |
|
114 <dd> |
|
115 arrow type |
|
116 </dd> |
|
117 <dt><i>colors</i> (tuple of (QColor, QColor))</dt> |
|
118 <dd> |
|
119 tuple containing the foreground and background colors |
|
120 </dd> |
|
121 <dt><i>parent</i> (QGraphicsItem)</dt> |
|
122 <dd> |
|
123 reference to the parent object |
|
124 </dd> |
|
125 </dl> |
|
126 <a NAME="EricArrowItem.boundingRect" ID="EricArrowItem.boundingRect"></a> |
|
127 <h4>EricArrowItem.boundingRect</h4> |
|
128 <b>boundingRect</b>(<i></i>) |
|
129 |
|
130 <p> |
|
131 Public method to return the bounding rectangle. |
|
132 </p> |
|
133 <dl> |
|
134 <dt>Return:</dt> |
|
135 <dd> |
|
136 bounding rectangle (QRectF) |
|
137 </dd> |
|
138 </dl> |
|
139 <a NAME="EricArrowItem.paint" ID="EricArrowItem.paint"></a> |
|
140 <h4>EricArrowItem.paint</h4> |
|
141 <b>paint</b>(<i>painter, option, widget=None</i>) |
|
142 |
|
143 <p> |
|
144 Public method to paint the item in local coordinates. |
|
145 </p> |
|
146 <dl> |
|
147 |
|
148 <dt><i>painter</i></dt> |
|
149 <dd> |
|
150 reference to the painter object (QPainter) |
|
151 </dd> |
|
152 <dt><i>option</i></dt> |
|
153 <dd> |
|
154 style options (QStyleOptionGraphicsItem) |
|
155 </dd> |
|
156 <dt><i>widget</i></dt> |
|
157 <dd> |
|
158 optional reference to the widget painted on (QWidget) |
|
159 </dd> |
|
160 </dl> |
|
161 <a NAME="EricArrowItem.setEndPoint" ID="EricArrowItem.setEndPoint"></a> |
|
162 <h4>EricArrowItem.setEndPoint</h4> |
|
163 <b>setEndPoint</b>(<i>x, y</i>) |
|
164 |
|
165 <p> |
|
166 Public method to set the end point. |
|
167 </p> |
|
168 <p> |
|
169 <b>Note:</b> This method does not redraw the item. |
|
170 </p> |
|
171 <dl> |
|
172 |
|
173 <dt><i>x</i></dt> |
|
174 <dd> |
|
175 x-coordinate of the end point (float) |
|
176 </dd> |
|
177 <dt><i>y</i></dt> |
|
178 <dd> |
|
179 y-coordinate of the end point (float) |
|
180 </dd> |
|
181 </dl> |
|
182 <a NAME="EricArrowItem.setPoints" ID="EricArrowItem.setPoints"></a> |
|
183 <h4>EricArrowItem.setPoints</h4> |
|
184 <b>setPoints</b>(<i>xa, ya, xb, yb</i>) |
|
185 |
|
186 <p> |
|
187 Public method to set the start and end points of the line. |
|
188 </p> |
|
189 <p> |
|
190 <b>Note:</b> This method does not redraw the item. |
|
191 </p> |
|
192 <dl> |
|
193 |
|
194 <dt><i>xa</i></dt> |
|
195 <dd> |
|
196 x-coordinate of the start point (float) |
|
197 </dd> |
|
198 <dt><i>ya</i></dt> |
|
199 <dd> |
|
200 y-coordinate of the start point (float) |
|
201 </dd> |
|
202 <dt><i>xb</i></dt> |
|
203 <dd> |
|
204 x-coordinate of the end point (float) |
|
205 </dd> |
|
206 <dt><i>yb</i></dt> |
|
207 <dd> |
|
208 y-coordinate of the end point (float) |
|
209 </dd> |
|
210 </dl> |
|
211 <a NAME="EricArrowItem.setStartPoint" ID="EricArrowItem.setStartPoint"></a> |
|
212 <h4>EricArrowItem.setStartPoint</h4> |
|
213 <b>setStartPoint</b>(<i>x, y</i>) |
|
214 |
|
215 <p> |
|
216 Public method to set the start point. |
|
217 </p> |
|
218 <p> |
|
219 <b>Note:</b> This method does not redraw the item. |
|
220 </p> |
|
221 <dl> |
|
222 |
|
223 <dt><i>x</i></dt> |
|
224 <dd> |
|
225 x-coordinate of the start point (float) |
|
226 </dd> |
|
227 <dt><i>y</i></dt> |
|
228 <dd> |
|
229 y-coordinate of the start point (float) |
|
230 </dd> |
|
231 </dl> |
|
232 <div align="right"><a href="#top">Up</a></div> |
|
233 <hr /> |
|
234 <hr /> |
|
235 <a NAME="EricArrowType" ID="EricArrowType"></a> |
|
236 <h2>EricArrowType</h2> |
|
237 |
|
238 <p> |
|
239 Class defining the arrow types. |
|
240 </p> |
|
241 <h3>Derived from</h3> |
|
242 enum.Enum |
|
243 <h3>Class Attributes</h3> |
|
244 |
|
245 <table> |
|
246 <tr><td>NORMAL</td></tr><tr><td>WIDE</td></tr> |
|
247 </table> |
|
248 <h3>Class Methods</h3> |
|
249 |
|
250 <table> |
|
251 <tr><td>None</td></tr> |
|
252 </table> |
|
253 <h3>Methods</h3> |
|
254 |
|
255 <table> |
|
256 <tr><td>None</td></tr> |
|
257 </table> |
|
258 <h3>Static Methods</h3> |
|
259 |
|
260 <table> |
|
261 <tr><td>None</td></tr> |
|
262 </table> |
|
263 |
|
264 <div align="right"><a href="#top">Up</a></div> |
|
265 <hr /> |
|
266 </body></html> |