diff options
author | Anne Jan Brouwer <brouwer@annejan.com> | 2015-11-23 23:48:56 +0100 |
---|---|---|
committer | Anne Jan Brouwer <annejan@noprotocol.com> | 2015-11-23 23:48:56 +0100 |
commit | 281d8efd8fc55d847cf356954c3b33853c4e2a35 (patch) | |
tree | e6b8f538cefbbb02b83a692282c32f60927a857a /progressindicator.cpp | |
parent | 95a68a47e10d59cc2d229ad4492264d6a93206f9 (diff) |
uncrustify
Diffstat (limited to 'progressindicator.cpp')
-rw-r--r-- | progressindicator.cpp | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/progressindicator.cpp b/progressindicator.cpp index b3835f66..164bb8aa 100644 --- a/progressindicator.cpp +++ b/progressindicator.cpp @@ -2,21 +2,21 @@ #include <QPainter> -QProgressIndicator::QProgressIndicator(QWidget* parent) - : QWidget(parent), - m_angle(0), - m_timerId(-1), - m_delay(40), - m_displayedWhenStopped(false), - m_color(Qt::black) +QProgressIndicator::QProgressIndicator(QWidget *parent) : + QWidget(parent), + m_angle(0), + m_timerId(-1), + m_delay(40), + m_displayedWhenStopped(false), + m_color(Qt::black) { setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); setFocusPolicy(Qt::NoFocus); } -bool QProgressIndicator::isAnimated () const +bool QProgressIndicator::isAnimated() const { - return (m_timerId != -1); + return m_timerId != -1; } void QProgressIndicator::setDisplayedWhenStopped(bool state) @@ -60,7 +60,7 @@ void QProgressIndicator::setAnimationDelay(int delay) m_timerId = startTimer(m_delay); } -void QProgressIndicator::setColor(const QColor & color) +void QProgressIndicator::setColor(const QColor &color) { m_color = color; @@ -69,7 +69,7 @@ void QProgressIndicator::setColor(const QColor & color) QSize QProgressIndicator::sizeHint() const { - return QSize(20,20); + return QSize(20, 20); } int QProgressIndicator::heightForWidth(int w) const @@ -90,27 +90,27 @@ void QProgressIndicator::paintEvent(QPaintEvent * /*event*/) return; int width = qMin(this->width(), this->height()); - + QPainter p(this); p.setRenderHint(QPainter::Antialiasing); - + int outerRadius = (width-1)*0.5; int innerRadius = (width-1)*0.5*0.38; int capsuleHeight = outerRadius - innerRadius; - int capsuleWidth = (width > 32 ) ? capsuleHeight *.23 : capsuleHeight *.35; + int capsuleWidth = (width > 32) ? capsuleHeight *.23 : capsuleHeight *.35; int capsuleRadius = capsuleWidth/2; - for (int i=0; i<12; i++) - { + for (int i = 0; i < 12; i++) { QColor color = m_color; color.setAlphaF(1.0f - (i/12.0f)); p.setPen(Qt::NoPen); - p.setBrush(color); + p.setBrush(color); p.save(); p.translate(rect().center()); p.rotate(m_angle - i*30.0f); - p.drawRoundedRect(-capsuleWidth*0.5, -(innerRadius+capsuleHeight), capsuleWidth, capsuleHeight, capsuleRadius, capsuleRadius); + p.drawRoundedRect(-capsuleWidth*0.5, -(innerRadius+capsuleHeight), capsuleWidth, + capsuleHeight, capsuleRadius, capsuleRadius); p.restore(); } } |