Isis 3 Programmer Reference
TreeViewContent.h
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
29
class
TreeViewContent
:
public
QAbstractScrollArea
{
30
Q_OBJECT
31
32
public
:
33
TreeViewContent
(
QWidget
*parent);
34
virtual
~
TreeViewContent
();
35
QSize minimumSizeHint()
const
;
36
QSize sizeHint()
const
;
37
AbstractTreeModel
*getModel();
38
void
setModel(
AbstractTreeModel
*someModel);
39
40
41
signals:
42
void
treeSelectionChanged();
43
void
treeSelectionChanged(
QList< AbstractTreeItem * >
);
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;
86
QList< AbstractTreeItem * >
* m_items;
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
Isis::AbstractTreeModel
Base class for tree models.
Definition:
AbstractTreeModel.h:39
QAbstractScrollArea
Isis::TreeViewContent::m_pressedItem
QPair< AbstractTreeItem *, bool > * m_pressedItem
The bool is true if the arrow in the item was pressed.
Definition:
TreeViewContent.h:89
Isis::TreeView
Definition:
TreeView.h:23
Isis::TreeViewContent
Definition:
TreeViewContent.h:29
Isis::TreeViewContent::m_hoveredItem
QPair< AbstractTreeItem *, bool > * m_hoveredItem
The bool is true if the mouse is hovering over the arrow.
Definition:
TreeViewContent.h:92
QList
Definition:
BoxcarCachingAlgorithm.h:29
Isis
Namespace for ISIS/Bullet specific routines.
Definition:
Apollo.h:31
QObject
Isis::AbstractTreeItem
Base class for an item in the tree.
Definition:
AbstractTreeItem.h:31
QPair
Definition:
CubeIoHandler.h:39
QWidget
src
qisis
objs
CnetEditorWidget
TreeViewContent.h