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

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

eric ide

mercurial