# How to clean rendering window in Qt (PySide2, Qt5)

**URL:** https://discourse.vtk.org/t/how-to-clean-rendering-window-in-qt-pyside2-qt5/1217
**Category:** Support
**Created:** [June 26, 2019, 12:38pm UTC](https://discourse.vtk.org/t/how-to-clean-rendering-window-in-qt-pyside2-qt5/1217 "2019-06-26T12:38:58Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![sbucc](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/s/f475e1/32.png) [@sbucc](https://discourse.vtk.org/u/sbucc)
#### Post date: [June 26, 2019, 12:38pm UTC](https://discourse.vtk.org/t/how-to-clean-rendering-window-in-qt-pyside2-qt5/1217/1 "2019-06-26T12:38:58Z")

</div>

I’m writing a viewer with python 3.5 and Qt5, using PySide2.  
How do I completely wipe or unload the existing mesh from a rendering window? I just want the existing mesh to disappear when I click a button.  
I’m rendering into a QVTKRenderWindowInteractor widget, I tried setting the actor to None, and other things that frankly I can’t remember, and nothing worked: either the last loaded mesh stayed stubbornly in the window, or else the window went black and I couldn’t load a new mesh.

---

<div class="post-metadata">

### Author: ![cory.quammen](https://discourse.vtk.org/user_avatar/discourse.vtk.org/cory.quammen/32/6751_2.png) [@cory.quammen](https://discourse.vtk.org/u/cory.quammen)
#### Post date: [June 26, 2019, 3:28pm UTC](https://discourse.vtk.org/t/how-to-clean-rendering-window-in-qt-pyside2-qt5/1217/2 "2019-06-26T15:28:48Z")

</div>

It sounds like you might need to remove the actor from the renderer with `vtkRenderer.RemoveActor(actor)` and pass in your actor object before setting it to `None`. Just deleting the actor isn’t sufficient because the renderer will hold a reference to the actor object.

To completely clear the renderer, you can call `vtkRenderer.RemoveAllViewProps()`.

---

<div class="post-metadata">

### Author: ![sbucc](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/s/f475e1/32.png) [@sbucc](https://discourse.vtk.org/u/sbucc)
#### Post date: [June 26, 2019, 8:54pm UTC](https://discourse.vtk.org/t/how-to-clean-rendering-window-in-qt-pyside2-qt5/1217/3 "2019-06-26T20:54:49Z")

</div>

@cory.quammen, RemoveAllViewProps is exactly what I was looking for, thanks!
