/usr/share/qt5/doc/qtquickdialogs/qml-qtquick-dialogs-messagedialog.html is in qtdeclarative5-doc-html 5.2.1-3ubuntu15.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 | <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en_US" lang="en_US">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- qquickplatformmessagedialog.cpp -->
<title>MessageDialog | QtQuickDialogs 5.2</title>
<link rel="stylesheet" type="text/css" href="style/offline.css" />
</head>
<body>
<div class="header" id="qtdocheader">
<div class="main">
<div class="main-rounded">
<div class="navigationbar">
<ul>
<li>Qt 5.2</li>
<li><a href="qtquickdialogs-index.html">Qt Quick Dialogs</a></li>
<li><a href="qtquick-dialogs-qmlmodule.html">QML Types</a></li>
<li>MessageDialog</li>
<li id="buildversion">
Qt 5.2.1 Reference Documentation</li>
</ul>
</div>
</div>
<div class="content">
<div class="line">
<div class="content mainContent">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#properties">Properties</a></li>
<li class="level1"><a href="#signals">Signals</a></li>
<li class="level1"><a href="#methods">Methods</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
</ul>
</div>
<h1 class="title">MessageDialog</h1>
<span class="subtitle"></span>
<!-- $$$MessageDialog-brief -->
<p>Dialog component for displaying popup messages. <a href="#details">More...</a></p>
<!-- @@@MessageDialog -->
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> Import Statement:</td><td class="memItemRight bottomAlign"> </b><tt>import QtQuick.Dialogs 1.1</tt></td></tr><tr><td class="memItemLeft rightAlign topAlign"> Since:</td><td class="memItemRight bottomAlign"> Qt 5.2</td></tr></table><ul>
<li><a href="qml-qtquick-dialogs-messagedialog-members.html">List of all members, including inherited members</a></li>
</ul>
<a name="properties"></a>
<h2>Properties</h2>
<ul>
<li class="fn"><b><b><a href="qml-qtquick-dialogs-messagedialog.html#detailedText-prop">detailedText</a></b></b> : string</li>
<li class="fn"><b><b><a href="qml-qtquick-dialogs-messagedialog.html#icon-prop">icon</a></b></b> : QQuickStandardIcon::Icon</li>
<li class="fn"><b><b><a href="qml-qtquick-dialogs-messagedialog.html#informativeText-prop">informativeText</a></b></b> : string</li>
<li class="fn"><b><b><a href="qml-qtquick-dialogs-messagedialog.html#modality-prop">modality</a></b></b> : Qt::WindowModality</li>
<li class="fn"><b><b><a href="qml-qtquick-dialogs-messagedialog.html#standardButtons-prop">standardButtons</a></b></b> : StandardButtons</li>
<li class="fn"><b><b><a href="qml-qtquick-dialogs-messagedialog.html#text-prop">text</a></b></b> : string</li>
<li class="fn"><b><b><a href="qml-qtquick-dialogs-messagedialog.html#title-prop">title</a></b></b> : string</li>
<li class="fn"><b><b><a href="qml-qtquick-dialogs-messagedialog.html#visible-prop">visible</a></b></b> : bool</li>
</ul>
<a name="signals"></a>
<h2>Signals</h2>
<ul>
<li class="fn"><b><b><a href="qml-qtquick-dialogs-messagedialog.html#accepted-signal">accepted</a></b></b>()</li>
<li class="fn"><b><b><a href="qml-qtquick-dialogs-messagedialog.html#apply-signal">apply</a></b></b>()</li>
<li class="fn"><b><b><a href="qml-qtquick-dialogs-messagedialog.html#discard-signal">discard</a></b></b>()</li>
<li class="fn"><b><b><a href="qml-qtquick-dialogs-messagedialog.html#help-signal">help</a></b></b>()</li>
<li class="fn"><b><b><a href="qml-qtquick-dialogs-messagedialog.html#no-signal">no</a></b></b>()</li>
<li class="fn"><b><b><a href="qml-qtquick-dialogs-messagedialog.html#rejected-signal">rejected</a></b></b>()</li>
<li class="fn"><b><b><a href="qml-qtquick-dialogs-messagedialog.html#reset-signal">reset</a></b></b>()</li>
<li class="fn"><b><b><a href="qml-qtquick-dialogs-messagedialog.html#yes-signal">yes</a></b></b>()</li>
</ul>
<a name="methods"></a>
<h2>Methods</h2>
<ul>
<li class="fn">void <b><b><a href="qml-qtquick-dialogs-messagedialog.html#close-method">close</a></b></b>()</li>
<li class="fn">void <b><b><a href="qml-qtquick-dialogs-messagedialog.html#open-method">open</a></b></b>()</li>
</ul>
<!-- $$$MessageDialog-description -->
<a name="details"></a>
<h2>Detailed Description</h2>
<p>The most basic use case for a MessageDialog is a popup alert. It also allows the user to respond in various ways depending on which buttons are enabled. The dialog is initially invisible. You need to set the properties as desired first, then set <a href="qml-qtquick-dialogs-messagedialog.html#visible-prop">visible</a> to <tt>true</tt> or call <a href="qml-qtquick-dialogs-messagedialog.html#open-method">open()</a>.</p>
<p>Here is a minimal example to show an alert and exit after the user responds:</p>
<pre class="qml">import QtQuick 2.2
import QtQuick.Dialogs 1.1
<span class="type">MessageDialog</span> {
<span class="name">id</span>: <span class="name">messageDialog</span>
<span class="name">title</span>: <span class="string">"May I have your attention please"</span>
<span class="name">text</span>: <span class="string">"It's so cool that you are using Qt Quick."</span>
<span class="name">onAccepted</span>: {
<span class="name">console</span>.<span class="name">log</span>(<span class="string">"And of course you could only agree."</span>)
<span class="name">Qt</span>.<span class="name">quit</span>()
}
<span class="name">Component</span>.onCompleted: <span class="name">visible</span> <span class="operator">=</span> <span class="number">true</span>
}</pre>
<p>There are several possible handlers depending on which <a href="qml-qtquick-dialogs-messagedialog.html#standardButtons-prop">standardButtons</a> the dialog has and the ButtonRole of each. For example, the <a href="qml-qtquick-dialogs-messagedialog.html#rejected-signal">onRejected</a> handler will be called if the user presses a <b>Cancel</b>, <b>Close</b> or <b>Abort</b> button.</p>
<p>A MessageDialog window is automatically transient for its parent window. So whether you declare the dialog inside an Item or inside a Window, the dialog will appear centered over the window containing the item, or over the Window that you declared.</p>
<p>The implementation of MessageDialog will be a platform message dialog if possible. If that isn't possible, then it will try to instantiate a QMessageBox. If that also isn't possible, then it will fall back to a QML implementation, <tt>DefaultMessageDialog.qml</tt>. In that case you can customize the appearance by editing this file. <tt>DefaultMessageDialog.qml</tt> contains a Rectangle to hold the dialog's contents, because certain embedded systems do not support multiple top-level windows. When the dialog becomes visible, it will automatically be wrapped in a Window if possible, or simply reparented on top of the main window if there can only be one window.</p>
<!-- @@@MessageDialog -->
<h2>Property Documentation</h2>
<!-- $$$detailedText -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlPropNode"><p><a name="detailedText-prop"></a><span class="name">detailedText</span> : <span class="type">string</span></p></td></tr></table></div><div class="qmldoc"><p>The text to be displayed in the details area, which is hidden by default. The user will then be able to press the <b>Show Details...</b> button to make it visible.</p>
<p><b>See also </b><a href="qml-qtquick-dialogs-messagedialog.html#text-prop">text</a>.</p>
</div></div><!-- @@@detailedText -->
<br/>
<!-- $$$icon -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlPropNode"><p><a name="icon-prop"></a><span class="name">icon</span> : <span class="type">QQuickStandardIcon::Icon</span></p></td></tr></table></div><div class="qmldoc"><p>The icon of the message box can be specified with one of these values:</p>
<table class="generic">
<tr valign="top" class="odd"><td >no icon</td><td >StandardIcon.NoIcon</td><td >For an unadorned text alert.</td></tr>
<tr valign="top" class="even"><td ><img src="images/question.png" alt=""Question icon"" /></td><td >StandardIcon.Question</td><td >For asking a question during normal operations.</td></tr>
<tr valign="top" class="odd"><td ><p class="centerAlign"><img src="images/information.png" alt="" /></p></td><td >StandardIcon.Information</td><td >For reporting information about normal operations.</td></tr>
<tr valign="top" class="even"><td ><p class="centerAlign"><img src="images/warning.png" alt="" /></p></td><td >StandardIcon.Warning</td><td >For reporting non-critical errors.</td></tr>
<tr valign="top" class="odd"><td ><p class="centerAlign"><img src="images/critical.png" alt="" /></p></td><td >StandardIcon.Critical</td><td >For reporting critical errors.</td></tr>
</table>
<p>The default is <tt>StandardIcon.NoIcon</tt>.</p>
<p>The enum values are the same as in QMessageBox::Icon.</p>
</div></div><!-- @@@icon -->
<br/>
<!-- $$$informativeText -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlPropNode"><p><a name="informativeText-prop"></a><span class="name">informativeText</span> : <span class="type">string</span></p></td></tr></table></div><div class="qmldoc"><p>The informative text that provides a fuller description for the message.</p>
<p>Informative text can be used to supplement the <tt>text</tt> to give more information to the user. Depending on the platform, it may appear in a smaller font below the text, or simply appended to the text.</p>
<p><b>See also </b><a href="qml-qtquick-dialogs-messagedialog.html#text-prop">text</a>.</p>
</div></div><!-- @@@informativeText -->
<br/>
<!-- $$$modality -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlPropNode"><p><a name="modality-prop"></a><span class="name">modality</span> : <span class="type">Qt::WindowModality</span></p></td></tr></table></div><div class="qmldoc"><p>Whether the dialog should be shown modal with respect to the window containing the dialog's parent Item, modal with respect to the whole application, or non-modal.</p>
<p>By default it is <tt>Qt.WindowModal</tt>.</p>
<p>Modality does not mean that there are any blocking calls to wait for the dialog to be accepted or rejected; it's only that the user will be prevented from interacting with the parent window and/or the application windows until the dialog is dismissed.</p>
</div></div><!-- @@@modality -->
<br/>
<!-- $$$standardButtons -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlPropNode"><p><a name="standardButtons-prop"></a><span class="name">standardButtons</span> : <span class="type">StandardButtons</span></p></td></tr></table></div><div class="qmldoc"><p>The <a href="qml-qtquick-dialogs-messagedialog.html">MessageDialog</a> has a row of buttons along the bottom, each of which has a ButtonRole that determines which signal will be emitted when the button is pressed. You can also find out which specific button was pressed after the fact via the clickedButton property. You can control which buttons are available by setting standardButtons to a bitwise-or combination of the following flags:</p>
<table class="generic">
<tr valign="top" class="odd"><td >StandardButton.Ok</td><td >An <b>OK</b> button defined with the AcceptRole.</td></tr>
<tr valign="top" class="even"><td >StandardButton.Open</td><td >An <b>Open</b> button defined with the AcceptRole.</td></tr>
<tr valign="top" class="odd"><td >StandardButton.Save</td><td >A <b>Save</b> button defined with the AcceptRole.</td></tr>
<tr valign="top" class="even"><td >StandardButton.Cancel</td><td >A <b>Cancel</b> button defined with the RejectRole.</td></tr>
<tr valign="top" class="odd"><td >StandardButton.Close</td><td >A <b>Close</b> button defined with the RejectRole.</td></tr>
<tr valign="top" class="even"><td >StandardButton.Discard</td><td >A <b>Discard</b> or <b>Don't Save</b> button, depending on the platform, defined with the DestructiveRole.</td></tr>
<tr valign="top" class="odd"><td >StandardButton.Apply</td><td >An <b>Apply</b> button defined with the ApplyRole.</td></tr>
<tr valign="top" class="even"><td >StandardButton.Reset</td><td >A <b>Reset</b> button defined with the ResetRole.</td></tr>
<tr valign="top" class="odd"><td >StandardButton.RestoreDefaults</td><td >A <b>Restore Defaults</b> button defined with the ResetRole.</td></tr>
<tr valign="top" class="even"><td >StandardButton.Help</td><td >A <b>Help</b> button defined with the HelpRole.</td></tr>
<tr valign="top" class="odd"><td >StandardButton.SaveAll</td><td >A <b>Save All</b> button defined with the AcceptRole.</td></tr>
<tr valign="top" class="even"><td >StandardButton.Yes</td><td >A <b>Yes</b> button defined with the YesRole.</td></tr>
<tr valign="top" class="odd"><td >StandardButton.YesToAll</td><td >A <b>Yes to All</b> button defined with the YesRole.</td></tr>
<tr valign="top" class="even"><td >StandardButton.No</td><td >A <b>No</b> button defined with the NoRole.</td></tr>
<tr valign="top" class="odd"><td >StandardButton.NoToAll</td><td >A <b>No to All</b> button defined with the NoRole.</td></tr>
<tr valign="top" class="even"><td >StandardButton.Abort</td><td >An <b>Abort</b> button defined with the RejectRole.</td></tr>
<tr valign="top" class="odd"><td >StandardButton.Retry</td><td >A <b>Retry</b> button defined with the AcceptRole.</td></tr>
<tr valign="top" class="even"><td >StandardButton.Ignore</td><td >An <b>Ignore</b> button defined with the AcceptRole.</td></tr>
</table>
<p>For example the following dialog will ask a question with 5 possible answers:</p>
<pre class="qml">import QtQuick 2.2
import QtQuick.Dialogs 1.1
<span class="type"><a href="qml-qtquick-dialogs-messagedialog.html">MessageDialog</a></span> {
<span class="name">title</span>: <span class="string">"Overwrite?"</span>
<span class="name">icon</span>: <span class="name">StandardIcon</span>.<span class="name">Question</span>
<span class="name">text</span>: <span class="string">"file.txt already exists. Replace?"</span>
<span class="name">detailedText</span>: <span class="string">"To replace a file means that its existing contents will be lost. "</span> <span class="operator">+</span>
<span class="string">"The file that you are copying now will be copied over it instead."</span>
<span class="name">standardButtons</span>: <span class="name">StandardButton</span>.<span class="name">Yes</span> <span class="operator">|</span> <span class="name">StandardButton</span>.<span class="name">YesToAll</span> <span class="operator">|</span>
<span class="name">StandardButton</span>.<span class="name">No</span> <span class="operator">|</span> <span class="name">StandardButton</span>.<span class="name">NoToAll</span> <span class="operator">|</span> <span class="name">StandardButton</span>.<span class="name">Abort</span>
<span class="name">Component</span>.onCompleted: <span class="name">visible</span> <span class="operator">=</span> <span class="number">true</span>
<span class="name">onYes</span>: <span class="name">console</span>.<span class="name">log</span>(<span class="string">"copied"</span>)
<span class="name">onNo</span>: <span class="name">console</span>.<span class="name">log</span>(<span class="string">"didn't copy"</span>)
<span class="name">onRejected</span>: <span class="name">console</span>.<span class="name">log</span>(<span class="string">"aborted"</span>)
}</pre>
<p class="centerAlign"><img src="images/replacefile.png" alt="" /></p><p>The default is <tt>StandardButton.Ok</tt>.</p>
<p>The enum values are the same as in QMessageBox::StandardButtons.</p>
</div></div><!-- @@@standardButtons -->
<br/>
<!-- $$$text -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlPropNode"><p><a name="text-prop"></a><span class="name">text</span> : <span class="type">string</span></p></td></tr></table></div><div class="qmldoc"><p>The primary text to be displayed.</p>
</div></div><!-- @@@text -->
<br/>
<!-- $$$title -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlPropNode"><p><a name="title-prop"></a><span class="name">title</span> : <span class="type">string</span></p></td></tr></table></div><div class="qmldoc"><p>The title of the dialog window.</p>
</div></div><!-- @@@title -->
<br/>
<!-- $$$visible -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlPropNode"><p><a name="visible-prop"></a><span class="name">visible</span> : <span class="type">bool</span></p></td></tr></table></div><div class="qmldoc"><p>This property holds whether the dialog is visible. By default this is <tt>false</tt>.</p>
<p><b>See also </b><a href="qml-qtquick-dialogs-messagedialog.html#modality-prop">modality</a>.</p>
</div></div><!-- @@@visible -->
<br/>
<h2>Signal Documentation</h2>
<!-- $$$accepted -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlFuncNode"><p><a name="accepted-signal"></a><span class="name">accepted</span>()</p></td></tr></table></div><div class="qmldoc"><p>This handler is called when the user has pressed any button which has the AcceptRole: <b>OK</b>, <b>Open</b>, <b>Save</b>, <b>Save All</b>, <b>Retry</b> or <b>Ignore</b>.</p>
</div></div><!-- @@@accepted -->
<br/>
<!-- $$$apply -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlFuncNode"><p><a name="apply-signal"></a><span class="name">apply</span>()</p></td></tr></table></div><div class="qmldoc"><p>This handler is called when the user has pressed the <b>Apply</b> button.</p>
</div></div><!-- @@@apply -->
<br/>
<!-- $$$discard -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlFuncNode"><p><a name="discard-signal"></a><span class="name">discard</span>()</p></td></tr></table></div><div class="qmldoc"><p>This handler is called when the user has pressed the <b>Discard</b> button.</p>
</div></div><!-- @@@discard -->
<br/>
<!-- $$$help -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlFuncNode"><p><a name="help-signal"></a><span class="name">help</span>()</p></td></tr></table></div><div class="qmldoc"><p>This handler is called when the user has pressed the <b>Help</b> button. Depending on platform, the dialog may not be automatically dismissed because the help that your application provides may need to be relevant to the text shown in this dialog in order to assist the user in making a decision. However on other platforms it's not possible to show a dialog and a help window at the same time. If you want to be sure that the dialog will close, you can set <a href="qml-qtquick-dialogs-messagedialog.html#visible-prop">visible</a> to <tt>false</tt> in your handler.</p>
</div></div><!-- @@@help -->
<br/>
<!-- $$$no -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlFuncNode"><p><a name="no-signal"></a><span class="name">no</span>()</p></td></tr></table></div><div class="qmldoc"><p>This handler is called when the user has pressed any button which has the NoRole: <b>No</b> or <b>No to All</b>.</p>
</div></div><!-- @@@no -->
<br/>
<!-- $$$rejected -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlFuncNode"><p><a name="rejected-signal"></a><span class="name">rejected</span>()</p></td></tr></table></div><div class="qmldoc"><p>This handler is called when the user has dismissed the dialog, by closing the dialog window, by pressing a <b>Cancel</b>, <b>Close</b> or <b>Abort</b> button on the dialog, or by pressing the back button or the escape key.</p>
</div></div><!-- @@@rejected -->
<br/>
<!-- $$$reset -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlFuncNode"><p><a name="reset-signal"></a><span class="name">reset</span>()</p></td></tr></table></div><div class="qmldoc"><p>This handler is called when the user has pressed any button which has the ResetRole: <b>Reset</b> or <b>Restore Defaults</b>.</p>
</div></div><!-- @@@reset -->
<br/>
<!-- $$$yes -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlFuncNode"><p><a name="yes-signal"></a><span class="name">yes</span>()</p></td></tr></table></div><div class="qmldoc"><p>This handler is called when the user has pressed any button which has the YesRole: <b>Yes</b> or <b>Yes to All</b>.</p>
</div></div><!-- @@@yes -->
<br/>
<h2>Method Documentation</h2>
<!-- $$$close -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlFuncNode"><p><a name="close-method"></a><span class="type">void</span> <span class="name">close</span>()</p></td></tr></table></div><div class="qmldoc"><p>Closes the dialog.</p>
</div></div><!-- @@@close -->
<br/>
<!-- $$$open -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlFuncNode"><p><a name="open-method"></a><span class="type">void</span> <span class="name">open</span>()</p></td></tr></table></div><div class="qmldoc"><p>Shows the dialog to the user. It is equivalent to setting <a href="qml-qtquick-dialogs-messagedialog.html#visible-prop">visible</a> to <tt>true</tt>.</p>
</div></div><!-- @@@open -->
<br/>
</div>
</div>
</div>
</div>
</div>
<div class="footer">
<p>
<acronym title="Copyright">©</acronym> 2013 Digia Plc and/or its
subsidiaries. Documentation contributions included herein are the copyrights of
their respective owners.<br> The documentation provided herein is licensed under the terms of the <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation License version 1.3</a> as published by the Free Software Foundation.<br> Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide. All other trademarks are property
of their respective owners. </p>
</div>
</body>
</html>
|