diff --git a/src/aooptionsdialog.cpp b/src/aooptionsdialog.cpp index 2641d8d..075e2d0 100644 --- a/src/aooptionsdialog.cpp +++ b/src/aooptionsdialog.cpp @@ -41,7 +41,7 @@ AOOptionsDialog::AOOptionsDialog(QWidget *parent, AOApplication *p_ao_app) // Let's add the tabs one by one. // First, we'll start with 'Gameplay'. - ui_gameplay_tab = new QWidget(); + ui_gameplay_tab = new QWidget(this); ui_gameplay_tab->setSizePolicy(sizePolicy1); ui_settings_tabs->addTab(ui_gameplay_tab, tr("Gameplay")); ui_form_layout_widget = new QWidget(ui_gameplay_tab); @@ -372,14 +372,14 @@ AOOptionsDialog::AOOptionsDialog(QWidget *parent, AOApplication *p_ao_app) ui_gameplay_form->setWidget(row, QFormLayout::FieldRole, ui_customchat_cb); - QScrollArea *scroll = new QScrollArea; + QScrollArea *scroll = new QScrollArea(this); scroll->setWidget(ui_form_layout_widget); ui_gameplay_tab->setLayout(new QVBoxLayout); ui_gameplay_tab->layout()->addWidget(scroll); ui_gameplay_tab->show(); // Here we start the callwords tab. - ui_callwords_tab = new QWidget(); + ui_callwords_tab = new QWidget(this); ui_settings_tabs->addTab(ui_callwords_tab, tr("Callwords")); ui_callwords_widget = new QWidget(ui_callwords_tab); @@ -416,7 +416,7 @@ AOOptionsDialog::AOOptionsDialog(QWidget *parent, AOApplication *p_ao_app) ui_callwords_layout->addWidget(ui_callwords_explain_lbl); // The audio tab. - ui_audio_tab = new QWidget(); + ui_audio_tab = new QWidget(this); ui_settings_tabs->addTab(ui_audio_tab, tr("Audio")); ui_audio_widget = new QWidget(ui_audio_tab); @@ -577,7 +577,7 @@ AOOptionsDialog::AOOptionsDialog(QWidget *parent, AOApplication *p_ao_app) ui_audio_layout->setWidget(row, QFormLayout::FieldRole, ui_objectmusic_cb); // The casing tab! - ui_casing_tab = new QWidget(); + ui_casing_tab = new QWidget(this); ui_settings_tabs->addTab(ui_casing_tab, tr("Casing")); ui_casing_widget = new QWidget(ui_casing_tab); diff --git a/src/debug_functions.cpp b/src/debug_functions.cpp index 477eec7..1613a7d 100644 --- a/src/debug_functions.cpp +++ b/src/debug_functions.cpp @@ -9,6 +9,7 @@ void call_error(QString p_message) { QMessageBox *msgBox = new QMessageBox; + msgBox->setAttribute(Qt::WA_DeleteOnClose); msgBox->setText(QCoreApplication::translate("debug_functions", "Error: %1") .arg(p_message)); msgBox->setWindowTitle( @@ -22,6 +23,7 @@ void call_notice(QString p_message) { QMessageBox *msgBox = new QMessageBox; + msgBox->setAttribute(Qt::WA_DeleteOnClose); msgBox->setText(p_message); msgBox->setWindowTitle( QCoreApplication::translate("debug_functions", "Notice")); diff --git a/src/evidence.cpp b/src/evidence.cpp index a8f5913..b97607b 100644 --- a/src/evidence.cpp +++ b/src/evidence.cpp @@ -258,8 +258,9 @@ void Courtroom::set_evidence_list(QVector &p_evi_list) else if (compare_evidence_changed( old_list.at(current_evidence), local_evidence_list.at(current_evidence))) { - QMessageBox *msgBox = new QMessageBox; + QMessageBox *msgBox = new QMessageBox(this); + msgBox->setAttribute(Qt::WA_DeleteOnClose); msgBox->setText(tr("The piece of evidence you've been editing has changed.")); msgBox->setInformativeText(tr("Do you wish to keep your changes?")); msgBox->setDetailedText(tr( @@ -552,7 +553,8 @@ void Courtroom::on_evidence_x_clicked() evidence_close(); return; } - QMessageBox *msgBox = new QMessageBox; + QMessageBox *msgBox = new QMessageBox(this); + msgBox->setAttribute(Qt::WA_DeleteOnClose); msgBox->setText(tr("Evidence has been modified.")); msgBox->setInformativeText(tr("Do you want to save your changes?")); msgBox->setStandardButtons(QMessageBox::Save | QMessageBox::Discard | @@ -655,7 +657,8 @@ void Courtroom::on_evidence_transfer_clicked() private_evidence_list.append(f_evi); } - QMessageBox *msgBox = new QMessageBox; + QMessageBox *msgBox = new QMessageBox(this); + msgBox->setAttribute(Qt::WA_DeleteOnClose); msgBox->setText(tr("\"%1\" has been transferred.").arg(name)); msgBox->setStandardButtons(QMessageBox::Ok); msgBox->setDefaultButton(QMessageBox::Ok);