aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsapi/qjsengine.cpp
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2023-02-03 10:14:56 +0100
committerUlf Hermann <ulf.hermann@qt.io>2023-02-07 19:23:13 +0100
commit11bc79d7c6e52dfb85e951e383f11395aecea337 (patch)
treeb2f721eadd284ecf69ac5af0d5ed6387d8a03dca /src/qml/jsapi/qjsengine.cpp
parent7e51a3fd91f84937adaf45230ff105e2aabfcdbd (diff)
QML: Treat long and ulong like other numbers
They should either be the same size as int/uint or the same size as longlong/ulonglong, but for some reason we get them as separate types. Pick-to: 6.5 Fixes: QTBUG-110767 Change-Id: I4c5826cfe6108e6f9722e6b3443bde13b2141b04 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Semih Yavuz <semih.yavuz@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'src/qml/jsapi/qjsengine.cpp')
-rw-r--r--src/qml/jsapi/qjsengine.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/qml/jsapi/qjsengine.cpp b/src/qml/jsapi/qjsengine.cpp
index d3a6ed7391..86901c7955 100644
--- a/src/qml/jsapi/qjsengine.cpp
+++ b/src/qml/jsapi/qjsengine.cpp
@@ -872,6 +872,12 @@ bool QJSEngine::convertString(const QString &string, QMetaType metaType, void *p
case QMetaType::UInt:
*reinterpret_cast<uint*>(ptr) = QV4::Value::toUInt32(d);
return true;
+ case QMetaType::Long:
+ *reinterpret_cast<long*>(ptr) = QV4::Value::toInteger(d);
+ return true;
+ case QMetaType::ULong:
+ *reinterpret_cast<ulong*>(ptr) = QV4::Value::toInteger(d);
+ return true;
case QMetaType::LongLong:
*reinterpret_cast<qlonglong*>(ptr) = QV4::Value::toInteger(d);
return true;