Skip to content

Commit

Permalink
Fixed stop button in runPipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
smistad committed Jun 10, 2022
1 parent 071f0f2 commit c92d254
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions source/FAST/Tools/Pipeline/GUI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,25 @@ GUI::GUI() {
auto stopButton = new QPushButton;
stopButton->setText("Stop");
connect(stopButton, &QPushButton::clicked, [this]() {
stopComputationThread();
auto thread = getComputationThread();
thread->clearViews();
thread->clearProcessObjects();

// Remove and delete old views
auto views = getViews();
clearViews();
for(auto view : views) {
view->stopPipeline();
delete view;
}
delete m_viewLayout;
m_viewLayout = new QHBoxLayout;
// Add an empty dummy view
auto view = createView();
view->setBackgroundColor(Color::Black());
view->set2DMode();
m_viewLayout->addWidget(view);
m_mainLayout->insertLayout(1, m_viewLayout);
});
menuLayout->addWidget(stopButton);

Expand Down Expand Up @@ -191,7 +209,6 @@ void GUI::loadPipeline() {
for(auto view : pipeline.getViews()) {
view->reinitialize();
}

} catch(Exception &e) {
std::string errorMessage = e.what();
int ret = QMessageBox::critical(mWidget, "Pipeline",
Expand Down

0 comments on commit c92d254

Please sign in to comment.