From f9bcd0a47cbdf0806c35a82856efdbe06279fb82 Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Mon, 19 Sep 2011 16:38:07 +0200 Subject: Rough draft for getting back the header for the details-view --- src/kitemviews/kitemlistview.h | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'src/kitemviews/kitemlistview.h') diff --git a/src/kitemviews/kitemlistview.h b/src/kitemviews/kitemlistview.h index 55a5c3344..a2fa23f3e 100644 --- a/src/kitemviews/kitemlistview.h +++ b/src/kitemviews/kitemlistview.h @@ -33,14 +33,15 @@ #include class KItemListController; -class KItemListWidgetCreatorBase; class KItemListGroupHeader; class KItemListGroupHeaderCreatorBase; +class KItemListHeader; class KItemListSizeHintResolver; class KItemListRubberBand; class KItemListViewAnimation; class KItemListViewLayouter; class KItemListWidget; +class KItemListWidgetCreatorBase; class KItemListViewCreatorBase; class QTimer; @@ -97,6 +98,13 @@ public: void setAutoScroll(bool enabled); bool autoScroll() const; + /** + * Turns on the header if \p show is true. Per default the + * header is not shown. + */ + void setHeaderShown(bool show); + bool isHeaderShown() const; + /** * @return Controller of the item-list. The controller gets * initialized by KItemListController::setView() and will @@ -206,6 +214,8 @@ protected: QList visibleItemListWidgets() const; + virtual void resizeEvent(QGraphicsSceneResizeEvent* event); + protected slots: virtual void slotItemsInserted(const KItemRangeList& itemRanges); virtual void slotItemsRemoved(const KItemRangeList& itemRanges); @@ -292,6 +302,12 @@ private: */ void updateWidgetProperties(KItemListWidget* widget, int index); + /** + * Updates the width of the KItemListHeader corresponding to the required width of + * the roles. + */ + void updateHeaderWidth(); + /** * Helper function for triggerAutoScrolling(). * @param pos Logical position of the mouse relative to the range. @@ -336,6 +352,8 @@ private: int m_autoScrollIncrement; QTimer* m_autoScrollTimer; + KItemListHeader* m_header; + friend class KItemListController; }; -- cgit v1.3.1