From 9b0fb916acb6024988018ec5d13f52490f46d272 Mon Sep 17 00:00:00 2001 From: Arno Date: Sun, 22 Nov 2020 02:47:33 +0100 Subject: Make SearchDialog parentless Don't raise SearchDialog every time MainWindow is clicked. --- shemov.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'shemov.cpp') diff --git a/shemov.cpp b/shemov.cpp index 2593d76..119a6aa 100644 --- a/shemov.cpp +++ b/shemov.cpp @@ -48,7 +48,7 @@ SheMov::SheMov(QWidget *parent, Qt::WindowFlags flags) : QMainWindow(parent, fla //init database as early as possible splash.showMessage(tr("Initializing globals..."), Qt::AlignHCenter, Qt::yellow); qApp->processEvents(); - mSearchDialog = new SearchDialog(this); + mSearchDialog = new SearchDialog(); mSearchDialog->setHidden(true); (void) SmGlobals::instance(); @@ -64,7 +64,7 @@ SheMov::SheMov(QWidget *parent, Qt::WindowFlags flags) : QMainWindow(parent, fla connect(mConsistencyA, &QAction::triggered, this, &SheMov::checkConsistency); QAction *searchDialogA = new QAction(tr("Search..."), this); searchDialogA->setShortcut(tr("CTRL+f")); - connect(searchDialogA, &QAction::triggered, mSearchDialog, &SearchDialog::show); + connect(searchDialogA, &QAction::triggered, mSearchDialog, [&] { mSearchDialog->show(); mSearchDialog->raise(); }); mQuitA = new QAction(tr("Quit"), this); mQuitA->setShortcut(tr("CTRL+q")); connect(mQuitA, &QAction::triggered, qApp, &QApplication::closeAllWindows); -- cgit v1.2.3-70-g09d2