|
1 <!DOCTYPE html> |
|
2 <html><head> |
|
3 <title>eric6.E5Gui.E5MessageBox</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.E5Gui.E5MessageBox</h1> |
|
23 <p> |
|
24 Module implementing QMessageBox replacements and more convenience function. |
|
25 </p> |
|
26 <h3>Global Attributes</h3> |
|
27 <table> |
|
28 <tr><td>Abort</td></tr><tr><td>AcceptRole</td></tr><tr><td>ActionRole</td></tr><tr><td>Apply</td></tr><tr><td>ApplyRole</td></tr><tr><td>Cancel</td></tr><tr><td>Close</td></tr><tr><td>Critical</td></tr><tr><td>DestructiveRole</td></tr><tr><td>Discard</td></tr><tr><td>Help</td></tr><tr><td>HelpRole</td></tr><tr><td>Ignore</td></tr><tr><td>Information</td></tr><tr><td>InvalidRole</td></tr><tr><td>No</td></tr><tr><td>NoButton</td></tr><tr><td>NoIcon</td></tr><tr><td>NoRole</td></tr><tr><td>NoToAll</td></tr><tr><td>Ok</td></tr><tr><td>Open</td></tr><tr><td>Question</td></tr><tr><td>RejectRole</td></tr><tr><td>Reset</td></tr><tr><td>ResetRole</td></tr><tr><td>RestoreDefaults</td></tr><tr><td>Retry</td></tr><tr><td>Save</td></tr><tr><td>SaveAll</td></tr><tr><td>StandardButtons</td></tr><tr><td>Warning</td></tr><tr><td>Yes</td></tr><tr><td>YesRole</td></tr><tr><td>YesToAll</td></tr><tr><td>about</td></tr><tr><td>aboutQt</td></tr> |
|
29 </table> |
|
30 <h3>Classes</h3> |
|
31 <table> |
|
32 <tr> |
|
33 <td><a href="#E5MessageBox">E5MessageBox</a></td> |
|
34 <td>Class implementing a replacement for QMessageBox.</td> |
|
35 </tr> |
|
36 </table> |
|
37 <h3>Functions</h3> |
|
38 <table> |
|
39 <tr> |
|
40 <td><a href="#__messageBox">__messageBox</a></td> |
|
41 <td>Private module function to show a modal message box.</td> |
|
42 </tr><tr> |
|
43 <td><a href="#critical">critical</a></td> |
|
44 <td>Function to show a modal critical message box.</td> |
|
45 </tr><tr> |
|
46 <td><a href="#information">information</a></td> |
|
47 <td>Function to show a modal information message box.</td> |
|
48 </tr><tr> |
|
49 <td><a href="#okToClearData">okToClearData</a></td> |
|
50 <td>Function to show a model message box to ask for clearing the data.</td> |
|
51 </tr><tr> |
|
52 <td><a href="#question">question</a></td> |
|
53 <td>Function to show a modal question message box.</td> |
|
54 </tr><tr> |
|
55 <td><a href="#retryAbort">retryAbort</a></td> |
|
56 <td>Function to show a model abort/retry message box.</td> |
|
57 </tr><tr> |
|
58 <td><a href="#warning">warning</a></td> |
|
59 <td>Function to show a modal warning message box.</td> |
|
60 </tr><tr> |
|
61 <td><a href="#yesNo">yesNo</a></td> |
|
62 <td>Function to show a model yes/no message box.</td> |
|
63 </tr> |
|
64 </table> |
|
65 <hr /><hr /> |
|
66 <a NAME="E5MessageBox" ID="E5MessageBox"></a> |
|
67 <h2>E5MessageBox</h2> |
|
68 <p> |
|
69 Class implementing a replacement for QMessageBox. |
|
70 </p> |
|
71 <h3>Derived from</h3> |
|
72 QMessageBox |
|
73 <h3>Class Attributes</h3> |
|
74 <table> |
|
75 <tr><td>None</td></tr> |
|
76 </table> |
|
77 <h3>Class Methods</h3> |
|
78 <table> |
|
79 <tr><td>None</td></tr> |
|
80 </table> |
|
81 <h3>Methods</h3> |
|
82 <table> |
|
83 <tr> |
|
84 <td><a href="#E5MessageBox.__init__">E5MessageBox</a></td> |
|
85 <td>Constructor</td> |
|
86 </tr> |
|
87 </table> |
|
88 <h3>Static Methods</h3> |
|
89 <table> |
|
90 <tr><td>None</td></tr> |
|
91 </table> |
|
92 <a NAME="E5MessageBox.__init__" ID="E5MessageBox.__init__"></a> |
|
93 <h4>E5MessageBox (Constructor)</h4> |
|
94 <b>E5MessageBox</b>(<i>icon, title, text, modal=False, buttons=QMessageBox.StandardButtons(QMessageBox.NoButton), parent=None</i>) |
|
95 <p> |
|
96 Constructor |
|
97 </p><dl> |
|
98 <dt><i>icon</i></dt> |
|
99 <dd> |
|
100 type of icon to be shown (QMessageBox.Icon) |
|
101 </dd><dt><i>title</i></dt> |
|
102 <dd> |
|
103 caption of the message box (string) |
|
104 </dd><dt><i>text</i></dt> |
|
105 <dd> |
|
106 text to be shown by the message box (string) |
|
107 </dd><dt><i>modal=</i></dt> |
|
108 <dd> |
|
109 flag indicating a modal dialog (boolean) |
|
110 </dd><dt><i>buttons=</i></dt> |
|
111 <dd> |
|
112 set of standard buttons to generate (StandardButtons) |
|
113 </dd><dt><i>parent=</i></dt> |
|
114 <dd> |
|
115 parent widget of the message box (QWidget) |
|
116 </dd> |
|
117 </dl> |
|
118 <div align="right"><a href="#top">Up</a></div> |
|
119 <hr /><hr /> |
|
120 <a NAME="__messageBox" ID="__messageBox"></a> |
|
121 <h2>__messageBox</h2> |
|
122 <b>__messageBox</b>(<i>parent, title, text, icon, buttons=QMessageBox.Ok, defaultButton=QMessageBox.NoButton, textFormat=Qt.AutoText</i>) |
|
123 <p> |
|
124 Private module function to show a modal message box. |
|
125 </p><dl> |
|
126 <dt><i>parent</i></dt> |
|
127 <dd> |
|
128 parent widget of the message box (QWidget) |
|
129 </dd><dt><i>title</i></dt> |
|
130 <dd> |
|
131 caption of the message box (string) |
|
132 </dd><dt><i>text</i></dt> |
|
133 <dd> |
|
134 text to be shown by the message box (string) |
|
135 </dd><dt><i>icon</i></dt> |
|
136 <dd> |
|
137 type of icon to be shown (QMessageBox.Icon) |
|
138 </dd><dt><i>buttons</i></dt> |
|
139 <dd> |
|
140 flags indicating which buttons to show |
|
141 (QMessageBox.StandardButtons) |
|
142 </dd><dt><i>defaultButton</i></dt> |
|
143 <dd> |
|
144 flag indicating the default button |
|
145 (QMessageBox.StandardButton) |
|
146 </dd><dt><i>textFormat</i></dt> |
|
147 <dd> |
|
148 format of the text (Qt.TextFormat) |
|
149 </dd> |
|
150 </dl><dl> |
|
151 <dt>Returns:</dt> |
|
152 <dd> |
|
153 button pressed by the user (QMessageBox.StandardButton) |
|
154 </dd> |
|
155 </dl> |
|
156 <div align="right"><a href="#top">Up</a></div> |
|
157 <hr /><hr /> |
|
158 <a NAME="critical" ID="critical"></a> |
|
159 <h2>critical</h2> |
|
160 <b>critical</b>(<i>parent, title, text, buttons=QMessageBox.Ok, defaultButton=QMessageBox.NoButton</i>) |
|
161 <p> |
|
162 Function to show a modal critical message box. |
|
163 </p><dl> |
|
164 <dt><i>parent</i></dt> |
|
165 <dd> |
|
166 parent widget of the message box (QWidget) |
|
167 </dd><dt><i>title</i></dt> |
|
168 <dd> |
|
169 caption of the message box (string) |
|
170 </dd><dt><i>text</i></dt> |
|
171 <dd> |
|
172 text to be shown by the message box (string) |
|
173 </dd><dt><i>buttons</i></dt> |
|
174 <dd> |
|
175 flags indicating which buttons to show |
|
176 (QMessageBox.StandardButtons) |
|
177 </dd><dt><i>defaultButton</i></dt> |
|
178 <dd> |
|
179 flag indicating the default button |
|
180 (QMessageBox.StandardButton) |
|
181 </dd> |
|
182 </dl><dl> |
|
183 <dt>Returns:</dt> |
|
184 <dd> |
|
185 button pressed by the user (QMessageBox.StandardButton) |
|
186 </dd> |
|
187 </dl> |
|
188 <div align="right"><a href="#top">Up</a></div> |
|
189 <hr /><hr /> |
|
190 <a NAME="information" ID="information"></a> |
|
191 <h2>information</h2> |
|
192 <b>information</b>(<i>parent, title, text, buttons=QMessageBox.Ok, defaultButton=QMessageBox.NoButton</i>) |
|
193 <p> |
|
194 Function to show a modal information message box. |
|
195 </p><dl> |
|
196 <dt><i>parent</i></dt> |
|
197 <dd> |
|
198 parent widget of the message box (QWidget) |
|
199 </dd><dt><i>title</i></dt> |
|
200 <dd> |
|
201 caption of the message box (string) |
|
202 </dd><dt><i>text</i></dt> |
|
203 <dd> |
|
204 text to be shown by the message box (string) |
|
205 </dd><dt><i>buttons</i></dt> |
|
206 <dd> |
|
207 flags indicating which buttons to show |
|
208 (QMessageBox.StandardButtons) |
|
209 </dd><dt><i>defaultButton</i></dt> |
|
210 <dd> |
|
211 flag indicating the default button |
|
212 (QMessageBox.StandardButton) |
|
213 </dd> |
|
214 </dl><dl> |
|
215 <dt>Returns:</dt> |
|
216 <dd> |
|
217 button pressed by the user (QMessageBox.StandardButton) |
|
218 </dd> |
|
219 </dl> |
|
220 <div align="right"><a href="#top">Up</a></div> |
|
221 <hr /><hr /> |
|
222 <a NAME="okToClearData" ID="okToClearData"></a> |
|
223 <h2>okToClearData</h2> |
|
224 <b>okToClearData</b>(<i>parent, title, text, saveFunc, textFormat=Qt.AutoText</i>) |
|
225 <p> |
|
226 Function to show a model message box to ask for clearing the data. |
|
227 </p><dl> |
|
228 <dt><i>parent</i></dt> |
|
229 <dd> |
|
230 parent widget of the message box (QWidget) |
|
231 </dd><dt><i>title</i></dt> |
|
232 <dd> |
|
233 caption of the message box (string) |
|
234 </dd><dt><i>text</i></dt> |
|
235 <dd> |
|
236 text to be shown by the message box (string) |
|
237 </dd><dt><i>saveFunc</i></dt> |
|
238 <dd> |
|
239 reference to a function performing the save action. It |
|
240 must be a parameterless function returning a flag indicating success. |
|
241 </dd><dt><i>textFormat</i></dt> |
|
242 <dd> |
|
243 format of the text (Qt.TextFormat) |
|
244 </dd> |
|
245 </dl><dl> |
|
246 <dt>Returns:</dt> |
|
247 <dd> |
|
248 flag indicating that it is ok to clear the data (boolean) |
|
249 </dd> |
|
250 </dl> |
|
251 <div align="right"><a href="#top">Up</a></div> |
|
252 <hr /><hr /> |
|
253 <a NAME="question" ID="question"></a> |
|
254 <h2>question</h2> |
|
255 <b>question</b>(<i>parent, title, text, buttons=QMessageBox.Ok, defaultButton=QMessageBox.NoButton</i>) |
|
256 <p> |
|
257 Function to show a modal question message box. |
|
258 </p><dl> |
|
259 <dt><i>parent</i></dt> |
|
260 <dd> |
|
261 parent widget of the message box (QWidget) |
|
262 </dd><dt><i>title</i></dt> |
|
263 <dd> |
|
264 caption of the message box (string) |
|
265 </dd><dt><i>text</i></dt> |
|
266 <dd> |
|
267 text to be shown by the message box (string) |
|
268 </dd><dt><i>buttons</i></dt> |
|
269 <dd> |
|
270 flags indicating which buttons to show |
|
271 (QMessageBox.StandardButtons) |
|
272 </dd><dt><i>defaultButton</i></dt> |
|
273 <dd> |
|
274 flag indicating the default button |
|
275 (QMessageBox.StandardButton) |
|
276 </dd> |
|
277 </dl><dl> |
|
278 <dt>Returns:</dt> |
|
279 <dd> |
|
280 button pressed by the user (QMessageBox.StandardButton) |
|
281 </dd> |
|
282 </dl> |
|
283 <div align="right"><a href="#top">Up</a></div> |
|
284 <hr /><hr /> |
|
285 <a NAME="retryAbort" ID="retryAbort"></a> |
|
286 <h2>retryAbort</h2> |
|
287 <b>retryAbort</b>(<i>parent, title, text, icon=Question, textFormat=Qt.AutoText</i>) |
|
288 <p> |
|
289 Function to show a model abort/retry message box. |
|
290 </p><dl> |
|
291 <dt><i>parent</i></dt> |
|
292 <dd> |
|
293 parent widget of the message box (QWidget) |
|
294 </dd><dt><i>title</i></dt> |
|
295 <dd> |
|
296 caption of the message box (string) |
|
297 </dd><dt><i>text</i></dt> |
|
298 <dd> |
|
299 text to be shown by the message box (string) |
|
300 </dd><dt><i>icon=</i></dt> |
|
301 <dd> |
|
302 icon for the dialog (Critical, Information, Question or |
|
303 Warning) |
|
304 </dd><dt><i>textFormat</i></dt> |
|
305 <dd> |
|
306 format of the text (Qt.TextFormat) |
|
307 </dd> |
|
308 </dl><dl> |
|
309 <dt>Returns:</dt> |
|
310 <dd> |
|
311 flag indicating the selection of the Retry button (boolean) |
|
312 </dd> |
|
313 </dl> |
|
314 <div align="right"><a href="#top">Up</a></div> |
|
315 <hr /><hr /> |
|
316 <a NAME="warning" ID="warning"></a> |
|
317 <h2>warning</h2> |
|
318 <b>warning</b>(<i>parent, title, text, buttons=QMessageBox.Ok, defaultButton=QMessageBox.NoButton</i>) |
|
319 <p> |
|
320 Function to show a modal warning message box. |
|
321 </p><dl> |
|
322 <dt><i>parent</i></dt> |
|
323 <dd> |
|
324 parent widget of the message box (QWidget) |
|
325 </dd><dt><i>title</i></dt> |
|
326 <dd> |
|
327 caption of the message box (string) |
|
328 </dd><dt><i>text</i></dt> |
|
329 <dd> |
|
330 text to be shown by the message box (string) |
|
331 </dd><dt><i>buttons</i></dt> |
|
332 <dd> |
|
333 flags indicating which buttons to show |
|
334 (QMessageBox.StandardButtons) |
|
335 </dd><dt><i>defaultButton</i></dt> |
|
336 <dd> |
|
337 flag indicating the default button |
|
338 (QMessageBox.StandardButton) |
|
339 </dd> |
|
340 </dl><dl> |
|
341 <dt>Returns:</dt> |
|
342 <dd> |
|
343 button pressed by the user (QMessageBox.StandardButton) |
|
344 </dd> |
|
345 </dl> |
|
346 <div align="right"><a href="#top">Up</a></div> |
|
347 <hr /><hr /> |
|
348 <a NAME="yesNo" ID="yesNo"></a> |
|
349 <h2>yesNo</h2> |
|
350 <b>yesNo</b>(<i>parent, title, text, icon=Question, yesDefault=False, textFormat=Qt.AutoText</i>) |
|
351 <p> |
|
352 Function to show a model yes/no message box. |
|
353 </p><dl> |
|
354 <dt><i>parent</i></dt> |
|
355 <dd> |
|
356 parent widget of the message box (QWidget) |
|
357 </dd><dt><i>title</i></dt> |
|
358 <dd> |
|
359 caption of the message box (string) |
|
360 </dd><dt><i>text</i></dt> |
|
361 <dd> |
|
362 text to be shown by the message box (string) |
|
363 </dd><dt><i>icon=</i></dt> |
|
364 <dd> |
|
365 icon for the dialog (Critical, Information, Question or |
|
366 Warning) |
|
367 </dd><dt><i>yesDefault=</i></dt> |
|
368 <dd> |
|
369 flag indicating that the Yes button should be the |
|
370 default button (boolean) |
|
371 </dd><dt><i>textFormat</i></dt> |
|
372 <dd> |
|
373 format of the text (Qt.TextFormat) |
|
374 </dd> |
|
375 </dl><dl> |
|
376 <dt>Returns:</dt> |
|
377 <dd> |
|
378 flag indicating the selection of the Yes button (boolean) |
|
379 </dd> |
|
380 </dl> |
|
381 <div align="right"><a href="#top">Up</a></div> |
|
382 <hr /> |
|
383 </body></html> |