diff --git a/ui/image/image_prepare.cpp b/ui/image/image_prepare.cpp index 5833500..98e3065 100644 --- a/ui/image/image_prepare.cpp +++ b/ui/image/image_prepare.cpp @@ -866,7 +866,7 @@ QImage GenerateLinearGradient( auto stops = QGradientStops(); const auto step = 1. / (colors.size() - 1); auto point = 0.; - for (const auto color : colors) { + for (const auto &color : colors) { stops.append({ point, color }); point += step; } diff --git a/ui/layers/box_content.cpp b/ui/layers/box_content.cpp index d27c19e..66b2d08 100644 --- a/ui/layers/box_content.cpp +++ b/ui/layers/box_content.cpp @@ -245,7 +245,7 @@ void BoxContent::paintEvent(QPaintEvent *e) { if (testAttribute(Qt::WA_OpaquePaintEvent)) { const auto &color = getDelegate()->style().bg; - for (const auto rect : e->region()) { + for (const auto &rect : e->region()) { p.fillRect(rect, color); } } diff --git a/ui/layers/box_layer_widget.cpp b/ui/layers/box_layer_widget.cpp index a7075ec..02a7d75 100644 --- a/ui/layers/box_layer_widget.cpp +++ b/ui/layers/box_layer_widget.cpp @@ -126,7 +126,7 @@ void BoxLayerWidget::paintEvent(QPaintEvent *e) { } auto other = e->region().intersected(QRect(0, st::boxRadius, width(), height() - 2 * st::boxRadius)); if (!other.isEmpty()) { - for (const auto rect : other) { + for (const auto &rect : other) { p.fillRect(rect, st().bg); } } diff --git a/ui/layers/layer_widget.cpp b/ui/layers/layer_widget.cpp index 8e70249..7d8722c 100644 --- a/ui/layers/layer_widget.cpp +++ b/ui/layers/layer_widget.cpp @@ -281,7 +281,7 @@ void LayerStackWidget::BackgroundWidget::paintEvent(QPaintEvent *e) { // in the transparent special layer cache corners after filling special layer // rect above its cache with alpha_current opacity. const auto region = QRegion(bg) - specialLayerBox; - for (const auto rect : region) { + for (const auto &rect : region) { p.fillRect(rect, st::layerBg); } p.setOpacity((bgOpacity - overSpecialOpacity) / (1. - (overSpecialOpacity * st::layerBg->c.alphaF()))); diff --git a/ui/widgets/menu/menu_action.cpp b/ui/widgets/menu/menu_action.cpp index 2c3601d..2f11c73 100644 --- a/ui/widgets/menu/menu_action.cpp +++ b/ui/widgets/menu/menu_action.cpp @@ -18,7 +18,7 @@ namespace { auto result = TextWithEntities(); result.text.reserve(text.size()); auto afterAmpersand = false; - for (const auto ch : text) { + for (const auto &ch : text) { if (afterAmpersand) { afterAmpersand = false; if (ch == '&') { diff --git a/ui/widgets/popup_menu.cpp b/ui/widgets/popup_menu.cpp index 23c1a50..3ecbfbb 100644 --- a/ui/widgets/popup_menu.cpp +++ b/ui/widgets/popup_menu.cpp @@ -37,7 +37,7 @@ PopupMenu::PopupMenu(QWidget *parent, QMenu *menu, const style::PopupMenu &st) , _menu(this, menu, _st.menu) { init(); - for (const auto action : actions()) { + for (const auto &action : actions()) { if (const auto submenu = action->menu()) { _submenus.emplace( action,