diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2014-02-27 20:09:57 -0800 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-02-27 20:09:57 -0800 |
commit | 76e6420f6b3503b76bd3eec00ab0e53d6ea17a20 (patch) | |
tree | 8b50298f41bd29d55bbd6f4301f36ad31dc0b008 /qt-ui/starwidget.cpp | |
parent | 006265d7a088cff4fea665159dbb454956c2cd76 (diff) | |
download | subsurface-76e6420f6b3503b76bd3eec00ab0e53d6ea17a20.tar.gz |
Massive automated whitespace cleanup
I know everyone will hate it.
Go ahead. Complain. Call me names.
At least now things are consistent and reproducible.
If you want changes, have your complaint come with a patch to
scripts/whitespace.pl so that we can automate it.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/starwidget.cpp')
-rw-r--r-- | qt-ui/starwidget.cpp | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/qt-ui/starwidget.cpp b/qt-ui/starwidget.cpp index 8cb368ed7..ff185a4a0 100644 --- a/qt-ui/starwidget.cpp +++ b/qt-ui/starwidget.cpp @@ -8,8 +8,8 @@ #include <QStyle> #include <QStyleOption> -QPixmap* StarWidget::activeStar = 0; -QPixmap* StarWidget::inactiveStar = 0; +QPixmap *StarWidget::activeStar = 0; +QPixmap *StarWidget::inactiveStar = 0; QPixmap StarWidget::starActive() { @@ -26,7 +26,7 @@ int StarWidget::currentStars() const return current; } -void StarWidget::mouseReleaseEvent(QMouseEvent* event) +void StarWidget::mouseReleaseEvent(QMouseEvent *event) { if (readOnly) { return; @@ -45,14 +45,14 @@ void StarWidget::mouseReleaseEvent(QMouseEvent* event) update(); } -void StarWidget::paintEvent(QPaintEvent* event) +void StarWidget::paintEvent(QPaintEvent *event) { QPainter p(this); - for(int i = 0; i < current; i++) + for (int i = 0; i < current; i++) p.drawPixmap(i * IMG_SIZE + SPACING, 0, starActive()); - for(int i = current; i < TOTALSTARS; i++) + for (int i = current; i < TOTALSTARS; i++) p.drawPixmap(i * IMG_SIZE + SPACING, 0, starInactive()); if (hasFocus()) { @@ -70,8 +70,7 @@ void StarWidget::setCurrentStars(int value) Q_EMIT valueChanged(current); } -StarWidget::StarWidget(QWidget* parent, Qt::WindowFlags f): - QWidget(parent, f), +StarWidget::StarWidget(QWidget *parent, Qt::WindowFlags f) : QWidget(parent, f), current(0), readOnly(false) { @@ -93,7 +92,7 @@ StarWidget::StarWidget(QWidget* parent, Qt::WindowFlags f): setFocusPolicy(Qt::StrongFocus); } -QPixmap StarWidget::grayImage(QPixmap* coloredImg) +QPixmap StarWidget::grayImage(QPixmap *coloredImg) { QImage img = coloredImg->toImage(); for (int i = 0; i < img.width(); ++i) { @@ -113,7 +112,7 @@ QPixmap StarWidget::grayImage(QPixmap* coloredImg) QSize StarWidget::sizeHint() const { - return QSize(IMG_SIZE * TOTALSTARS + SPACING * (TOTALSTARS-1), IMG_SIZE); + return QSize(IMG_SIZE * TOTALSTARS + SPACING * (TOTALSTARS - 1), IMG_SIZE); } void StarWidget::setReadOnly(bool r) @@ -121,27 +120,27 @@ void StarWidget::setReadOnly(bool r) readOnly = r; } -void StarWidget::focusInEvent(QFocusEvent* event) +void StarWidget::focusInEvent(QFocusEvent *event) { setFocus(); QWidget::focusInEvent(event); } -void StarWidget::focusOutEvent(QFocusEvent* event) +void StarWidget::focusOutEvent(QFocusEvent *event) { QWidget::focusOutEvent(event); } -void StarWidget::keyPressEvent(QKeyEvent* event) +void StarWidget::keyPressEvent(QKeyEvent *event) { if (event->key() == Qt::Key_Up || event->key() == Qt::Key_Right) { if (currentStars() < TOTALSTARS) { - setCurrentStars( currentStars()+1); + setCurrentStars(currentStars() + 1); } } else if (event->key() == Qt::Key_Down || event->key() == Qt::Key_Left) { if (currentStars() > 0) { - setCurrentStars( currentStars()-1); + setCurrentStars(currentStars() - 1); } } } |