Skip to content

Commit b3719be

Browse files
committed
Bring the window to the front when it is restored.
1 parent 091868a commit b3719be

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

v2rock/maindialog.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ MainDialog::MainDialog(QWidget *parent) :
8585
connect(addAction, SIGNAL(triggered()), this, SLOT(actAddHandler()));
8686

8787
restoreAction = new QAction(tr("&Restore"), this);
88-
connect(restoreAction, SIGNAL(triggered()), this, SLOT(showNormal()));
88+
connect(restoreAction, SIGNAL(triggered()), this, SLOT(showAndActive()));
8989

9090
quitAction = new QAction(tr("&Quit"), this);
9191
connect(quitAction, &QAction::triggered, qApp, &QCoreApplication::quit);
@@ -250,6 +250,12 @@ void MainDialog::processFinished(int __attribute__ ((unused)) exitCode, QProcess
250250
this->updateBtnStatus(true);
251251
}
252252

253+
void MainDialog::showAndActive()
254+
{
255+
this->show();
256+
this->activateWindow();
257+
}
258+
253259
void MainDialog::btnImportClickHandler()
254260
{
255261
if (btnImport->text() == tr("Import"))

v2rock/maindialog.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ private slots:
9191
void networkAccessManagerFinished(QNetworkReply *reply);
9292
void treeItemDoubleClicked(QTreeWidgetItem *item, int column);
9393
void processFinished(int exitCode, QProcess::ExitStatus exitStatus);
94+
void showAndActive();
9495
};
9596

9697
#endif // MAINDIALOG_H

0 commit comments

Comments
 (0)