# How to change interactor of QQuickVTKRenderWindow?

**URL:** https://discourse.vtk.org/t/how-to-change-interactor-of-qquickvtkrenderwindow/7289
**Category:** Support
**Created:** [November 26, 2021, 5:16pm UTC](https://discourse.vtk.org/t/how-to-change-interactor-of-qquickvtkrenderwindow/7289 "2021-11-26T17:16:26Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![tmnku](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/t/e95f7d/32.png) [@tmnku](https://discourse.vtk.org/u/tmnku)
#### Post date: [November 26, 2021, 5:16pm UTC](https://discourse.vtk.org/t/how-to-change-interactor-of-qquickvtkrenderwindow/7289/1 "2021-11-26T17:16:26Z")

</div>

Hi, I’m new to the forum. I’m currently working on a project with Qt 5.12 and VTK 9.1 in which I want to use a custom interactorStyle. In my qml I have

```json
  VTKRenderWindow {
    id: vtkwindow
    width: 400
    height: 400
  }
 
  ModelViewer {
    objectName: "ModelViewer"
    anchors.fill: vtkwindow
    renderWindow: vtkwindow
  }

```

`ModelViewer` is my custom class which inherits from `QQuickVTKRenderItem`. From within `ModelViewer` I try to change the interactorStyle like this:

```cpp
vtkNew<vtkInteractorStyleFlight> style;
renderWindow()->renderWindow()->GetInteractor()->SetInteractorStyle(style);

```

When I move within the scene I get an error message after a short time

```auto
QObject: Cannot create children for a parent that is in a different thread.
(Parent is QVTKInteractorInternal(0x55f0a93f3e20), parent's thread is QThread(0x55f0a90e7ce0), current thread is QSGRenderThread(0x55f0a97e3d50)

```

then the program segfaults. I also printed out the current thread when I set the new style and it is not `QSGRenderThread`. Setting `QSG_RENDER_LOOP=basic` makes the application run without any errors.  
Unfortunately I could not find any examples on how to change the interactor in a Qt setting so thank you in advance for any help.
