summaryrefslogtreecommitdiffstats
path: root/src/libs/installer/messageboxhandler.cpp
diff options
context:
space:
mode:
authorKai Koehne <kai.koehne@digia.com>2013-02-28 16:32:23 +0100
committerKai Koehne <kai.koehne@digia.com>2013-04-23 16:33:47 +0200
commit20fc67fdf1569dc349ae2b703ff911fbcf72836d (patch)
treed40da766798eb1eb30acf4fc9658fc98568740e2 /src/libs/installer/messageboxhandler.cpp
parent2d832326bd1b6257849b23a86527c12a19d120b9 (diff)
Add documentation for JS API
Change-Id: Ifef70bf0ef12b90972186f64ff9b0ae602f14420 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@digia.com> Reviewed-by: Tim Jenssen <tim.jenssen@digia.com>
Diffstat (limited to 'src/libs/installer/messageboxhandler.cpp')
-rw-r--r--src/libs/installer/messageboxhandler.cpp83
1 files changed, 83 insertions, 0 deletions
diff --git a/src/libs/installer/messageboxhandler.cpp b/src/libs/installer/messageboxhandler.cpp
index 2ae4c351d..9905e024d 100644
--- a/src/libs/installer/messageboxhandler.cpp
+++ b/src/libs/installer/messageboxhandler.cpp
@@ -51,6 +51,89 @@
#include <QScriptValue>
#include <QMetaEnum>
+/*!
+ \qmltype QMessageBox
+ \inqmlmodule scripting
+
+ \brief The QMessageBox type provides a modal dialog for informing the
+ user or asking the user a question and receiving an answer.
+
+
+ \code
+ var result = QMessageBox.question("quit.question", "Installer", "Do you want to quit the installer?",
+ QMessageBox.Yes | QMessageBox.No);
+ if (result == QMessageBox.Yes) {
+ // ...
+ }
+ \endcode
+
+ \section2 Buttons
+
+ QMessageBox defines a list of common buttons:
+ \list
+ \li QMessageBox.Ok
+ \li QMessageBox.Open
+ \li QMessageBox.Save
+ \li QMessageBox.Cancel
+ \li QMessageBox.Close
+ \li QMessageBox.Discard
+ \li QMessageBox.Apply
+ \li QMessageBox.Reset
+ \li QMessageBox.RestoreDefaults
+ \li QMessageBox.Help
+ \li QMessageBox.SaveAll
+ \li QMessageBox.Yes
+ \li QMessageBox.YesToAll
+ \li QMessageBox.No
+ \li QMessageBox.NoToAll
+ \li QMessageBox.Abort
+ \li QMessageBox.Retry
+ \li QMessageBox.Ignore
+ \li QMessageBox.NoButton
+ \endlist
+
+ \section2 Scripted Installations
+
+ Sometimes it is useful to automatically close message boxes, for example during a scripted
+ installation. This can be achieved by calling
+ Installer::setMessageBoxAutomaticAnswer, Installer::autoAcceptMessageBoxes,
+ Installer::autoRejectMessageBoxes. The \c identifier argument in the method calls
+ allows to identify specific message boxes for this purpose.
+ */
+
+
+/*!
+ \qmlmethod Button QMessageBox::critical(string identifier, string title, string text,
+ Buttons buttons = QMessageBox.Ok, Button button
+ = QMessageBox.NoButton)
+
+ Opens a critical message box with the given \a title and \a text.
+*/
+
+/*!
+ \qmlmethod Button QMessageBox::information(string identifier, string title, string text,
+ Buttons buttons = QMessageBox.Ok, Button button
+ = QMessageBox.NoButton)
+
+ Opens an information message box with the given \a title and \a text.
+*/
+
+/*!
+ \qmlmethod Button QMessageBox::question(string identifier, string title, string text,
+ Buttons buttons = QMessageBox.Yes | QMessageBox.No, Button button
+ = QMessageBox.NoButton)
+
+ Opens a question message box with the given \a title and \a text.
+*/
+
+/*!
+ \qmlmethod Button QMessageBox::warning(string identifier, string title, string text,
+ Buttons buttons = QMessageBox.Ok, Button button
+ = QMessageBox.NoButton)
+
+ Opens a warning message box with the given \a title and \a text.
+*/
+
QScriptValue QInstaller::registerMessageBox(QScriptEngine *scriptEngine)
{
// register QMessageBox::StandardButton enum in the script connection