diff --git a/mainwindow.cpp b/mainwindow.cpp --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -743,6 +743,24 @@ void MainWindow::takeSnapShot() } snapshots.append(snapShot); + updateSnapShotMenu(); + auto sv = new SnapShotView(this, snapShot); sv->show(); } + +void MainWindow::updateSnapShotMenu() +{ + ui->menuSnapShots->clear(); + ui->menuSnapShots->addAction(ui->actionSnapShot); + if (snapshots.size()) + { + ui->menuSnapShots->addSeparator(); + for (auto ss : snapshots) + { + ui->menuSnapShots->addAction(ss->name); + } + ui->menuSnapShots->addSeparator(); + ui->menuSnapShots->addAction(ui->actionClearSnapShots); + } +} diff --git a/mainwindow.h b/mainwindow.h --- a/mainwindow.h +++ b/mainwindow.h @@ -103,6 +103,8 @@ private: // snapshots QList snapshots; + void updateSnapShotMenu(); + // demo QTimer demoTimer; int demoCount; diff --git a/mainwindow.ui b/mainwindow.ui --- a/mainwindow.ui +++ b/mainwindow.ui @@ -488,8 +488,15 @@ + + + SnapShots + + + + @@ -607,7 +614,7 @@ - SnapShot + Take Snapshot Take a snapshot of the current plot (F5) @@ -616,6 +623,14 @@ F5 + + + Clear SnapShots + + + Delete all snapshots + +