diff options
author | Ulf Hermann <[email protected]> | 2020-09-18 16:10:58 +0200 |
---|---|---|
committer | Ulf Hermann <[email protected]> | 2020-09-23 14:54:47 +0200 |
commit | 55158d25127173f4a96f2fa70fa7603fa81f8bd9 (patch) | |
tree | 011f38a9dccd0262e785d654378ced60a2e9bfa2 /src/quick/util/qquickglobal.cpp | |
parent | ad6d92d1bd2cd90cf8164fd445ad76432314bfab (diff) |
Eliminate QQmlValueTypeProvider::createVariantFromString()
This can be expressed as constructing the variant from a QJSValue.
Change-Id: I3140958469423acdc498e26129e349bcfb601198
Reviewed-by: Fabian Kosmale <[email protected]>
Diffstat (limited to 'src/quick/util/qquickglobal.cpp')
-rw-r--r-- | src/quick/util/qquickglobal.cpp | 52 |
1 files changed, 0 insertions, 52 deletions
diff --git a/src/quick/util/qquickglobal.cpp b/src/quick/util/qquickglobal.cpp index 48b882c218..90b3139b33 100644 --- a/src/quick/util/qquickglobal.cpp +++ b/src/quick/util/qquickglobal.cpp @@ -671,58 +671,6 @@ public: } template<typename T> - bool createFromStringTyped(void *data, size_t dataSize, T initValue) - { - ASSERT_VALID_SIZE(dataSize, sizeof(T)); - T *t = reinterpret_cast<T *>(data); - new (t) T(initValue); - return true; - } - - bool variantFromString(int type, const QString &s, QVariant *v) override - { - bool ok = false; - - switch (type) { - case QMetaType::QColor: - { - QColor c(s); - *v = QVariant::fromValue(c); - return true; - } - case QMetaType::QVector2D: - { - *v = QVariant::fromValue(vector2DFromString(s, &ok)); - return true; - } - case QMetaType::QVector3D: - { - *v = QVariant::fromValue(vector3DFromString(s, &ok)); - return true; - } - case QMetaType::QVector4D: - { - *v = QVariant::fromValue(vector4DFromString(s, &ok)); - return true; - } - case QMetaType::QQuaternion: - { - *v = QVariant::fromValue(quaternionFromString(s, &ok)); - return true; - } - case QMetaType::QMatrix4x4: - { - *v = QVariant::fromValue(matrix4x4FromString(s, &ok)); - return true; - } - default: - break; - } - - return false; - } - - template<typename T> bool typedStore(const void *src, void *dst, size_t dstSize) { ASSERT_VALID_SIZE(dstSize, sizeof(T)); |