Skip to content

Commit

Permalink
Fix: delete scene
Browse files Browse the repository at this point in the history
  • Loading branch information
thorpelawrence committed Nov 2, 2017
1 parent 6e1bd1d commit 0522acc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ MainWindow::MainWindow(QWidget *parent) :
QIcon::setThemeName("oxygen");
#endif
ui->setupUi(this);
scene = nullptr;
ui->actionUndo->setEnabled(false);
}

Expand Down Expand Up @@ -40,7 +41,8 @@ void MainWindow::updateProgress(int progress) {

void MainWindow::showImage(QImage image) {
this->image = image;
//delete scene;
if (scene)
delete scene;
scene = new QGraphicsScene(ui->graphicsView);
scene->addPixmap(QPixmap::fromImage(image));
ui->graphicsView->setScene(scene);
Expand Down

0 comments on commit 0522acc

Please sign in to comment.