Changeset - e421d52f198e
[Not reviewed]
snapshots
0 3 0
Hasan Yavuz Ă–ZDERYA - 10 years ago 2015-09-20 09:56:52
hy@ozderya.net
code cleanup and remove test messages
3 files changed with 1 insertions and 12 deletions:
0 comments (0 inline, 0 general)
mainwindow.cpp
Show inline comments
 
@@ -730,13 +730,12 @@ void MainWindow::messageHandler(QtMsgTyp
 
        ui->statusBar->showMessage(msg, 5000);
 
    }
 
}
 

	
 
void MainWindow::takeSnapShot()
 
{
 
    qDebug() << "taking a snopshot yay!";
 
    QString name = QTime::currentTime().toString("'Snapshot ['HH:mm:ss']'");
 
    auto snapShot = new SnapShot(this, name);
 

	
 
    for (unsigned ci = 0; ci < numOfChannels; ci++)
 
    {
 
        snapShot->data.append(QVector<QPointF>(numOfSamples));
snapshot.cpp
Show inline comments
 
@@ -40,33 +40,26 @@ QAction* SnapShot::deleteAction()
 
}
 

	
 
void SnapShot::show()
 
{
 
    if (view == NULL)
 
    {
 
        qDebug() << "view == NULL";
 
        view = new SnapShotView(mainWindow, this);
 
        connect(view, &SnapShotView::closed, this, &SnapShot::viewClosed);
 
    }
 
    view->show();
 
    view->activateWindow();
 
    view->raise();
 
}
 

	
 
void SnapShot::hide()
 
{
 

	
 
}
 

	
 
void SnapShot::viewClosed()
 
{
 
    delete view;
 
    view = NULL;
 
}
 

	
 

	
 
void SnapShot::onDeleteTriggered()
 
{
 
    emit deleteRequested(this);
 
}
 

	
 
QString SnapShot::name()
snapshot.h
Show inline comments
 
@@ -19,27 +19,24 @@ public:
 
    QVector<QVector<QPointF>> data;
 
    QAction* showAction();
 
    QAction* deleteAction();
 

	
 
    QString name();
 

	
 
public slots:
 
    void show();
 
    void hide();
 

	
 
signals:
 
    void deleteRequested(SnapShot*);
 

	
 
private:
 
    QString _name;
 
    QAction _showAction;
 
    QAction _deleteAction;
 
    QMainWindow* mainWindow;
 
    SnapShotView* view;
 

	
 
private slots:
 
    void show();
 
    void viewClosed();
 

	
 
    void onDeleteTriggered();
 
};
 

	
 
#endif /* SNAPSHOT_H */
0 comments (0 inline, 0 general)