|
1 <!DOCTYPE html> |
|
2 <html><head> |
|
3 <title>eric7.UI.NotificationWidget</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> |
|
22 <a NAME="top" ID="top"></a> |
|
23 <h1>eric7.UI.NotificationWidget</h1> |
|
24 |
|
25 <p> |
|
26 Module implementing a Notification widget. |
|
27 </p> |
|
28 <h3>Global Attributes</h3> |
|
29 |
|
30 <table> |
|
31 <tr><td>None</td></tr> |
|
32 </table> |
|
33 <h3>Classes</h3> |
|
34 |
|
35 <table> |
|
36 |
|
37 <tr> |
|
38 <td><a href="#NotificationFrame">NotificationFrame</a></td> |
|
39 <td>Class implementing a Notification widget.</td> |
|
40 </tr> |
|
41 <tr> |
|
42 <td><a href="#NotificationTypes">NotificationTypes</a></td> |
|
43 <td>Class implementing the notification types.</td> |
|
44 </tr> |
|
45 <tr> |
|
46 <td><a href="#NotificationWidget">NotificationWidget</a></td> |
|
47 <td>Class implementing a Notification list widget.</td> |
|
48 </tr> |
|
49 </table> |
|
50 <h3>Functions</h3> |
|
51 |
|
52 <table> |
|
53 <tr><td>None</td></tr> |
|
54 </table> |
|
55 <hr /> |
|
56 <hr /> |
|
57 <a NAME="NotificationFrame" ID="NotificationFrame"></a> |
|
58 <h2>NotificationFrame</h2> |
|
59 |
|
60 <p> |
|
61 Class implementing a Notification widget. |
|
62 </p> |
|
63 <h3>Derived from</h3> |
|
64 QFrame, Ui_NotificationFrame |
|
65 <h3>Class Attributes</h3> |
|
66 |
|
67 <table> |
|
68 <tr><td>NotificationStyleSheetTemplate</td></tr> |
|
69 </table> |
|
70 <h3>Class Methods</h3> |
|
71 |
|
72 <table> |
|
73 |
|
74 <tr> |
|
75 <td><a href="#NotificationFrame.getIcon">getIcon</a></td> |
|
76 <td>Class method to get the icon for a specific notification kind.</td> |
|
77 </tr> |
|
78 <tr> |
|
79 <td><a href="#NotificationFrame.getStyleSheet">getStyleSheet</a></td> |
|
80 <td>Class method to get a style sheet for specific notification kind.</td> |
|
81 </tr> |
|
82 </table> |
|
83 <h3>Methods</h3> |
|
84 |
|
85 <table> |
|
86 |
|
87 <tr> |
|
88 <td><a href="#NotificationFrame.__init__">NotificationFrame</a></td> |
|
89 <td>Constructor</td> |
|
90 </tr> |
|
91 </table> |
|
92 <h3>Static Methods</h3> |
|
93 |
|
94 <table> |
|
95 <tr><td>None</td></tr> |
|
96 </table> |
|
97 |
|
98 <a NAME="NotificationFrame.getIcon" ID="NotificationFrame.getIcon"></a> |
|
99 <h4>NotificationFrame.getIcon (class method)</h4> |
|
100 <b>getIcon</b>(<i>kind</i>) |
|
101 |
|
102 <p> |
|
103 Class method to get the icon for a specific notification kind. |
|
104 </p> |
|
105 <dl> |
|
106 |
|
107 <dt><i>kind</i> (NotificationTypes)</dt> |
|
108 <dd> |
|
109 notification kind |
|
110 </dd> |
|
111 </dl> |
|
112 <dl> |
|
113 <dt>Return:</dt> |
|
114 <dd> |
|
115 icon for the notification kind |
|
116 </dd> |
|
117 </dl> |
|
118 <dl> |
|
119 <dt>Return Type:</dt> |
|
120 <dd> |
|
121 QPixmap |
|
122 </dd> |
|
123 </dl> |
|
124 <a NAME="NotificationFrame.getStyleSheet" ID="NotificationFrame.getStyleSheet"></a> |
|
125 <h4>NotificationFrame.getStyleSheet (class method)</h4> |
|
126 <b>getStyleSheet</b>(<i>kind</i>) |
|
127 |
|
128 <p> |
|
129 Class method to get a style sheet for specific notification kind. |
|
130 </p> |
|
131 <dl> |
|
132 |
|
133 <dt><i>kind</i> (NotificationTypes)</dt> |
|
134 <dd> |
|
135 notification kind |
|
136 </dd> |
|
137 </dl> |
|
138 <dl> |
|
139 <dt>Return:</dt> |
|
140 <dd> |
|
141 string containing the style sheet for the notification kind |
|
142 </dd> |
|
143 </dl> |
|
144 <dl> |
|
145 <dt>Return Type:</dt> |
|
146 <dd> |
|
147 str |
|
148 </dd> |
|
149 </dl> |
|
150 <a NAME="NotificationFrame.__init__" ID="NotificationFrame.__init__"></a> |
|
151 <h4>NotificationFrame (Constructor)</h4> |
|
152 <b>NotificationFrame</b>(<i>icon, heading, text, kind=NotificationTypes.INFORMATION, parent=None</i>) |
|
153 |
|
154 <p> |
|
155 Constructor |
|
156 </p> |
|
157 <dl> |
|
158 |
|
159 <dt><i>icon</i> (QPixmap)</dt> |
|
160 <dd> |
|
161 icon to be used |
|
162 </dd> |
|
163 <dt><i>heading</i> (str)</dt> |
|
164 <dd> |
|
165 heading to be used |
|
166 </dd> |
|
167 <dt><i>text</i> (str)</dt> |
|
168 <dd> |
|
169 text to be used |
|
170 </dd> |
|
171 <dt><i>kind</i> (NotificationTypes)</dt> |
|
172 <dd> |
|
173 kind of notification to be shown |
|
174 </dd> |
|
175 <dt><i>parent</i> (QWidget)</dt> |
|
176 <dd> |
|
177 reference to the parent widget |
|
178 </dd> |
|
179 </dl> |
|
180 <div align="right"><a href="#top">Up</a></div> |
|
181 <hr /> |
|
182 <hr /> |
|
183 <a NAME="NotificationTypes" ID="NotificationTypes"></a> |
|
184 <h2>NotificationTypes</h2> |
|
185 |
|
186 <p> |
|
187 Class implementing the notification types. |
|
188 </p> |
|
189 <h3>Derived from</h3> |
|
190 enum.Enum |
|
191 <h3>Class Attributes</h3> |
|
192 |
|
193 <table> |
|
194 <tr><td>CRITICAL</td></tr><tr><td>INFORMATION</td></tr><tr><td>OTHER</td></tr><tr><td>WARNING</td></tr> |
|
195 </table> |
|
196 <h3>Class Methods</h3> |
|
197 |
|
198 <table> |
|
199 <tr><td>None</td></tr> |
|
200 </table> |
|
201 <h3>Methods</h3> |
|
202 |
|
203 <table> |
|
204 <tr><td>None</td></tr> |
|
205 </table> |
|
206 <h3>Static Methods</h3> |
|
207 |
|
208 <table> |
|
209 <tr><td>None</td></tr> |
|
210 </table> |
|
211 |
|
212 <div align="right"><a href="#top">Up</a></div> |
|
213 <hr /> |
|
214 <hr /> |
|
215 <a NAME="NotificationWidget" ID="NotificationWidget"></a> |
|
216 <h2>NotificationWidget</h2> |
|
217 |
|
218 <p> |
|
219 Class implementing a Notification list widget. |
|
220 </p> |
|
221 <h3>Derived from</h3> |
|
222 QWidget |
|
223 <h3>Class Attributes</h3> |
|
224 |
|
225 <table> |
|
226 <tr><td>None</td></tr> |
|
227 </table> |
|
228 <h3>Class Methods</h3> |
|
229 |
|
230 <table> |
|
231 <tr><td>None</td></tr> |
|
232 </table> |
|
233 <h3>Methods</h3> |
|
234 |
|
235 <table> |
|
236 |
|
237 <tr> |
|
238 <td><a href="#NotificationWidget.__init__">NotificationWidget</a></td> |
|
239 <td>Constructor</td> |
|
240 </tr> |
|
241 <tr> |
|
242 <td><a href="#NotificationWidget.__adjustSizeAndPosition">__adjustSizeAndPosition</a></td> |
|
243 <td>Private slot to adjust the notification list widget size and position.</td> |
|
244 </tr> |
|
245 <tr> |
|
246 <td><a href="#NotificationWidget.__removeNotification">__removeNotification</a></td> |
|
247 <td>Private method to remove a notification from the list.</td> |
|
248 </tr> |
|
249 <tr> |
|
250 <td><a href="#NotificationWidget.mouseMoveEvent">mouseMoveEvent</a></td> |
|
251 <td>Protected method to handle dragging the window.</td> |
|
252 </tr> |
|
253 <tr> |
|
254 <td><a href="#NotificationWidget.mousePressEvent">mousePressEvent</a></td> |
|
255 <td>Protected method to handle presses of a mouse button.</td> |
|
256 </tr> |
|
257 <tr> |
|
258 <td><a href="#NotificationWidget.mouseReleaseEvent">mouseReleaseEvent</a></td> |
|
259 <td>Protected method to handle releases of a mouse button.</td> |
|
260 </tr> |
|
261 <tr> |
|
262 <td><a href="#NotificationWidget.showNotification">showNotification</a></td> |
|
263 <td>Public method to show a notification.</td> |
|
264 </tr> |
|
265 </table> |
|
266 <h3>Static Methods</h3> |
|
267 |
|
268 <table> |
|
269 <tr><td>None</td></tr> |
|
270 </table> |
|
271 |
|
272 <a NAME="NotificationWidget.__init__" ID="NotificationWidget.__init__"></a> |
|
273 <h4>NotificationWidget (Constructor)</h4> |
|
274 <b>NotificationWidget</b>(<i>parent=None, setPosition=False</i>) |
|
275 |
|
276 <p> |
|
277 Constructor |
|
278 </p> |
|
279 <dl> |
|
280 |
|
281 <dt><i>parent</i> (QWidget)</dt> |
|
282 <dd> |
|
283 reference to the parent widget |
|
284 </dd> |
|
285 <dt><i>setPosition</i> (bool)</dt> |
|
286 <dd> |
|
287 flag indicating to set the display |
|
288 position interactively |
|
289 </dd> |
|
290 </dl> |
|
291 <a NAME="NotificationWidget.__adjustSizeAndPosition" ID="NotificationWidget.__adjustSizeAndPosition"></a> |
|
292 <h4>NotificationWidget.__adjustSizeAndPosition</h4> |
|
293 <b>__adjustSizeAndPosition</b>(<i></i>) |
|
294 |
|
295 <p> |
|
296 Private slot to adjust the notification list widget size and position. |
|
297 </p> |
|
298 <a NAME="NotificationWidget.__removeNotification" ID="NotificationWidget.__removeNotification"></a> |
|
299 <h4>NotificationWidget.__removeNotification</h4> |
|
300 <b>__removeNotification</b>(<i>notification</i>) |
|
301 |
|
302 <p> |
|
303 Private method to remove a notification from the list. |
|
304 </p> |
|
305 <dl> |
|
306 |
|
307 <dt><i>notification</i> (NotificationFrame)</dt> |
|
308 <dd> |
|
309 reference to the notification to be removed |
|
310 </dd> |
|
311 </dl> |
|
312 <a NAME="NotificationWidget.mouseMoveEvent" ID="NotificationWidget.mouseMoveEvent"></a> |
|
313 <h4>NotificationWidget.mouseMoveEvent</h4> |
|
314 <b>mouseMoveEvent</b>(<i>evt</i>) |
|
315 |
|
316 <p> |
|
317 Protected method to handle dragging the window. |
|
318 </p> |
|
319 <dl> |
|
320 |
|
321 <dt><i>evt</i></dt> |
|
322 <dd> |
|
323 reference to the mouse event (QMouseEvent) |
|
324 </dd> |
|
325 </dl> |
|
326 <a NAME="NotificationWidget.mousePressEvent" ID="NotificationWidget.mousePressEvent"></a> |
|
327 <h4>NotificationWidget.mousePressEvent</h4> |
|
328 <b>mousePressEvent</b>(<i>evt</i>) |
|
329 |
|
330 <p> |
|
331 Protected method to handle presses of a mouse button. |
|
332 </p> |
|
333 <dl> |
|
334 |
|
335 <dt><i>evt</i></dt> |
|
336 <dd> |
|
337 reference to the mouse event (QMouseEvent) |
|
338 </dd> |
|
339 </dl> |
|
340 <a NAME="NotificationWidget.mouseReleaseEvent" ID="NotificationWidget.mouseReleaseEvent"></a> |
|
341 <h4>NotificationWidget.mouseReleaseEvent</h4> |
|
342 <b>mouseReleaseEvent</b>(<i>evt</i>) |
|
343 |
|
344 <p> |
|
345 Protected method to handle releases of a mouse button. |
|
346 </p> |
|
347 <dl> |
|
348 |
|
349 <dt><i>evt</i></dt> |
|
350 <dd> |
|
351 reference to the mouse event (QMouseEvent) |
|
352 </dd> |
|
353 </dl> |
|
354 <a NAME="NotificationWidget.showNotification" ID="NotificationWidget.showNotification"></a> |
|
355 <h4>NotificationWidget.showNotification</h4> |
|
356 <b>showNotification</b>(<i>icon, heading, text, kind=NotificationTypes.INFORMATION, timeout=0</i>) |
|
357 |
|
358 <p> |
|
359 Public method to show a notification. |
|
360 </p> |
|
361 <dl> |
|
362 |
|
363 <dt><i>icon</i> (QPixmap)</dt> |
|
364 <dd> |
|
365 icon to be used |
|
366 </dd> |
|
367 <dt><i>heading</i> (str)</dt> |
|
368 <dd> |
|
369 heading to be used |
|
370 </dd> |
|
371 <dt><i>text</i> (str)</dt> |
|
372 <dd> |
|
373 text to be used |
|
374 </dd> |
|
375 <dt><i>kind</i> (NotificationTypes)</dt> |
|
376 <dd> |
|
377 kind of notification to be shown |
|
378 </dd> |
|
379 <dt><i>timeout</i> (int)</dt> |
|
380 <dd> |
|
381 timeout in seconds after which the notification is |
|
382 to be removed (0 = do not remove until it is clicked on) |
|
383 </dd> |
|
384 </dl> |
|
385 <div align="right"><a href="#top">Up</a></div> |
|
386 <hr /> |
|
387 </body></html> |