1 /*=========================================================================
2 
3   Program:   Visualization Toolkit
4   Module:    vtkQtDebugLeaksView.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 =========================================================================*/
15 /**
16  * @class   vtkQtDebugLeaksView
17  * @brief   view class to display contents of vtkQtDebugLeaksModel
18  *
19  *
20  * A widget the displays all vtkObjectBase derived objects that are alive in
21  * memory.  The widget is designed to be a debugging tool that is instantiated
22  * at program startup and displayed as a top level widget.  Simply create the
23  * widget and call show().
24  */
25 
26 #ifndef vtkQtDebugLeaksView_h
27 #define vtkQtDebugLeaksView_h
28 
29 #include "vtkGUISupportQtModule.h" // For export macro
30 #include <QWidget>
31 
32 class QModelIndex;
33 class vtkObjectBase;
34 class vtkQtDebugLeaksModel;
35 
36 class VTKGUISUPPORTQT_EXPORT vtkQtDebugLeaksView : public QWidget
37 {
38   Q_OBJECT
39 
40 public:
41   vtkQtDebugLeaksView(QWidget* p = nullptr);
42   ~vtkQtDebugLeaksView() override;
43 
44   vtkQtDebugLeaksModel* model();
45 
46   /**
47    * Returns whether or not the regexp filter is enabled
48    */
49   bool filterEnabled() const;
50 
51   /**
52    * Enabled or disables the regexp filter
53    */
54   void setFilterEnabled(bool value);
55 
56   /**
57    * Returns the regexp filter line edit's current text
58    */
59   QString filterText() const;
60 
61   /**
62    * Sets the current text in the regexp filter line edit
63    */
64   void setFilterText(const QString& text);
65 
66 protected:
67   virtual void onObjectDoubleClicked(vtkObjectBase* object);
68   virtual void onClassNameDoubleClicked(const QString& className);
69 
70 protected Q_SLOTS:
71 
72   void onCurrentRowChanged(const QModelIndex& current);
73   void onRowDoubleClicked(const QModelIndex&);
74   void onFilterTextChanged(const QString& filterText);
75   void onFilterToggled();
76   void onFilterHelp();
77 
78 private:
79   class qInternal;
80   qInternal* Internal;
81 
82   Q_DISABLE_COPY(vtkQtDebugLeaksView);
83 };
84 
85 #endif
86 // VTK-HeaderTest-Exclude: vtkQtDebugLeaksView.h
87