VTK  9.2.6
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=========================================================================*/
27
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 vtkQtDebugLeaksModel(QObject* p = nullptr);
43
47 QList<vtkObjectBase*> getObjects(const QString& className);
48
54 QStandardItemModel* referenceCountModel(const QString& className);
55
56protected Q_SLOTS:
57
58 void addObject(vtkObjectBase* object);
63
64 // Inherited method from QAbstractItemModel
65 Qt::ItemFlags flags(const QModelIndex& index) const override;
66
67private:
68 class qInternal;
69 qInternal* Internal;
70
71 class qObserver;
72 qObserver* Observer;
73
74 Q_DISABLE_COPY(vtkQtDebugLeaksModel);
75};
76
77// TODO - move to private
78//-----------------------------------------------------------------------------
79class ReferenceCountModel : public QStandardItemModel
80{
81 Q_OBJECT
82
83public:
84 ReferenceCountModel(QObject* p = nullptr);
88 QString pointerAsString(void* ptr);
89
90 // Inherited method from QAbstractItemModel
91 Qt::ItemFlags flags(const QModelIndex& index) const override;
92
93protected Q_SLOTS:
95};
96
97#endif
98// 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
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