/* Copyright (C) 2026 The Qt Company Ltd.
 *
 * SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
*/

/*!
    \qmltype QMessageBox
    \inqmlmodule scripting

    \brief 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 in Message Boxes

    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 or 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 identifier \a identifier, title \a title,
    text \a text, default buttons \a buttons and button \a button selected
    by default.
*/

/*!
    \qmlmethod Button QMessageBox::information(string identifier, string title, string text,
    Buttons buttons = QMessageBox.Ok, Button button = QMessageBox.NoButton)

    Opens an information message box with identifier \a identifier, title \a title,
    text \a text, default buttons \a buttons and button \a button selected
    by default.
*/

/*!
    \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 identifier \a identifier, title \a title,
    text \a text, default buttons \a buttons and button \a button selected
    by default.
*/

/*!
    \qmlmethod Button QMessageBox::warning(string identifier, string title, string text,
    Buttons buttons = QMessageBox.Ok, Button button = QMessageBox.NoButton)

    Opens a warning message box with identifier \a identifier, title \a title,
    text \a text, default buttons \a buttons and button \a button selected
    by default.
*/
