# HG changeset patch # User Hasan Yavuz Ă–ZDERYA # Date 2015-09-20 08:17:23 # Node ID 92c0f8665f08e8b3a4ea935d1ef41f1f0d623d18 # Parent 1f9bc936c790b54909e373708c2ed0979fa38501 implemented clear snapshots menu item diff --git a/mainwindow.cpp b/mainwindow.cpp --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -118,6 +118,9 @@ MainWindow::MainWindow(QWidget *parent) QObject::connect(ui->actionSnapShot, SIGNAL(triggered(bool)), this, SLOT(takeSnapShot())); + QObject::connect(ui->actionClearSnapShots, SIGNAL(triggered(bool)), + this, SLOT(clearSnapshots())); + // setup number of channels spinbox QObject::connect(ui->spNumOfChannels, SELECT::OVERLOAD_OF(&QSpinBox::valueChanged), @@ -760,3 +763,13 @@ void MainWindow::updateSnapShotMenu() ui->menuSnapShots->addAction(ui->actionClearSnapShots); } } + +void MainWindow::clearSnapshots() +{ + for (auto snapshot : snapshots) + { + delete snapshot; + } + snapshots.clear(); + updateSnapShotMenu(); +} diff --git a/mainwindow.h b/mainwindow.h --- a/mainwindow.h +++ b/mainwindow.h @@ -133,6 +133,7 @@ private slots: void spsTimerTimeout(); void takeSnapShot(); + void clearSnapshots(); void demoTimerTimeout(); void enableDemo(bool enabled);