Hi :-),
I want to use VTK with Pyside6 and QML. For C++ i found an example and with
QObject* topLevel = engine.rootObjects().value(0);
QQuickWindow* window = qobject_cast<QQuickWindow*>(topLevel);
window->show();
QQuickVTKRenderItem* qquickvtkItem = topLevel->findChild<QQuickVTKRenderItem*>("ConeView");
vtkRenderWindow *renderWindow = qquickvtkItem->renderWindow()->renderWindow();
vtkRenderWindowInteractor *iRen = renderWindow->GetInteractor();
vtkRenderer *renderer = qquickvtkItem->renderer();
on C++ side and
import QtQuick.Window
import VTK 9.3
Window {
width: 600
height: 600
VTKRenderWindow {
id: vtkwindow
anchors.fill: parent
VTKRenderItem {
id: renderItem
objectName: "ConeView"
anchors.fill: vtkwindow
renderWindow: vtkwindow
}
}
}
on QML Side, i get everything to use vtk.
But in Pyhon the VTKRenderWindow is just a QQuickItem and the Type QQuickVTKRenderItem does not exist.
So, how to use VTK in pyside6/qml apps ?
Thanks for help