From 8c819f9bbd13f4448c0277f33a7434dd044c412f Mon Sep 17 00:00:00 2001 From: jp9000 Date: Sun, 10 Feb 2019 16:27:51 -0800 Subject: [PATCH] UI: Make "What's New" dialog modeless --- UI/window-basic-main.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/UI/window-basic-main.cpp b/UI/window-basic-main.cpp index be61c3921..a8a4facf3 100644 --- a/UI/window-basic-main.cpp +++ b/UI/window-basic-main.cpp @@ -1918,9 +1918,10 @@ void OBSBasic::ReceivedIntroJson(const QString &text) config_set_int(App()->GlobalConfig(), "General", "InfoIncrement", info_increment); - QDialog dlg(this); - dlg.setWindowTitle("What's New"); - dlg.resize(700, 600); + QDialog *dlg = new QDialog(this); + dlg->setAttribute(Qt::WA_DeleteOnClose, true); + dlg->setWindowTitle("What's New"); + dlg->resize(700, 600); QCefWidget *cefWidget = cef->create_widget(nullptr, info_url); if (!cefWidget) { @@ -1928,22 +1929,22 @@ void OBSBasic::ReceivedIntroJson(const QString &text) } connect(cefWidget, SIGNAL(titleChanged(const QString &)), - &dlg, SLOT(setWindowTitle(const QString &))); + dlg, SLOT(setWindowTitle(const QString &))); QPushButton *close = new QPushButton(QTStr("Close")); connect(close, &QAbstractButton::clicked, - &dlg, &QDialog::accept); + dlg, &QDialog::accept); QHBoxLayout *bottomLayout = new QHBoxLayout(); bottomLayout->addStretch(); bottomLayout->addWidget(close); bottomLayout->addStretch(); - QVBoxLayout *topLayout = new QVBoxLayout(&dlg); + QVBoxLayout *topLayout = new QVBoxLayout(dlg); topLayout->addWidget(cefWidget); topLayout->addLayout(bottomLayout); - dlg.exec(); + dlg->show(); #else UNUSED_PARAMETER(text); #endif