┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/kitemviews/kitemlistgroupheader.h
diff options
context:
space:
mode:
authorPeter Penz <[email protected]>2012-02-11 18:02:38 +0100
committerPeter Penz <[email protected]>2012-02-11 18:04:53 +0100
commit056d12d60f93a052e19f6e2cff9b826e500eef16 (patch)
tree45c79d8620617645e1e34cd996adf8cc02f268b1 /src/kitemviews/kitemlistgroupheader.h
parente29e1cda15973969164d7b7fa805544189a5e172 (diff)
Group header layout fixes
- Don't use a margin for the first group header - Provide margins between the groups - Use a more subtle coloring - Prevent animation glitches when resizing a window
Diffstat (limited to 'src/kitemviews/kitemlistgroupheader.h')
-rw-r--r--src/kitemviews/kitemlistgroupheader.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/kitemviews/kitemlistgroupheader.h b/src/kitemviews/kitemlistgroupheader.h
index 5ddf20896..c996a4870 100644
--- a/src/kitemviews/kitemlistgroupheader.h
+++ b/src/kitemviews/kitemlistgroupheader.h
@@ -62,6 +62,9 @@ public:
void setScrollOrientation(Qt::Orientation orientation);
Qt::Orientation scrollOrientation() const;
+ void setItemIndex(int index);
+ int itemIndex() const;
+
virtual void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget = 0);
protected:
@@ -95,19 +98,29 @@ protected:
*/
virtual void scrollOrientationChanged(Qt::Orientation current, Qt::Orientation previous);
+ /**
+ * Is called after the item index has been changed and allows the derived class to react on
+ * this change.
+ */
+ virtual void itemIndexChanged(int current, int previous);
+
/** @reimp */
virtual void resizeEvent(QGraphicsSceneResizeEvent* event);
private:
void updateCache();
+ static QColor mixedColor(const QColor& c1, const QColor& c2, int c1Percent = 50);
+
private:
bool m_dirtyCache;
QByteArray m_role;
QVariant m_data;
KItemListStyleOption m_styleOption;
Qt::Orientation m_scrollOrientation;
+ int m_itemIndex;
+ QColor m_lineColor;
QColor m_roleColor;
QRectF m_roleBounds;
};