![]() |
Home · Modules · Classes · Namespaces · Functions |
The QxtConfirmationMessage class provides a confirmation message. More...
#include <QxtConfirmationMessage>
Inherits QMessageBox.
The QxtConfirmationMessage class provides a confirmation message.
QxtConfirmationMessage is a confirmation message with checkable "Do not show again." option. A checked and accepted confirmation message is no more shown until reseted.
Example usage:
void MainWindow::closeEvent(QCloseEvent* event) { static const QString text(tr("Are you sure you want to quit?")); if (QxtConfirmationMessage::confirm(this, tr("Confirm"), text) == QMessageBox::No) event->ignore(); }
Note: QCoreApplication::organizationName and QCoreApplication::applicationName are used for storing settings. In case these properties are empty, "QxtGui" and "QxtConfirmationMessage" are used, respectively.
Constructs a new QxtConfirmationMessage with parent.
Constructs a new QxtConfirmationMessage with icon, title, text, confirmation, buttons, parent and flags.
Destructs the confirmation message.
Opens an confirmation message box with the specified title, text and confirmation. The standard buttons are added to the message box. defaultButton specifies the button used when Enter is pressed. defaultButton must refer to a button that was given in buttons. If defaultButton is QMessageBox::NoButton, QMessageBox chooses a suitable default automatically.
Returns the identity of the standard button that was clicked. If Esc was pressed instead, the escape button is returned.
If parent is 0, the message box is an application modal dialog box. If parent is a widget, the message box is window modal relative to parent.
See also setConfirmationText().
Shows the confirmation message if necessary. The confirmation message is not shown in case "Do not show again." has been checked while the same confirmation message was earlierly accepted.
A confirmation message is identified by the combination of title, QMessageBox::text and optional QMessageBox::informativeText.
A clicked button with role QDialogButtonBox::AcceptRole or QDialogButtonBox::YesRole is considered as "accepted".
Warning: This function does not reimplement but shadows QMessageBox::exec().
See also QWidget::windowTitle, QMessageBox::text, and QMessageBox::informativeText.
See also setOverrideSettingsApplication().
See also setOverrideSettingsKey().
See also setOverrideSettingsOrganization().
See also setRememberOnReject().
Resets this instance of QxtConfirmationMessage. A reseted confirmation message is shown again until user checks "Do not show again." and accepts the confirmation message.
See also confirmationText().
See also overrideSettingsApplication().
See also overrideSettingsKey().
See also overrideSettingsOrganization().
See also rememberOnReject().
Sets the format used for storing settings.
See also settingsFormat().
Sets the path used for storing settings.
See also settingsPath().
Sets the scope used for storing settings.
See also settingsScope().
Returns The format used for storing settings.
The default value is QSettings::NativeFormat.
Returns the path used for storing settings.
The default value is an empty string.
Returns The scope used for storing settings.
The default value is QSettings::UserScope.
Copyright © 2007-2010 Qxt Foundation |
Qxt 0.6.1 |