diff --git a/kdecoration/breezebutton.cpp b/kdecoration/breezebutton.cpp --- a/kdecoration/breezebutton.cpp +++ b/kdecoration/breezebutton.cpp @@ -206,27 +206,27 @@ pen.setJoinStyle( Qt::RoundJoin ); painter->setPen( pen ); - painter->drawPolygon( QPolygonF() - << QPointF( 4, 9 ) - << QPointF( 9, 4 ) - << QPointF( 14, 9 ) - << QPointF( 9, 14 ) ); + painter->drawPolygon( QVector{ + QPointF( 4, 9 ), + QPointF( 9, 4 ), + QPointF( 14, 9 ), + QPointF( 9, 14 )} ); } else { - painter->drawPolyline( QPolygonF() - << QPointF( 4, 11 ) - << QPointF( 9, 6 ) - << QPointF( 14, 11 ) ); + painter->drawPolyline( QVector{ + QPointF( 4, 11 ), + QPointF( 9, 6 ), + QPointF( 14, 11 )}); } break; } case DecorationButtonType::Minimize: { - painter->drawPolyline( QPolygonF() - << QPointF( 4, 7 ) - << QPointF( 9, 12 ) - << QPointF( 14, 7 ) ); + painter->drawPolyline( QVector{ + QPointF( 4, 7 ), + QPointF( 9, 12 ), + QPointF( 14, 7 ) }); break; } @@ -254,11 +254,11 @@ } else { - painter->drawPolygon( QPolygonF() - << QPointF( 6.5, 8.5 ) - << QPointF( 12, 3 ) - << QPointF( 15, 6 ) - << QPointF( 9.5, 11.5 ) ); + painter->drawPolygon( QVector { + QPointF( 6.5, 8.5 ), + QPointF( 12, 3 ), + QPointF( 15, 6 ), + QPointF( 9.5, 11.5 )} ); painter->setPen( pen ); painter->drawLine( QPointF( 5.5, 7.5 ), QPointF( 10.5, 12.5 ) ); @@ -274,18 +274,18 @@ { painter->drawLine( 4, 5, 14, 5 ); - painter->drawPolyline( QPolygonF() - << QPointF( 4, 8 ) - << QPointF( 9, 13 ) - << QPointF( 14, 8 ) ); + painter->drawPolyline( QVector { + QPointF( 4, 8 ), + QPointF( 9, 13 ), + QPointF( 14, 8 )} ); } else { painter->drawLine( 4, 5, 14, 5 ); - painter->drawPolyline( QPolygonF() - << QPointF( 4, 13 ) - << QPointF( 9, 8 ) - << QPointF( 14, 13 ) ); + painter->drawPolyline( QVector { + QPointF( 4, 13 ), + QPointF( 9, 8 ), + QPointF( 14, 13 ) }); } break; @@ -295,30 +295,30 @@ case DecorationButtonType::KeepBelow: { - painter->drawPolyline( QPolygonF() - << QPointF( 4, 5 ) - << QPointF( 9, 10 ) - << QPointF( 14, 5 ) ); + painter->drawPolyline( QVector { + QPointF( 4, 5 ), + QPointF( 9, 10 ), + QPointF( 14, 5 ) }); - painter->drawPolyline( QPolygonF() - << QPointF( 4, 9 ) - << QPointF( 9, 14 ) - << QPointF( 14, 9 ) ); + painter->drawPolyline( QVector { + QPointF( 4, 9 ), + QPointF( 9, 14 ), + QPointF( 14, 9 ) }); break; } case DecorationButtonType::KeepAbove: { - painter->drawPolyline( QPolygonF() - << QPointF( 4, 9 ) - << QPointF( 9, 4 ) - << QPointF( 14, 9 ) ); - - painter->drawPolyline( QPolygonF() - << QPointF( 4, 13 ) - << QPointF( 9, 8 ) - << QPointF( 14, 13 ) ); + painter->drawPolyline( QVector { + QPointF( 4, 9 ), + QPointF( 9, 4 ), + QPointF( 14, 9 ) }); + + painter->drawPolyline( QVector { + QPointF( 4, 13 ), + QPointF( 9, 8 ), + QPointF( 14, 13 ) }); break; } diff --git a/kdecoration/breezesizegrip.cpp b/kdecoration/breezesizegrip.cpp --- a/kdecoration/breezesizegrip.cpp +++ b/kdecoration/breezesizegrip.cpp @@ -51,13 +51,11 @@ setFixedSize( QSize( GripSize, GripSize ) ); // mask - QPolygon p; - p << QPoint( 0, GripSize ) - << QPoint( GripSize, 0 ) - << QPoint( GripSize, GripSize ) - << QPoint( 0, GripSize ); - - setMask( QRegion( p ) ); + setMask( QRegion( QVector{ + QPoint( 0, GripSize ), + QPoint( GripSize, 0 ), + QPoint( GripSize, GripSize ), + QPoint( 0, GripSize )} ) ); // embed embed(); @@ -147,13 +145,11 @@ painter.setBrush( backgroundColor ); // polygon - QPolygon p; - p << QPoint( 0, GripSize ) - << QPoint( GripSize, 0 ) - << QPoint( GripSize, GripSize ) - << QPoint( 0, GripSize ); - painter.drawPolygon( p ); - + painter.drawPolygon( QVector { + QPoint( 0, GripSize ), + QPoint( GripSize, 0 ), + QPoint( GripSize, GripSize ), + QPoint( 0, GripSize )} ); } //_____________________________________________ diff --git a/kstyle/breezehelper.cpp b/kstyle/breezehelper.cpp --- a/kstyle/breezehelper.cpp +++ b/kstyle/breezehelper.cpp @@ -1297,15 +1297,14 @@ //______________________________________________________________________________ void Helper::renderArrow( QPainter* painter, const QRect& rect, const QColor& color, ArrowOrientation orientation ) const { - // define polygon QPolygonF arrow; switch( orientation ) { - case ArrowUp: arrow << QPointF( -4, 2 ) << QPointF( 0, -2 ) << QPointF( 4, 2 ); break; - case ArrowDown: arrow << QPointF( -4, -2 ) << QPointF( 0, 2 ) << QPointF( 4, -2 ); break; - case ArrowLeft: arrow << QPointF( 2, -4 ) << QPointF( -2, 0 ) << QPointF( 2, 4 ); break; - case ArrowRight: arrow << QPointF( -2, -4 ) << QPointF( 2, 0 ) << QPointF( -2, 4 ); break; + case ArrowUp: arrow = QVector{QPointF( -4, 2 ), QPointF( 0, -2 ), QPointF( 4, 2 )}; break; + case ArrowDown: arrow = QVector{QPointF( -4, -2 ), QPointF( 0, 2 ), QPointF( 4, -2 )}; break; + case ArrowLeft: arrow = QVector{QPointF( 2, -4 ), QPointF( -2, 0 ), QPointF( 2, 4 )}; break; + case ArrowRight: arrow = QVector{QPointF( -2, -4 ), QPointF( 2, 0 ), QPointF( -2, 4 )}; break; default: break; } @@ -1367,32 +1366,32 @@ case ButtonMaximize: { - painter->drawPolyline( QPolygonF() - << QPointF( 4, 11 ) - << QPointF( 9, 6 ) - << QPointF( 14, 11 ) ); + painter->drawPolyline( QVector{ + QPointF( 4, 11 ), + QPointF( 9, 6 ), + QPointF( 14, 11 )}); break; } case ButtonMinimize: { - painter->drawPolyline( QPolygonF() - << QPointF( 4, 7 ) - << QPointF( 9, 12 ) - << QPointF( 14, 7 ) ); + painter->drawPolyline(QVector{ + QPointF( 4, 7 ), + QPointF( 9, 12 ), + QPointF( 14, 7 )} ); break; } case ButtonRestore: { pen.setJoinStyle( Qt::RoundJoin ); painter->setPen( pen ); - painter->drawPolygon( QPolygonF() - << QPointF( 4.5, 9 ) - << QPointF( 9, 4.5 ) - << QPointF( 13.5, 9 ) - << QPointF( 9, 13.5 ) ); + painter->drawPolygon( QVector{ + QPointF( 4.5, 9 ), + QPointF( 9, 4.5 ), + QPointF( 13.5, 9 ), + QPointF( 9, 13.5 )}); break; } diff --git a/kstyle/breezeshadowhelper.cpp b/kstyle/breezeshadowhelper.cpp --- a/kstyle/breezeshadowhelper.cpp +++ b/kstyle/breezeshadowhelper.cpp @@ -415,16 +415,16 @@ // make sure size is valid if( _pixmaps.empty() ) { - - _pixmaps.append( createPixmap( _shadowTiles.pixmap( 1 ) ) ); - _pixmaps.append( createPixmap( _shadowTiles.pixmap( 2 ) ) ); - _pixmaps.append( createPixmap( _shadowTiles.pixmap( 5 ) ) ); - _pixmaps.append( createPixmap( _shadowTiles.pixmap( 8 ) ) ); - _pixmaps.append( createPixmap( _shadowTiles.pixmap( 7 ) ) ); - _pixmaps.append( createPixmap( _shadowTiles.pixmap( 6 ) ) ); - _pixmaps.append( createPixmap( _shadowTiles.pixmap( 3 ) ) ); - _pixmaps.append( createPixmap( _shadowTiles.pixmap( 0 ) ) ); - + _pixmaps = QVector { + createPixmap( _shadowTiles.pixmap( 1 ) ), + createPixmap( _shadowTiles.pixmap( 2 ) ), + createPixmap( _shadowTiles.pixmap( 5 ) ), + createPixmap( _shadowTiles.pixmap( 8 ) ), + createPixmap( _shadowTiles.pixmap( 7 ) ), + createPixmap( _shadowTiles.pixmap( 6 ) ), + createPixmap( _shadowTiles.pixmap( 3 ) ), + createPixmap( _shadowTiles.pixmap( 0 ) ) + }; } // return relevant list of pixmap handles @@ -504,23 +504,17 @@ #ifndef QT_NO_XRENDER // create pixmap handles if needed - const QVector& pixmaps( createPixmapHandles() ); - if( pixmaps.size() != numPixmaps ) return false; - - // create data - // add pixmap handles - QVector data; - foreach( const quint32& value, pixmaps ) - { data.append( value ); } + QVector data( createPixmapHandles() ); + if( data.size() != numPixmaps ) return false; const QMargins margins = shadowMargins( widget ); - const int topSize = margins.top(); - const int bottomSize = margins.bottom(); - const int leftSize( margins.left() ); - const int rightSize( margins.right() ); + const quint32 topSize = margins.top(); + const quint32 bottomSize = margins.bottom(); + const quint32 leftSize( margins.left() ); + const quint32 rightSize( margins.right() ); // assign to data and xcb property - data << topSize << rightSize << bottomSize << leftSize; + data << QVector{topSize, rightSize, bottomSize, leftSize}; xcb_change_property( Helper::connection(), XCB_PROP_MODE_REPLACE, widget->winId(), _atom, XCB_ATOM_CARDINAL, 32, data.size(), data.constData() ); xcb_flush( Helper::connection() );