┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/klistview_p.h
diff options
context:
space:
mode:
authorRafael Fernández López <[email protected]>2007-07-06 17:41:04 +0000
committerRafael Fernández López <[email protected]>2007-07-06 17:41:04 +0000
commit98d01c5e23e9f9dc6b6a1071e4c6e6bd740dbab3 (patch)
treee2fde20a54d0a3cf38ee724aa8a8641faea409fe /src/klistview_p.h
parent0661c42dd9893c67a7ceaea6585df2cf7aa3a440 (diff)
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
Diffstat (limited to 'src/klistview_p.h')
-rw-r--r--src/klistview_p.h11
1 files changed, 8 insertions, 3 deletions
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<QModelIndex, struct ElementInfo> elementsInfo; // in source model
QHash<QModelIndex, QRect> elementsPosition; // in source model
QHash<QModelIndex, QModelIndex> elementDictionary; // mapped indexes
+ QHash<QModelIndex, QModelIndex> invertedElementDictionary; // mapped indexes
QHash<QString, QModelIndexList> categoriesIndexes;
QHash<QString, QRect> categoriesPosition;
QStringList categories;