From dbc5fd7a491f95ca4084a113d0f902ea975478fd Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Wed, 22 Feb 2012 18:28:11 +0100 Subject: Fix alternate backgrounds when enabling grouping Up to now the alternating backgrounds just have been calculated by checking whether the item index is odd. This does not work well when grouping is enabled: In this case the alternate background color of the first item of a group should stay consistent. --- src/kitemviews/kitemlistwidget.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/kitemviews/kitemlistwidget.h') diff --git a/src/kitemviews/kitemlistwidget.h b/src/kitemviews/kitemlistwidget.h index 20efa7c94..84bd15fa5 100644 --- a/src/kitemviews/kitemlistwidget.h +++ b/src/kitemviews/kitemlistwidget.h @@ -82,8 +82,8 @@ public: void setHovered(bool hovered); bool isHovered() const; - void setAlternatingBackgroundColors(bool enable); - bool alternatingBackgroundColors() const; + void setAlternateBackground(bool enable); + bool alternateBackground() const; void setEnabledSelectionToggle(bool enabled); bool enabledSelectionToggle() const; @@ -138,7 +138,7 @@ protected: virtual void currentChanged(bool current); virtual void selectedChanged(bool selected); virtual void hoveredChanged(bool hovered); - virtual void alternatingBackgroundColorsChanged(bool enabled); + virtual void alternateBackgroundChanged(bool enabled); virtual void siblingsInformationChanged(const QBitArray& current, const QBitArray& previous); virtual void resizeEvent(QGraphicsSceneResizeEvent* event); @@ -164,7 +164,7 @@ private: bool m_selected; bool m_current; bool m_hovered; - bool m_alternatingBackgroundColors; + bool m_alternateBackground; bool m_enabledSelectionToggle; QHash m_data; QList m_visibleRoles; -- cgit v1.3.1