aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2023-06-14 10:24:22 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2023-06-14 12:14:23 +0200
commitc5f7a934d741e22172978ec8b79ee61903f8f1f0 (patch)
tree95d5ecd84975a973f7f3cb4f3940406f58e53be2
parent59581e630740a5216c57a6b9ee6c3742f10e4323 (diff)
Fix deprecation warnings in Qt 6.6
Remove old string literals, qAsConst, use new Regex API. Pick-to: 6.5 Change-Id: Iffdaa5217596e181c0766d161ce70c0a36ba37b5 Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
-rw-r--r--sources/shiboken6/ApiExtractor/abstractmetabuilder.cpp16
-rw-r--r--sources/shiboken6/ApiExtractor/abstractmetalang.h5
-rw-r--r--sources/shiboken6/ApiExtractor/clangparser/compilersupport.cpp2
-rw-r--r--sources/shiboken6/ApiExtractor/typedatabase.cpp2
-rw-r--r--sources/shiboken6/ApiExtractor/typesystemparser.cpp2
-rw-r--r--sources/shiboken6/generator/shiboken/cppgenerator.cpp2
6 files changed, 16 insertions, 13 deletions
diff --git a/sources/shiboken6/ApiExtractor/abstractmetabuilder.cpp b/sources/shiboken6/ApiExtractor/abstractmetabuilder.cpp
index 76c868698..87b3436a1 100644
--- a/sources/shiboken6/ApiExtractor/abstractmetabuilder.cpp
+++ b/sources/shiboken6/ApiExtractor/abstractmetabuilder.cpp
@@ -3431,13 +3431,13 @@ static void writeRejectLogFile(const QString &name,
const AbstractMetaBuilderPrivate::RejectSet &rejects)
{
static const QHash<AbstractMetaBuilder::RejectReason, QByteArray> descriptions ={
- {AbstractMetaBuilder::NotInTypeSystem, "Not in type system"_qba},
- {AbstractMetaBuilder::GenerationDisabled, "Generation disabled by type system"_qba},
- {AbstractMetaBuilder::RedefinedToNotClass, "Type redefined to not be a class"_qba},
- {AbstractMetaBuilder::UnmatchedReturnType, "Unmatched return type"_qba},
- {AbstractMetaBuilder::UnmatchedArgumentType, "Unmatched argument type"_qba},
- {AbstractMetaBuilder::UnmatchedOperator, "Unmatched operator"_qba},
- {AbstractMetaBuilder::Deprecated, "Deprecated"_qba}
+ {AbstractMetaBuilder::NotInTypeSystem, "Not in type system"_ba},
+ {AbstractMetaBuilder::GenerationDisabled, "Generation disabled by type system"_ba},
+ {AbstractMetaBuilder::RedefinedToNotClass, "Type redefined to not be a class"_ba},
+ {AbstractMetaBuilder::UnmatchedReturnType, "Unmatched return type"_ba},
+ {AbstractMetaBuilder::UnmatchedArgumentType, "Unmatched argument type"_ba},
+ {AbstractMetaBuilder::UnmatchedOperator, "Unmatched operator"_ba},
+ {AbstractMetaBuilder::Deprecated, "Deprecated"_ba}
};
QFile f(name);
@@ -3451,7 +3451,7 @@ static void writeRejectLogFile(const QString &name,
int lastReason = -1;
for (const auto &e : rejects) {
if (e.reason != lastReason) {
- const QByteArray description = descriptions.value(e.reason, "Unknown reason"_qba);
+ const QByteArray description = descriptions.value(e.reason, "Unknown reason"_ba);
const QByteArray underline(description.size(), '*');
if (lastReason != -1)
s << '\n';
diff --git a/sources/shiboken6/ApiExtractor/abstractmetalang.h b/sources/shiboken6/ApiExtractor/abstractmetalang.h
index 5bd291664..d5071a283 100644
--- a/sources/shiboken6/ApiExtractor/abstractmetalang.h
+++ b/sources/shiboken6/ApiExtractor/abstractmetalang.h
@@ -372,7 +372,10 @@ void AbstractMetaClass::invisibleNamespaceRecursion(Function f) const
bool inheritsFrom(const AbstractMetaClassCPtr &c, const AbstractMetaClassCPtr &other);
bool inheritsFrom(const AbstractMetaClassCPtr &c, const QString &name);
-inline bool isQObject(const AbstractMetaClassCPtr &c) { return inheritsFrom(c, u"QObject"_qs); }
+inline bool isQObject(const AbstractMetaClassCPtr &c)
+{
+ return inheritsFrom(c, QStringLiteral("QObject"));
+}
AbstractMetaClassCPtr findBaseClass(const AbstractMetaClassCPtr &c,
const QString &qualifiedName);
diff --git a/sources/shiboken6/ApiExtractor/clangparser/compilersupport.cpp b/sources/shiboken6/ApiExtractor/clangparser/compilersupport.cpp
index 22cb25aea..62bca91eb 100644
--- a/sources/shiboken6/ApiExtractor/clangparser/compilersupport.cpp
+++ b/sources/shiboken6/ApiExtractor/clangparser/compilersupport.cpp
@@ -354,7 +354,7 @@ QByteArrayList emulatedCompilerOptions()
// Append the c++ include paths since Clang is unable to find
// <type_traits> etc (g++ 11.3).
- const HeaderPaths gppPaths = gppInternalIncludePaths(compilerFromCMake(u"g++"_qs));
+ const HeaderPaths gppPaths = gppInternalIncludePaths(compilerFromCMake(u"g++"_s));
for (const HeaderPath &h : gppPaths) {
if (h.path.contains("c++") || h.path.contains("sysroot"))
headerPaths.append(h);
diff --git a/sources/shiboken6/ApiExtractor/typedatabase.cpp b/sources/shiboken6/ApiExtractor/typedatabase.cpp
index 966eb05ab..737192e78 100644
--- a/sources/shiboken6/ApiExtractor/typedatabase.cpp
+++ b/sources/shiboken6/ApiExtractor/typedatabase.cpp
@@ -833,7 +833,7 @@ bool TypeDatabase::isSuppressedWarning(QStringView s) const
return false;
return std::any_of(d->m_suppressedWarnings.cbegin(), d->m_suppressedWarnings.cend(),
[&s] (const QRegularExpression &e) {
- return e.match(s).hasMatch();
+ return e.matchView(s).hasMatch();
});
}
diff --git a/sources/shiboken6/ApiExtractor/typesystemparser.cpp b/sources/shiboken6/ApiExtractor/typesystemparser.cpp
index 632bb4451..d99626219 100644
--- a/sources/shiboken6/ApiExtractor/typesystemparser.cpp
+++ b/sources/shiboken6/ApiExtractor/typesystemparser.cpp
@@ -175,7 +175,7 @@ std::optional<QString>
QString result;
const auto lines = QStringView{code}.split(u'\n');
for (const auto &line : lines) {
- if (snippetRe.match(line).hasMatch()) {
+ if (snippetRe.matchView(line).hasMatch()) {
foundLabel = true;
useLine = !useLine;
if (!useLine)
diff --git a/sources/shiboken6/generator/shiboken/cppgenerator.cpp b/sources/shiboken6/generator/shiboken/cppgenerator.cpp
index 38c3f139d..7d1a3aa96 100644
--- a/sources/shiboken6/generator/shiboken/cppgenerator.cpp
+++ b/sources/shiboken6/generator/shiboken/cppgenerator.cpp
@@ -1517,7 +1517,7 @@ void CppGenerator::writeVirtualMethodNative(TextStream &s,
if (argCount > 0) {
s << "PyObject_Vectorcall(" << PYTHON_OVERRIDE_VAR << ", "
<< PYTHON_ARGS_ARRAY << ", " << argCount << ", nullptr));\n";
- for (int argIndex : qAsConst(invalidateArgs)) {
+ for (int argIndex : std::as_const(invalidateArgs)) {
s << "if (invalidateArg" << argIndex << ")\n" << indent
<< "Shiboken::Object::invalidate(" << PYTHON_ARGS_ARRAY
<< '[' << (argIndex - 1) << "]);\n" << outdent;