aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside6/libpysideqml
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2024-09-09 13:49:36 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2024-09-10 11:06:13 +0200
commit46e0d095def5742540babd3854d582f32c4f2e48 (patch)
treedf035d488c807ae8a55dc091e74d8b0c3b24915b /sources/pyside6/libpysideqml
parent8acc7f3e52444e34dfaff5e38b1fb75e046a434b (diff)
libpysideqml: Fix MSVC lossy integer conversion warning in QML error handling
Returning the qint64 result of the QV4::ExecutionEngine::throw...() functions (usually 0) as int causes a lossy conversion warning. It is not clear what the original intent of the code was; return -1 instead to terminate processing in qt_metacall(), from which it is used. Change-Id: I3a4f7f38ae6f2b36de47f7d14f6c12254f85147d Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
Diffstat (limited to 'sources/pyside6/libpysideqml')
-rw-r--r--sources/pyside6/libpysideqml/pysideqmlmetacallerror.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/sources/pyside6/libpysideqml/pysideqmlmetacallerror.cpp b/sources/pyside6/libpysideqml/pysideqmlmetacallerror.cpp
index 431e44aa0..7e7758114 100644
--- a/sources/pyside6/libpysideqml/pysideqmlmetacallerror.cpp
+++ b/sources/pyside6/libpysideqml/pysideqmlmetacallerror.cpp
@@ -55,10 +55,12 @@ std::optional<int> qmlMetaCallErrorHandler(QObject *object)
PyErr_Print(); // Note: PyErr_Print clears the error.
if (isSyntaxError)
- return engine->throwSyntaxError(errString);
- if (isTypeError)
- return engine->throwTypeError(errString);
- return engine->throwError(errString);
+ engine->throwSyntaxError(errString);
+ else if (isTypeError)
+ engine->throwTypeError(errString);
+ else
+ engine->throwError(errString);
+ return -1;
#else
Q_UNUSED(object);
qWarning("libpyside6qml was built without QML private API support, error handling will not work.");