QMessageBox QML Type

Provides a modal dialog for informing the user or asking the user a question and receiving an answer. More...

Import Statement: import scripting .

Methods

  • Button critical(string identifier, string title, string text, Buttons buttons = QMessageBox.Ok, Button button = QMessageBox.NoButton)
  • Button information(string identifier, string title, string text, Buttons buttons = QMessageBox.Ok, Button button = QMessageBox.NoButton)
  • Button question(string identifier, string title, string text, Buttons buttons = QMessageBox.Yes | QMessageBox.No, Button button = QMessageBox.NoButton)
  • Button warning(string identifier, string title, string text, Buttons buttons = QMessageBox.Ok, Button button = QMessageBox.NoButton)

Detailed Description

 var result = QMessageBox.question("quit.question", "Installer", "Do you want to quit the installer?",
                                   QMessageBox.Yes | QMessageBox.No);
 if (result == QMessageBox.Yes) {
    // ...
 }

Buttons in Message Boxes

QMessageBox defines a list of common buttons:

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 identifier argument in the method calls allows to identify specific message boxes for this purpose.

Method Documentation

Button critical(string identifier, string title, string text, Buttons buttons = QMessageBox.Ok, Button button = QMessageBox.NoButton)

Opens a critical message box with identifier identifier, title title, text text, default buttons buttons and button button selected by default.


Button information(string identifier, string title, string text, Buttons buttons = QMessageBox.Ok, Button button = QMessageBox.NoButton)

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


Button question(string identifier, string title, string text, Buttons buttons = QMessageBox.Yes | QMessageBox.No, Button button = QMessageBox.NoButton)

Opens a question message box with identifier identifier, title title, text text, default buttons buttons and button button selected by default.


Button warning(string identifier, string title, string text, Buttons buttons = QMessageBox.Ok, Button button = QMessageBox.NoButton)

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