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, 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:
- QMessageBox.Ok
- QMessageBox.Open
- QMessageBox.Save
- QMessageBox.Cancel
- QMessageBox.Close
- QMessageBox.Discard
- QMessageBox.Apply
- QMessageBox.Reset
- QMessageBox.RestoreDefaults
- QMessageBox.Help
- QMessageBox.SaveAll
- QMessageBox.Yes
- QMessageBox.YesToAll
- QMessageBox.No
- QMessageBox.NoToAll
- QMessageBox.Abort
- QMessageBox.Retry
- QMessageBox.Ignore
- QMessageBox.NoButton
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
Opens a critical message box with identifier identifier, title title, text text, default buttons buttons and button button selected by default.
Opens an information message box with identifier identifier, title title, text text, default buttons buttons and button button selected by default.
Opens a question message box with identifier identifier, title title, text text, default buttons buttons and button button selected by default.
Opens a warning message box with identifier identifier, title title, text text, default buttons buttons and button button selected by default.