#ifndef BUSY_ICON_H
#define BUSY_ICON_H

#include <QWidget>
#include <QIcon>
#include <QDebug>
#include "shs_widgets_export.h"

QT_BEGIN_NAMESPACE

class SHS_WIDGETS_EXPORT BusyIcon: public QWidget
{
	Q_OBJECT
	Q_PROPERTY(QIcon icon READ icon WRITE setIcon)
	Q_PROPERTY(qreal iconSize READ iconSize WRITE setIconSize)
public:
	explicit BusyIcon(QWidget * parent = 0);
	~BusyIcon();

	QIcon icon();
	void setIcon(QIcon i);
	qreal iconSize() {return icon_size;}
	void setIconSize(qreal s);

private:
	QSize sizeHint() const;
	void timerEvent(QTimerEvent * );
	void paintEvent(QPaintEvent * );

	QIcon icon_;
	QImage image;
	qreal icon_size;
	int timer, ang;
	
private slots:

public slots:
	void start();
	void stop();

signals:

};

QT_END_NAMESPACE

#endif // BUSY_ICON_H
