VTK
vtkQtDebugLeaksModel.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkQtDebugLeaksModel.h
5
6 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7 All rights reserved.
8 See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9
10 This software is distributed WITHOUT ANY WARRANTY; without even
11 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12 PURPOSE. See the above copyright notice for more information.
13
14=========================================================================*/
28#ifndef vtkQtDebugLeaksModel_h
29#define vtkQtDebugLeaksModel_h
30
31#include "vtkGUISupportQtModule.h" // For export macro
32#include <QStandardItemModel>
33
34class vtkObjectBase;
35
36class VTKGUISUPPORTQT_EXPORT vtkQtDebugLeaksModel : public QStandardItemModel
37{
38 Q_OBJECT
39
40public:
41
42 vtkQtDebugLeaksModel(QObject* p=0);
44
48 QList<vtkObjectBase*> getObjects(const QString& className);
49
55 QStandardItemModel* referenceCountModel(const QString& className);
56
57protected slots:
58
59 void addObject(vtkObjectBase* object);
64
65 // Inherited method from QAbstractItemModel
66 virtual Qt::ItemFlags flags(const QModelIndex &index) const;
67
68private:
69
70 class qInternal;
71 qInternal* Internal;
72
73 class qObserver;
74 qObserver* Observer;
75
76 Q_DISABLE_COPY(vtkQtDebugLeaksModel);
77};
78
79
80// TODO - move to private
81//-----------------------------------------------------------------------------
82class ReferenceCountModel : public QStandardItemModel
83{
84 Q_OBJECT
85
86public:
87 ReferenceCountModel(QObject* p=0);
91 QString pointerAsString(void* ptr);
92
93 // Inherited method from QAbstractItemModel
94 virtual Qt::ItemFlags flags(const QModelIndex &index) const;
95
96protected slots:
98};
99
100
101#endif
void updateReferenceCounts()
ReferenceCountModel(QObject *p=0)
void removeObject(vtkObjectBase *obj)
QString pointerAsString(void *ptr)
void addObject(vtkObjectBase *obj)
virtual Qt::ItemFlags flags(const QModelIndex &index) const
abstract base class for most VTK objects
Definition: vtkObjectBase.h:66
model class that observes the vtkDebugLeaks singleton
void removeObject(vtkObjectBase *object)
QStandardItemModel * referenceCountModel(const QString &className)
Return an item model that contains only objects with the given class name.
QList< vtkObjectBase * > getObjects(const QString &className)
Get the list of objects in the model that have the given class name.
vtkQtDebugLeaksModel(QObject *p=0)
void registerObject(vtkObjectBase *object)
virtual Qt::ItemFlags flags(const QModelIndex &index) const
void addObject(vtkObjectBase *object)
virtual ~vtkQtDebugLeaksModel()
@ index
Definition: vtkX3D.h:246