summaryrefslogtreecommitdiffstats
path: root/qt-ui/modeldelegates.cpp
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tcanabrava@kde.org>2013-10-11 10:21:04 -0300
committerGravatar Tomaz Canabrava <tcanabrava@kde.org>2013-10-11 10:21:04 -0300
commit1b9a4f2bf8e9de9144133a435f3470fd77975945 (patch)
tree74aa1d0972296d3d7f7b327fbabd523d91cb8aeb /qt-ui/modeldelegates.cpp
parent9ed933d033889ac841c5f38afcdd40fa588a8cb9 (diff)
downloadsubsurface-1b9a4f2bf8e9de9144133a435f3470fd77975945.tar.gz
Good deal of whitespace fixes and code cleanup.
I just went thru all of subsurface code removing some whitespaces issues and trying to make the code prettyer, I also removed a few QString issues.d Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Diffstat (limited to 'qt-ui/modeldelegates.cpp')
-rw-r--r--qt-ui/modeldelegates.cpp6
1 files changed, 0 insertions, 6 deletions
diff --git a/qt-ui/modeldelegates.cpp b/qt-ui/modeldelegates.cpp
index 5304313b3..a4f457f79 100644
--- a/qt-ui/modeldelegates.cpp
+++ b/qt-ui/modeldelegates.cpp
@@ -32,26 +32,20 @@ StarWidgetsDelegate::StarWidgetsDelegate(QWidget* parent):
void StarWidgetsDelegate::paint(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index) const
{
QStyledItemDelegate::paint(painter, option, index);
-
if (!index.isValid())
return;
QVariant value = index.model()->data(index, DiveTripModel::STAR_ROLE);
-
if (!value.isValid())
return;
int rating = value.toInt();
-
painter->save();
painter->setRenderHint(QPainter::Antialiasing, true);
-
for(int i = 0; i < rating; i++)
painter->drawPixmap(option.rect.x() + i * IMG_SIZE + SPACING, option.rect.y(), StarWidget::starActive());
-
for(int i = rating; i < TOTALSTARS; i++)
painter->drawPixmap(option.rect.x() + i * IMG_SIZE + SPACING, option.rect.y(), StarWidget::starInactive());
-
painter->restore();
}