TextEditor: Replace QRegExp by QRegularExpression

Task-number: QTCREATORBUG-24098
Change-Id: Id407154bd7d05bf5bbf07a804959e87452225c70
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Christian Stenger
2020-06-16 08:02:59 +02:00
parent 816a1df45a
commit 29e60f0741
3 changed files with 10 additions and 11 deletions

View File

@@ -1836,7 +1836,7 @@ void TextEditorWidget::joinLines()
QString cutLine = cursor.selectedText();
// Collapse leading whitespaces to one or insert whitespace
cutLine.replace(QRegExp(QLatin1String("^\\s*")), QLatin1String(" "));
cutLine.replace(QRegularExpression(QLatin1String("^\\s*")), QLatin1String(" "));
cursor.movePosition(QTextCursor::Right, QTextCursor::KeepAnchor);
cursor.removeSelectedText();
@@ -7123,7 +7123,7 @@ void TextEditorWidget::autoIndent()
void TextEditorWidget::rewrapParagraph()
{
const int paragraphWidth = marginSettings().m_marginColumn;
const QRegExp anyLettersOrNumbers = QRegExp(QLatin1String("\\w"));
const QRegularExpression anyLettersOrNumbers("\\w");
const int tabSize = d->m_document->tabSettings().m_tabSize;
QTextCursor cursor = textCursor();