akonadi
22 #ifndef PROGRESSSPINNERDELEGATE_P_H
23 #define PROGRESSSPINNERDELEGATE_P_H
25 #include <QStyledItemDelegate>
28 #include <kpixmapsequence.h>
32 class DelegateAnimator :
public QObject
36 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; }
54 inline void nextFrame()
const { frame = ( frame + 1 ) % sCount; }
56 QPersistentModelIndex index;
60 virtual void timerEvent(QTimerEvent *event);
64 QSet<Animation> m_animations;
65 QAbstractItemView *m_view;
66 KPixmapSequence m_pixmapSequence;
70 uint qHash(Akonadi::DelegateAnimator::Animation anim);
75 class ProgressSpinnerDelegate :
public QStyledItemDelegate
79 explicit ProgressSpinnerDelegate(DelegateAnimator *animator, QObject* parent = 0);
82 virtual void initStyleOption(QStyleOptionViewItem* option,
const QModelIndex& index)
const;
85 DelegateAnimator *m_animator;
This file is part of the KDE documentation.
Documentation copyright © 1996-2013 The KDE developers.
Generated on Sat Jul 13 2013 01:27:40 by
doxygen 1.8.3.1 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.