using c++11 iteration
This commit is contained in:
parent
2a3811fcd9
commit
e9facebb29
@ -47,12 +47,12 @@ static inline QBrush qskSubstitutedBrush(
|
||||
bool isModified = false;
|
||||
|
||||
QGradientStops stops = gradient->stops();
|
||||
for ( int i = 0; i < stops.size(); i++ )
|
||||
for ( auto& stop : stops )
|
||||
{
|
||||
const QColor c = qskSubstitutedColor( substitions, stops[ i ].second );
|
||||
if ( c != stops[ i ].second )
|
||||
const QColor c = qskSubstitutedColor( substitions, stop.second );
|
||||
if ( c != stop.second )
|
||||
{
|
||||
stops[ i ].second = c;
|
||||
stop.second = c;
|
||||
isModified = true;
|
||||
}
|
||||
}
|
||||
@ -153,11 +153,11 @@ QskColorFilter::~QskColorFilter()
|
||||
|
||||
void QskColorFilter::addColorSubstitution( QRgb from, QRgb to )
|
||||
{
|
||||
for ( int i = 0; i < m_substitutions.size(); i++ )
|
||||
for ( auto& substitution : m_substitutions )
|
||||
{
|
||||
if ( m_substitutions[ i ].first == from )
|
||||
if ( substitution.first == from )
|
||||
{
|
||||
m_substitutions[ i ].second = to;
|
||||
substitution.second = to;
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -227,14 +227,12 @@ QVariant QskColorFilter::interpolate(
|
||||
|
||||
QDebug operator<<( QDebug debug, const QskColorFilter& filter )
|
||||
{
|
||||
const QVector< QPair< QRgb, QRgb > >& s = filter.substitutions();
|
||||
|
||||
QDebugStateSaver saver( debug );
|
||||
debug.nospace();
|
||||
|
||||
debug << "Filter" << '(';
|
||||
for ( int i = 0; i < s.count(); i++ )
|
||||
debug << '[' << s[ i ].first << "->" << s[ i ].second << "]";
|
||||
for ( const auto& s : filter.substitutions() )
|
||||
debug << '[' << s.first << "->" << s.second << "]";
|
||||
debug << ')';
|
||||
|
||||
return debug;
|
||||
|
@ -550,8 +550,8 @@ QRectF QskGraphic::scaledBoundingRect( qreal sx, qreal sy ) const
|
||||
|
||||
QRectF rect = transform.mapRect( m_data->pointRect );
|
||||
|
||||
for ( int i = 0; i < m_data->pathInfos.size(); i++ )
|
||||
rect |= m_data->pathInfos[ i ].scaledBoundingRect( sx, sy, scalePens );
|
||||
for ( const auto& info : qskAsConst( m_data->pathInfos ) )
|
||||
rect |= info.scaledBoundingRect( sx, sy, scalePens );
|
||||
|
||||
return rect;
|
||||
}
|
||||
@ -636,10 +636,8 @@ void QskGraphic::render( QPainter* painter, const QRectF& rect,
|
||||
|
||||
const bool scalePens = !( m_data->renderHints & RenderPensUnscaled );
|
||||
|
||||
for ( int i = 0; i < m_data->pathInfos.size(); i++ )
|
||||
for ( const auto& info : qskAsConst( m_data->pathInfos ) )
|
||||
{
|
||||
const PathInfo info = m_data->pathInfos[ i ];
|
||||
|
||||
const double ssx = info.scaleFactorX(
|
||||
m_data->pointRect, rect, scalePens );
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user