Hi every developer , hope you can see this:
I found some issues when I use vtk9.1 and qml .Below is the one description ：
- When I add a cameraorientationwidget with QQuickVTKInteractiveWidget by use
QQuickVTKRenderItem::addWidget(QQuickVTKInteractiveWidget* w) ,and the widget not work normally , such like when the mouse hold on the actor on widget , The "X " or “Y” or “Z” do not highlight and click the actor it has no response, but it should rotate the camera .
- When I debug the application I found that the actor cannot be selected by vtkhardwareselector , because everytime mouse event will lead to a pixel buffer set and release , but It should have render event between set and release buffer , and the reason why the render() work is the renderer is not correctly in vtkRenderer::PickProp() function , but I don’t know how and why I should do , I can not find any documents for this and there are no similar issue with this.
Here is some code
m_QQuickvtkrenderItem = topLevel->findChild<MyQQuickVTKRenderItem*>("ConeView"); ... ... vtkSmartPointer<vtkInteractorStyleTrackballCamera2> style = vtkSmartPointer<vtkInteractorStyleTrackballCamera2>::New(); vtkNew<vtkRenderWindowInteractor> iRen; m_QQuickvtkrenderItem->renderWindow()->renderWindow()->GetInteractor()->SetInteractorStyle(style); style->SetDefaultRenderer(m_QQuickvtkrenderItem->renderer()); style->setQtItem(this); QQuickVTKInteractiveWidget* interactorWidget = new QQuickVTKInteractiveWidget(m_QQuickvtkrenderItem->renderWindow()); interactorWidget->setWidget(camOrientManipulator); interactorWidget->setEnabled(true); m_QQuickvtkrenderItem->addWidget(interactorWidget); camOrientManipulator->SetParentRenderer(m_QQuickvtkrenderItem->renderer()); camOrientManipulator->SetInteractor(m_QQuickvtkrenderItem->renderWindow()->renderWindow()->GetInteractor()); m_QQuickvtkrenderItem->renderWindow()->interactorAdapter()->SetEnableHover(true); m_QQuickvtkrenderItem->update(); camOrientManipulator->EnabledOn(); camOrientManipulator->On();`
And here is my project address , GitHub - dezbracaty/QtVtk9.1: A qt vtk demo with vtk 9.1
I hope someone can help me to resolve this issue and help more people to use vtk9.1 with qml .
Very thanks for everyone.