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