QQmlVTKPlugin window initialization from QML

I am using the QQMLvtkPlugin in my Qt Quick app. To do that the vtk documentation give the following example :

  QGuiApplication app(argc, argv);
  QQmlApplicaQtionEngine engine;
  QObject* topLevel = engine.rootObjects().value(0);
  QQuickWindow* window = qobject_cast<QQuickWindow*>(topLevel);
  // Fetch the QQuick window using the standard object name set up in the constructor
  QQuickVTKRenderItem* qquickvtkItem = topLevel->findChild<QQuickVTKRenderItem*>("ConeView");

However, in my app I want to initialize my qquickvtkItem from my main.qml. In order to do that I have a singleton testQML wich allows me to create my scene:

ApplicationWindow  {
    id: appWindow;
    readonly property SceneManage scene: TestQML.create(appWindow)


SceneManage *testQML::create(QQuickWindow *parent)
    SceneManage *scene = new SceneManage(parent);
    return scene;

But my app crashes when I do a window->show in the SceneManage constructor :

SceneManage::SceneManage(QObject *topLevel)
    window = qobject_cast<QQuickWindow *>(topLevel);   // QQuickWindow window
    QQuickItem *item = topLevel->findChild<QQuickItem *>("3DViewer");

Does someone have a way to solve this problem ? (The solution of the documentation and mine give the same adresses for window and the QQuickVTKRenderItem, so these are the right object)
Many thanks

Solution : Don’t decide to show the window from c++ but only set visible parameter in QML.