Qt: Simplify AboutDialog creation

Just create the AboutDialog on the stack -- the actual object lives on
the heap anyway, since Qt uses the pimpl idiom. Removes the need for
an explicit new and a special delete on close attribute.
This commit is contained in:
Léo Lam 2017-09-14 17:01:43 +02:00
parent 730b7fc833
commit 8f2558dc89
2 changed files with 2 additions and 3 deletions

View File

@ -14,7 +14,6 @@ AboutDialog::AboutDialog(QWidget* parent) : QDialog(parent)
{
setWindowTitle(tr("About Dolphin"));
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
setAttribute(Qt::WA_DeleteOnClose);
QString text = QStringLiteral("");
QString small = QStringLiteral("<p style='margin-top:0px; margin-bottom:0px; font-size:9pt;'>");

View File

@ -553,8 +553,8 @@ void MainWindow::ShowAudioWindow()
void MainWindow::ShowAboutDialog()
{
AboutDialog* about = new AboutDialog(this);
about->show();
AboutDialog about{this};
about.exec();
}
void MainWindow::ShowHotkeyDialog()