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 
34 class vtkObjectBase;
35 
36 class VTKGUISUPPORTQT_EXPORT vtkQtDebugLeaksModel : public QStandardItemModel
37 {
38  Q_OBJECT
39 
40 public:
41 
42  vtkQtDebugLeaksModel(QObject* p=nullptr);
44 
48  QList<vtkObjectBase*> getObjects(const QString& className);
49 
55  QStandardItemModel* referenceCountModel(const QString& className);
56 
57 protected slots:
58 
59  void addObject(vtkObjectBase* object);
60  void removeObject(vtkObjectBase* object);
63  void onAboutToQuit();
64 
65  // Inherited method from QAbstractItemModel
66  Qt::ItemFlags flags(const QModelIndex &index) const override;
67 
68 private:
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 //-----------------------------------------------------------------------------
82 class ReferenceCountModel : public QStandardItemModel
83 {
84  Q_OBJECT
85 
86 public:
87  ReferenceCountModel(QObject* p=nullptr);
91  QString pointerAsString(void* ptr);
92 
93  // Inherited method from QAbstractItemModel
94  Qt::ItemFlags flags(const QModelIndex &index) const override;
95 
96 protected slots:
98 };
99 
100 
101 #endif
vtkQtDebugLeaksModel::registerObject
void registerObject(vtkObjectBase *object)
ReferenceCountModel::addObject
void addObject(vtkObjectBase *obj)
vtkQtDebugLeaksModel
model class that observes the vtkDebugLeaks singleton
Definition: vtkQtDebugLeaksModel.h:37
vtkQtDebugLeaksModel::referenceCountModel
QStandardItemModel * referenceCountModel(const QString &className)
Return an item model that contains only objects with the given class name.
vtkQtDebugLeaksModel::removeObject
void removeObject(vtkObjectBase *object)
vtkQtDebugLeaksModel::onAboutToQuit
void onAboutToQuit()
ReferenceCountModel
Definition: vtkQtDebugLeaksModel.h:83
ReferenceCountModel::ReferenceCountModel
ReferenceCountModel(QObject *p=nullptr)
ReferenceCountModel::pointerAsString
QString pointerAsString(void *ptr)
vtkQtDebugLeaksModel::getObjects
QList< vtkObjectBase * > getObjects(const QString &className)
Get the list of objects in the model that have the given class name.
ReferenceCountModel::~ReferenceCountModel
~ReferenceCountModel() override
ReferenceCountModel::flags
Qt::ItemFlags flags(const QModelIndex &index) const override
vtkObjectBase
abstract base class for most VTK objects
Definition: vtkObjectBase.h:66
vtkQtDebugLeaksModel::processPendingObjects
void processPendingObjects()
ReferenceCountModel::updateReferenceCounts
void updateReferenceCounts()
vtkQtDebugLeaksModel::addObject
void addObject(vtkObjectBase *object)
ReferenceCountModel::removeObject
void removeObject(vtkObjectBase *obj)
vtkQtDebugLeaksModel::~vtkQtDebugLeaksModel
~vtkQtDebugLeaksModel() override
vtkX3D::index
@ index
Definition: vtkX3D.h:246
vtkQtDebugLeaksModel::flags
Qt::ItemFlags flags(const QModelIndex &index) const override
vtkQtDebugLeaksModel::vtkQtDebugLeaksModel
vtkQtDebugLeaksModel(QObject *p=nullptr)