From 4a4e3a13e6b5653aa32f112d2f71acf7a0d83158 Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Tue, 30 May 2017 14:00:00 +0800 Subject: [PATCH] Fix focusing on the previously opened dialog didn't work Placing modeless dialog A on top of modeless dialog B, then open dialog B again, the expected behavior is B on top of A. --- src/gui/mainwindow.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gui/mainwindow.cpp b/src/gui/mainwindow.cpp index 77574aacb..bc8d78263 100644 --- a/src/gui/mainwindow.cpp +++ b/src/gui/mainwindow.cpp @@ -989,7 +989,7 @@ void MainWindow::on_actionAbout_triggered() { // About dialog if (m_aboutDlg) - m_aboutDlg->setFocus(); + m_aboutDlg->activateWindow(); else m_aboutDlg = new about(this); } @@ -997,7 +997,7 @@ void MainWindow::on_actionAbout_triggered() void MainWindow::on_actionStatistics_triggered() { if (m_statsDlg) - m_statsDlg->setFocus(); + m_statsDlg->activateWindow(); else m_statsDlg = new StatsDialog(this); } @@ -1077,7 +1077,7 @@ void MainWindow::createTorrentTriggered(const QString &path) { if (m_createTorrentDlg) { m_createTorrentDlg->updateInputPath(path); - m_createTorrentDlg->setFocus(); + m_createTorrentDlg->activateWindow(); } else m_createTorrentDlg = new TorrentCreatorDlg(this, path); @@ -1547,7 +1547,7 @@ void MainWindow::createTrayIcon() void MainWindow::on_actionOptions_triggered() { if (m_options) - m_options->setFocus(); + m_options->activateWindow(); else m_options = new OptionsDialog(this); }