9 #include "TreeViewContent.h" 10 #include "TreeViewHeader.h" 11 #include "AbstractTreeModel.h" 20 m_content =
new TreeViewContent(
this);
21 m_header =
new TreeViewHeader(m_content,
this);
22 connect(m_header, SIGNAL(activated()),
this, SIGNAL(activated()));
23 connect(m_content, SIGNAL(treeSelectionChanged()),
24 this, SIGNAL(selectionChanged()));
27 QVBoxLayout *layout =
new QVBoxLayout;
28 layout->addWidget(m_header);
29 layout->addWidget(m_content);
30 layout->setContentsMargins(0, 0, 0, 0);
31 layout->setSpacing(0);
37 TreeView::~TreeView() {
41 QSize TreeView::sizeHint()
const {
43 return QSize(parentWidget()->width() / 4, parentWidget()->height() / 2);
49 QFont TreeView::getContentFont()
const {
50 return m_content->font();
54 void TreeView::setModel(AbstractTreeModel *someModel) {
56 m_content->setModel(someModel);
58 connect(someModel, SIGNAL(filterProgressChanged(
int)),
59 m_header, SLOT(updateFilterProgress(
int)));
60 connect(someModel, SIGNAL(filterProgressRangeChanged(
int,
int)),
61 m_header, SLOT(updateFilterProgressRange(
int,
int)));
62 connect(someModel, SIGNAL(rebuildProgressChanged(
int)),
63 m_header, SLOT(updateRebuildProgress(
int)));
64 connect(someModel, SIGNAL(rebuildProgressRangeChanged(
int,
int)),
65 m_header, SLOT(updateRebuildProgressRange(
int,
int)));
66 connect(someModel, SIGNAL(filterCountsChanged(
int,
int)),
67 m_header, SLOT(handleFilterCountsChanged(
int,
int)));
69 connect(someModel, SIGNAL(modelModified()),
70 this, SIGNAL(selectionChanged()));
74 AbstractTreeModel *TreeView::getModel()
const {
75 return m_content->getModel();
79 bool TreeView::isActive()
const {
84 QString TreeView::getTitle()
const {
85 return m_header->getText();
89 void TreeView::setTitle(QString someTitle) {
90 m_header->setText(someTitle);
94 void TreeView::deactivate() {
99 m_header->setActive(
false);
104 void TreeView::activate() {
109 m_header->setActive(
true);
114 void TreeView::handleModelSelectionChanged() {
115 m_content->refresh();
119 void TreeView::nullify() {
Namespace for ISIS/Bullet specific routines.