kcms/cursortheme: Convert some foreach

GIT_SILENT
wilder-5.25
David Redondo 4 years ago committed by Nate Graham
parent 346f69ecc5
commit 5795b25e73
  1. 6
      kcms/cursortheme/xcursor/previewwidget.cpp

@ -192,7 +192,7 @@ void PreviewWidget::updateImplicitSize()
qreal totalWidth = 0;
qreal maxHeight = 0;
foreach (const PreviewCursor *c, list) {
for (const auto *c : std::as_const(list)) {
totalWidth += c->width();
maxHeight = qMax(c->height(), (int)maxHeight);
}
@ -211,7 +211,7 @@ void PreviewWidget::layoutItems()
int nextX = spacing;
int nextY = spacing;
foreach (PreviewCursor *c, list) {
for (auto *c : std::as_const(list)) {
c->setPosition(nextX, nextY);
nextX += c->boundingSize() + spacing;
if (nextX + c->boundingSize() > width()) {
@ -246,7 +246,7 @@ void PreviewWidget::paint(QPainter *painter)
if (needLayout)
layoutItems();
foreach (const PreviewCursor *c, list) {
for (const auto *c : std::as_const(list)) {
if (c->pixmap().isNull())
continue;

Loading…
Cancel
Save