Fix break point warning dialog

QMessageBox apparently only saves the state in the actual
QMessageBox instance ... anyhow, it's the only place in
QtCreator where we use QMessageBox, which makes it look
somewhat alien. Instead, use CheckableMessageBox and
extend it for an information dialog.

Task-number: QTCREATORBUG-9876

Change-Id: I8014e972943dd4a336952325ebb9f6cbc5dd0902
Reviewed-by: hjk <hjk121@nokiamail.com>
This commit is contained in:
Kai Koehne
2013-09-13 16:12:04 +02:00
committed by hjk
parent f29ce3d9b9
commit 3bdc50d1b1
3 changed files with 40 additions and 4 deletions

View File

@@ -256,6 +256,28 @@ CheckableMessageBox::question(QWidget *parent,
return mb.clickedStandardButton();
}
QDialogButtonBox::StandardButton
CheckableMessageBox::information(QWidget *parent,
const QString &title,
const QString &text,
const QString &checkBoxText,
bool *checkBoxSetting,
QDialogButtonBox::StandardButtons buttons,
QDialogButtonBox::StandardButton defaultButton)
{
CheckableMessageBox mb(parent);
mb.setWindowTitle(title);
mb.setIconPixmap(QMessageBox::standardIcon(QMessageBox::Information));
mb.setText(text);
mb.setCheckBoxText(checkBoxText);
mb.setChecked(*checkBoxSetting);
mb.setStandardButtons(buttons);
mb.setDefaultButton(defaultButton);
mb.exec();
*checkBoxSetting = mb.isChecked();
return mb.clickedStandardButton();
}
QMessageBox::StandardButton CheckableMessageBox::dialogButtonBoxToMessageBoxButton(QDialogButtonBox::StandardButton db)
{
return static_cast<QMessageBox::StandardButton>(int(db));