diff options
author | Marc Mutz <marc.mutz@qt.io> | 2023-01-03 14:44:57 +0100 |
---|---|---|
committer | Marc Mutz <marc.mutz@qt.io> | 2023-01-03 21:34:49 +0100 |
commit | 0766794e0bc85a6681177cd62fd7047fa85a4643 (patch) | |
tree | 6985969d376eee51e98ec4aaf65521fe4326917e | |
parent | b62f70fe9fd36252e9ae31e910323a130f458ddd (diff) | |
download | qtdeclarative-0766794e0bc85a6681177cd62fd7047fa85a4643.tar.gz |
QObjectWrapper: fix QT_ASCII_CAST_WARNING
The two arguments to QLatin1StringView::arg() are const char* and
QByteArray, both of which are considered "ASCII" for the purposes of
QT_ASCII_CAST_WARNING.
Fix by wrap them in QLatin1StringView (their contents are actually
ASCII (class and method names)).
Amends 3fd3a2a9d06505d549cc4a7c18819a17c6622dfd.
As a drive-by, use the _L1 UDL for the format string.
Pick-to: 6.5
Change-Id: I7f83133f52b6f4ec53a2bfcbca58d91afa9e2ff2
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
-rw-r--r-- | src/qml/jsruntime/qv4qobjectwrapper.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/qml/jsruntime/qv4qobjectwrapper.cpp b/src/qml/jsruntime/qv4qobjectwrapper.cpp index 873262ea16..d9bbae08a7 100644 --- a/src/qml/jsruntime/qv4qobjectwrapper.cpp +++ b/src/qml/jsruntime/qv4qobjectwrapper.cpp @@ -60,6 +60,8 @@ Q_LOGGING_CATEGORY(lcMethodBehavior, "qt.qml.method.behavior") // so turn off the warnings for us to have a clean build QT_WARNING_DISABLE_GCC("-Wstrict-aliasing") +using namespace Qt::StringLiterals; + namespace QV4 { QPair<QObject *, int> QObjectMethod::extractQtMethod(const FunctionObject *function) @@ -2438,7 +2440,8 @@ QString Heap::QObjectMethod::name() const methodOffset -= QMetaObjectPrivate::get(mo)->methodCount; } - return QLatin1String("%1::%2").arg(mo->className(), mo->method(index).name()); + return "%1::%2"_L1.arg(QLatin1StringView{mo->className()}, + QLatin1StringView{mo->method(index).name()}); } void Heap::QObjectMethod::ensureMethodsCache(const QMetaObject *thisMeta) |