|
1 <?xml version="1.0" encoding="utf-8"?> |
|
2 <!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN' |
|
3 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'> |
|
4 <html><head> |
|
5 <title>eric4.IconEditor.IconEditorGrid</title> |
|
6 <style> |
|
7 body { |
|
8 background:white; |
|
9 margin: 0em 1em 10em 1em; |
|
10 color: black; |
|
11 } |
|
12 |
|
13 h1 { color: white; background: #4FA4FF; } |
|
14 h2 { color: white; background: #4FA4FF; } |
|
15 h3 { color: white; background: #00557F; } |
|
16 h4 { color: white; background: #00557F; } |
|
17 |
|
18 a { color: #AA5500; } |
|
19 |
|
20 </style> |
|
21 </head> |
|
22 <body><a NAME="top" ID="top"></a> |
|
23 <h1>eric4.IconEditor.IconEditorGrid</h1> |
|
24 <p> |
|
25 Module implementing the icon editor grid. |
|
26 </p> |
|
27 <h3>Global Attributes</h3> |
|
28 <table> |
|
29 <tr><td>None</td></tr> |
|
30 </table> |
|
31 <h3>Classes</h3> |
|
32 <table> |
|
33 <tr> |
|
34 <td><a href="#IconEditCommand">IconEditCommand</a></td> |
|
35 <td>Class implementing an undo command for the icon editor.</td> |
|
36 </tr><tr> |
|
37 <td><a href="#IconEditorGrid">IconEditorGrid</a></td> |
|
38 <td>Class implementing the icon editor grid.</td> |
|
39 </tr> |
|
40 </table> |
|
41 <h3>Functions</h3> |
|
42 <table> |
|
43 <tr><td>None</td></tr> |
|
44 </table> |
|
45 <hr /><hr /> |
|
46 <a NAME="IconEditCommand" ID="IconEditCommand"></a> |
|
47 <h2>IconEditCommand</h2> |
|
48 <p> |
|
49 Class implementing an undo command for the icon editor. |
|
50 </p> |
|
51 <h3>Derived from</h3> |
|
52 QUndoCommand |
|
53 <h3>Class Attributes</h3> |
|
54 <table> |
|
55 <tr><td>None</td></tr> |
|
56 </table> |
|
57 <h3>Methods</h3> |
|
58 <table> |
|
59 <tr> |
|
60 <td><a href="#IconEditCommand.__init__">IconEditCommand</a></td> |
|
61 <td>Constructor</td> |
|
62 </tr><tr> |
|
63 <td><a href="#IconEditCommand.redo">redo</a></td> |
|
64 <td>Public method to perform the redo.</td> |
|
65 </tr><tr> |
|
66 <td><a href="#IconEditCommand.setAfterImage">setAfterImage</a></td> |
|
67 <td>Public method to set the image after the changes were applied.</td> |
|
68 </tr><tr> |
|
69 <td><a href="#IconEditCommand.undo">undo</a></td> |
|
70 <td>Public method to perform the undo.</td> |
|
71 </tr> |
|
72 </table> |
|
73 <a NAME="IconEditCommand.__init__" ID="IconEditCommand.__init__"></a> |
|
74 <h4>IconEditCommand (Constructor)</h4> |
|
75 <b>IconEditCommand</b>(<i>grid, text, oldImage, parent = None</i>) |
|
76 <p> |
|
77 Constructor |
|
78 </p><dl> |
|
79 <dt><i>grid</i></dt> |
|
80 <dd> |
|
81 reference to the icon editor grid (IconEditorGrid) |
|
82 </dd><dt><i>text</i></dt> |
|
83 <dd> |
|
84 text for the undo command (string) |
|
85 </dd><dt><i>oldImage</i></dt> |
|
86 <dd> |
|
87 copy of the icon before the changes were applied (QImage) |
|
88 </dd><dt><i>parent</i></dt> |
|
89 <dd> |
|
90 reference to the parent command (QUndoCommand) |
|
91 </dd> |
|
92 </dl><a NAME="IconEditCommand.redo" ID="IconEditCommand.redo"></a> |
|
93 <h4>IconEditCommand.redo</h4> |
|
94 <b>redo</b>(<i></i>) |
|
95 <p> |
|
96 Public method to perform the redo. |
|
97 </p><a NAME="IconEditCommand.setAfterImage" ID="IconEditCommand.setAfterImage"></a> |
|
98 <h4>IconEditCommand.setAfterImage</h4> |
|
99 <b>setAfterImage</b>(<i>image</i>) |
|
100 <p> |
|
101 Public method to set the image after the changes were applied. |
|
102 </p><dl> |
|
103 <dt><i>image</i></dt> |
|
104 <dd> |
|
105 copy of the icon after the changes were applied (QImage) |
|
106 </dd> |
|
107 </dl><a NAME="IconEditCommand.undo" ID="IconEditCommand.undo"></a> |
|
108 <h4>IconEditCommand.undo</h4> |
|
109 <b>undo</b>(<i></i>) |
|
110 <p> |
|
111 Public method to perform the undo. |
|
112 </p> |
|
113 <div align="right"><a href="#top">Up</a></div> |
|
114 <hr /><hr /> |
|
115 <a NAME="IconEditorGrid" ID="IconEditorGrid"></a> |
|
116 <h2>IconEditorGrid</h2> |
|
117 <p> |
|
118 Class implementing the icon editor grid. |
|
119 </p><h4>Signals</h4> |
|
120 <dl> |
|
121 <dt>canRedoChanged(bool)</dt> |
|
122 <dd> |
|
123 emitted after the redo status has changed |
|
124 </dd><dt>canUndoChanged(bool)</dt> |
|
125 <dd> |
|
126 emitted after the undo status has changed |
|
127 </dd><dt>clipboardImageAvailable(bool)</dt> |
|
128 <dd> |
|
129 emitted to signal the availability of an |
|
130 image to be pasted |
|
131 </dd><dt>colorChanged(const QColor&)</dt> |
|
132 <dd> |
|
133 emitted after the drawing color was changed |
|
134 </dd><dt>imageChanged(bool)</dt> |
|
135 <dd> |
|
136 emitted after the image was modified |
|
137 </dd><dt>positionChanged(int, int)</dt> |
|
138 <dd> |
|
139 emitted after the cursor poition was changed |
|
140 </dd><dt>previewChanged(const QPixmap&)</dt> |
|
141 <dd> |
|
142 emitted to signal a new preview pixmap |
|
143 </dd><dt>selectionAvailable(bool)</dt> |
|
144 <dd> |
|
145 emitted to signal a change of the selection |
|
146 </dd><dt>sizeChanged(int, int)</dt> |
|
147 <dd> |
|
148 emitted after the size has been changed |
|
149 </dd> |
|
150 </dl> |
|
151 <h3>Derived from</h3> |
|
152 QWidget |
|
153 <h3>Class Attributes</h3> |
|
154 <table> |
|
155 <tr><td>Circle</td></tr><tr><td>CircleSelection</td></tr><tr><td>ColorPicker</td></tr><tr><td>Ellipse</td></tr><tr><td>Fill</td></tr><tr><td>FilledCircle</td></tr><tr><td>FilledEllipse</td></tr><tr><td>FilledRectangle</td></tr><tr><td>Line</td></tr><tr><td>MarkColor</td></tr><tr><td>NoMarkColor</td></tr><tr><td>Pencil</td></tr><tr><td>Rectangle</td></tr><tr><td>RectangleSelection</td></tr><tr><td>Rubber</td></tr> |
|
156 </table> |
|
157 <h3>Methods</h3> |
|
158 <table> |
|
159 <tr> |
|
160 <td><a href="#IconEditorGrid.__init__">IconEditorGrid</a></td> |
|
161 <td>Constructor</td> |
|
162 </tr><tr> |
|
163 <td><a href="#IconEditorGrid.__checkClipboard">__checkClipboard</a></td> |
|
164 <td>Private slot to check, if the clipboard contains a valid image, and signal the result.</td> |
|
165 </tr><tr> |
|
166 <td><a href="#IconEditorGrid.__cleanChanged">__cleanChanged</a></td> |
|
167 <td>Private slot to handle the undo stack clean state change.</td> |
|
168 </tr><tr> |
|
169 <td><a href="#IconEditorGrid.__clipboardImage">__clipboardImage</a></td> |
|
170 <td>Private method to get an image from the clipboard.</td> |
|
171 </tr><tr> |
|
172 <td><a href="#IconEditorGrid.__drawFlood">__drawFlood</a></td> |
|
173 <td>Private method to perform a flood fill operation.</td> |
|
174 </tr><tr> |
|
175 <td><a href="#IconEditorGrid.__drawPasteRect">__drawPasteRect</a></td> |
|
176 <td>Private slot to draw a rectangle for signaling a paste operation.</td> |
|
177 </tr><tr> |
|
178 <td><a href="#IconEditorGrid.__drawTool">__drawTool</a></td> |
|
179 <td>Public method to perform a draw operation depending of the current tool.</td> |
|
180 </tr><tr> |
|
181 <td><a href="#IconEditorGrid.__getSelectionImage">__getSelectionImage</a></td> |
|
182 <td>Private method to get an image from the selection.</td> |
|
183 </tr><tr> |
|
184 <td><a href="#IconEditorGrid.__imageCoordinates">__imageCoordinates</a></td> |
|
185 <td>Private method to convert from widget to image coordinates.</td> |
|
186 </tr><tr> |
|
187 <td><a href="#IconEditorGrid.__initCursors">__initCursors</a></td> |
|
188 <td>Private method to initialize the various cursors.</td> |
|
189 </tr><tr> |
|
190 <td><a href="#IconEditorGrid.__initUndoTexts">__initUndoTexts</a></td> |
|
191 <td>Private method to initialize texts to be associated with undo commands for the various drawing tools.</td> |
|
192 </tr><tr> |
|
193 <td><a href="#IconEditorGrid.__isMarked">__isMarked</a></td> |
|
194 <td>Private method to check, if a pixel is marked.</td> |
|
195 </tr><tr> |
|
196 <td><a href="#IconEditorGrid.__pixelRect">__pixelRect</a></td> |
|
197 <td>Private method to determine the rectangle for a given pixel coordinate.</td> |
|
198 </tr><tr> |
|
199 <td><a href="#IconEditorGrid.__setImagePixel">__setImagePixel</a></td> |
|
200 <td>Private slot to set or erase a pixel.</td> |
|
201 </tr><tr> |
|
202 <td><a href="#IconEditorGrid.__unMark">__unMark</a></td> |
|
203 <td>Private slot to remove the mark indicator.</td> |
|
204 </tr><tr> |
|
205 <td><a href="#IconEditorGrid.__updateImageRect">__updateImageRect</a></td> |
|
206 <td>Private slot to update parts of the widget.</td> |
|
207 </tr><tr> |
|
208 <td><a href="#IconEditorGrid.__updatePreviewPixmap">__updatePreviewPixmap</a></td> |
|
209 <td>Private slot to generate and signal an updated preview pixmap.</td> |
|
210 </tr><tr> |
|
211 <td><a href="#IconEditorGrid.__updateRect">__updateRect</a></td> |
|
212 <td>Private slot to update parts of the widget.</td> |
|
213 </tr><tr> |
|
214 <td><a href="#IconEditorGrid.canPaste">canPaste</a></td> |
|
215 <td>Public slot to check the availability of the paste operation.</td> |
|
216 </tr><tr> |
|
217 <td><a href="#IconEditorGrid.canRedo">canRedo</a></td> |
|
218 <td>Public method to return the redo status.</td> |
|
219 </tr><tr> |
|
220 <td><a href="#IconEditorGrid.canUndo">canUndo</a></td> |
|
221 <td>Public method to return the undo status.</td> |
|
222 </tr><tr> |
|
223 <td><a href="#IconEditorGrid.editClear">editClear</a></td> |
|
224 <td>Public slot to clear the image.</td> |
|
225 </tr><tr> |
|
226 <td><a href="#IconEditorGrid.editCopy">editCopy</a></td> |
|
227 <td>Public slot to copy the selection.</td> |
|
228 </tr><tr> |
|
229 <td><a href="#IconEditorGrid.editCut">editCut</a></td> |
|
230 <td>Public slot to cut the selection.</td> |
|
231 </tr><tr> |
|
232 <td><a href="#IconEditorGrid.editNew">editNew</a></td> |
|
233 <td>Public slot to generate a new, empty image.</td> |
|
234 </tr><tr> |
|
235 <td><a href="#IconEditorGrid.editPaste">editPaste</a></td> |
|
236 <td>Public slot to paste an image from the clipboard.</td> |
|
237 </tr><tr> |
|
238 <td><a href="#IconEditorGrid.editPasteAsNew">editPasteAsNew</a></td> |
|
239 <td>Public slot to paste the clipboard as a new image.</td> |
|
240 </tr><tr> |
|
241 <td><a href="#IconEditorGrid.editRedo">editRedo</a></td> |
|
242 <td>Public slot to perform a redo operation.</td> |
|
243 </tr><tr> |
|
244 <td><a href="#IconEditorGrid.editResize">editResize</a></td> |
|
245 <td>Public slot to resize the image.</td> |
|
246 </tr><tr> |
|
247 <td><a href="#IconEditorGrid.editSelectAll">editSelectAll</a></td> |
|
248 <td>Public slot to select the complete image.</td> |
|
249 </tr><tr> |
|
250 <td><a href="#IconEditorGrid.editUndo">editUndo</a></td> |
|
251 <td>Public slot to perform an undo operation.</td> |
|
252 </tr><tr> |
|
253 <td><a href="#IconEditorGrid.grayScale">grayScale</a></td> |
|
254 <td>Public slot to convert the image to gray preserving transparency.</td> |
|
255 </tr><tr> |
|
256 <td><a href="#IconEditorGrid.iconImage">iconImage</a></td> |
|
257 <td>Public method to get a copy of the icon image.</td> |
|
258 </tr><tr> |
|
259 <td><a href="#IconEditorGrid.iconSize">iconSize</a></td> |
|
260 <td>Public method to get the size of the icon.</td> |
|
261 </tr><tr> |
|
262 <td><a href="#IconEditorGrid.isDirty">isDirty</a></td> |
|
263 <td>Public method to check the dirty status.</td> |
|
264 </tr><tr> |
|
265 <td><a href="#IconEditorGrid.isGridEnabled">isGridEnabled</a></td> |
|
266 <td>Public method to get the grid lines status.</td> |
|
267 </tr><tr> |
|
268 <td><a href="#IconEditorGrid.isSelectionAvailable">isSelectionAvailable</a></td> |
|
269 <td>Public method to check the availability of a selection.</td> |
|
270 </tr><tr> |
|
271 <td><a href="#IconEditorGrid.mouseMoveEvent">mouseMoveEvent</a></td> |
|
272 <td>Protected method to handle mouse move events.</td> |
|
273 </tr><tr> |
|
274 <td><a href="#IconEditorGrid.mousePressEvent">mousePressEvent</a></td> |
|
275 <td>Protected method to handle mouse button press events.</td> |
|
276 </tr><tr> |
|
277 <td><a href="#IconEditorGrid.mouseReleaseEvent">mouseReleaseEvent</a></td> |
|
278 <td>Protected method to handle mouse button release events.</td> |
|
279 </tr><tr> |
|
280 <td><a href="#IconEditorGrid.paintEvent">paintEvent</a></td> |
|
281 <td>Protected method called to repaint some of the widget.</td> |
|
282 </tr><tr> |
|
283 <td><a href="#IconEditorGrid.penColor">penColor</a></td> |
|
284 <td>Public method to get the current drawing color.</td> |
|
285 </tr><tr> |
|
286 <td><a href="#IconEditorGrid.previewPixmap">previewPixmap</a></td> |
|
287 <td>Public method to generate a preview pixmap.</td> |
|
288 </tr><tr> |
|
289 <td><a href="#IconEditorGrid.setDirty">setDirty</a></td> |
|
290 <td>Public slot to set the dirty flag.</td> |
|
291 </tr><tr> |
|
292 <td><a href="#IconEditorGrid.setGridEnabled">setGridEnabled</a></td> |
|
293 <td>Public method to enable the display of grid lines.</td> |
|
294 </tr><tr> |
|
295 <td><a href="#IconEditorGrid.setIconImage">setIconImage</a></td> |
|
296 <td>Public method to set a new icon image.</td> |
|
297 </tr><tr> |
|
298 <td><a href="#IconEditorGrid.setPenColor">setPenColor</a></td> |
|
299 <td>Public method to set the drawing color.</td> |
|
300 </tr><tr> |
|
301 <td><a href="#IconEditorGrid.setTool">setTool</a></td> |
|
302 <td>Public method to set the current drawing tool.</td> |
|
303 </tr><tr> |
|
304 <td><a href="#IconEditorGrid.setZoomFactor">setZoomFactor</a></td> |
|
305 <td>Public method to set the zoom factor.</td> |
|
306 </tr><tr> |
|
307 <td><a href="#IconEditorGrid.shutdown">shutdown</a></td> |
|
308 <td>Public slot to perform some shutdown actions.</td> |
|
309 </tr><tr> |
|
310 <td><a href="#IconEditorGrid.sizeHint">sizeHint</a></td> |
|
311 <td>Public method to report the size hint.</td> |
|
312 </tr><tr> |
|
313 <td><a href="#IconEditorGrid.tool">tool</a></td> |
|
314 <td>Public method to get the current drawing tool.</td> |
|
315 </tr><tr> |
|
316 <td><a href="#IconEditorGrid.zoomFactor">zoomFactor</a></td> |
|
317 <td>Public method to get the current zoom factor.</td> |
|
318 </tr> |
|
319 </table> |
|
320 <a NAME="IconEditorGrid.__init__" ID="IconEditorGrid.__init__"></a> |
|
321 <h4>IconEditorGrid (Constructor)</h4> |
|
322 <b>IconEditorGrid</b>(<i>parent = None</i>) |
|
323 <p> |
|
324 Constructor |
|
325 </p><dl> |
|
326 <dt><i>parent</i></dt> |
|
327 <dd> |
|
328 reference to the parent widget (QWidget) |
|
329 </dd> |
|
330 </dl><a NAME="IconEditorGrid.__checkClipboard" ID="IconEditorGrid.__checkClipboard"></a> |
|
331 <h4>IconEditorGrid.__checkClipboard</h4> |
|
332 <b>__checkClipboard</b>(<i></i>) |
|
333 <p> |
|
334 Private slot to check, if the clipboard contains a valid image, and signal |
|
335 the result. |
|
336 </p><a NAME="IconEditorGrid.__cleanChanged" ID="IconEditorGrid.__cleanChanged"></a> |
|
337 <h4>IconEditorGrid.__cleanChanged</h4> |
|
338 <b>__cleanChanged</b>(<i>clean</i>) |
|
339 <p> |
|
340 Private slot to handle the undo stack clean state change. |
|
341 </p><dl> |
|
342 <dt><i>clean</i></dt> |
|
343 <dd> |
|
344 flag indicating the clean state (boolean) |
|
345 </dd> |
|
346 </dl><a NAME="IconEditorGrid.__clipboardImage" ID="IconEditorGrid.__clipboardImage"></a> |
|
347 <h4>IconEditorGrid.__clipboardImage</h4> |
|
348 <b>__clipboardImage</b>(<i></i>) |
|
349 <p> |
|
350 Private method to get an image from the clipboard. |
|
351 </p><dl> |
|
352 <dt>Returns:</dt> |
|
353 <dd> |
|
354 tuple with the image (QImage) and a flag indicating a |
|
355 valid image (boolean) |
|
356 </dd> |
|
357 </dl><a NAME="IconEditorGrid.__drawFlood" ID="IconEditorGrid.__drawFlood"></a> |
|
358 <h4>IconEditorGrid.__drawFlood</h4> |
|
359 <b>__drawFlood</b>(<i>i, j, oldColor, doUpdate = True</i>) |
|
360 <p> |
|
361 Private method to perform a flood fill operation. |
|
362 </p><dl> |
|
363 <dt><i>i</i></dt> |
|
364 <dd> |
|
365 x-value in image coordinates (integer) |
|
366 </dd><dt><i>j</i></dt> |
|
367 <dd> |
|
368 y-value in image coordinates (integer) |
|
369 </dd><dt><i>oldColor</i></dt> |
|
370 <dd> |
|
371 reference to the color at position i, j (QColor) |
|
372 </dd><dt><i>doUpdate</i></dt> |
|
373 <dd> |
|
374 flag indicating an update is requested (boolean) |
|
375 (used for speed optimizations) |
|
376 </dd> |
|
377 </dl><a NAME="IconEditorGrid.__drawPasteRect" ID="IconEditorGrid.__drawPasteRect"></a> |
|
378 <h4>IconEditorGrid.__drawPasteRect</h4> |
|
379 <b>__drawPasteRect</b>(<i>pos</i>) |
|
380 <p> |
|
381 Private slot to draw a rectangle for signaling a paste operation. |
|
382 </p><dl> |
|
383 <dt><i>pos</i></dt> |
|
384 <dd> |
|
385 widget position of the paste rectangle (QPoint) |
|
386 </dd> |
|
387 </dl><a NAME="IconEditorGrid.__drawTool" ID="IconEditorGrid.__drawTool"></a> |
|
388 <h4>IconEditorGrid.__drawTool</h4> |
|
389 <b>__drawTool</b>(<i>pos, mark</i>) |
|
390 <p> |
|
391 Public method to perform a draw operation depending of the current tool. |
|
392 </p><dl> |
|
393 <dt><i>pos</i></dt> |
|
394 <dd> |
|
395 widget coordinate to perform the draw operation at (QPoint) |
|
396 </dd><dt><i>mark</i></dt> |
|
397 <dd> |
|
398 flag indicating a mark operation (boolean) |
|
399 </dd><dt><i>flag</i></dt> |
|
400 <dd> |
|
401 indicating a successful draw (boolean) |
|
402 </dd> |
|
403 </dl><a NAME="IconEditorGrid.__getSelectionImage" ID="IconEditorGrid.__getSelectionImage"></a> |
|
404 <h4>IconEditorGrid.__getSelectionImage</h4> |
|
405 <b>__getSelectionImage</b>(<i>cut</i>) |
|
406 <p> |
|
407 Private method to get an image from the selection. |
|
408 </p><dl> |
|
409 <dt><i>cut</i></dt> |
|
410 <dd> |
|
411 flag indicating to cut the selection (boolean) |
|
412 </dd> |
|
413 </dl><dl> |
|
414 <dt>Returns:</dt> |
|
415 <dd> |
|
416 image of the selection (QImage) |
|
417 </dd> |
|
418 </dl><a NAME="IconEditorGrid.__imageCoordinates" ID="IconEditorGrid.__imageCoordinates"></a> |
|
419 <h4>IconEditorGrid.__imageCoordinates</h4> |
|
420 <b>__imageCoordinates</b>(<i>pos</i>) |
|
421 <p> |
|
422 Private method to convert from widget to image coordinates. |
|
423 </p><dl> |
|
424 <dt><i>pos</i></dt> |
|
425 <dd> |
|
426 widget coordinate (QPoint) |
|
427 </dd> |
|
428 </dl><dl> |
|
429 <dt>Returns:</dt> |
|
430 <dd> |
|
431 tuple with the image coordinates (tuple of two integers) |
|
432 </dd> |
|
433 </dl><a NAME="IconEditorGrid.__initCursors" ID="IconEditorGrid.__initCursors"></a> |
|
434 <h4>IconEditorGrid.__initCursors</h4> |
|
435 <b>__initCursors</b>(<i></i>) |
|
436 <p> |
|
437 Private method to initialize the various cursors. |
|
438 </p><a NAME="IconEditorGrid.__initUndoTexts" ID="IconEditorGrid.__initUndoTexts"></a> |
|
439 <h4>IconEditorGrid.__initUndoTexts</h4> |
|
440 <b>__initUndoTexts</b>(<i></i>) |
|
441 <p> |
|
442 Private method to initialize texts to be associated with undo commands for |
|
443 the various drawing tools. |
|
444 </p><a NAME="IconEditorGrid.__isMarked" ID="IconEditorGrid.__isMarked"></a> |
|
445 <h4>IconEditorGrid.__isMarked</h4> |
|
446 <b>__isMarked</b>(<i>i, j</i>) |
|
447 <p> |
|
448 Private method to check, if a pixel is marked. |
|
449 </p><dl> |
|
450 <dt><i>i</i></dt> |
|
451 <dd> |
|
452 x-value in image coordinates (integer) |
|
453 </dd><dt><i>j</i></dt> |
|
454 <dd> |
|
455 y-value in image coordinates (integer) |
|
456 </dd> |
|
457 </dl><dl> |
|
458 <dt>Returns:</dt> |
|
459 <dd> |
|
460 flag indicating a marked pixel (boolean) |
|
461 </dd> |
|
462 </dl><a NAME="IconEditorGrid.__pixelRect" ID="IconEditorGrid.__pixelRect"></a> |
|
463 <h4>IconEditorGrid.__pixelRect</h4> |
|
464 <b>__pixelRect</b>(<i>i, j</i>) |
|
465 <p> |
|
466 Private method to determine the rectangle for a given pixel coordinate. |
|
467 </p><dl> |
|
468 <dt><i>i</i></dt> |
|
469 <dd> |
|
470 x-coordinate of the pixel in the image (integer) |
|
471 </dd><dt><i>j</i></dt> |
|
472 <dd> |
|
473 y-coordinate of the pixel in the image (integer) |
|
474 return rectangle for the given pixel coordinates (QRect) |
|
475 </dd> |
|
476 </dl><a NAME="IconEditorGrid.__setImagePixel" ID="IconEditorGrid.__setImagePixel"></a> |
|
477 <h4>IconEditorGrid.__setImagePixel</h4> |
|
478 <b>__setImagePixel</b>(<i>pos, opaque</i>) |
|
479 <p> |
|
480 Private slot to set or erase a pixel. |
|
481 </p><dl> |
|
482 <dt><i>pos</i></dt> |
|
483 <dd> |
|
484 position of the pixel in the widget (QPoint) |
|
485 </dd><dt><i>opaque</i></dt> |
|
486 <dd> |
|
487 flag indicating a set operation (boolean) |
|
488 </dd> |
|
489 </dl><a NAME="IconEditorGrid.__unMark" ID="IconEditorGrid.__unMark"></a> |
|
490 <h4>IconEditorGrid.__unMark</h4> |
|
491 <b>__unMark</b>(<i></i>) |
|
492 <p> |
|
493 Private slot to remove the mark indicator. |
|
494 </p><a NAME="IconEditorGrid.__updateImageRect" ID="IconEditorGrid.__updateImageRect"></a> |
|
495 <h4>IconEditorGrid.__updateImageRect</h4> |
|
496 <b>__updateImageRect</b>(<i>ipos1, ipos2</i>) |
|
497 <p> |
|
498 Private slot to update parts of the widget. |
|
499 </p><dl> |
|
500 <dt><i>ipos1</i></dt> |
|
501 <dd> |
|
502 top, left position for the update in image coordinates (QPoint) |
|
503 </dd><dt><i>ipos2</i></dt> |
|
504 <dd> |
|
505 bottom, right position for the update in image coordinates (QPoint) |
|
506 </dd> |
|
507 </dl><a NAME="IconEditorGrid.__updatePreviewPixmap" ID="IconEditorGrid.__updatePreviewPixmap"></a> |
|
508 <h4>IconEditorGrid.__updatePreviewPixmap</h4> |
|
509 <b>__updatePreviewPixmap</b>(<i></i>) |
|
510 <p> |
|
511 Private slot to generate and signal an updated preview pixmap. |
|
512 </p><a NAME="IconEditorGrid.__updateRect" ID="IconEditorGrid.__updateRect"></a> |
|
513 <h4>IconEditorGrid.__updateRect</h4> |
|
514 <b>__updateRect</b>(<i>pos1, pos2</i>) |
|
515 <p> |
|
516 Private slot to update parts of the widget. |
|
517 </p><dl> |
|
518 <dt><i>pos1</i></dt> |
|
519 <dd> |
|
520 top, left position for the update in widget coordinates (QPoint) |
|
521 </dd><dt><i>pos2</i></dt> |
|
522 <dd> |
|
523 bottom, right position for the update in widget coordinates (QPoint) |
|
524 </dd> |
|
525 </dl><a NAME="IconEditorGrid.canPaste" ID="IconEditorGrid.canPaste"></a> |
|
526 <h4>IconEditorGrid.canPaste</h4> |
|
527 <b>canPaste</b>(<i></i>) |
|
528 <p> |
|
529 Public slot to check the availability of the paste operation. |
|
530 </p><dl> |
|
531 <dt>Returns:</dt> |
|
532 <dd> |
|
533 flag indicating availability of paste (boolean) |
|
534 </dd> |
|
535 </dl><a NAME="IconEditorGrid.canRedo" ID="IconEditorGrid.canRedo"></a> |
|
536 <h4>IconEditorGrid.canRedo</h4> |
|
537 <b>canRedo</b>(<i></i>) |
|
538 <p> |
|
539 Public method to return the redo status. |
|
540 </p><dl> |
|
541 <dt>Returns:</dt> |
|
542 <dd> |
|
543 flag indicating the availability of redo (boolean) |
|
544 </dd> |
|
545 </dl><a NAME="IconEditorGrid.canUndo" ID="IconEditorGrid.canUndo"></a> |
|
546 <h4>IconEditorGrid.canUndo</h4> |
|
547 <b>canUndo</b>(<i></i>) |
|
548 <p> |
|
549 Public method to return the undo status. |
|
550 </p><dl> |
|
551 <dt>Returns:</dt> |
|
552 <dd> |
|
553 flag indicating the availability of undo (boolean) |
|
554 </dd> |
|
555 </dl><a NAME="IconEditorGrid.editClear" ID="IconEditorGrid.editClear"></a> |
|
556 <h4>IconEditorGrid.editClear</h4> |
|
557 <b>editClear</b>(<i></i>) |
|
558 <p> |
|
559 Public slot to clear the image. |
|
560 </p><a NAME="IconEditorGrid.editCopy" ID="IconEditorGrid.editCopy"></a> |
|
561 <h4>IconEditorGrid.editCopy</h4> |
|
562 <b>editCopy</b>(<i></i>) |
|
563 <p> |
|
564 Public slot to copy the selection. |
|
565 </p><a NAME="IconEditorGrid.editCut" ID="IconEditorGrid.editCut"></a> |
|
566 <h4>IconEditorGrid.editCut</h4> |
|
567 <b>editCut</b>(<i></i>) |
|
568 <p> |
|
569 Public slot to cut the selection. |
|
570 </p><a NAME="IconEditorGrid.editNew" ID="IconEditorGrid.editNew"></a> |
|
571 <h4>IconEditorGrid.editNew</h4> |
|
572 <b>editNew</b>(<i></i>) |
|
573 <p> |
|
574 Public slot to generate a new, empty image. |
|
575 </p><a NAME="IconEditorGrid.editPaste" ID="IconEditorGrid.editPaste"></a> |
|
576 <h4>IconEditorGrid.editPaste</h4> |
|
577 <b>editPaste</b>(<i>pasting = False</i>) |
|
578 <p> |
|
579 Public slot to paste an image from the clipboard. |
|
580 </p><dl> |
|
581 <dt><i>pasting</i></dt> |
|
582 <dd> |
|
583 flag indicating part two of the paste operation (boolean) |
|
584 </dd> |
|
585 </dl><a NAME="IconEditorGrid.editPasteAsNew" ID="IconEditorGrid.editPasteAsNew"></a> |
|
586 <h4>IconEditorGrid.editPasteAsNew</h4> |
|
587 <b>editPasteAsNew</b>(<i></i>) |
|
588 <p> |
|
589 Public slot to paste the clipboard as a new image. |
|
590 </p><a NAME="IconEditorGrid.editRedo" ID="IconEditorGrid.editRedo"></a> |
|
591 <h4>IconEditorGrid.editRedo</h4> |
|
592 <b>editRedo</b>(<i></i>) |
|
593 <p> |
|
594 Public slot to perform a redo operation. |
|
595 </p><a NAME="IconEditorGrid.editResize" ID="IconEditorGrid.editResize"></a> |
|
596 <h4>IconEditorGrid.editResize</h4> |
|
597 <b>editResize</b>(<i></i>) |
|
598 <p> |
|
599 Public slot to resize the image. |
|
600 </p><a NAME="IconEditorGrid.editSelectAll" ID="IconEditorGrid.editSelectAll"></a> |
|
601 <h4>IconEditorGrid.editSelectAll</h4> |
|
602 <b>editSelectAll</b>(<i></i>) |
|
603 <p> |
|
604 Public slot to select the complete image. |
|
605 </p><a NAME="IconEditorGrid.editUndo" ID="IconEditorGrid.editUndo"></a> |
|
606 <h4>IconEditorGrid.editUndo</h4> |
|
607 <b>editUndo</b>(<i></i>) |
|
608 <p> |
|
609 Public slot to perform an undo operation. |
|
610 </p><a NAME="IconEditorGrid.grayScale" ID="IconEditorGrid.grayScale"></a> |
|
611 <h4>IconEditorGrid.grayScale</h4> |
|
612 <b>grayScale</b>(<i></i>) |
|
613 <p> |
|
614 Public slot to convert the image to gray preserving transparency. |
|
615 </p><a NAME="IconEditorGrid.iconImage" ID="IconEditorGrid.iconImage"></a> |
|
616 <h4>IconEditorGrid.iconImage</h4> |
|
617 <b>iconImage</b>(<i></i>) |
|
618 <p> |
|
619 Public method to get a copy of the icon image. |
|
620 </p><dl> |
|
621 <dt>Returns:</dt> |
|
622 <dd> |
|
623 copy of the icon image (QImage) |
|
624 </dd> |
|
625 </dl><a NAME="IconEditorGrid.iconSize" ID="IconEditorGrid.iconSize"></a> |
|
626 <h4>IconEditorGrid.iconSize</h4> |
|
627 <b>iconSize</b>(<i></i>) |
|
628 <p> |
|
629 Public method to get the size of the icon. |
|
630 </p><dl> |
|
631 <dt>Returns:</dt> |
|
632 <dd> |
|
633 width and height of the image as a tuple (integer, integer) |
|
634 </dd> |
|
635 </dl><a NAME="IconEditorGrid.isDirty" ID="IconEditorGrid.isDirty"></a> |
|
636 <h4>IconEditorGrid.isDirty</h4> |
|
637 <b>isDirty</b>(<i></i>) |
|
638 <p> |
|
639 Public method to check the dirty status. |
|
640 </p><dl> |
|
641 <dt>Returns:</dt> |
|
642 <dd> |
|
643 flag indicating a modified status (boolean) |
|
644 </dd> |
|
645 </dl><a NAME="IconEditorGrid.isGridEnabled" ID="IconEditorGrid.isGridEnabled"></a> |
|
646 <h4>IconEditorGrid.isGridEnabled</h4> |
|
647 <b>isGridEnabled</b>(<i></i>) |
|
648 <p> |
|
649 Public method to get the grid lines status. |
|
650 </p><dl> |
|
651 <dt>Returns:</dt> |
|
652 <dd> |
|
653 enabled status of the grid lines (boolean) |
|
654 </dd> |
|
655 </dl><a NAME="IconEditorGrid.isSelectionAvailable" ID="IconEditorGrid.isSelectionAvailable"></a> |
|
656 <h4>IconEditorGrid.isSelectionAvailable</h4> |
|
657 <b>isSelectionAvailable</b>(<i></i>) |
|
658 <p> |
|
659 Public method to check the availability of a selection. |
|
660 </p><dl> |
|
661 <dt>Returns:</dt> |
|
662 <dd> |
|
663 flag indicating the availability of a selection (boolean) |
|
664 </dd> |
|
665 </dl><a NAME="IconEditorGrid.mouseMoveEvent" ID="IconEditorGrid.mouseMoveEvent"></a> |
|
666 <h4>IconEditorGrid.mouseMoveEvent</h4> |
|
667 <b>mouseMoveEvent</b>(<i>evt</i>) |
|
668 <p> |
|
669 Protected method to handle mouse move events. |
|
670 </p><dl> |
|
671 <dt><i>evt</i></dt> |
|
672 <dd> |
|
673 reference to the mouse event object (QMouseEvent) |
|
674 </dd> |
|
675 </dl><a NAME="IconEditorGrid.mousePressEvent" ID="IconEditorGrid.mousePressEvent"></a> |
|
676 <h4>IconEditorGrid.mousePressEvent</h4> |
|
677 <b>mousePressEvent</b>(<i>evt</i>) |
|
678 <p> |
|
679 Protected method to handle mouse button press events. |
|
680 </p><dl> |
|
681 <dt><i>evt</i></dt> |
|
682 <dd> |
|
683 reference to the mouse event object (QMouseEvent) |
|
684 </dd> |
|
685 </dl><a NAME="IconEditorGrid.mouseReleaseEvent" ID="IconEditorGrid.mouseReleaseEvent"></a> |
|
686 <h4>IconEditorGrid.mouseReleaseEvent</h4> |
|
687 <b>mouseReleaseEvent</b>(<i>evt</i>) |
|
688 <p> |
|
689 Protected method to handle mouse button release events. |
|
690 </p><dl> |
|
691 <dt><i>evt</i></dt> |
|
692 <dd> |
|
693 reference to the mouse event object (QMouseEvent) |
|
694 </dd> |
|
695 </dl><a NAME="IconEditorGrid.paintEvent" ID="IconEditorGrid.paintEvent"></a> |
|
696 <h4>IconEditorGrid.paintEvent</h4> |
|
697 <b>paintEvent</b>(<i>evt</i>) |
|
698 <p> |
|
699 Protected method called to repaint some of the widget. |
|
700 </p><dl> |
|
701 <dt><i>evt</i></dt> |
|
702 <dd> |
|
703 reference to the paint event object (QPaintEvent) |
|
704 </dd> |
|
705 </dl><a NAME="IconEditorGrid.penColor" ID="IconEditorGrid.penColor"></a> |
|
706 <h4>IconEditorGrid.penColor</h4> |
|
707 <b>penColor</b>(<i></i>) |
|
708 <p> |
|
709 Public method to get the current drawing color. |
|
710 </p><dl> |
|
711 <dt>Returns:</dt> |
|
712 <dd> |
|
713 current drawing color (QColor) |
|
714 </dd> |
|
715 </dl><a NAME="IconEditorGrid.previewPixmap" ID="IconEditorGrid.previewPixmap"></a> |
|
716 <h4>IconEditorGrid.previewPixmap</h4> |
|
717 <b>previewPixmap</b>(<i></i>) |
|
718 <p> |
|
719 Public method to generate a preview pixmap. |
|
720 </p><dl> |
|
721 <dt>Returns:</dt> |
|
722 <dd> |
|
723 preview pixmap (QPixmap) |
|
724 </dd> |
|
725 </dl><a NAME="IconEditorGrid.setDirty" ID="IconEditorGrid.setDirty"></a> |
|
726 <h4>IconEditorGrid.setDirty</h4> |
|
727 <b>setDirty</b>(<i>dirty, setCleanState = False</i>) |
|
728 <p> |
|
729 Public slot to set the dirty flag. |
|
730 </p><dl> |
|
731 <dt><i>dirty</i></dt> |
|
732 <dd> |
|
733 flag indicating the new modification status (boolean) |
|
734 </dd><dt><i>setCleanState</i></dt> |
|
735 <dd> |
|
736 flag indicating to set the undo stack to clean (boolean) |
|
737 </dd> |
|
738 </dl><a NAME="IconEditorGrid.setGridEnabled" ID="IconEditorGrid.setGridEnabled"></a> |
|
739 <h4>IconEditorGrid.setGridEnabled</h4> |
|
740 <b>setGridEnabled</b>(<i>enable</i>) |
|
741 <p> |
|
742 Public method to enable the display of grid lines. |
|
743 </p><dl> |
|
744 <dt><i>enable</i></dt> |
|
745 <dd> |
|
746 enabled status of the grid lines (boolean) |
|
747 </dd> |
|
748 </dl><a NAME="IconEditorGrid.setIconImage" ID="IconEditorGrid.setIconImage"></a> |
|
749 <h4>IconEditorGrid.setIconImage</h4> |
|
750 <b>setIconImage</b>(<i>newImage, undoRedo = False, clearUndo = False</i>) |
|
751 <p> |
|
752 Public method to set a new icon image. |
|
753 </p><dl> |
|
754 <dt><i>newImage</i></dt> |
|
755 <dd> |
|
756 reference to the new image (QImage) |
|
757 </dd><dt><i>undoRedo=</i></dt> |
|
758 <dd> |
|
759 flag indicating an undo or redo operation (boolean) |
|
760 </dd><dt><i>clearUndo=</i></dt> |
|
761 <dd> |
|
762 flag indicating to clear the undo stack (boolean) |
|
763 </dd> |
|
764 </dl><a NAME="IconEditorGrid.setPenColor" ID="IconEditorGrid.setPenColor"></a> |
|
765 <h4>IconEditorGrid.setPenColor</h4> |
|
766 <b>setPenColor</b>(<i>newColor</i>) |
|
767 <p> |
|
768 Public method to set the drawing color. |
|
769 </p><dl> |
|
770 <dt><i>newColor</i></dt> |
|
771 <dd> |
|
772 reference to the new color (QColor) |
|
773 </dd> |
|
774 </dl><a NAME="IconEditorGrid.setTool" ID="IconEditorGrid.setTool"></a> |
|
775 <h4>IconEditorGrid.setTool</h4> |
|
776 <b>setTool</b>(<i>tool</i>) |
|
777 <p> |
|
778 Public method to set the current drawing tool. |
|
779 </p><dl> |
|
780 <dt><i>tool</i></dt> |
|
781 <dd> |
|
782 drawing tool to be used |
|
783 (IconEditorGrid.Pencil ... IconEditorGrid.CircleSelection) |
|
784 </dd> |
|
785 </dl><a NAME="IconEditorGrid.setZoomFactor" ID="IconEditorGrid.setZoomFactor"></a> |
|
786 <h4>IconEditorGrid.setZoomFactor</h4> |
|
787 <b>setZoomFactor</b>(<i>newZoom</i>) |
|
788 <p> |
|
789 Public method to set the zoom factor. |
|
790 </p><dl> |
|
791 <dt><i>newZoom</i></dt> |
|
792 <dd> |
|
793 zoom factor (integer >= 1) |
|
794 </dd> |
|
795 </dl><a NAME="IconEditorGrid.shutdown" ID="IconEditorGrid.shutdown"></a> |
|
796 <h4>IconEditorGrid.shutdown</h4> |
|
797 <b>shutdown</b>(<i></i>) |
|
798 <p> |
|
799 Public slot to perform some shutdown actions. |
|
800 </p><a NAME="IconEditorGrid.sizeHint" ID="IconEditorGrid.sizeHint"></a> |
|
801 <h4>IconEditorGrid.sizeHint</h4> |
|
802 <b>sizeHint</b>(<i></i>) |
|
803 <p> |
|
804 Public method to report the size hint. |
|
805 </p><dl> |
|
806 <dt>Returns:</dt> |
|
807 <dd> |
|
808 size hint (QSize) |
|
809 </dd> |
|
810 </dl><a NAME="IconEditorGrid.tool" ID="IconEditorGrid.tool"></a> |
|
811 <h4>IconEditorGrid.tool</h4> |
|
812 <b>tool</b>(<i></i>) |
|
813 <p> |
|
814 Public method to get the current drawing tool. |
|
815 </p><dl> |
|
816 <dt>Returns:</dt> |
|
817 <dd> |
|
818 current drawing tool |
|
819 (IconEditorGrid.Pencil ... IconEditorGrid.CircleSelection) |
|
820 </dd> |
|
821 </dl><a NAME="IconEditorGrid.zoomFactor" ID="IconEditorGrid.zoomFactor"></a> |
|
822 <h4>IconEditorGrid.zoomFactor</h4> |
|
823 <b>zoomFactor</b>(<i></i>) |
|
824 <p> |
|
825 Public method to get the current zoom factor. |
|
826 </p><dl> |
|
827 <dt>Returns:</dt> |
|
828 <dd> |
|
829 zoom factor (integer) |
|
830 </dd> |
|
831 </dl> |
|
832 <div align="right"><a href="#top">Up</a></div> |
|
833 <hr /> |
|
834 </body></html> |