mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
9ed933d033
commit
1b9a4f2bf8
11 changed files with 50 additions and 131 deletions
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue