|
1 <!DOCTYPE html> |
|
2 <html><head> |
|
3 <title>eric7.Tools.UIPreviewer</title> |
|
4 <meta charset="UTF-8"> |
|
5 <link rel="stylesheet" href="styles.css"> |
|
6 </head> |
|
7 <body> |
|
8 <a NAME="top" ID="top"></a> |
|
9 <h1>eric7.Tools.UIPreviewer</h1> |
|
10 |
|
11 <p> |
|
12 Module implementing the UI Previewer main window. |
|
13 </p> |
|
14 <h3>Global Attributes</h3> |
|
15 |
|
16 <table> |
|
17 <tr><td>None</td></tr> |
|
18 </table> |
|
19 <h3>Classes</h3> |
|
20 |
|
21 <table> |
|
22 |
|
23 <tr> |
|
24 <td><a href="#UIPreviewer">UIPreviewer</a></td> |
|
25 <td>Class implementing the UI Previewer main window.</td> |
|
26 </tr> |
|
27 </table> |
|
28 <h3>Functions</h3> |
|
29 |
|
30 <table> |
|
31 <tr><td>None</td></tr> |
|
32 </table> |
|
33 <hr /> |
|
34 <hr /> |
|
35 <a NAME="UIPreviewer" ID="UIPreviewer"></a> |
|
36 <h2>UIPreviewer</h2> |
|
37 |
|
38 <p> |
|
39 Class implementing the UI Previewer main window. |
|
40 </p> |
|
41 <h3>Derived from</h3> |
|
42 EricMainWindow |
|
43 <h3>Class Attributes</h3> |
|
44 |
|
45 <table> |
|
46 <tr><td>None</td></tr> |
|
47 </table> |
|
48 <h3>Class Methods</h3> |
|
49 |
|
50 <table> |
|
51 <tr><td>None</td></tr> |
|
52 </table> |
|
53 <h3>Methods</h3> |
|
54 |
|
55 <table> |
|
56 |
|
57 <tr> |
|
58 <td><a href="#UIPreviewer.__init__">UIPreviewer</a></td> |
|
59 <td>Constructor</td> |
|
60 </tr> |
|
61 <tr> |
|
62 <td><a href="#UIPreviewer.__about">__about</a></td> |
|
63 <td>Private slot to show the about information.</td> |
|
64 </tr> |
|
65 <tr> |
|
66 <td><a href="#UIPreviewer.__aboutQt">__aboutQt</a></td> |
|
67 <td>Private slot to show info about Qt.</td> |
|
68 </tr> |
|
69 <tr> |
|
70 <td><a href="#UIPreviewer.__copyImageToClipboard">__copyImageToClipboard</a></td> |
|
71 <td>Private slot to handle the Copy Image menu action.</td> |
|
72 </tr> |
|
73 <tr> |
|
74 <td><a href="#UIPreviewer.__guiStyleSelected">__guiStyleSelected</a></td> |
|
75 <td>Private slot to handle the selection of a GUI style.</td> |
|
76 </tr> |
|
77 <tr> |
|
78 <td><a href="#UIPreviewer.__handleCloseEvent">__handleCloseEvent</a></td> |
|
79 <td>Private slot to handle the close event of a viewed QMainWidget.</td> |
|
80 </tr> |
|
81 <tr> |
|
82 <td><a href="#UIPreviewer.__initActions">__initActions</a></td> |
|
83 <td>Private method to define the user interface actions.</td> |
|
84 </tr> |
|
85 <tr> |
|
86 <td><a href="#UIPreviewer.__initMenus">__initMenus</a></td> |
|
87 <td>Private method to create the menus.</td> |
|
88 </tr> |
|
89 <tr> |
|
90 <td><a href="#UIPreviewer.__initToolbars">__initToolbars</a></td> |
|
91 <td>Private method to create the toolbars.</td> |
|
92 </tr> |
|
93 <tr> |
|
94 <td><a href="#UIPreviewer.__loadFile">__loadFile</a></td> |
|
95 <td>Private slot to load a ui file.</td> |
|
96 </tr> |
|
97 <tr> |
|
98 <td><a href="#UIPreviewer.__openFile">__openFile</a></td> |
|
99 <td>Private slot to load a new file.</td> |
|
100 </tr> |
|
101 <tr> |
|
102 <td><a href="#UIPreviewer.__print">__print</a></td> |
|
103 <td>Private slot to the actual printing.</td> |
|
104 </tr> |
|
105 <tr> |
|
106 <td><a href="#UIPreviewer.__printImage">__printImage</a></td> |
|
107 <td>Private slot to handle the Print Image menu action.</td> |
|
108 </tr> |
|
109 <tr> |
|
110 <td><a href="#UIPreviewer.__printPreviewImage">__printPreviewImage</a></td> |
|
111 <td>Private slot to handle the Print Preview menu action.</td> |
|
112 </tr> |
|
113 <tr> |
|
114 <td><a href="#UIPreviewer.__saveImage">__saveImage</a></td> |
|
115 <td>Private slot to handle the Save Image menu action.</td> |
|
116 </tr> |
|
117 <tr> |
|
118 <td><a href="#UIPreviewer.__updateActions">__updateActions</a></td> |
|
119 <td>Private slot to update the actions state.</td> |
|
120 </tr> |
|
121 <tr> |
|
122 <td><a href="#UIPreviewer.__updateChildren">__updateChildren</a></td> |
|
123 <td>Private slot to change the style of the show UI.</td> |
|
124 </tr> |
|
125 <tr> |
|
126 <td><a href="#UIPreviewer.__whatsThis">__whatsThis</a></td> |
|
127 <td>Private slot called in to enter Whats This mode.</td> |
|
128 </tr> |
|
129 <tr> |
|
130 <td><a href="#UIPreviewer.eventFilter">eventFilter</a></td> |
|
131 <td>Public method called to filter an event.</td> |
|
132 </tr> |
|
133 <tr> |
|
134 <td><a href="#UIPreviewer.show">show</a></td> |
|
135 <td>Public slot to show this dialog.</td> |
|
136 </tr> |
|
137 </table> |
|
138 <h3>Static Methods</h3> |
|
139 |
|
140 <table> |
|
141 <tr><td>None</td></tr> |
|
142 </table> |
|
143 |
|
144 <a NAME="UIPreviewer.__init__" ID="UIPreviewer.__init__"></a> |
|
145 <h4>UIPreviewer (Constructor)</h4> |
|
146 <b>UIPreviewer</b>(<i>filename=None, parent=None, name=None</i>) |
|
147 |
|
148 <p> |
|
149 Constructor |
|
150 </p> |
|
151 <dl> |
|
152 |
|
153 <dt><i>filename</i></dt> |
|
154 <dd> |
|
155 name of a UI file to load |
|
156 </dd> |
|
157 <dt><i>parent</i></dt> |
|
158 <dd> |
|
159 parent widget of this window (QWidget) |
|
160 </dd> |
|
161 <dt><i>name</i></dt> |
|
162 <dd> |
|
163 name of this window (string) |
|
164 </dd> |
|
165 </dl> |
|
166 <a NAME="UIPreviewer.__about" ID="UIPreviewer.__about"></a> |
|
167 <h4>UIPreviewer.__about</h4> |
|
168 <b>__about</b>(<i></i>) |
|
169 |
|
170 <p> |
|
171 Private slot to show the about information. |
|
172 </p> |
|
173 <a NAME="UIPreviewer.__aboutQt" ID="UIPreviewer.__aboutQt"></a> |
|
174 <h4>UIPreviewer.__aboutQt</h4> |
|
175 <b>__aboutQt</b>(<i></i>) |
|
176 |
|
177 <p> |
|
178 Private slot to show info about Qt. |
|
179 </p> |
|
180 <a NAME="UIPreviewer.__copyImageToClipboard" ID="UIPreviewer.__copyImageToClipboard"></a> |
|
181 <h4>UIPreviewer.__copyImageToClipboard</h4> |
|
182 <b>__copyImageToClipboard</b>(<i></i>) |
|
183 |
|
184 <p> |
|
185 Private slot to handle the Copy Image menu action. |
|
186 </p> |
|
187 <a NAME="UIPreviewer.__guiStyleSelected" ID="UIPreviewer.__guiStyleSelected"></a> |
|
188 <h4>UIPreviewer.__guiStyleSelected</h4> |
|
189 <b>__guiStyleSelected</b>(<i>index</i>) |
|
190 |
|
191 <p> |
|
192 Private slot to handle the selection of a GUI style. |
|
193 </p> |
|
194 <dl> |
|
195 |
|
196 <dt><i>index</i> (int)</dt> |
|
197 <dd> |
|
198 index of the selected entry |
|
199 </dd> |
|
200 </dl> |
|
201 <a NAME="UIPreviewer.__handleCloseEvent" ID="UIPreviewer.__handleCloseEvent"></a> |
|
202 <h4>UIPreviewer.__handleCloseEvent</h4> |
|
203 <b>__handleCloseEvent</b>(<i></i>) |
|
204 |
|
205 <p> |
|
206 Private slot to handle the close event of a viewed QMainWidget. |
|
207 </p> |
|
208 <a NAME="UIPreviewer.__initActions" ID="UIPreviewer.__initActions"></a> |
|
209 <h4>UIPreviewer.__initActions</h4> |
|
210 <b>__initActions</b>(<i></i>) |
|
211 |
|
212 <p> |
|
213 Private method to define the user interface actions. |
|
214 </p> |
|
215 <a NAME="UIPreviewer.__initMenus" ID="UIPreviewer.__initMenus"></a> |
|
216 <h4>UIPreviewer.__initMenus</h4> |
|
217 <b>__initMenus</b>(<i></i>) |
|
218 |
|
219 <p> |
|
220 Private method to create the menus. |
|
221 </p> |
|
222 <a NAME="UIPreviewer.__initToolbars" ID="UIPreviewer.__initToolbars"></a> |
|
223 <h4>UIPreviewer.__initToolbars</h4> |
|
224 <b>__initToolbars</b>(<i></i>) |
|
225 |
|
226 <p> |
|
227 Private method to create the toolbars. |
|
228 </p> |
|
229 <a NAME="UIPreviewer.__loadFile" ID="UIPreviewer.__loadFile"></a> |
|
230 <h4>UIPreviewer.__loadFile</h4> |
|
231 <b>__loadFile</b>(<i>fn</i>) |
|
232 |
|
233 <p> |
|
234 Private slot to load a ui file. |
|
235 </p> |
|
236 <dl> |
|
237 |
|
238 <dt><i>fn</i> (str)</dt> |
|
239 <dd> |
|
240 name of the ui file to be laoded |
|
241 </dd> |
|
242 </dl> |
|
243 <a NAME="UIPreviewer.__openFile" ID="UIPreviewer.__openFile"></a> |
|
244 <h4>UIPreviewer.__openFile</h4> |
|
245 <b>__openFile</b>(<i></i>) |
|
246 |
|
247 <p> |
|
248 Private slot to load a new file. |
|
249 </p> |
|
250 <a NAME="UIPreviewer.__print" ID="UIPreviewer.__print"></a> |
|
251 <h4>UIPreviewer.__print</h4> |
|
252 <b>__print</b>(<i>printer</i>) |
|
253 |
|
254 <p> |
|
255 Private slot to the actual printing. |
|
256 </p> |
|
257 <dl> |
|
258 |
|
259 <dt><i>printer</i></dt> |
|
260 <dd> |
|
261 reference to the printer object (QPrinter) |
|
262 </dd> |
|
263 </dl> |
|
264 <a NAME="UIPreviewer.__printImage" ID="UIPreviewer.__printImage"></a> |
|
265 <h4>UIPreviewer.__printImage</h4> |
|
266 <b>__printImage</b>(<i></i>) |
|
267 |
|
268 <p> |
|
269 Private slot to handle the Print Image menu action. |
|
270 </p> |
|
271 <a NAME="UIPreviewer.__printPreviewImage" ID="UIPreviewer.__printPreviewImage"></a> |
|
272 <h4>UIPreviewer.__printPreviewImage</h4> |
|
273 <b>__printPreviewImage</b>(<i></i>) |
|
274 |
|
275 <p> |
|
276 Private slot to handle the Print Preview menu action. |
|
277 </p> |
|
278 <a NAME="UIPreviewer.__saveImage" ID="UIPreviewer.__saveImage"></a> |
|
279 <h4>UIPreviewer.__saveImage</h4> |
|
280 <b>__saveImage</b>(<i></i>) |
|
281 |
|
282 <p> |
|
283 Private slot to handle the Save Image menu action. |
|
284 </p> |
|
285 <a NAME="UIPreviewer.__updateActions" ID="UIPreviewer.__updateActions"></a> |
|
286 <h4>UIPreviewer.__updateActions</h4> |
|
287 <b>__updateActions</b>(<i></i>) |
|
288 |
|
289 <p> |
|
290 Private slot to update the actions state. |
|
291 </p> |
|
292 <a NAME="UIPreviewer.__updateChildren" ID="UIPreviewer.__updateChildren"></a> |
|
293 <h4>UIPreviewer.__updateChildren</h4> |
|
294 <b>__updateChildren</b>(<i>sstyle</i>) |
|
295 |
|
296 <p> |
|
297 Private slot to change the style of the show UI. |
|
298 </p> |
|
299 <dl> |
|
300 |
|
301 <dt><i>sstyle</i></dt> |
|
302 <dd> |
|
303 name of the selected style (string) |
|
304 </dd> |
|
305 </dl> |
|
306 <a NAME="UIPreviewer.__whatsThis" ID="UIPreviewer.__whatsThis"></a> |
|
307 <h4>UIPreviewer.__whatsThis</h4> |
|
308 <b>__whatsThis</b>(<i></i>) |
|
309 |
|
310 <p> |
|
311 Private slot called in to enter Whats This mode. |
|
312 </p> |
|
313 <a NAME="UIPreviewer.eventFilter" ID="UIPreviewer.eventFilter"></a> |
|
314 <h4>UIPreviewer.eventFilter</h4> |
|
315 <b>eventFilter</b>(<i>obj, ev</i>) |
|
316 |
|
317 <p> |
|
318 Public method called to filter an event. |
|
319 </p> |
|
320 <dl> |
|
321 |
|
322 <dt><i>obj</i></dt> |
|
323 <dd> |
|
324 object, that generated the event (QObject) |
|
325 </dd> |
|
326 <dt><i>ev</i></dt> |
|
327 <dd> |
|
328 the event, that was generated by object (QEvent) |
|
329 </dd> |
|
330 </dl> |
|
331 <dl> |
|
332 <dt>Return:</dt> |
|
333 <dd> |
|
334 flag indicating if event was filtered out |
|
335 </dd> |
|
336 </dl> |
|
337 <a NAME="UIPreviewer.show" ID="UIPreviewer.show"></a> |
|
338 <h4>UIPreviewer.show</h4> |
|
339 <b>show</b>(<i></i>) |
|
340 |
|
341 <p> |
|
342 Public slot to show this dialog. |
|
343 </p> |
|
344 <p> |
|
345 This overloaded slot loads a UI file to be previewed after |
|
346 the main window has been shown. This way, previewing a dialog |
|
347 doesn't interfere with showing the main window. |
|
348 </p> |
|
349 <div align="right"><a href="#top">Up</a></div> |
|
350 <hr /> |
|
351 </body></html> |