From 98d01c5e23e9f9dc6b6a1071e4c6e6bd740dbab3 Mon Sep 17 00:00:00 2001 From: Rafael Fernández López Date: Fri, 6 Jul 2007 17:41:04 +0000 Subject: Make KListView capable of drawing categories on our own way. This make things easier when we are trying to customize it. We can also benefit from KStyle if some day it supports category drawing. KListView keyboard navigation. Tricier than I thought. Pending renaming to KCategorizedView. Seems a good name. svn path=/trunk/KDE/kdebase/apps/; revision=684478 --- src/klistview_p.h | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/klistview_p.h') diff --git a/src/klistview_p.h b/src/klistview_p.h index b590b2307..4d0cec138 100644 --- a/src/klistview_p.h +++ b/src/klistview_p.h @@ -85,10 +85,12 @@ public: QRect categoryVisualRect(const QString &category); /** - * This method will draw a new category with name @p category on the rect - * specified by @p option.rect, with painter @p painter + * This method will draw a new category represented by index + * @param index on the rect specified by @p option.rect, with + * painter @p painter */ - void drawNewCategory(const QString &category, + void drawNewCategory(const QModelIndex &index, + int sortRole, const QStyleOption &option, QPainter *painter); @@ -131,6 +133,8 @@ public: QPoint initialPressPosition; QPoint mousePosition; QItemSelection lastSelection; + QModelIndex currentViewIndex; + int forcedSelectionPosition; // Cache data // We cannot merge some of them into structs because it would affect @@ -138,6 +142,7 @@ public: QHash elementsInfo; // in source model QHash elementsPosition; // in source model QHash elementDictionary; // mapped indexes + QHash invertedElementDictionary; // mapped indexes QHash categoriesIndexes; QHash categoriesPosition; QStringList categories; -- cgit v1.3.1