QmlProfiler: Replace QRegExp by QRegularExpression

Task-number: QTCREATORBUG-24098
Change-Id: I98bc7a6561c8e19da984d2efbf36d890b1f48ebf
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
This commit is contained in:
Christian Stenger
2020-07-13 14:06:55 +02:00
parent ca0f504c0e
commit ddc5afc4ec
2 changed files with 10 additions and 9 deletions

View File

@@ -67,7 +67,7 @@
#include <QQuickItem>
#include <QQuickWidget>
#include <QApplication>
#include <QRegExp>
#include <QRegularExpression>
#include <QTextCursor>
namespace QmlProfiler {
@@ -403,9 +403,10 @@ bool TraceViewFindSupport::find(const QString &txt, Core::FindFlags findFlags, i
bool TraceViewFindSupport::findOne(const QString &txt, Core::FindFlags findFlags, int start)
{
bool caseSensitiveSearch = (findFlags & Core::FindCaseSensitively);
QRegExp regexp(txt);
regexp.setPatternSyntax((findFlags & Core::FindRegularExpression) ? QRegExp::RegExp : QRegExp::FixedString);
regexp.setCaseSensitivity(caseSensitiveSearch ? Qt::CaseSensitive : Qt::CaseInsensitive);
bool regexSearch = (findFlags & Core::FindRegularExpression);
QRegularExpression regexp(regexSearch ? txt : QRegularExpression::escape(txt),
caseSensitiveSearch ? QRegularExpression::NoPatternOption
: QRegularExpression::CaseInsensitiveOption);
QTextDocument::FindFlags flags;
if (caseSensitiveSearch)
flags |= QTextDocument::FindCaseSensitively;