akonadi
22 #ifndef PROGRESSSPINNERDELEGATE_P_H
23 #define PROGRESSSPINNERDELEGATE_P_H
25 #include <QStyledItemDelegate>
28 #include <kpixmapsequence.h>
32 class DelegateAnimator :
public QObject
36 explicit DelegateAnimator(QAbstractItemView *view);
38 void push(
const QModelIndex &index);
39 void pop(
const QModelIndex &index);
41 QPixmap sequenceFrame(
const QModelIndex &index);
43 static const int sCount = 7;
45 inline Animation(
const QPersistentModelIndex &idx)
46 : frame(0), index(idx)
50 bool operator==(
const Animation &other)
const
51 {
return index == other.index; }
53 inline void nextFrame()
const { frame = ( frame + 1 ) % sCount; }
55 QPersistentModelIndex index;
59 virtual void timerEvent(QTimerEvent *event);
63 QSet<Animation> m_animations;
64 QAbstractItemView *m_view;
65 KPixmapSequence m_pixmapSequence;
69 uint qHash(Akonadi::DelegateAnimator::Animation anim);
74 class ProgressSpinnerDelegate :
public QStyledItemDelegate
78 explicit ProgressSpinnerDelegate(DelegateAnimator *animator, QObject* parent = 0);
81 virtual void initStyleOption(QStyleOptionViewItem* option,
const QModelIndex& index)
const;
84 DelegateAnimator *m_animator;
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:00:27 by
doxygen 1.8.7 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.