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