forked from qt-creator/qt-creator
HighlightScrollbar: Avoid creation of unneeded temporary container
Change-Id: I764f8f376b4a626d5258abb2fdd4ec7484b2c8c9 Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -293,10 +293,11 @@ void HighlightScrollBarOverlay::paintEvent(QPaintEvent *paintEvent)
|
|||||||
|
|
||||||
QPainter painter(this);
|
QPainter painter(this);
|
||||||
painter.setRenderHint(QPainter::Antialiasing, false);
|
painter.setRenderHint(QPainter::Antialiasing, false);
|
||||||
foreach (Utils::Theme::Color themeColor, highlights.keys()) {
|
const auto highlightEnd = highlights.cend();
|
||||||
const QColor &color = creatorTheme()->color(themeColor);
|
for (auto highlightIt = highlights.cbegin(); highlightIt != highlightEnd; ++highlightIt) {
|
||||||
for (int i = 0, total = highlights[themeColor].size(); i < total; ++i) {
|
const QColor &color = creatorTheme()->color(highlightIt.key());
|
||||||
const QRect rect = highlights[themeColor][i];
|
for (int i = 0, total = highlightIt.value().size(); i < total; ++i) {
|
||||||
|
const QRect rect = highlightIt.value().at(i);
|
||||||
painter.fillRect(rect, color);
|
painter.fillRect(rect, color);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user