Here are some bugs when use official demo quickVtkRenderwindow with qml.
First :
In qml file , QQuickVtkRenderer cannot in Rectangle ,like this :
bug1.qml
...
VTKRenderWindow {
id: vtkwindow
width: 400
height: 400
}
// add one or more vtk render items
Rectangle{
id : parentRect
width : 200
height: 200
VTKRenderItem {
objectName: "VolumeView"
x: 0
y: 0
width: 200
height: 200
// Provide the handle to the render window
renderWindow: vtkwindow
}
}
In my test , if parentRect has width and height , the VtnRenderItem show nothing .
And if I change Rectangle to Item , that not happen.
Second :
Can not use visible to show or hide vtk either set the visible property of windows to false or the visible property of renderItem to false dynamically . It’s just to freeze the picture, not hide the picture.
like this:
bug2.qml
...
Rectangle{
id : _button
width : 100
height: 100
MouseArea{
anchors.fill : parent
onClicked:{
vtkwindow.visible = !vtkwindow.visible
_renderer.visible = !_renderer.visible
}
}
VTKRenderWindow {
id: vtkwindow
width: 400
height: 400
}
// add one or more vtk render items
Rectangle{
id : parentRect
VTKRenderItem {
id : _renderer
objectName: "VolumeView"
x: 0
y: 0
width: 200
height: 200
// Provide the handle to the render window
renderWindow: vtkwindow
}
}
There is another bug that is not listed for the time being......