Hi,
Im working in a software where i can create and close VTK windows using QML, all in Qt Creator. The app is working fine, i can plot my samples is the way i want, even using 2D vtk versions (using ContextView) and 3D vtk versions (using Renderer).
The reason why im posting this topic is that i just found a weird problem at the moment of closing the app, when i click in classic X button to close the app in certain conditions, the app closes but there is still something running in the task manager. This are the test i have tried and i think i have narrow it down to the following
- If i open the app, open any 2D window and close the app, No problem
- if else i open the app, open any 2D window and plot some data with some , , ’s, … and close the app, No problem
- if else i open the app, open any 3D window and close the app, No problem
- if else i open the app, open any 3D window and plot some data with the classic pipeline like and try to close the app. Here is the problem, the app still runs in the background.
So i have tried everything in the destructor to empty the but still im having the issue.
Im using VTK 9.3.0, Qt Creator 6.9.3 and i based my code in the John Stone examples QML-VTK-Examples/HighlightPickedActor at main · john-stone-ics/QML-VTK-Examples · GitHub
Just not to make a huge ticket, im going to add some snipped code to give more context, but im more than happy to find someone to maybe know something or could help me, i can respond any time.
class PointCloud : public QQuickVtkItem {
Q_OBJECT
public:
~PointCloud();
vtkUserData initializeVTK(vtkRenderWindow *renderWindow) override;
struct MyVtkData : vtkObject {
static MyVtkData* New();
vtkTypeMacro(MyVtkData, vtkObject);
// Core VTK pipeline components
vtkSmartPointer<vtkPoints> _points = vtkSmartPointer<vtkPoints>::New();
vtkSmartPointer<vtkDoubleArray> _zValues = vtkSmartPointer<vtkDoubleArray>::New();
vtkSmartPointer<vtkPolyData> _polyData = vtkSmartPointer<vtkPolyData>::New();
vtkSmartPointer<vtkMaskPoints> _maskPoints = vtkSmartPointer<vtkMaskPoints>::New();
vtkSmartPointer<vtkVertexGlyphFilter> _vertexFilter = vtkSmartPointer<vtkVertexGlyphFilter>::New();
vtkSmartPointer<vtkPolyDataMapper> _mapper = vtkSmartPointer<vtkPolyDataMapper>::New();
vtkSmartPointer<vtkActor> _actor = vtkSmartPointer<vtkActor>::New();
vtkSmartPointer<CustomPanInteractorStyle> _style = vtkSmartPointer<CustomPanInteractorStyle>::New();
vtkSmartPointer<vtkRenderer> _renderer = vtkSmartPointer<vtkRenderer>::New();
vtkSmartPointer<vtkScalarBarActor> _scalarBar = vtkSmartPointer<vtkScalarBarActor>::New();
vtkSmartPointer<vtkLookupTable> _lut = vtkSmartPointer<vtkLookupTable>::New();
};
I really read the documentation, all other examples and i still cannot find the solution, that why i writing the ticket. I dont know if its a problem of understanding the basics of VTK but i think i reached the moment of frustation when you dont see where is the problem.
Thanks a lot.