5#ifndef DLOADINGINDICATOR_H
6#define DLOADINGINDICATOR_H
13#include <QVariantAnimation>
14#include <QGraphicsScene>
15#include <QGraphicsPixmapItem>
16#include <QGraphicsView>
17#include <QEasingCurve>
20#include <dtkwidget_global.h>
23DWIDGET_BEGIN_NAMESPACE
25class DLoadingIndicatorPrivate;
26class LIBDTKWIDGETSHARED_EXPORT
DLoadingIndicator :
public QGraphicsView,
public DTK_CORE_NAMESPACE::DObject
30 Q_PROPERTY(QColor backgroundColor READ backgroundColor WRITE setBackgroundColor DESIGNABLE
true SCRIPTABLE
true)
31 Q_PROPERTY(
bool loading READ loading WRITE setLoading)
32 Q_PROPERTY(
bool smooth READ smooth WRITE setSmooth)
33 Q_PROPERTY(QPixmap imageSource READ imageSource WRITE setImageSource)
34 Q_PROPERTY(QWidget* widgetSource READ widgetSource WRITE setWidgetSource)
35 Q_PROPERTY(
int aniDuration READ aniDuration WRITE setAniDuration)
37 Q_PROPERTY(
RotationDirection direction READ direction WRITE setDirection NOTIFY directionChanged)
38 Q_PROPERTY(qreal rotate READ rotate WRITE setRotate NOTIFY rotateChanged)
50 Q_ENUMS(RotationDirection)
55 QColor backgroundColor()
const;
57 QWidget* widgetSource()
const;
58 QPixmap imageSource()
const;
59 int aniDuration()
const;
61 QSize sizeHint() const Q_DECL_OVERRIDE;
63 RotationDirection direction() const;
69 void setLoading(
bool flag);
70 void setAniDuration(
int msecs);
72 void setBackgroundColor(const QColor &color);
74 void setWidgetSource(QWidget* widgetSource);
75 void setImageSource(const QPixmap &imageSource);
77 void setSmooth(
bool smooth);
78 void setDirection(RotationDirection direction);
81 void directionChanged(RotationDirection direction);
82 void rotateChanged(qreal rotate);
85 void resizeEvent(QResizeEvent *e) Q_DECL_OVERRIDE;