[vtkusers] why are destructors protected?

Matthieu Chabanas Matthieu.Chabanas at imag.fr
Fri Jun 1 09:56:42 EDT 2001


Sorry if this is a dummy question, but... 

I wonder why constructor, destructor, operator=, copy constructor, ...
are *protected* in vtk classes?
It is just to know.

Actually, I use VTK and QT in my applications. I would like to use Qt
template collection classes, especially QList<vktDataSet>.
However, it is required to compile that a public destructor is defined
for vktDataSet.

> d:\applications\qt\include\qlist.h(104) : error C2248: 'vtkDataSet::~vtkDataSet' : cannot access protected member declared in class 'vtkDataSet'
>         d:\applications\vtk32\include\vtkdataset.h(346) : see declaration of 'vtkDataSet::~vtkDataSet'
>         d:\applications\qt\include\qvaluelist.h(88) : while compiling class-template member function 'void __thiscall QList<class vtkDataSet>::deleteItem(void *)'

Any suggestion?

Thanks,
Matt




More information about the vtkusers mailing list