From 0397658b81ce371047d9ce6979aa37d8112f1a2c Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Tue, 14 Feb 2012 18:04:47 +0100 Subject: Details view: Fix indicator-branches Up to now no indicator-branches have been drawn when showing a tree. The patch fixes this so that that the style-dependent branches are drawn. The main part of the patch is the implementation of KItemListView::updateSiblingsInformation(). Most of the other changes are related due to an internal renaming of the expansionsLevel-role to expandedParentsCount and some related cleanups. BUG: 290276 FIXED-IN: 4.8.1 --- src/kitemviews/kitemlistwidget.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/kitemviews/kitemlistwidget.h') diff --git a/src/kitemviews/kitemlistwidget.h b/src/kitemviews/kitemlistwidget.h index 02e5998f9..20efa7c94 100644 --- a/src/kitemviews/kitemlistwidget.h +++ b/src/kitemviews/kitemlistwidget.h @@ -27,6 +27,7 @@ #include +#include #include #include @@ -87,6 +88,16 @@ public: void setEnabledSelectionToggle(bool enabled); bool enabledSelectionToggle() const; + /** + * Sets the sibling information for the item and all of its parents. + * The sibling information of the upper most parent is represented by + * the first bit, the sibling information of the item by the last bit. + * The sibling information is useful for drawing the branches in + * tree views. + */ + void setSiblingsInformation(const QBitArray& siblings); + QBitArray siblingsInformation() const; + /** * @return True if \a point is inside KItemListWidget::hoverRect(), * KItemListWidget::textRect(), KItemListWidget::selectionToggleRect() @@ -128,6 +139,7 @@ protected: virtual void selectedChanged(bool selected); virtual void hoveredChanged(bool hovered); virtual void alternatingBackgroundColorsChanged(bool enabled); + virtual void siblingsInformationChanged(const QBitArray& current, const QBitArray& previous); virtual void resizeEvent(QGraphicsSceneResizeEvent* event); /** @@ -158,6 +170,7 @@ private: QList m_visibleRoles; QHash m_visibleRolesSizes; KItemListStyleOption m_styleOption; + QBitArray m_siblingsInfo; qreal m_hoverOpacity; mutable QPixmap* m_hoverCache; -- cgit v1.3.1