5 <link rel="stylesheet" href="styles.css"> |
5 <link rel="stylesheet" href="styles.css"> |
6 </head> |
6 </head> |
7 <body> |
7 <body> |
8 <a NAME="top" ID="top"></a> |
8 <a NAME="top" ID="top"></a> |
9 <h1>eric7.EricGraphics.EricGraphicsView</h1> |
9 <h1>eric7.EricGraphics.EricGraphicsView</h1> |
10 |
|
11 <p> |
10 <p> |
12 Module implementing a canvas view class. |
11 Module implementing a canvas view class. |
13 </p> |
12 </p> |
|
13 |
14 <h3>Global Attributes</h3> |
14 <h3>Global Attributes</h3> |
15 |
|
16 <table> |
15 <table> |
17 <tr><td>None</td></tr> |
16 <tr><td>None</td></tr> |
18 </table> |
17 </table> |
|
18 |
19 <h3>Classes</h3> |
19 <h3>Classes</h3> |
20 |
20 <table> |
21 <table> |
|
22 |
|
23 <tr> |
21 <tr> |
24 <td><a href="#EricGraphicsView">EricGraphicsView</a></td> |
22 <td><a href="#EricGraphicsView">EricGraphicsView</a></td> |
25 <td>Class implementing a graphics view.</td> |
23 <td>Class implementing a graphics view.</td> |
26 </tr> |
24 </tr> |
27 </table> |
25 </table> |
|
26 |
28 <h3>Functions</h3> |
27 <h3>Functions</h3> |
29 |
|
30 <table> |
28 <table> |
31 <tr><td>None</td></tr> |
29 <tr><td>None</td></tr> |
32 </table> |
30 </table> |
|
31 |
33 <hr /> |
32 <hr /> |
34 <hr /> |
33 <hr /> |
35 <a NAME="EricGraphicsView" ID="EricGraphicsView"></a> |
34 <a NAME="EricGraphicsView" ID="EricGraphicsView"></a> |
36 <h2>EricGraphicsView</h2> |
35 <h2>EricGraphicsView</h2> |
37 |
|
38 <p> |
36 <p> |
39 Class implementing a graphics view. |
37 Class implementing a graphics view. |
40 </p> |
38 </p> |
|
39 |
41 <h3>Signals</h3> |
40 <h3>Signals</h3> |
42 <dl> |
41 <dl> |
43 |
42 |
44 <dt>zoomValueChanged(int)</dt> |
43 <dt>zoomValueChanged(int)</dt> |
45 <dd> |
44 <dd> |
47 </dd> |
46 </dd> |
48 </dl> |
47 </dl> |
49 <h3>Derived from</h3> |
48 <h3>Derived from</h3> |
50 QGraphicsView |
49 QGraphicsView |
51 <h3>Class Attributes</h3> |
50 <h3>Class Attributes</h3> |
52 |
51 <table> |
53 <table> |
52 <tr><td>ZoomLevelDefault</td></tr> |
54 <tr><td>ZoomLevelDefault</td></tr><tr><td>ZoomLevels</td></tr> |
53 <tr><td>ZoomLevels</td></tr> |
55 </table> |
54 </table> |
|
55 |
56 <h3>Class Methods</h3> |
56 <h3>Class Methods</h3> |
57 |
|
58 <table> |
57 <table> |
59 <tr><td>None</td></tr> |
58 <tr><td>None</td></tr> |
60 </table> |
59 </table> |
|
60 |
61 <h3>Methods</h3> |
61 <h3>Methods</h3> |
62 |
62 <table> |
63 <table> |
|
64 |
|
65 <tr> |
63 <tr> |
66 <td><a href="#EricGraphicsView.__init__">EricGraphicsView</a></td> |
64 <td><a href="#EricGraphicsView.__init__">EricGraphicsView</a></td> |
67 <td>Constructor</td> |
65 <td>Constructor</td> |
68 </tr> |
66 </tr> |
69 <tr> |
67 <tr> |
137 <tr> |
135 <tr> |
138 <td><a href="#EricGraphicsView.zoomReset">zoomReset</a></td> |
136 <td><a href="#EricGraphicsView.zoomReset">zoomReset</a></td> |
139 <td>Public method to handle the reset the zoom value.</td> |
137 <td>Public method to handle the reset the zoom value.</td> |
140 </tr> |
138 </tr> |
141 </table> |
139 </table> |
|
140 |
142 <h3>Static Methods</h3> |
141 <h3>Static Methods</h3> |
143 |
|
144 <table> |
142 <table> |
145 <tr><td>None</td></tr> |
143 <tr><td>None</td></tr> |
146 </table> |
144 </table> |
|
145 |
147 |
146 |
148 <a NAME="EricGraphicsView.__init__" ID="EricGraphicsView.__init__"></a> |
147 <a NAME="EricGraphicsView.__init__" ID="EricGraphicsView.__init__"></a> |
149 <h4>EricGraphicsView (Constructor)</h4> |
148 <h4>EricGraphicsView (Constructor)</h4> |
150 <b>EricGraphicsView</b>(<i>scene, parent=None</i>) |
149 <b>EricGraphicsView</b>(<i>scene, parent=None</i>) |
151 |
|
152 <p> |
150 <p> |
153 Constructor |
151 Constructor |
154 </p> |
152 </p> |
|
153 |
155 <dl> |
154 <dl> |
156 |
155 |
157 <dt><i>scene</i> (QGraphicsScene)</dt> |
156 <dt><i>scene</i> (QGraphicsScene)</dt> |
158 <dd> |
157 <dd> |
159 reference to the scene object |
158 reference to the scene object |
164 </dd> |
163 </dd> |
165 </dl> |
164 </dl> |
166 <a NAME="EricGraphicsView.__getDiagram" ID="EricGraphicsView.__getDiagram"></a> |
165 <a NAME="EricGraphicsView.__getDiagram" ID="EricGraphicsView.__getDiagram"></a> |
167 <h4>EricGraphicsView.__getDiagram</h4> |
166 <h4>EricGraphicsView.__getDiagram</h4> |
168 <b>__getDiagram</b>(<i>rect, imageFormat="PNG", filename=None</i>) |
167 <b>__getDiagram</b>(<i>rect, imageFormat="PNG", filename=None</i>) |
169 |
|
170 <p> |
168 <p> |
171 Private method to retrieve the diagram from the scene fitting it |
169 Private method to retrieve the diagram from the scene fitting it |
172 in the minimum rectangle. |
170 in the minimum rectangle. |
173 </p> |
171 </p> |
|
172 |
174 <dl> |
173 <dl> |
175 |
174 |
176 <dt><i>rect</i> (QRectF)</dt> |
175 <dt><i>rect</i> (QRectF)</dt> |
177 <dd> |
176 <dd> |
178 minimum rectangle fitting the diagram |
177 minimum rectangle fitting the diagram |
199 </dd> |
198 </dd> |
200 </dl> |
199 </dl> |
201 <a NAME="EricGraphicsView.__levelForZoom" ID="EricGraphicsView.__levelForZoom"></a> |
200 <a NAME="EricGraphicsView.__levelForZoom" ID="EricGraphicsView.__levelForZoom"></a> |
202 <h4>EricGraphicsView.__levelForZoom</h4> |
201 <h4>EricGraphicsView.__levelForZoom</h4> |
203 <b>__levelForZoom</b>(<i>zoom</i>) |
202 <b>__levelForZoom</b>(<i>zoom</i>) |
204 |
|
205 <p> |
203 <p> |
206 Private method determining the zoom level index given a zoom factor. |
204 Private method determining the zoom level index given a zoom factor. |
207 </p> |
205 </p> |
|
206 |
208 <dl> |
207 <dl> |
209 |
208 |
210 <dt><i>zoom</i> (int)</dt> |
209 <dt><i>zoom</i> (int)</dt> |
211 <dd> |
210 <dd> |
212 zoom factor |
211 zoom factor |
225 </dd> |
224 </dd> |
226 </dl> |
225 </dl> |
227 <a NAME="EricGraphicsView._getDiagramRect" ID="EricGraphicsView._getDiagramRect"></a> |
226 <a NAME="EricGraphicsView._getDiagramRect" ID="EricGraphicsView._getDiagramRect"></a> |
228 <h4>EricGraphicsView._getDiagramRect</h4> |
227 <h4>EricGraphicsView._getDiagramRect</h4> |
229 <b>_getDiagramRect</b>(<i>border=0</i>) |
228 <b>_getDiagramRect</b>(<i>border=0</i>) |
230 |
|
231 <p> |
229 <p> |
232 Protected method to calculate the minimum rectangle fitting the |
230 Protected method to calculate the minimum rectangle fitting the |
233 diagram. |
231 diagram. |
234 </p> |
232 </p> |
|
233 |
235 <dl> |
234 <dl> |
236 |
235 |
237 <dt><i>border</i> (int)</dt> |
236 <dt><i>border</i> (int)</dt> |
238 <dd> |
237 <dd> |
239 border width to include in the calculation |
238 border width to include in the calculation |
252 </dd> |
251 </dd> |
253 </dl> |
252 </dl> |
254 <a NAME="EricGraphicsView._getDiagramSize" ID="EricGraphicsView._getDiagramSize"></a> |
253 <a NAME="EricGraphicsView._getDiagramSize" ID="EricGraphicsView._getDiagramSize"></a> |
255 <h4>EricGraphicsView._getDiagramSize</h4> |
254 <h4>EricGraphicsView._getDiagramSize</h4> |
256 <b>_getDiagramSize</b>(<i>border=0</i>) |
255 <b>_getDiagramSize</b>(<i>border=0</i>) |
257 |
|
258 <p> |
256 <p> |
259 Protected method to calculate the minimum size fitting the diagram. |
257 Protected method to calculate the minimum size fitting the diagram. |
260 </p> |
258 </p> |
|
259 |
261 <dl> |
260 <dl> |
262 |
261 |
263 <dt><i>border</i> (int)</dt> |
262 <dt><i>border</i> (int)</dt> |
264 <dd> |
263 <dd> |
265 border width to include in the calculation |
264 border width to include in the calculation |
278 </dd> |
277 </dd> |
279 </dl> |
278 </dl> |
280 <a NAME="EricGraphicsView.autoAdjustSceneSize" ID="EricGraphicsView.autoAdjustSceneSize"></a> |
279 <a NAME="EricGraphicsView.autoAdjustSceneSize" ID="EricGraphicsView.autoAdjustSceneSize"></a> |
281 <h4>EricGraphicsView.autoAdjustSceneSize</h4> |
280 <h4>EricGraphicsView.autoAdjustSceneSize</h4> |
282 <b>autoAdjustSceneSize</b>(<i>limit=False</i>) |
281 <b>autoAdjustSceneSize</b>(<i>limit=False</i>) |
283 |
|
284 <p> |
282 <p> |
285 Public method to adjust the scene size to the diagram size. |
283 Public method to adjust the scene size to the diagram size. |
286 </p> |
284 </p> |
|
285 |
287 <dl> |
286 <dl> |
288 |
287 |
289 <dt><i>limit</i> (bool)</dt> |
288 <dt><i>limit</i> (bool)</dt> |
290 <dd> |
289 <dd> |
291 flag indicating to limit the scene to the |
290 flag indicating to limit the scene to the |
293 </dd> |
292 </dd> |
294 </dl> |
293 </dl> |
295 <a NAME="EricGraphicsView.filteredItems" ID="EricGraphicsView.filteredItems"></a> |
294 <a NAME="EricGraphicsView.filteredItems" ID="EricGraphicsView.filteredItems"></a> |
296 <h4>EricGraphicsView.filteredItems</h4> |
295 <h4>EricGraphicsView.filteredItems</h4> |
297 <b>filteredItems</b>(<i>items</i>) |
296 <b>filteredItems</b>(<i>items</i>) |
298 |
|
299 <p> |
297 <p> |
300 Public method to filter a list of items. |
298 Public method to filter a list of items. |
301 </p> |
299 </p> |
|
300 |
302 <dl> |
301 <dl> |
303 |
302 |
304 <dt><i>items</i> (QGraphicsItem)</dt> |
303 <dt><i>items</i> (QGraphicsItem)</dt> |
305 <dd> |
304 <dd> |
306 list of items as returned by the scene object |
305 list of items as returned by the scene object |
338 </dd> |
337 </dd> |
339 </dl> |
338 </dl> |
340 <a NAME="EricGraphicsView.getDrawingColors" ID="EricGraphicsView.getDrawingColors"></a> |
339 <a NAME="EricGraphicsView.getDrawingColors" ID="EricGraphicsView.getDrawingColors"></a> |
341 <h4>EricGraphicsView.getDrawingColors</h4> |
340 <h4>EricGraphicsView.getDrawingColors</h4> |
342 <b>getDrawingColors</b>(<i></i>) |
341 <b>getDrawingColors</b>(<i></i>) |
343 |
|
344 <p> |
342 <p> |
345 Public method to get the configured drawing colors. |
343 Public method to get the configured drawing colors. |
346 </p> |
344 </p> |
|
345 |
347 <dl> |
346 <dl> |
348 <dt>Return:</dt> |
347 <dt>Return:</dt> |
349 <dd> |
348 <dd> |
350 tuple containing the foreground and background colors |
349 tuple containing the foreground and background colors |
351 </dd> |
350 </dd> |
376 </dd> |
375 </dd> |
377 </dl> |
376 </dl> |
378 <a NAME="EricGraphicsView.printDiagram" ID="EricGraphicsView.printDiagram"></a> |
377 <a NAME="EricGraphicsView.printDiagram" ID="EricGraphicsView.printDiagram"></a> |
379 <h4>EricGraphicsView.printDiagram</h4> |
378 <h4>EricGraphicsView.printDiagram</h4> |
380 <b>printDiagram</b>(<i>printer, diagramName=""</i>) |
379 <b>printDiagram</b>(<i>printer, diagramName=""</i>) |
381 |
|
382 <p> |
380 <p> |
383 Public method to print the diagram. |
381 Public method to print the diagram. |
384 </p> |
382 </p> |
|
383 |
385 <dl> |
384 <dl> |
386 |
385 |
387 <dt><i>printer</i> (QPrinter)</dt> |
386 <dt><i>printer</i> (QPrinter)</dt> |
388 <dd> |
387 <dd> |
389 reference to a ready configured printer object |
388 reference to a ready configured printer object |
394 </dd> |
393 </dd> |
395 </dl> |
394 </dl> |
396 <a NAME="EricGraphicsView.resizeScene" ID="EricGraphicsView.resizeScene"></a> |
395 <a NAME="EricGraphicsView.resizeScene" ID="EricGraphicsView.resizeScene"></a> |
397 <h4>EricGraphicsView.resizeScene</h4> |
396 <h4>EricGraphicsView.resizeScene</h4> |
398 <b>resizeScene</b>(<i>amount, isWidth=True</i>) |
397 <b>resizeScene</b>(<i>amount, isWidth=True</i>) |
399 |
|
400 <p> |
398 <p> |
401 Public method to resize the scene. |
399 Public method to resize the scene. |
402 </p> |
400 </p> |
|
401 |
403 <dl> |
402 <dl> |
404 |
403 |
405 <dt><i>amount</i> (int)</dt> |
404 <dt><i>amount</i> (int)</dt> |
406 <dd> |
405 <dd> |
407 size increment |
406 size increment |
412 </dd> |
411 </dd> |
413 </dl> |
412 </dl> |
414 <a NAME="EricGraphicsView.saveImage" ID="EricGraphicsView.saveImage"></a> |
413 <a NAME="EricGraphicsView.saveImage" ID="EricGraphicsView.saveImage"></a> |
415 <h4>EricGraphicsView.saveImage</h4> |
414 <h4>EricGraphicsView.saveImage</h4> |
416 <b>saveImage</b>(<i>filename, imageFormat="PNG"</i>) |
415 <b>saveImage</b>(<i>filename, imageFormat="PNG"</i>) |
417 |
|
418 <p> |
416 <p> |
419 Public method to save the scene to a file. |
417 Public method to save the scene to a file. |
420 </p> |
418 </p> |
|
419 |
421 <dl> |
420 <dl> |
422 |
421 |
423 <dt><i>filename</i> (float)</dt> |
422 <dt><i>filename</i> (float)</dt> |
424 <dd> |
423 <dd> |
425 name of the file to write the image to |
424 name of the file to write the image to |
442 </dd> |
441 </dd> |
443 </dl> |
442 </dl> |
444 <a NAME="EricGraphicsView.setSceneSize" ID="EricGraphicsView.setSceneSize"></a> |
443 <a NAME="EricGraphicsView.setSceneSize" ID="EricGraphicsView.setSceneSize"></a> |
445 <h4>EricGraphicsView.setSceneSize</h4> |
444 <h4>EricGraphicsView.setSceneSize</h4> |
446 <b>setSceneSize</b>(<i>width, height</i>) |
445 <b>setSceneSize</b>(<i>width, height</i>) |
447 |
|
448 <p> |
446 <p> |
449 Public method to set the scene size. |
447 Public method to set the scene size. |
450 </p> |
448 </p> |
|
449 |
451 <dl> |
450 <dl> |
452 |
451 |
453 <dt><i>width</i> (float)</dt> |
452 <dt><i>width</i> (float)</dt> |
454 <dd> |
453 <dd> |
455 width for the scene |
454 width for the scene |
460 </dd> |
459 </dd> |
461 </dl> |
460 </dl> |
462 <a NAME="EricGraphicsView.setZoom" ID="EricGraphicsView.setZoom"></a> |
461 <a NAME="EricGraphicsView.setZoom" ID="EricGraphicsView.setZoom"></a> |
463 <h4>EricGraphicsView.setZoom</h4> |
462 <h4>EricGraphicsView.setZoom</h4> |
464 <b>setZoom</b>(<i>value</i>) |
463 <b>setZoom</b>(<i>value</i>) |
465 |
|
466 <p> |
464 <p> |
467 Public method to set the zoom value in percent. |
465 Public method to set the zoom value in percent. |
468 </p> |
466 </p> |
|
467 |
469 <dl> |
468 <dl> |
470 |
469 |
471 <dt><i>value</i> (int)</dt> |
470 <dt><i>value</i> (int)</dt> |
472 <dd> |
471 <dd> |
473 zoom value in percent |
472 zoom value in percent |
474 </dd> |
473 </dd> |
475 </dl> |
474 </dl> |
476 <a NAME="EricGraphicsView.zoom" ID="EricGraphicsView.zoom"></a> |
475 <a NAME="EricGraphicsView.zoom" ID="EricGraphicsView.zoom"></a> |
477 <h4>EricGraphicsView.zoom</h4> |
476 <h4>EricGraphicsView.zoom</h4> |
478 <b>zoom</b>(<i></i>) |
477 <b>zoom</b>(<i></i>) |
479 |
|
480 <p> |
478 <p> |
481 Public method to get the current zoom factor in percent. |
479 Public method to get the current zoom factor in percent. |
482 </p> |
480 </p> |
|
481 |
483 <dl> |
482 <dl> |
484 <dt>Return:</dt> |
483 <dt>Return:</dt> |
485 <dd> |
484 <dd> |
486 current zoom factor in percent |
485 current zoom factor in percent |
487 </dd> |
486 </dd> |
493 </dd> |
492 </dd> |
494 </dl> |
493 </dl> |
495 <a NAME="EricGraphicsView.zoomIn" ID="EricGraphicsView.zoomIn"></a> |
494 <a NAME="EricGraphicsView.zoomIn" ID="EricGraphicsView.zoomIn"></a> |
496 <h4>EricGraphicsView.zoomIn</h4> |
495 <h4>EricGraphicsView.zoomIn</h4> |
497 <b>zoomIn</b>(<i></i>) |
496 <b>zoomIn</b>(<i></i>) |
498 |
|
499 <p> |
497 <p> |
500 Public method to zoom in. |
498 Public method to zoom in. |
501 </p> |
499 </p> |
|
500 |
502 <a NAME="EricGraphicsView.zoomOut" ID="EricGraphicsView.zoomOut"></a> |
501 <a NAME="EricGraphicsView.zoomOut" ID="EricGraphicsView.zoomOut"></a> |
503 <h4>EricGraphicsView.zoomOut</h4> |
502 <h4>EricGraphicsView.zoomOut</h4> |
504 <b>zoomOut</b>(<i></i>) |
503 <b>zoomOut</b>(<i></i>) |
505 |
|
506 <p> |
504 <p> |
507 Public method to zoom out. |
505 Public method to zoom out. |
508 </p> |
506 </p> |
|
507 |
509 <a NAME="EricGraphicsView.zoomReset" ID="EricGraphicsView.zoomReset"></a> |
508 <a NAME="EricGraphicsView.zoomReset" ID="EricGraphicsView.zoomReset"></a> |
510 <h4>EricGraphicsView.zoomReset</h4> |
509 <h4>EricGraphicsView.zoomReset</h4> |
511 <b>zoomReset</b>(<i></i>) |
510 <b>zoomReset</b>(<i></i>) |
512 |
|
513 <p> |
511 <p> |
514 Public method to handle the reset the zoom value. |
512 Public method to handle the reset the zoom value. |
515 </p> |
513 </p> |
|
514 |
516 <div align="right"><a href="#top">Up</a></div> |
515 <div align="right"><a href="#top">Up</a></div> |
517 <hr /> |
516 <hr /> |
518 </body></html> |
517 </body></html> |