forked from qt-creator/qt-creator
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:
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user