forked from qt-creator/qt-creator
TextEditor: Modernize
modernize-* Change-Id: Ic497fea1942a77cf017be3b0033f92e3807066f1 Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -46,8 +46,8 @@ RefactorOverlay::RefactorOverlay(TextEditor::TextEditorWidget *editor) :
|
||||
void RefactorOverlay::paint(QPainter *painter, const QRect &clip)
|
||||
{
|
||||
m_maxWidth = 0;
|
||||
for (int i = 0; i < m_markers.size(); ++i) {
|
||||
paintMarker(m_markers.at(i), painter, clip);
|
||||
for (auto &marker : qAsConst(m_markers)) {
|
||||
paintMarker(marker, painter, clip);
|
||||
}
|
||||
|
||||
if (auto documentLayout = qobject_cast<TextDocumentLayout*>(m_editor->document()->documentLayout()))
|
||||
@@ -57,7 +57,7 @@ void RefactorOverlay::paint(QPainter *painter, const QRect &clip)
|
||||
|
||||
RefactorMarker RefactorOverlay::markerAt(const QPoint &pos) const
|
||||
{
|
||||
foreach (const RefactorMarker &marker, m_markers) {
|
||||
for (const auto &marker : m_markers) {
|
||||
if (marker.rect.contains(pos))
|
||||
return marker;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user