# vtkInteractorStyleRubberBand3D not playing nice with QQuickVTKRenderWindow

**URL:** <https://discourse.vtk.org/t/vtkinteractorstylerubberband3d-not-playing-nice-with-qquickvtkrenderwindow/7478>\
**Category:** Development\
**Created:** [December 23, 2021, 4:28am UTC](https://discourse.vtk.org/t/vtkinteractorstylerubberband3d-not-playing-nice-with-qquickvtkrenderwindow/7478 "2021-12-23T04:28:46Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![marcwang](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/m/b4bc9f/32.png) [@marcwang](https://discourse.vtk.org/u/marcwang)\
**Post date:** [December 23, 2021, 4:28am UTC](https://discourse.vtk.org/t/vtkinteractorstylerubberband3d-not-playing-nice-with-qquickvtkrenderwindow/7478/1 "2021-12-23T04:28:46Z")

</div>

I was playing around with QQuickVTKRenderWindow. Instead of a trackball interactor on [line 260](https://gitlab.kitware.com/acbauer/vtk/-/blob/master/GUISupport/QtQuick/QQuickVTKRenderWindow.cxx#L260), I put in a vtkInteractorStyleRubberBand3D. But when I try using it, it throws an error

> vtkGenericOpenGLRenderWindow (0000024B9236C8E0): `ReadPixels` called before window is ready for rendering;

This is due to vtkInteractorStyleRubberBand3D calling the method [GetRGBACharPixelData](https://gitlab.kitware.com/acbauer/vtk/-/blob/master/Interaction/Style/vtkInteractorStyleRubberBand3D.cxx#L70) which calls [ReadPixels](https://gitlab.kitware.com/acbauer/vtk/-/blob/master/Rendering/OpenGL2/vtkGenericOpenGLRenderWindow.cxx#L243). If I keep on clicking I finally get an error:

> vtkOpenGLState.cxx:68 WARN| Error in cache state for GL\_DEPTH\_WRITEMASK

I notice the ReadPixels Warning is triggered because the ReadyForRendering state is set to false after assigning the interactor at [line 263](https://gitlab.kitware.com/acbauer/vtk/-/blob/master/GUISupport/QtQuick/QQuickVTKRenderWindow.cxx#L263). Why is this property been set to false? When I set them all to true, I just get the GL\_DEPTH\_WRITEMASK error.

I get the feeling their might some synchronization issue between the qt quick opengl calls and the vtk.

EDIT : I just found that it is sort of related to [this issue](https://gitlab.kitware.com/vtk/vtk/-/issues/18409).
