Isis 3 Developer Reference
TreeViewContent.h
Go to the documentation of this file.
1 #ifndef TreeViewContent_H
2 #define TreeViewContent_H
3 
4 
5 // parent
6 #include <QAbstractScrollArea>
7 
8 
9 class QEvent;
10 class QKeyEvent;
11 template< typename T > class QList;
12 class QMouseEvent;
13 class QPoint;
14 class QResizeEvent;
15 
16 
17 namespace Isis {
18  class AbstractTreeItem;
19  class AbstractTreeModel;
20  class TreeView;
21 
30  Q_OBJECT
31 
32  public:
33  TreeViewContent(QWidget *parent);
34  virtual ~TreeViewContent();
35  QSize minimumSizeHint() const;
36  QSize sizeHint() const;
38  void setModel(AbstractTreeModel *someModel);
39 
40 
41  signals:
42  void treeSelectionChanged();
44 
45 
46  public slots:
47  void refresh();
48 
49 
50  protected:
51  bool eventFilter(QObject *target, QEvent *event);
52  void keyPressEvent(QKeyEvent *event);
53  void leaveEvent(QEvent *event);
54  void mouseDoubleClickEvent(QMouseEvent *event);
55  void mouseMoveEvent(QMouseEvent *event);
56  void mousePressEvent(QMouseEvent *event);
57  void mouseReleaseEvent(QMouseEvent *event);
58  void paintEvent(QPaintEvent *event);
59  void resizeEvent(QResizeEvent *event);
60  void scrollContentsBy(int dx, int dy);
61 
62 
63  private:
64  TreeViewContent(const TreeViewContent &other);
65  TreeViewContent &operator=(const TreeViewContent &other);
66 
67 
68  private:
69  void nullify();
70  void paintItemText(QPainter *, int, QPoint, QPoint);
71  void drawCollapsedArrow(QPainter *, QRect);
72  void drawExpandedArrow(QPainter *, QRect);
73  QRect getArrowRect(AbstractTreeItem *item) const;
74 
75 
76  private slots:
77  void scrollTo(QList< AbstractTreeItem * >);
78  void scrollTo(AbstractTreeItem *);
79  void setAlternatingRowColors(bool);
80  void updateItemList();
81 
82 
83  private:
84  TreeView *m_parentView;
85  AbstractTreeModel *m_model;
87 
89  QPair< AbstractTreeItem *, bool > * m_pressedItem;
90 
92  QPair< AbstractTreeItem *, bool > * m_hoveredItem;
93 
94  AbstractTreeItem *m_lastDirectlySelectedItem;
95  QList<AbstractTreeItem *> * m_lastShiftSelection;
96 
97  QPoint *m_mousePressPos;
98  int m_rowHeight;
99  int m_contentWidth;
100  bool m_alternatingRowColors;
101 
102 
103  private:
104  static const int ITEM_PADDING = 4;
105  static const int ITEM_INDENTATION = 23;
106  };
107 }
108 
109 #endif
void mouseReleaseEvent(QMouseEvent *event)
Definition: TreeViewContent.cpp:253
QSize sizeHint() const
Definition: TreeViewContent.cpp:80
void leaveEvent(QEvent *event)
Definition: TreeViewContent.cpp:293
AbstractTreeModel * getModel()
Definition: TreeViewContent.cpp:85
void mouseMoveEvent(QMouseEvent *event)
Definition: TreeViewContent.cpp:268
virtual ~TreeViewContent()
Definition: TreeViewContent.cpp:57
Base class for tree models.
Definition: AbstractTreeModel.h:39
void refresh()
Definition: TreeViewContent.cpp:121
QSize minimumSizeHint() const
Definition: TreeViewContent.cpp:75
bool eventFilter(QObject *target, QEvent *event)
Definition: TreeViewContent.cpp:140
TreeViewContent(QWidget *parent)
Definition: TreeViewContent.cpp:28
Definition: TreeView.h:23
void mousePressEvent(QMouseEvent *event)
Definition: TreeViewContent.cpp:156
void scrollContentsBy(int dx, int dy)
Definition: TreeViewContent.cpp:385
Definition: TreeViewContent.h:29
void setModel(AbstractTreeModel *someModel)
Definition: TreeViewContent.cpp:90
Definition: BoxcarCachingAlgorithm.h:29
Namespace for ISIS/Bullet specific routines.
Definition: Apollo.h:31
void mouseDoubleClickEvent(QMouseEvent *event)
Definition: TreeViewContent.cpp:145
void keyPressEvent(QKeyEvent *event)
Definition: TreeViewContent.cpp:300
Base class for an item in the tree.
Definition: AbstractTreeItem.h:31
void paintEvent(QPaintEvent *event)
Definition: TreeViewContent.cpp:313
Definition: CubeIoHandler.h:39
void resizeEvent(QResizeEvent *event)
Definition: TreeViewContent.cpp:377