eric7/Documentation/Source/eric7.EricWidgets.EricMessageBox.html

branch
eric7
changeset 8372
e0227a7c850e
child 8596
d64760b2da50
equal deleted inserted replaced
8371:d6062691d424 8372:e0227a7c850e
1 <!DOCTYPE html>
2 <html><head>
3 <title>eric7.EricWidgets.EricMessageBox</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.EricWidgets.EricMessageBox</h1>
24
25 <p>
26 Module implementing QMessageBox replacements and more convenience function.
27 </p>
28 <h3>Global Attributes</h3>
29
30 <table>
31 <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>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>
32 </table>
33 <h3>Classes</h3>
34
35 <table>
36
37 <tr>
38 <td><a href="#EricMessageBox">EricMessageBox</a></td>
39 <td>Class implementing a replacement for QMessageBox.</td>
40 </tr>
41 </table>
42 <h3>Functions</h3>
43
44 <table>
45
46 <tr>
47 <td><a href="#__messageBox">__messageBox</a></td>
48 <td>Private module function to show a modal message box.</td>
49 </tr>
50 <tr>
51 <td><a href="#critical">critical</a></td>
52 <td>Function to show a modal critical message box.</td>
53 </tr>
54 <tr>
55 <td><a href="#information">information</a></td>
56 <td>Function to show a modal information message box.</td>
57 </tr>
58 <tr>
59 <td><a href="#okToClearData">okToClearData</a></td>
60 <td>Function to show a model message box to ask for clearing the data.</td>
61 </tr>
62 <tr>
63 <td><a href="#question">question</a></td>
64 <td>Function to show a modal question message box.</td>
65 </tr>
66 <tr>
67 <td><a href="#retryAbort">retryAbort</a></td>
68 <td>Function to show a model abort/retry message box.</td>
69 </tr>
70 <tr>
71 <td><a href="#warning">warning</a></td>
72 <td>Function to show a modal warning message box.</td>
73 </tr>
74 <tr>
75 <td><a href="#yesNo">yesNo</a></td>
76 <td>Function to show a model yes/no message box.</td>
77 </tr>
78 </table>
79 <hr />
80 <hr />
81 <a NAME="EricMessageBox" ID="EricMessageBox"></a>
82 <h2>EricMessageBox</h2>
83
84 <p>
85 Class implementing a replacement for QMessageBox.
86 </p>
87 <h3>Derived from</h3>
88 QMessageBox
89 <h3>Class Attributes</h3>
90
91 <table>
92 <tr><td>None</td></tr>
93 </table>
94 <h3>Class Methods</h3>
95
96 <table>
97 <tr><td>None</td></tr>
98 </table>
99 <h3>Methods</h3>
100
101 <table>
102
103 <tr>
104 <td><a href="#EricMessageBox.__init__">EricMessageBox</a></td>
105 <td>Constructor</td>
106 </tr>
107 </table>
108 <h3>Static Methods</h3>
109
110 <table>
111 <tr><td>None</td></tr>
112 </table>
113
114 <a NAME="EricMessageBox.__init__" ID="EricMessageBox.__init__"></a>
115 <h4>EricMessageBox (Constructor)</h4>
116 <b>EricMessageBox</b>(<i>icon, title, text, modal=False, buttons=QMessageBox.StandardButton.NoButton, parent=None</i>)
117
118 <p>
119 Constructor
120 </p>
121 <dl>
122
123 <dt><i>icon</i></dt>
124 <dd>
125 type of icon to be shown (QMessageBox.Icon)
126 </dd>
127 <dt><i>title</i></dt>
128 <dd>
129 caption of the message box (string)
130 </dd>
131 <dt><i>text</i></dt>
132 <dd>
133 text to be shown by the message box (string)
134 </dd>
135 <dt><i>modal</i></dt>
136 <dd>
137 flag indicating a modal dialog (boolean)
138 </dd>
139 <dt><i>buttons</i></dt>
140 <dd>
141 set of standard buttons to generate (StandardButtons)
142 </dd>
143 <dt><i>parent</i></dt>
144 <dd>
145 parent widget of the message box (QWidget)
146 </dd>
147 </dl>
148 <div align="right"><a href="#top">Up</a></div>
149 <hr />
150 <hr />
151 <a NAME="__messageBox" ID="__messageBox"></a>
152 <h2>__messageBox</h2>
153 <b>__messageBox</b>(<i>parent, title, text, icon, buttons=QMessageBox.StandardButton.Ok, defaultButton=QMessageBox.StandardButton.NoButton, textFormat=Qt.TextFormat.AutoText</i>)
154
155 <p>
156 Private module function to show a modal message box.
157 </p>
158 <dl>
159
160 <dt><i>parent</i></dt>
161 <dd>
162 parent widget of the message box (QWidget)
163 </dd>
164 <dt><i>title</i></dt>
165 <dd>
166 caption of the message box (string)
167 </dd>
168 <dt><i>text</i></dt>
169 <dd>
170 text to be shown by the message box (string)
171 </dd>
172 <dt><i>icon</i></dt>
173 <dd>
174 type of icon to be shown (QMessageBox.Icon)
175 </dd>
176 <dt><i>buttons</i></dt>
177 <dd>
178 flags indicating which buttons to show
179 (QMessageBox.StandardButtons)
180 </dd>
181 <dt><i>defaultButton</i></dt>
182 <dd>
183 flag indicating the default button
184 (QMessageBox.StandardButton)
185 </dd>
186 <dt><i>textFormat</i></dt>
187 <dd>
188 format of the text (Qt.TextFormat)
189 </dd>
190 </dl>
191 <dl>
192 <dt>Return:</dt>
193 <dd>
194 button pressed by the user (QMessageBox.StandardButton)
195 </dd>
196 </dl>
197 <div align="right"><a href="#top">Up</a></div>
198 <hr />
199 <hr />
200 <a NAME="critical" ID="critical"></a>
201 <h2>critical</h2>
202 <b>critical</b>(<i>parent, title, text, buttons=QMessageBox.StandardButton.Ok, defaultButton=QMessageBox.StandardButton.NoButton</i>)
203
204 <p>
205 Function to show a modal critical message box.
206 </p>
207 <dl>
208
209 <dt><i>parent</i></dt>
210 <dd>
211 parent widget of the message box (QWidget)
212 </dd>
213 <dt><i>title</i></dt>
214 <dd>
215 caption of the message box (string)
216 </dd>
217 <dt><i>text</i></dt>
218 <dd>
219 text to be shown by the message box (string)
220 </dd>
221 <dt><i>buttons</i></dt>
222 <dd>
223 flags indicating which buttons to show
224 (QMessageBox.StandardButtons)
225 </dd>
226 <dt><i>defaultButton</i></dt>
227 <dd>
228 flag indicating the default button
229 (QMessageBox.StandardButton)
230 </dd>
231 </dl>
232 <dl>
233 <dt>Return:</dt>
234 <dd>
235 button pressed by the user (QMessageBox.StandardButton)
236 </dd>
237 </dl>
238 <div align="right"><a href="#top">Up</a></div>
239 <hr />
240 <hr />
241 <a NAME="information" ID="information"></a>
242 <h2>information</h2>
243 <b>information</b>(<i>parent, title, text, buttons=QMessageBox.StandardButton.Ok, defaultButton=QMessageBox.StandardButton.NoButton</i>)
244
245 <p>
246 Function to show a modal information message box.
247 </p>
248 <dl>
249
250 <dt><i>parent</i></dt>
251 <dd>
252 parent widget of the message box (QWidget)
253 </dd>
254 <dt><i>title</i></dt>
255 <dd>
256 caption of the message box (string)
257 </dd>
258 <dt><i>text</i></dt>
259 <dd>
260 text to be shown by the message box (string)
261 </dd>
262 <dt><i>buttons</i></dt>
263 <dd>
264 flags indicating which buttons to show
265 (QMessageBox.StandardButtons)
266 </dd>
267 <dt><i>defaultButton</i></dt>
268 <dd>
269 flag indicating the default button
270 (QMessageBox.StandardButton)
271 </dd>
272 </dl>
273 <dl>
274 <dt>Return:</dt>
275 <dd>
276 button pressed by the user (QMessageBox.StandardButton)
277 </dd>
278 </dl>
279 <div align="right"><a href="#top">Up</a></div>
280 <hr />
281 <hr />
282 <a NAME="okToClearData" ID="okToClearData"></a>
283 <h2>okToClearData</h2>
284 <b>okToClearData</b>(<i>parent, title, text, saveFunc, textFormat=Qt.TextFormat.AutoText</i>)
285
286 <p>
287 Function to show a model message box to ask for clearing the data.
288 </p>
289 <dl>
290
291 <dt><i>parent</i></dt>
292 <dd>
293 parent widget of the message box (QWidget)
294 </dd>
295 <dt><i>title</i></dt>
296 <dd>
297 caption of the message box (string)
298 </dd>
299 <dt><i>text</i></dt>
300 <dd>
301 text to be shown by the message box (string)
302 </dd>
303 <dt><i>saveFunc</i></dt>
304 <dd>
305 reference to a function performing the save action. It
306 must be a parameterless function returning a flag indicating success.
307 </dd>
308 <dt><i>textFormat</i></dt>
309 <dd>
310 format of the text (Qt.TextFormat)
311 </dd>
312 </dl>
313 <dl>
314 <dt>Return:</dt>
315 <dd>
316 flag indicating that it is ok to clear the data (boolean)
317 </dd>
318 </dl>
319 <div align="right"><a href="#top">Up</a></div>
320 <hr />
321 <hr />
322 <a NAME="question" ID="question"></a>
323 <h2>question</h2>
324 <b>question</b>(<i>parent, title, text, buttons=QMessageBox.StandardButton.Ok, defaultButton=QMessageBox.StandardButton.NoButton</i>)
325
326 <p>
327 Function to show a modal question message box.
328 </p>
329 <dl>
330
331 <dt><i>parent</i></dt>
332 <dd>
333 parent widget of the message box (QWidget)
334 </dd>
335 <dt><i>title</i></dt>
336 <dd>
337 caption of the message box (string)
338 </dd>
339 <dt><i>text</i></dt>
340 <dd>
341 text to be shown by the message box (string)
342 </dd>
343 <dt><i>buttons</i></dt>
344 <dd>
345 flags indicating which buttons to show
346 (QMessageBox.StandardButtons)
347 </dd>
348 <dt><i>defaultButton</i></dt>
349 <dd>
350 flag indicating the default button
351 (QMessageBox.StandardButton)
352 </dd>
353 </dl>
354 <dl>
355 <dt>Return:</dt>
356 <dd>
357 button pressed by the user (QMessageBox.StandardButton)
358 </dd>
359 </dl>
360 <div align="right"><a href="#top">Up</a></div>
361 <hr />
362 <hr />
363 <a NAME="retryAbort" ID="retryAbort"></a>
364 <h2>retryAbort</h2>
365 <b>retryAbort</b>(<i>parent, title, text, icon=Question, textFormat=Qt.TextFormat.AutoText</i>)
366
367 <p>
368 Function to show a model abort/retry message box.
369 </p>
370 <dl>
371
372 <dt><i>parent</i></dt>
373 <dd>
374 parent widget of the message box (QWidget)
375 </dd>
376 <dt><i>title</i></dt>
377 <dd>
378 caption of the message box (string)
379 </dd>
380 <dt><i>text</i></dt>
381 <dd>
382 text to be shown by the message box (string)
383 </dd>
384 <dt><i>icon</i></dt>
385 <dd>
386 icon for the dialog (Critical, Information, Question or
387 Warning)
388 </dd>
389 <dt><i>textFormat</i></dt>
390 <dd>
391 format of the text (Qt.TextFormat)
392 </dd>
393 </dl>
394 <dl>
395 <dt>Return:</dt>
396 <dd>
397 flag indicating the selection of the Retry button (boolean)
398 </dd>
399 </dl>
400 <dl>
401
402 <dt>Raises <b>ValueError</b>:</dt>
403 <dd>
404 raised to indicate a bad parameter value
405 </dd>
406 </dl>
407 <div align="right"><a href="#top">Up</a></div>
408 <hr />
409 <hr />
410 <a NAME="warning" ID="warning"></a>
411 <h2>warning</h2>
412 <b>warning</b>(<i>parent, title, text, buttons=QMessageBox.StandardButton.Ok, defaultButton=QMessageBox.StandardButton.NoButton</i>)
413
414 <p>
415 Function to show a modal warning message box.
416 </p>
417 <dl>
418
419 <dt><i>parent</i></dt>
420 <dd>
421 parent widget of the message box (QWidget)
422 </dd>
423 <dt><i>title</i></dt>
424 <dd>
425 caption of the message box (string)
426 </dd>
427 <dt><i>text</i></dt>
428 <dd>
429 text to be shown by the message box (string)
430 </dd>
431 <dt><i>buttons</i></dt>
432 <dd>
433 flags indicating which buttons to show
434 (QMessageBox.StandardButtons)
435 </dd>
436 <dt><i>defaultButton</i></dt>
437 <dd>
438 flag indicating the default button
439 (QMessageBox.StandardButton)
440 </dd>
441 </dl>
442 <dl>
443 <dt>Return:</dt>
444 <dd>
445 button pressed by the user (QMessageBox.StandardButton)
446 </dd>
447 </dl>
448 <div align="right"><a href="#top">Up</a></div>
449 <hr />
450 <hr />
451 <a NAME="yesNo" ID="yesNo"></a>
452 <h2>yesNo</h2>
453 <b>yesNo</b>(<i>parent, title, text, icon=Question, yesDefault=False, textFormat=Qt.TextFormat.AutoText</i>)
454
455 <p>
456 Function to show a model yes/no message box.
457 </p>
458 <dl>
459
460 <dt><i>parent</i></dt>
461 <dd>
462 parent widget of the message box (QWidget)
463 </dd>
464 <dt><i>title</i></dt>
465 <dd>
466 caption of the message box (string)
467 </dd>
468 <dt><i>text</i></dt>
469 <dd>
470 text to be shown by the message box (string)
471 </dd>
472 <dt><i>icon</i></dt>
473 <dd>
474 icon for the dialog (Critical, Information, Question or
475 Warning)
476 </dd>
477 <dt><i>yesDefault</i></dt>
478 <dd>
479 flag indicating that the Yes button should be the
480 default button (boolean)
481 </dd>
482 <dt><i>textFormat</i></dt>
483 <dd>
484 format of the text (Qt.TextFormat)
485 </dd>
486 </dl>
487 <dl>
488 <dt>Return:</dt>
489 <dd>
490 flag indicating the selection of the Yes button (boolean)
491 </dd>
492 </dl>
493 <dl>
494
495 <dt>Raises <b>ValueError</b>:</dt>
496 <dd>
497 raised to indicate a bad parameter value
498 </dd>
499 </dl>
500 <div align="right"><a href="#top">Up</a></div>
501 <hr />
502 </body></html>

eric ide

mercurial