Skip to content
This repository has been archived by the owner on Dec 17, 2017. It is now read-only.

Commit

Permalink
Merge remote-tracking branch 'razor/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
surlykke committed Jun 23, 2013
2 parents 1fe958d + 3877704 commit dd75eec
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Expand Up @@ -43,7 +43,8 @@ BusyIndicator::BusyIndicator(QWidget *busyWidget) : QGraphicsView(busyWidget)
QTimer *timer = new QTimer(this);
connect(timer, SIGNAL(timeout()), this, SLOT(update()));
timer->start(100);
startTime = QDateTime::currentMSecsSinceEpoch();

startTime.start();
pendingResize = true;
}

Expand All @@ -68,8 +69,8 @@ void BusyIndicator::update()
center = QPointF(size().width()/2, size().height()/2);
pendingResize = false;
}
long timeGone = QDateTime::currentMSecsSinceEpoch() - startTime;
float angle = M_PI*timeGone/1000; // 2 seconds -> full circle

float angle = M_PI*startTime.elapsed()/1000; // 2 seconds -> full circle
for (int i = 0; i < numberOfDots; i++)
{
moveDot(m_Dots[i], angle);
Expand Down
Expand Up @@ -11,6 +11,7 @@
#include <QList>
#include <QFutureWatcher>
#include <QGraphicsView>
#include <QTime>

class QResizeEvent;
class QGraphicsEllipseItem;
Expand All @@ -33,7 +34,7 @@ private slots:

QPointF center;

long startTime;
QTime startTime;
bool pendingResize;

QList<QGraphicsEllipseItem*> m_Dots;
Expand Down

0 comments on commit dd75eec

Please sign in to comment.