ignore, solved by self
Go to solution
Solved by CookieMaster,
11 hours ago, Pinguinsan said:void MainWindow::on_close_clicked() { ui->graphicsView->clear(); ui->graphicsView->viewPort().update(); }
The viewPort update may or may not be necessary, see here
error: 'class QGraphicsView' has no member named 'clear'
ui->graphicsView->clear();
^
: error: 'class QGraphicsView' has no member named 'viewPort'
ui->graphicsView->viewPort().update();
^
I found out that I can use
scene->clear(); ui->graphicsView->items().clear();
but is what you had above better?
Not sure what the difference between the 2 is to be honest.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now