TextEditor: Fix build with Qt6

Adapt to QStringRef and QAbstractItemView::viewOptions() removal

Task-number: QTCREATORBUG-24098
Change-Id: Ia2d446312f68bd60143796284d31f5bba56aa0ed
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Eike Ziller
2020-09-07 14:44:41 +02:00
parent 6b9cad8b05
commit 7aa0b1ea6b
5 changed files with 9 additions and 10 deletions

View File

@@ -3745,7 +3745,7 @@ QString TextEditorWidgetPrivate::copyBlockSelection()
selection += QString(-startOffset, QLatin1Char(' '));
if (endOffset < 0)
--endPos;
selection += text.midRef(startPos, endPos - startPos);
selection += text.mid(startPos, endPos - startPos);
if (endOffset < 0)
selection += QString(ts.m_tabSize + endOffset, QLatin1Char(' '));
else if (endOffset > 0)
@@ -4622,10 +4622,10 @@ void TextEditorWidgetPrivate::paintReplacement(PaintEventData &data, QPainter &p
if (right.endsWith(QLatin1Char(';'))) {
right.chop(1);
right = right.trimmed();
replacement.append(right.rightRef(right.endsWith('/') ? 2 : 1));
replacement.append(right.right(right.endsWith('/') ? 2 : 1));
replacement.append(QLatin1Char(';'));
} else {
replacement.append(right.rightRef(right.endsWith('/') ? 2 : 1));
replacement.append(right.right(right.endsWith('/') ? 2 : 1));
}
}
}