VTK  9.1.0
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=========================================================================*/
25#ifndef vtkQtDebugLeaksModel_h
26#define vtkQtDebugLeaksModel_h
27
28#include "vtkGUISupportQtModule.h" // For export macro
29#include <QStandardItemModel>
30
31class vtkObjectBase;
32
33class VTKGUISUPPORTQT_EXPORT vtkQtDebugLeaksModel : public QStandardItemModel
34{
35 Q_OBJECT
36
37public:
38 vtkQtDebugLeaksModel(QObject* p = nullptr);
40
44 QList<vtkObjectBase*> getObjects(const QString& className);
45
51 QStandardItemModel* referenceCountModel(const QString& className);
52
53protected Q_SLOTS:
54
55 void addObject(vtkObjectBase* object);
60
61 // Inherited method from QAbstractItemModel
62 Qt::ItemFlags flags(const QModelIndex& index) const override;
63
64private:
65 class qInternal;
66 qInternal* Internal;
67
68 class qObserver;
69 qObserver* Observer;
70
71 Q_DISABLE_COPY(vtkQtDebugLeaksModel);
72};
73
74// TODO - move to private
75//-----------------------------------------------------------------------------
76class ReferenceCountModel : public QStandardItemModel
77{
78 Q_OBJECT
79
80public:
81 ReferenceCountModel(QObject* p = nullptr);
85 QString pointerAsString(void* ptr);
86
87 // Inherited method from QAbstractItemModel
88 Qt::ItemFlags flags(const QModelIndex& index) const override;
89
90protected Q_SLOTS:
92};
93
94#endif
95// VTK-HeaderTest-Exclude: vtkQtDebugLeaksModel.h
void updateReferenceCounts()
Qt::ItemFlags flags(const QModelIndex &index) const override
void removeObject(vtkObjectBase *obj)
~ReferenceCountModel() override
QString pointerAsString(void *ptr)
void addObject(vtkObjectBase *obj)
ReferenceCountModel(QObject *p=nullptr)
abstract base class for most VTK objects
Definition: vtkObjectBase.h:70
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.
~vtkQtDebugLeaksModel() override
QList< vtkObjectBase * > getObjects(const QString &className)
Get the list of objects in the model that have the given class name.
void registerObject(vtkObjectBase *object)
vtkQtDebugLeaksModel(QObject *p=nullptr)
void addObject(vtkObjectBase *object)
Qt::ItemFlags flags(const QModelIndex &index) const override