#ifndef KITEMLISTVIEW_H
#define KITEMLISTVIEW_H
+#include <optional>
+
#include "dolphin_export.h"
#include "kitemviews/kitemliststyleoption.h"
#include "kitemviews/kitemlistwidget.h"
* @return Index of the item that is below the point \a pos.
* The position is relative to the upper right of
* the visible area. Only (at least partly) visible
- * items are considered. -1 is returned if no item is
- * below the position.
+ * items are considered. std::nullopt is returned if
+ * no item is below the position.
*/
- int itemAt(const QPointF& pos) const;
+ std::optional<int> itemAt(const QPointF& pos) const;
bool isAboveSelectionToggle(int index, const QPointF& pos) const;
bool isAboveExpansionToggle(int index, const QPointF& pos) const;
bool isAboveText(int index, const QPointF& pos) const;
void setSupportsItemExpanding(bool supportsExpanding);
bool supportsItemExpanding() const;
+ void setHighlightEntireRow(bool highlightEntireRow);
+ bool highlightEntireRow() const;
+
+ void setAlternateBackgrounds(bool alternate);
+ bool alternateBackgrounds() const;
+
/**
* @return The rectangle of the item relative to the top/left of
* the currently visible area (see KItemListView::offset()).
virtual void onScrollOffsetChanged(qreal current, qreal previous);
virtual void onVisibleRolesChanged(const QList<QByteArray>& current, const QList<QByteArray>& previous);
virtual void onStyleOptionChanged(const KItemListStyleOption& current, const KItemListStyleOption& previous);
+ virtual void onHighlightEntireRowChanged(bool highlightEntireRow);
virtual void onSupportsItemExpandingChanged(bool supportsExpanding);
virtual void onTransactionBegin();
virtual void updateFont();
virtual void updatePalette();
- KItemListSizeHintResolver* m_sizeHintResolver;
-
protected Q_SLOTS:
virtual void slotItemsInserted(const KItemRangeList& itemRanges);
virtual void slotItemsRemoved(const KItemRangeList& itemRanges);
private Q_SLOTS:
void slotAnimationFinished(QGraphicsWidget* widget,
KItemListViewAnimation::AnimationType type);
- void slotLayoutTimerFinished();
void slotRubberBandPosChanged();
void slotRubberBandActivationChanged(bool active);
qreal currentWidth,
qreal previousWidth);
+ void slotSidePaddingChanged(qreal width);
+
/**
* Is invoked if a column has been moved by the user. Applies
* the moved role to the view.
private:
bool m_enabledSelectionToggles;
bool m_grouped;
+ bool m_highlightEntireRow;
+ bool m_alternateBackgrounds;
bool m_supportsItemExpanding;
bool m_editingRole;
int m_activeTransactions; // Counter for beginTransaction()/endTransaction()
KItemListViewLayouter* m_layouter;
KItemListViewAnimation* m_animation;
- QTimer* m_layoutTimer; // Triggers an asynchronous doLayout() call.
qreal m_oldScrollOffset;
qreal m_oldMaximumScrollOffset;
qreal m_oldItemOffset;
QList<QVariantAnimation*> m_rubberBandAnimations;
+ KItemListSizeHintResolver* m_sizeHintResolver;
+
friend class KItemListContainer; // Accesses scrollBarRequired()
friend class KItemListHeader; // Accesses m_headerWidget
friend class KItemListController;