class KItemListWidgetInformant;
class KItemListWidgetCreatorBase;
class QTimer;
+class QPropertyAnimation;
+class QVariantAnimation;
/**
* @brief Represents the view of an item-list.
void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget = nullptr) override;
-signals:
+Q_SIGNALS:
void scrollOrientationChanged(Qt::Orientation current, Qt::Orientation previous);
void scrollOffsetChanged(qreal current, qreal previous);
void maximumScrollOffsetChanged(qreal current, qreal previous);
void roleEditingCanceled(int index, const QByteArray& role, const QVariant& value);
void roleEditingFinished(int index, const QByteArray& role, const QVariant& value);
+ /**
+ * Emitted once scrolling has finished, or immediately if no scrolling was necessary
+ * to get item in view in scrollToItem.
+ */
+ void scrollingStopped();
+
protected:
QVariant itemChange(GraphicsItemChange change, const QVariant &value) override;
void setItemSize(const QSizeF& size);
virtual void updateFont();
virtual void updatePalette();
-protected slots:
+protected Q_SLOTS:
virtual void slotItemsInserted(const KItemRangeList& itemRanges);
virtual void slotItemsRemoved(const KItemRangeList& itemRanges);
virtual void slotItemsMoved(const KItemRange& itemRange, const QList<int>& movedToIndexes);
virtual void slotCurrentChanged(int current, int previous);
virtual void slotSelectionChanged(const KItemSet& current, const KItemSet& previous);
-private slots:
+private Q_SLOTS:
void slotAnimationFinished(QGraphicsWidget* widget,
KItemListViewAnimation::AnimationType type);
void slotLayoutTimerFinished();
bool m_skipAutoScrollForRubberBand;
KItemListRubberBand* m_rubberBand;
+ KItemListRubberBand* m_tapAndHoldIndicator;
QPointF m_mousePos;
int m_autoScrollIncrement;
KItemListHeader* m_header;
KItemListHeaderWidget* m_headerWidget;
+ QPropertyAnimation* m_indicatorAnimation;
+
// When dragging items into the view where the sort-role of the model
// is empty, a visual indicator should be shown during dragging where
// the dropping will happen. This indicator is specified by an index
// by KItemListView::showDropIndicator() and KItemListView::hideDropIndicator().
QRectF m_dropIndicator;
+ QList<QVariantAnimation*> m_rubberBandAnimations;
+
friend class KItemListContainer; // Accesses scrollBarRequired()
friend class KItemListHeader; // Accesses m_headerWidget
friend class KItemListController;
widget = new T(m_informant, view);
addCreatedWidget(widget);
}
+ widget->setParentItem(view);
return widget;
}