QMessageBox

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

Methods

  • Button critical(string identifier, string title, string text, Buttons buttons, Button button)
  • Button information(string identifier, string title, string text, Buttons buttons, Button button)
  • Button question(string identifier, string title, string text, Buttons buttons, Button button)
  • Button warning(string identifier, string title, string text, Buttons buttons, Button button)

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 the given title and text.


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

Opens an information message box with the given title and text.


Button 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 title and text.


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

Opens a warning message box with the given title and text.


© 2016 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. The Qt Company, Qt and their respective logos are trademarks of The Qt Company Ltd in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.