r23341 by jghali - Code style fixes
scribus-commit
scribus-commit at lists.scribus.net
Wed Nov 6 21:45:59 UTC 2019
Author: jghali
Date: Wed Nov 6 21:45:59 2019
New Revision: 23341
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=23341
Log:
Code style fixes
Modified:
trunk/Scribus/scribus/sclistboxpixmap.h
Modified: trunk/Scribus/scribus/sclistboxpixmap.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23341&path=/trunk/Scribus/scribus/sclistboxpixmap.h
==============================================================================
--- trunk/Scribus/scribus/sclistboxpixmap.h (original)
+++ trunk/Scribus/scribus/sclistboxpixmap.h Wed Nov 6 21:45:59 2019
@@ -55,14 +55,14 @@
int h,w;
QFontMetrics metrics(option.font);
const QVariant data(index.data(Qt::DisplayRole));
- if ( text(data).isEmpty() )
+ if (text(data).isEmpty())
{
h = pmap->height();
w = pmap->width() + 6;
}
else
{
- h = qMax( pmap->height(), metrics.lineSpacing() + 2 );
+ h = qMax(pmap->height(), metrics.lineSpacing() + 2);
//FIXME: metrics.width replacement by horizontalAdvance requires Qt 5.11+
w = pmap->width() + metrics.width(text(data)) + 6;
}
@@ -76,7 +76,7 @@
const QVariant data(index.data(Qt::UserRole));
redraw(data);
- int itemHeight = sizeHint( option, index ).height();
+ int itemHeight = sizeHint(option, index).height();
if (option.state & QStyle::State_Selected)
qpainter->fillRect(option.rect, option.palette.highlight());
@@ -85,10 +85,10 @@
qpainter->setRenderHint(QPainter::Antialiasing, true);
qpainter->setPen(Qt::NoPen);
- if ( !pmap->isNull() )
+ if (!pmap->isNull())
{
- int yPos = ( itemHeight - pmap->height() ) / 2;
- qpainter->drawPixmap( option.rect.x() + 3, option.rect.y() + yPos, *pmap);
+ int yPos = (itemHeight - pmap->height()) / 2;
+ qpainter->drawPixmap(option.rect.x() + 3, option.rect.y() + yPos, *pmap);
}
if (option.state & QStyle::State_Selected)
qpainter->setBrush(option.palette.highlightedText());
@@ -98,11 +98,11 @@
QString txt(index.data(Qt::DisplayRole).toString());
- if ( !txt.isEmpty() )
+ if (!txt.isEmpty())
{
QFontMetrics fm = qpainter->fontMetrics();
- int yPos = ( ( itemHeight - fm.height() ) / 2 ) + fm.ascent();
- qpainter->drawText( option.rect.x() + pmap->width() + 5, option.rect.y() + yPos, txt );
+ int yPos = (itemHeight - fm.height()) / 2 + fm.ascent();
+ qpainter->drawText(option.rect.x() + pmap->width() + 5, option.rect.y() + yPos, txt);
}
qpainter->restore();
}
More information about the scribus-commit
mailing list