diff options
Diffstat (limited to 'src/qgraphicstreeview.cpp')
-rw-r--r-- | src/qgraphicstreeview.cpp | 29 |
1 files changed, 5 insertions, 24 deletions
diff --git a/src/qgraphicstreeview.cpp b/src/qgraphicstreeview.cpp index 85490cd..305dd65 100644 --- a/src/qgraphicstreeview.cpp +++ b/src/qgraphicstreeview.cpp @@ -44,7 +44,7 @@ /*! */ -QtGraphicsTreeViewItem::QtGraphicsTreeViewItem(const QtTreeModelIterator &it, int index, QtGraphicsTreeView *view) +QtGraphicsTreeViewItem::QtGraphicsTreeViewItem(const QtTreeModelIterator &it, QtGraphicsTreeView *view) : QGraphicsWidget(view, 0), d_ptr(new QtGraphicsTreeViewItemPrivate) { Q_D(QtGraphicsTreeViewItem); @@ -53,7 +53,6 @@ QtGraphicsTreeViewItem::QtGraphicsTreeViewItem(const QtTreeModelIterator &it, in d->view = view; d->header = view->header(); d->it = it; - d->index = index; } /*! @@ -84,22 +83,6 @@ void QtGraphicsTreeViewItem::setIterator(const QtTreeModelIterator &it) /*! */ -int QtGraphicsTreeViewItem::index() const -{ - Q_D(const QtGraphicsTreeViewItem); - return d->index; -} - -/*! - */ -void QtGraphicsTreeViewItem::setIndex(int index) -{ - Q_D(QtGraphicsTreeViewItem); - d->index = index; -} - -/*! - */ QSizeF QtGraphicsTreeViewItem::sizeHint(Qt::SizeHint which, const QSizeF &constraint) const { Q_D(const QtGraphicsTreeViewItem); @@ -237,10 +220,9 @@ QtGraphicsTreeViewItemCreatorBase::~QtGraphicsTreeViewItemCreatorBase() { } -QtGraphicsTreeViewItem *QtGraphicsTreeViewItemCreatorBase::reassign(const QtTreeModelIterator &it, int index, QtGraphicsTreeViewItem *item) +QtGraphicsTreeViewItem *QtGraphicsTreeViewItemCreatorBase::reassign(const QtTreeModelIterator &it, QtGraphicsTreeViewItem *item) { Q_ASSERT(item); - item->setIndex(index); item->setIterator(it); return item; } @@ -1147,10 +1129,10 @@ void QtGraphicsTreeView::doLayout() QtGraphicsTreeViewItem *item = unused.take(it); if (!item) { // if the item did not exist if (unused.isEmpty()) { - item = d->creator->create(it, index, this); + item = d->creator->create(it, this); } else { // take another random item (idealy we should take from the bottom, since this kicks in early when scolling up) QHash<QtTreeModelBase::iterator_base, QtGraphicsTreeViewItem*>::iterator random = unused.begin(); - item = d->creator->reassign(it, index, random.value()); + item = d->creator->reassign(it, random.value()); unused.erase(random); } } @@ -1160,7 +1142,6 @@ void QtGraphicsTreeView::doLayout() // next item y += size.height(); d->next(it, stack); - ++index; } // while // recycle any unused items left @@ -1173,7 +1154,7 @@ void QtGraphicsTreeView::doLayout() */ QtTreeModelIterator QtGraphicsTreeView::itemAt(const QPointF &position, int *index, QRectF *rect) const { - // works only inside the view + // works only inside the view area Q_D(const QtGraphicsTreeView); QStyleOptionViewItemV4 option; initStyleOption(&option); |