|
1 <!DOCTYPE html> |
|
2 <html><head> |
|
3 <title>eric7.EricWidgets.EricPassivePopup</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.EricWidgets.EricPassivePopup</h1> |
|
10 |
|
11 <p> |
|
12 Module implementing dialog-like popup that displays messages without |
|
13 interrupting the user. |
|
14 </p> |
|
15 <h3>Global Attributes</h3> |
|
16 |
|
17 <table> |
|
18 <tr><td>None</td></tr> |
|
19 </table> |
|
20 <h3>Classes</h3> |
|
21 |
|
22 <table> |
|
23 |
|
24 <tr> |
|
25 <td><a href="#EricPassivePopup">EricPassivePopup</a></td> |
|
26 <td>Class implementing dialog-like popup that displays messages without interrupting the user.</td> |
|
27 </tr> |
|
28 <tr> |
|
29 <td><a href="#EricPassivePopupStyle">EricPassivePopupStyle</a></td> |
|
30 <td>Class defining the popup styles.</td> |
|
31 </tr> |
|
32 </table> |
|
33 <h3>Functions</h3> |
|
34 |
|
35 <table> |
|
36 <tr><td>None</td></tr> |
|
37 </table> |
|
38 <hr /> |
|
39 <hr /> |
|
40 <a NAME="EricPassivePopup" ID="EricPassivePopup"></a> |
|
41 <h2>EricPassivePopup</h2> |
|
42 |
|
43 <p> |
|
44 Class implementing dialog-like popup that displays messages without |
|
45 interrupting the user. |
|
46 </p> |
|
47 <h3>Signals</h3> |
|
48 <dl> |
|
49 |
|
50 <dt>clicked</dt> |
|
51 <dd> |
|
52 emitted to indicate a mouse button click |
|
53 </dd> |
|
54 </dl> |
|
55 <h3>Derived from</h3> |
|
56 QFrame |
|
57 <h3>Class Attributes</h3> |
|
58 |
|
59 <table> |
|
60 <tr><td>DefaultPopupTime</td></tr> |
|
61 </table> |
|
62 <h3>Class Methods</h3> |
|
63 |
|
64 <table> |
|
65 <tr><td>None</td></tr> |
|
66 </table> |
|
67 <h3>Methods</h3> |
|
68 |
|
69 <table> |
|
70 |
|
71 <tr> |
|
72 <td><a href="#EricPassivePopup.__init__">EricPassivePopup</a></td> |
|
73 <td>Constructor</td> |
|
74 </tr> |
|
75 <tr> |
|
76 <td><a href="#EricPassivePopup.__calculateNearbyPoint">__calculateNearbyPoint</a></td> |
|
77 <td>Private method to calculate the position to place the popup near the specified rectangle.</td> |
|
78 </tr> |
|
79 <tr> |
|
80 <td><a href="#EricPassivePopup.__defaultArea">__defaultArea</a></td> |
|
81 <td>Private method to determine the default rectangle to be passed to moveNear().</td> |
|
82 </tr> |
|
83 <tr> |
|
84 <td><a href="#EricPassivePopup.__moveNear">__moveNear</a></td> |
|
85 <td>Private method to move the popup to be adjacent to the specified rectangle.</td> |
|
86 </tr> |
|
87 <tr> |
|
88 <td><a href="#EricPassivePopup.__positionSelf">__positionSelf</a></td> |
|
89 <td>Private method to position the popup.</td> |
|
90 </tr> |
|
91 <tr> |
|
92 <td><a href="#EricPassivePopup.getCustomData">getCustomData</a></td> |
|
93 <td>Public method to get some custom data.</td> |
|
94 </tr> |
|
95 <tr> |
|
96 <td><a href="#EricPassivePopup.hideEvent">hideEvent</a></td> |
|
97 <td>Protected method to handle the hide event.</td> |
|
98 </tr> |
|
99 <tr> |
|
100 <td><a href="#EricPassivePopup.mouseReleaseEvent">mouseReleaseEvent</a></td> |
|
101 <td>Protected method to handle a mouse release event.</td> |
|
102 </tr> |
|
103 <tr> |
|
104 <td><a href="#EricPassivePopup.setCustomData">setCustomData</a></td> |
|
105 <td>Public method to set some custom data.</td> |
|
106 </tr> |
|
107 <tr> |
|
108 <td><a href="#EricPassivePopup.setTimeout">setTimeout</a></td> |
|
109 <td>Public method to set the delay for the popup is removed automatically.</td> |
|
110 </tr> |
|
111 <tr> |
|
112 <td><a href="#EricPassivePopup.setView">setView</a></td> |
|
113 <td>Public method to set the message view.</td> |
|
114 </tr> |
|
115 <tr> |
|
116 <td><a href="#EricPassivePopup.setVisible">setVisible</a></td> |
|
117 <td>Public method to show or hide the popup.</td> |
|
118 </tr> |
|
119 <tr> |
|
120 <td><a href="#EricPassivePopup.show">show</a></td> |
|
121 <td>Public slot to show the popup.</td> |
|
122 </tr> |
|
123 <tr> |
|
124 <td><a href="#EricPassivePopup.timeout">timeout</a></td> |
|
125 <td>Public method to get the delay before the popup is removed automatically.</td> |
|
126 </tr> |
|
127 <tr> |
|
128 <td><a href="#EricPassivePopup.view">view</a></td> |
|
129 <td>Public method to get a reference to the message view.</td> |
|
130 </tr> |
|
131 </table> |
|
132 <h3>Static Methods</h3> |
|
133 |
|
134 <table> |
|
135 <tr><td>None</td></tr> |
|
136 </table> |
|
137 |
|
138 <a NAME="EricPassivePopup.__init__" ID="EricPassivePopup.__init__"></a> |
|
139 <h4>EricPassivePopup (Constructor)</h4> |
|
140 <b>EricPassivePopup</b>(<i>style=EricPassivePopupStyle.BOXED, parent=None</i>) |
|
141 |
|
142 <p> |
|
143 Constructor |
|
144 </p> |
|
145 <dl> |
|
146 |
|
147 <dt><i>style</i> (EricPassivePopupStyle)</dt> |
|
148 <dd> |
|
149 style of the popup |
|
150 </dd> |
|
151 <dt><i>parent</i> (QWidget)</dt> |
|
152 <dd> |
|
153 reference to the parent widget |
|
154 </dd> |
|
155 </dl> |
|
156 <a NAME="EricPassivePopup.__calculateNearbyPoint" ID="EricPassivePopup.__calculateNearbyPoint"></a> |
|
157 <h4>EricPassivePopup.__calculateNearbyPoint</h4> |
|
158 <b>__calculateNearbyPoint</b>(<i>target</i>) |
|
159 |
|
160 <p> |
|
161 Private method to calculate the position to place the popup near the |
|
162 specified rectangle. |
|
163 </p> |
|
164 <dl> |
|
165 |
|
166 <dt><i>target</i></dt> |
|
167 <dd> |
|
168 rectangle to be placed at (QRect) |
|
169 </dd> |
|
170 </dl> |
|
171 <dl> |
|
172 <dt>Return:</dt> |
|
173 <dd> |
|
174 position to place the popup (QPoint) |
|
175 </dd> |
|
176 </dl> |
|
177 <a NAME="EricPassivePopup.__defaultArea" ID="EricPassivePopup.__defaultArea"></a> |
|
178 <h4>EricPassivePopup.__defaultArea</h4> |
|
179 <b>__defaultArea</b>(<i></i>) |
|
180 |
|
181 <p> |
|
182 Private method to determine the default rectangle to be passed to |
|
183 moveNear(). |
|
184 </p> |
|
185 <dl> |
|
186 <dt>Return:</dt> |
|
187 <dd> |
|
188 default rectangle (QRect) |
|
189 </dd> |
|
190 </dl> |
|
191 <a NAME="EricPassivePopup.__moveNear" ID="EricPassivePopup.__moveNear"></a> |
|
192 <h4>EricPassivePopup.__moveNear</h4> |
|
193 <b>__moveNear</b>(<i>target</i>) |
|
194 |
|
195 <p> |
|
196 Private method to move the popup to be adjacent to the specified |
|
197 rectangle. |
|
198 </p> |
|
199 <dl> |
|
200 |
|
201 <dt><i>target</i></dt> |
|
202 <dd> |
|
203 rectangle to be placed at (QRect) |
|
204 </dd> |
|
205 </dl> |
|
206 <a NAME="EricPassivePopup.__positionSelf" ID="EricPassivePopup.__positionSelf"></a> |
|
207 <h4>EricPassivePopup.__positionSelf</h4> |
|
208 <b>__positionSelf</b>(<i></i>) |
|
209 |
|
210 <p> |
|
211 Private method to position the popup. |
|
212 </p> |
|
213 <a NAME="EricPassivePopup.getCustomData" ID="EricPassivePopup.getCustomData"></a> |
|
214 <h4>EricPassivePopup.getCustomData</h4> |
|
215 <b>getCustomData</b>(<i>key</i>) |
|
216 |
|
217 <p> |
|
218 Public method to get some custom data. |
|
219 </p> |
|
220 <dl> |
|
221 |
|
222 <dt><i>key</i> (str)</dt> |
|
223 <dd> |
|
224 key for the custom data |
|
225 </dd> |
|
226 </dl> |
|
227 <dl> |
|
228 <dt>Return:</dt> |
|
229 <dd> |
|
230 stored data |
|
231 </dd> |
|
232 </dl> |
|
233 <dl> |
|
234 <dt>Return Type:</dt> |
|
235 <dd> |
|
236 any |
|
237 </dd> |
|
238 </dl> |
|
239 <a NAME="EricPassivePopup.hideEvent" ID="EricPassivePopup.hideEvent"></a> |
|
240 <h4>EricPassivePopup.hideEvent</h4> |
|
241 <b>hideEvent</b>(<i>evt</i>) |
|
242 |
|
243 <p> |
|
244 Protected method to handle the hide event. |
|
245 </p> |
|
246 <dl> |
|
247 |
|
248 <dt><i>evt</i></dt> |
|
249 <dd> |
|
250 reference to the hide event (QHideEvent) |
|
251 </dd> |
|
252 </dl> |
|
253 <a NAME="EricPassivePopup.mouseReleaseEvent" ID="EricPassivePopup.mouseReleaseEvent"></a> |
|
254 <h4>EricPassivePopup.mouseReleaseEvent</h4> |
|
255 <b>mouseReleaseEvent</b>(<i>evt</i>) |
|
256 |
|
257 <p> |
|
258 Protected method to handle a mouse release event. |
|
259 </p> |
|
260 <dl> |
|
261 |
|
262 <dt><i>evt</i></dt> |
|
263 <dd> |
|
264 reference to the mouse event (QMouseEvent) |
|
265 </dd> |
|
266 </dl> |
|
267 <a NAME="EricPassivePopup.setCustomData" ID="EricPassivePopup.setCustomData"></a> |
|
268 <h4>EricPassivePopup.setCustomData</h4> |
|
269 <b>setCustomData</b>(<i>key, data</i>) |
|
270 |
|
271 <p> |
|
272 Public method to set some custom data. |
|
273 </p> |
|
274 <dl> |
|
275 |
|
276 <dt><i>key</i> (str)</dt> |
|
277 <dd> |
|
278 key for the custom data |
|
279 </dd> |
|
280 <dt><i>data</i> (any)</dt> |
|
281 <dd> |
|
282 data to be stored |
|
283 </dd> |
|
284 </dl> |
|
285 <a NAME="EricPassivePopup.setTimeout" ID="EricPassivePopup.setTimeout"></a> |
|
286 <h4>EricPassivePopup.setTimeout</h4> |
|
287 <b>setTimeout</b>(<i>delay</i>) |
|
288 |
|
289 <p> |
|
290 Public method to set the delay for the popup is removed automatically. |
|
291 </p> |
|
292 <p> |
|
293 Setting the delay to 0 disables the timeout. If you're doing this, you |
|
294 may want to connect the clicked() signal to the hide() slot. Setting |
|
295 the delay to -1 makes it use the default value. |
|
296 </p> |
|
297 <dl> |
|
298 |
|
299 <dt><i>delay</i></dt> |
|
300 <dd> |
|
301 value for the delay in milliseconds (integer) |
|
302 </dd> |
|
303 </dl> |
|
304 <a NAME="EricPassivePopup.setView" ID="EricPassivePopup.setView"></a> |
|
305 <h4>EricPassivePopup.setView</h4> |
|
306 <b>setView</b>(<i>child</i>) |
|
307 |
|
308 <p> |
|
309 Public method to set the message view. |
|
310 </p> |
|
311 <dl> |
|
312 |
|
313 <dt><i>child</i></dt> |
|
314 <dd> |
|
315 reference to the widget to set as the message view |
|
316 (QWidget) |
|
317 </dd> |
|
318 </dl> |
|
319 <a NAME="EricPassivePopup.setVisible" ID="EricPassivePopup.setVisible"></a> |
|
320 <h4>EricPassivePopup.setVisible</h4> |
|
321 <b>setVisible</b>(<i>visible</i>) |
|
322 |
|
323 <p> |
|
324 Public method to show or hide the popup. |
|
325 </p> |
|
326 <dl> |
|
327 |
|
328 <dt><i>visible</i></dt> |
|
329 <dd> |
|
330 flag indicating the visibility status (boolean) |
|
331 </dd> |
|
332 </dl> |
|
333 <a NAME="EricPassivePopup.show" ID="EricPassivePopup.show"></a> |
|
334 <h4>EricPassivePopup.show</h4> |
|
335 <b>show</b>(<i>p=None</i>) |
|
336 |
|
337 <p> |
|
338 Public slot to show the popup. |
|
339 </p> |
|
340 <dl> |
|
341 |
|
342 <dt><i>p</i></dt> |
|
343 <dd> |
|
344 position for the popup (QPoint) |
|
345 </dd> |
|
346 </dl> |
|
347 <a NAME="EricPassivePopup.timeout" ID="EricPassivePopup.timeout"></a> |
|
348 <h4>EricPassivePopup.timeout</h4> |
|
349 <b>timeout</b>(<i></i>) |
|
350 |
|
351 <p> |
|
352 Public method to get the delay before the popup is removed |
|
353 automatically. |
|
354 </p> |
|
355 <dl> |
|
356 <dt>Return:</dt> |
|
357 <dd> |
|
358 the delay before the popup is removed automatically (integer) |
|
359 </dd> |
|
360 </dl> |
|
361 <a NAME="EricPassivePopup.view" ID="EricPassivePopup.view"></a> |
|
362 <h4>EricPassivePopup.view</h4> |
|
363 <b>view</b>(<i></i>) |
|
364 |
|
365 <p> |
|
366 Public method to get a reference to the message view. |
|
367 </p> |
|
368 <dl> |
|
369 <dt>Return:</dt> |
|
370 <dd> |
|
371 reference to the message view (QWidget) |
|
372 </dd> |
|
373 </dl> |
|
374 <div align="right"><a href="#top">Up</a></div> |
|
375 <hr /> |
|
376 <hr /> |
|
377 <a NAME="EricPassivePopupStyle" ID="EricPassivePopupStyle"></a> |
|
378 <h2>EricPassivePopupStyle</h2> |
|
379 |
|
380 <p> |
|
381 Class defining the popup styles. |
|
382 </p> |
|
383 <h3>Derived from</h3> |
|
384 enum.Enum |
|
385 <h3>Class Attributes</h3> |
|
386 |
|
387 <table> |
|
388 <tr><td>BOXED</td></tr><tr><td>CUSTOM</td></tr><tr><td>STYLED</td></tr> |
|
389 </table> |
|
390 <h3>Class Methods</h3> |
|
391 |
|
392 <table> |
|
393 <tr><td>None</td></tr> |
|
394 </table> |
|
395 <h3>Methods</h3> |
|
396 |
|
397 <table> |
|
398 <tr><td>None</td></tr> |
|
399 </table> |
|
400 <h3>Static Methods</h3> |
|
401 |
|
402 <table> |
|
403 <tr><td>None</td></tr> |
|
404 </table> |
|
405 |
|
406 <div align="right"><a href="#top">Up</a></div> |
|
407 <hr /> |
|
408 </body></html> |