From 529f052add3edbc1afb063a5cbbb118b67434fb6 Mon Sep 17 00:00:00 2001 From: Giuseppe D'Angelo Date: Sun, 31 May 2020 18:04:04 +0200 Subject: Port QRegularExpression to QStringView, drop QStringRef The idea is pretty simple -- add QRegularExpression matching over QStringView. When matching over a QString, keep the string alive (by taking a copy), and set the view onto that string. Otherwise, just use the view provided by the user (who is then responsible for ensuring the data stays valid while matching). Do just minor refactorings to support this use case in a cleaner fashion. In QRegularExpressionMatch drop the QStringRef-returning methods, as they cannot work any more -- in the general case there won't be a QString to build a QStringRef from. [ChangeLog][QtCore][QRegularExpression] All the APIs dealing with QStringRef have been ported to QStringView, following QStringRef deprecation in Qt 6.0. Change-Id: Ic367991d9583cc108c045e4387c9b7288c8f1ffd Reviewed-by: Lars Knoll --- examples/widgets/tools/codecs/mainwindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'examples/widgets/tools/codecs/mainwindow.cpp') diff --git a/examples/widgets/tools/codecs/mainwindow.cpp b/examples/widgets/tools/codecs/mainwindow.cpp index dfd2ff452a..2379eaf5cc 100644 --- a/examples/widgets/tools/codecs/mainwindow.cpp +++ b/examples/widgets/tools/codecs/mainwindow.cpp @@ -162,7 +162,7 @@ void MainWindow::findCodecs() } else if (sortKey.startsWith(QLatin1String("UTF-16"))) { rank = 2; } else if ((match = iso8859RegExp.match(sortKey)).hasMatch()) { - if (match.capturedRef(1).size() == 1) + if (match.capturedView(1).size() == 1) rank = 3; else rank = 4; -- cgit v1.2.3