Isis 3 Programmer Reference
TreeViewHeader.h
1 #ifndef TreeViewHeader_H
2 #define TreeViewHeader_H
3 
10 /* SPDX-License-Identifier: CC0-1.0 */
11 
12 #include <QWidget>
13 
14 class QMouseEvent;
15 class QPainter;
16 class QPaintEvent;
17 class QSize;
18 class QString;
19 
20 namespace Isis {
21  class TreeViewContent;
22 
30  class TreeViewHeader : public QWidget {
31 
32  Q_OBJECT
33 
34  public:
35  explicit TreeViewHeader(TreeViewContent *someContent,
36  QWidget *parent);
37  TreeViewHeader(const TreeViewHeader &other);
38  virtual ~TreeViewHeader();
39  QSize minimumSizeHint() const;
40  QString getText();
41  void setText(QString text);
42 
43 
44  QSize sizeHint() const {
45  return minimumSizeHint();
46  }
47 
48  TreeViewHeader &operator=(const TreeViewHeader &other);
49 
50 
51  public slots:
52  void setActive(bool);
53  void handleFilterCountsChanged(int visibleTopLevelItemCount,
54  int topLevelItemCount);
55 
56 
57  signals:
58  void activated();
59 
60 
61  protected:
62  void mouseReleaseEvent(QMouseEvent *event);
63  void paintEvent(QPaintEvent *event);
64 
65 
66  private: // methods
67  void nullify();
68  void paintHeader(QPainter *painter, int rowheight);
69  void paintProgress(QPainter *painter, const QRect &rect, int min,
70  int max, int value);
71 
72 
73  private slots:
74  void updateFilterProgress(int newProgress);
75  void updateFilterProgressRange(int min, int max);
76  void updateRebuildProgress(int newProgress);
77  void updateRebuildProgressRange(int min, int max);
78 
79 
80  private: // data
81  TreeViewContent *m_content;
82  QString *m_headerText;
83  int m_filterProgress;
84  int m_filterProgressMin;
85  int m_filterProgressMax;
86  int m_rebuildProgress;
87  int m_rebuildProgressMin;
88  int m_rebuildProgressMax;
89  bool m_active;
90  int m_visibleCount;
91  int m_totalCount;
92  };
93 }
94 
95 
96 #endif
QWidget
Isis::TreeViewHeader
Definition: TreeViewHeader.h:30
Isis::TreeViewContent
Definition: TreeViewContent.h:36
Isis
This is free and unencumbered software released into the public domain.
Definition: Apollo.h:16