From 7fc6c64fd799419c6c0994129287a1b04cdb1686 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Du=C5=A1an=20Poizl?= Date: Mon, 24 Mar 2025 22:09:18 +0100 Subject: [PATCH] Make help windows non modal --- about.cpp | 2 ++ mainwindow.cpp | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/about.cpp b/about.cpp index 8ce32dd..fa96a58 100644 --- a/about.cpp +++ b/about.cpp @@ -32,6 +32,8 @@ HelpDialog::HelpDialog(QWidget *parent) : QDialog(parent) { setWindowTitle(tr("Help")); resize(1000, 600); + setModal(false); + setAttribute(Qt::WA_DeleteOnClose, true); QVBoxLayout *layout = new QVBoxLayout(this); QTextEdit *helpText = new QTextEdit(this); diff --git a/mainwindow.cpp b/mainwindow.cpp index ac4df1a..3a0c814 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -306,7 +306,7 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) menuBar()->addMenu(dockMenu); QMenu *helpMenu = menuBar()->addMenu(tr("Help")); - helpMenu->addAction(tr("Help"), QKeySequence::HelpContents, [this]{ HelpDialog help(this); help.exec(); }); + helpMenu->addAction(tr("Help"), QKeySequence::HelpContents, [this]{ HelpDialog *help = new HelpDialog(this); help->show(); }); helpMenu->addAction(tr("About Tenmon"), [this]{ About about(this); about.exec(); }); helpMenu->addAction(tr("About Qt"), [this](){ QMessageBox::aboutQt(this); }); helpMenu->addAction(tr("Check for update"), this, &MainWindow::checkNewVersion);