|
1 <!DOCTYPE html> |
|
2 <html><head> |
|
3 <title>eric6.Snapshot.SnapWidget</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.Snapshot.SnapWidget</h1> |
|
23 <p> |
|
24 Module implementing the snapshot widget. |
|
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="#SnapWidget">SnapWidget</a></td> |
|
34 <td>Class implementing the snapshot widget.</td> |
|
35 </tr> |
|
36 </table> |
|
37 <h3>Functions</h3> |
|
38 <table> |
|
39 <tr><td>None</td></tr> |
|
40 </table> |
|
41 <hr /><hr /> |
|
42 <a NAME="SnapWidget" ID="SnapWidget"></a> |
|
43 <h2>SnapWidget</h2> |
|
44 <p> |
|
45 Class implementing the snapshot widget. |
|
46 </p> |
|
47 <h3>Derived from</h3> |
|
48 QWidget, Ui_SnapWidget |
|
49 <h3>Class Attributes</h3> |
|
50 <table> |
|
51 <tr><td>None</td></tr> |
|
52 </table> |
|
53 <h3>Class Methods</h3> |
|
54 <table> |
|
55 <tr><td>None</td></tr> |
|
56 </table> |
|
57 <h3>Methods</h3> |
|
58 <table> |
|
59 <tr> |
|
60 <td><a href="#SnapWidget.__init__">SnapWidget</a></td> |
|
61 <td>Constructor</td> |
|
62 </tr><tr> |
|
63 <td><a href="#SnapWidget.__autoIncFilename">__autoIncFilename</a></td> |
|
64 <td>Private method to auto-increment the file name.</td> |
|
65 </tr><tr> |
|
66 <td><a href="#SnapWidget.__captured">__captured</a></td> |
|
67 <td>Private slot to show a preview of the snapshot.</td> |
|
68 </tr><tr> |
|
69 <td><a href="#SnapWidget.__dragSnapshot">__dragSnapshot</a></td> |
|
70 <td>Private slot handling the dragging of the preview picture.</td> |
|
71 </tr><tr> |
|
72 <td><a href="#SnapWidget.__initFileFilters">__initFileFilters</a></td> |
|
73 <td>Private method to define the supported image file filters.</td> |
|
74 </tr><tr> |
|
75 <td><a href="#SnapWidget.__initShortcuts">__initShortcuts</a></td> |
|
76 <td>Private method to initialize the keyboard shortcuts.</td> |
|
77 </tr><tr> |
|
78 <td><a href="#SnapWidget.__quickSave">__quickSave</a></td> |
|
79 <td>Private slot to save the snapshot bypassing the file selection dialog.</td> |
|
80 </tr><tr> |
|
81 <td><a href="#SnapWidget.__redisplay">__redisplay</a></td> |
|
82 <td>Private method to redisplay the window.</td> |
|
83 </tr><tr> |
|
84 <td><a href="#SnapWidget.__saveImage">__saveImage</a></td> |
|
85 <td>Private method to save the snapshot.</td> |
|
86 </tr><tr> |
|
87 <td><a href="#SnapWidget.__updateCaption">__updateCaption</a></td> |
|
88 <td>Private method to update the window caption.</td> |
|
89 </tr><tr> |
|
90 <td><a href="#SnapWidget.__updatePreview">__updatePreview</a></td> |
|
91 <td>Private slot to update the preview picture.</td> |
|
92 </tr><tr> |
|
93 <td><a href="#SnapWidget.closeEvent">closeEvent</a></td> |
|
94 <td>Protected method handling the close event.</td> |
|
95 </tr><tr> |
|
96 <td><a href="#SnapWidget.on_copyButton_clicked">on_copyButton_clicked</a></td> |
|
97 <td>Private slot to copy the snapshot to the clipboard.</td> |
|
98 </tr><tr> |
|
99 <td><a href="#SnapWidget.on_copyPreviewButton_clicked">on_copyPreviewButton_clicked</a></td> |
|
100 <td>Private slot to copy the snapshot preview to the clipboard.</td> |
|
101 </tr><tr> |
|
102 <td><a href="#SnapWidget.on_modeCombo_currentIndexChanged">on_modeCombo_currentIndexChanged</a></td> |
|
103 <td>Private slot handling the selection of a screenshot mode.</td> |
|
104 </tr><tr> |
|
105 <td><a href="#SnapWidget.on_saveButton_clicked">on_saveButton_clicked</a></td> |
|
106 <td>Private slot to save the snapshot.</td> |
|
107 </tr><tr> |
|
108 <td><a href="#SnapWidget.on_takeButton_clicked">on_takeButton_clicked</a></td> |
|
109 <td>Private slot to take a snapshot.</td> |
|
110 </tr><tr> |
|
111 <td><a href="#SnapWidget.resizeEvent">resizeEvent</a></td> |
|
112 <td>Protected method handling a resizing of the window.</td> |
|
113 </tr> |
|
114 </table> |
|
115 <h3>Static Methods</h3> |
|
116 <table> |
|
117 <tr><td>None</td></tr> |
|
118 </table> |
|
119 <a NAME="SnapWidget.__init__" ID="SnapWidget.__init__"></a> |
|
120 <h4>SnapWidget (Constructor)</h4> |
|
121 <b>SnapWidget</b>(<i>parent=None</i>) |
|
122 <p> |
|
123 Constructor |
|
124 </p><dl> |
|
125 <dt><i>parent</i></dt> |
|
126 <dd> |
|
127 reference to the parent widget (QWidget) |
|
128 </dd> |
|
129 </dl><a NAME="SnapWidget.__autoIncFilename" ID="SnapWidget.__autoIncFilename"></a> |
|
130 <h4>SnapWidget.__autoIncFilename</h4> |
|
131 <b>__autoIncFilename</b>(<i></i>) |
|
132 <p> |
|
133 Private method to auto-increment the file name. |
|
134 </p><a NAME="SnapWidget.__captured" ID="SnapWidget.__captured"></a> |
|
135 <h4>SnapWidget.__captured</h4> |
|
136 <b>__captured</b>(<i>pixmap</i>) |
|
137 <p> |
|
138 Private slot to show a preview of the snapshot. |
|
139 </p><dl> |
|
140 <dt><i>pixmap</i></dt> |
|
141 <dd> |
|
142 pixmap of the snapshot (QPixmap) |
|
143 </dd> |
|
144 </dl><a NAME="SnapWidget.__dragSnapshot" ID="SnapWidget.__dragSnapshot"></a> |
|
145 <h4>SnapWidget.__dragSnapshot</h4> |
|
146 <b>__dragSnapshot</b>(<i></i>) |
|
147 <p> |
|
148 Private slot handling the dragging of the preview picture. |
|
149 </p><a NAME="SnapWidget.__initFileFilters" ID="SnapWidget.__initFileFilters"></a> |
|
150 <h4>SnapWidget.__initFileFilters</h4> |
|
151 <b>__initFileFilters</b>(<i></i>) |
|
152 <p> |
|
153 Private method to define the supported image file filters. |
|
154 </p><a NAME="SnapWidget.__initShortcuts" ID="SnapWidget.__initShortcuts"></a> |
|
155 <h4>SnapWidget.__initShortcuts</h4> |
|
156 <b>__initShortcuts</b>(<i></i>) |
|
157 <p> |
|
158 Private method to initialize the keyboard shortcuts. |
|
159 </p><a NAME="SnapWidget.__quickSave" ID="SnapWidget.__quickSave"></a> |
|
160 <h4>SnapWidget.__quickSave</h4> |
|
161 <b>__quickSave</b>(<i></i>) |
|
162 <p> |
|
163 Private slot to save the snapshot bypassing the file selection dialog. |
|
164 </p><a NAME="SnapWidget.__redisplay" ID="SnapWidget.__redisplay"></a> |
|
165 <h4>SnapWidget.__redisplay</h4> |
|
166 <b>__redisplay</b>(<i></i>) |
|
167 <p> |
|
168 Private method to redisplay the window. |
|
169 </p><a NAME="SnapWidget.__saveImage" ID="SnapWidget.__saveImage"></a> |
|
170 <h4>SnapWidget.__saveImage</h4> |
|
171 <b>__saveImage</b>(<i>fileName</i>) |
|
172 <p> |
|
173 Private method to save the snapshot. |
|
174 </p><dl> |
|
175 <dt><i>fileName</i></dt> |
|
176 <dd> |
|
177 name of the file to save to (string) |
|
178 </dd> |
|
179 </dl><dl> |
|
180 <dt>Returns:</dt> |
|
181 <dd> |
|
182 flag indicating success (boolean) |
|
183 </dd> |
|
184 </dl><a NAME="SnapWidget.__updateCaption" ID="SnapWidget.__updateCaption"></a> |
|
185 <h4>SnapWidget.__updateCaption</h4> |
|
186 <b>__updateCaption</b>(<i></i>) |
|
187 <p> |
|
188 Private method to update the window caption. |
|
189 </p><a NAME="SnapWidget.__updatePreview" ID="SnapWidget.__updatePreview"></a> |
|
190 <h4>SnapWidget.__updatePreview</h4> |
|
191 <b>__updatePreview</b>(<i></i>) |
|
192 <p> |
|
193 Private slot to update the preview picture. |
|
194 </p><a NAME="SnapWidget.closeEvent" ID="SnapWidget.closeEvent"></a> |
|
195 <h4>SnapWidget.closeEvent</h4> |
|
196 <b>closeEvent</b>(<i>evt</i>) |
|
197 <p> |
|
198 Protected method handling the close event. |
|
199 </p><dl> |
|
200 <dt><i>evt</i></dt> |
|
201 <dd> |
|
202 close event (QCloseEvent) |
|
203 </dd> |
|
204 </dl><a NAME="SnapWidget.on_copyButton_clicked" ID="SnapWidget.on_copyButton_clicked"></a> |
|
205 <h4>SnapWidget.on_copyButton_clicked</h4> |
|
206 <b>on_copyButton_clicked</b>(<i></i>) |
|
207 <p> |
|
208 Private slot to copy the snapshot to the clipboard. |
|
209 </p><a NAME="SnapWidget.on_copyPreviewButton_clicked" ID="SnapWidget.on_copyPreviewButton_clicked"></a> |
|
210 <h4>SnapWidget.on_copyPreviewButton_clicked</h4> |
|
211 <b>on_copyPreviewButton_clicked</b>(<i></i>) |
|
212 <p> |
|
213 Private slot to copy the snapshot preview to the clipboard. |
|
214 </p><a NAME="SnapWidget.on_modeCombo_currentIndexChanged" ID="SnapWidget.on_modeCombo_currentIndexChanged"></a> |
|
215 <h4>SnapWidget.on_modeCombo_currentIndexChanged</h4> |
|
216 <b>on_modeCombo_currentIndexChanged</b>(<i>index</i>) |
|
217 <p> |
|
218 Private slot handling the selection of a screenshot mode. |
|
219 </p><dl> |
|
220 <dt><i>index</i> (int)</dt> |
|
221 <dd> |
|
222 index of the selection |
|
223 </dd> |
|
224 </dl><a NAME="SnapWidget.on_saveButton_clicked" ID="SnapWidget.on_saveButton_clicked"></a> |
|
225 <h4>SnapWidget.on_saveButton_clicked</h4> |
|
226 <b>on_saveButton_clicked</b>(<i></i>) |
|
227 <p> |
|
228 Private slot to save the snapshot. |
|
229 </p><a NAME="SnapWidget.on_takeButton_clicked" ID="SnapWidget.on_takeButton_clicked"></a> |
|
230 <h4>SnapWidget.on_takeButton_clicked</h4> |
|
231 <b>on_takeButton_clicked</b>(<i></i>) |
|
232 <p> |
|
233 Private slot to take a snapshot. |
|
234 </p><a NAME="SnapWidget.resizeEvent" ID="SnapWidget.resizeEvent"></a> |
|
235 <h4>SnapWidget.resizeEvent</h4> |
|
236 <b>resizeEvent</b>(<i>evt</i>) |
|
237 <p> |
|
238 Protected method handling a resizing of the window. |
|
239 </p><dl> |
|
240 <dt><i>evt</i></dt> |
|
241 <dd> |
|
242 resize event (QResizeEvent) |
|
243 </dd> |
|
244 </dl> |
|
245 <div align="right"><a href="#top">Up</a></div> |
|
246 <hr /> |
|
247 </body></html> |