Commit e174969c authored by Eike Ziller's avatar Eike Ziller

HighlightScrollbar: Avoid creation of unneeded temporary container

Change-Id: I764f8f376b4a626d5258abb2fdd4ec7484b2c8c9
Reviewed-by: David Schulz's avatarDavid Schulz <david.schulz@qt.io>
parent 867d401b
......@@ -293,10 +293,11 @@ void HighlightScrollBarOverlay::paintEvent(QPaintEvent *paintEvent)
QPainter painter(this);
painter.setRenderHint(QPainter::Antialiasing, false);
foreach (Utils::Theme::Color themeColor, highlights.keys()) {
const QColor &color = creatorTheme()->color(themeColor);
for (int i = 0, total = highlights[themeColor].size(); i < total; ++i) {
const QRect rect = highlights[themeColor][i];
const auto highlightEnd = highlights.cend();
for (auto highlightIt = highlights.cbegin(); highlightIt != highlightEnd; ++highlightIt) {
const QColor &color = creatorTheme()->color(highlightIt.key());
for (int i = 0, total = highlightIt.value().size(); i < total; ++i) {
const QRect rect = highlightIt.value().at(i);
painter.fillRect(rect, color);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment