diff --git a/src/plugins/cppeditor/cppfunctiondecldeflink.cpp b/src/plugins/cppeditor/cppfunctiondecldeflink.cpp index d0494f8b0fe..537664023da 100644 --- a/src/plugins/cppeditor/cppfunctiondecldeflink.cpp +++ b/src/plugins/cppeditor/cppfunctiondecldeflink.cpp @@ -47,7 +47,7 @@ #include #include -#include +#include #include using namespace CPlusPlus; @@ -359,7 +359,7 @@ static int declaredParameterCount(Function *function) return argc; } -Q_GLOBAL_STATIC(QRegExp, commentArgNameRegexp) +Q_GLOBAL_STATIC(QRegularExpression, commentArgNameRegexp) static bool hasCommentedName( TranslationUnit *unit, @@ -410,9 +410,9 @@ static bool hasCommentedName( QString text = source.mid(nameStart, nameEnd - nameStart); - if (commentArgNameRegexp()->isEmpty()) - *commentArgNameRegexp() = QRegExp(QLatin1String("/\\*\\s*(\\w*)\\s*\\*/")); - return commentArgNameRegexp()->indexIn(text) != -1; + if (commentArgNameRegexp()->pattern().isEmpty()) + *commentArgNameRegexp() = QRegularExpression(QLatin1String("/\\*\\s*(\\w*)\\s*\\*/")); + return text.indexOf(*commentArgNameRegexp()) != -1; } static bool canReplaceSpecifier(TranslationUnit *translationUnit, SpecifierAST *specifier) diff --git a/src/plugins/cpptools/cppmodelmanager.cpp b/src/plugins/cpptools/cppmodelmanager.cpp index fe251aa1837..ce9fe475bb4 100644 --- a/src/plugins/cpptools/cppmodelmanager.cpp +++ b/src/plugins/cpptools/cppmodelmanager.cpp @@ -111,7 +111,7 @@ protected: pp(ast); QString code = QString::fromStdString(s.str()); code.replace('\n', ' '); - code.replace(QRegExp("\\s+"), " "); + code.replace(QRegularExpression("\\s+"), " "); const char *name = abi::__cxa_demangle(typeid(*ast).name(), 0, 0, 0) + 11;