24 #include "kdgantttreeviewrowcontroller_p.h" 26 #include <QAbstractProxyModel> 27 #include <QHeaderView> 43 _d->treeview =
static_cast<Private::HackTreeView*
>(tv);
57 return d->treeview->viewport()->y()-
d->treeview->frameWidth();
62 return d->treeview->fontMetrics().height();
67 return d->treeview->verticalScrollBar()->maximum()+
d->treeview->viewport()->height();
73 const QModelIndex idx =
d->proxy->mapToSource( _idx );
74 assert( idx.isValid() ? ( idx.model() ==
d->treeview->model() ):(
true ) );
75 return d->treeview->visualRect(idx).isValid();
80 const QModelIndex idx =
d->proxy->mapToSource( _idx );
81 assert( idx.isValid() ? ( idx.model() ==
d->treeview->model() ):(
true ) );
82 return d->treeview->isExpanded( idx );
87 const QModelIndex idx =
d->proxy->mapToSource( _idx );
88 assert( idx.isValid() ? ( idx.model() ==
d->treeview->model() ):(
true ) );
89 QRect r =
d->treeview->visualRect(idx).translated( QPoint( 0,
d->treeview->verticalOffset() ) );
90 return Span( r.y(), r.height() );
102 if ( !
d->treeview->model() )
return QModelIndex();
103 int y =
d->treeview->verticalOffset();
104 QModelIndex idx =
d->treeview->model()->index( 0, 0,
d->treeview->rootIndex() );
106 if ( y >= height )
break;
107 #if QT_VERSION >= 0x040300 108 y +=
d->treeview->rowHeight( idx );
112 y +=
d->treeview->indexRowSizeHint( idx );
114 idx =
d->treeview->indexBelow( idx );
115 }
while ( idx.isValid() );
116 return d->proxy->mapFromSource( idx );
121 const QModelIndex idx =
d->proxy->mapToSource( _idx );
122 return d->proxy->mapFromSource(
d->treeview->indexAbove( idx ) );
127 const QModelIndex idx =
d->proxy->mapToSource( _idx );
128 return d->proxy->mapFromSource(
d->treeview->indexBelow( idx ) );
int totalHeight() const override
QModelIndex indexAt(int height) const override
~TreeViewRowController() override
QModelIndex indexAbove(const QModelIndex &idx) const override
A class representing a start point and a length.
Class only listed here to document inheritance of some KDChart classes.
bool isRowVisible(const QModelIndex &idx) const override
int maximumItemHeight() const override
TreeViewRowController(QTreeView *tv, QAbstractProxyModel *proxy)
Span rowGeometry(const QModelIndex &idx) const override
QModelIndex indexBelow(const QModelIndex &idx) const override
int headerHeight() const override
bool isRowExpanded(const QModelIndex &idx) const override