aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlvaluetypewrapper.cpp
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2023-01-17 17:13:08 +0100
committerUlf Hermann <ulf.hermann@qt.io>2024-03-02 10:28:44 +0100
commitccbfa4458357a1c49b6c192b96ef9440cdbaf397 (patch)
treebe8d18e85b683371e5caf4c7169cabbf604ed939 /src/qml/qml/qqmlvaluetypewrapper.cpp
parent5a85b92dd3f5bc0b7f0a753986d23a944fe2ab24 (diff)
QtQml: Make QLocale an actual value type
We want to be accessible to qmllint and other QML tooling. To this end, make all legal invocations of its methods properly typed invokables. Keep two QQmlV4Function overloads to produce error messages if the methods are called with the wrong parameters. We have to do this because JavaScript is more liberal in its argument coercion than the methods would like. Un-deprecate QJSNumberCoercion::isInteger() since it's actually quite practical here. Pick-to: 6.7 Fixes: QTBUG-112366 Change-Id: I016e5edc47efaade44461c504c1b3e2b1b829b58 Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qml/qml/qqmlvaluetypewrapper.cpp')
-rw-r--r--src/qml/qml/qqmlvaluetypewrapper.cpp9
1 files changed, 0 insertions, 9 deletions
diff --git a/src/qml/qml/qqmlvaluetypewrapper.cpp b/src/qml/qml/qqmlvaluetypewrapper.cpp
index da3c2bfe2c..e0d684e377 100644
--- a/src/qml/qml/qqmlvaluetypewrapper.cpp
+++ b/src/qml/qml/qqmlvaluetypewrapper.cpp
@@ -339,12 +339,6 @@ static ReturnedValue getGadgetProperty(ExecutionEngine *engine,
time, valueTypeWrapper, index, referenceFlags(metaObject, index));
};
-#if QT_CONFIG(qml_locale)
- const auto wrapLocale = [engine](const QLocale &locale) {
- return QQmlLocale::wrap(engine, locale);
- };
-#endif
-
#define VALUE_TYPE_LOAD(metatype, cpptype, constructor) \
case metatype: { \
cpptype v; \
@@ -397,9 +391,6 @@ static ReturnedValue getGadgetProperty(ExecutionEngine *engine,
VALUE_TYPE_LOAD(QMetaType::QJsonValue, QJsonValue, wrapJsonValue);
VALUE_TYPE_LOAD(QMetaType::QJsonObject, QJsonObject, wrapJsonObject);
VALUE_TYPE_LOAD(QMetaType::QJsonArray, QJsonArray, wrapJsonArray);
-#if QT_CONFIG(qml_locale)
- VALUE_TYPE_LOAD(QMetaType::QLocale, QLocale, wrapLocale);
-#endif
case QMetaType::QPixmap:
case QMetaType::QImage: {
QVariant v(metaType);