diff options
author | Frank Meerkoetter <frank.meerkoetter@basyskom.com> | 2015-07-20 20:47:22 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@theqtcompany.com> | 2015-08-18 20:25:42 +0000 |
commit | eeb466a3b9208dd25b2bd7003d03c264f0a4f4a7 (patch) | |
tree | aca98d31bc29a4cefe2315526dca2b86fa292fa1 /src/quick/util/qquickglobal.cpp | |
parent | 7a4967986ed5cfa3418bdd53a8ea8a34e100241a (diff) |
Remove QQmlValueTypeProvider::copyValueType
While reworking the QQmlValueTypeProvider interface I noticed that this
code isn't used.
Change-Id: I30a279ffabf3a1c70eaa1327e69b774f5e5981f0
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Diffstat (limited to 'src/quick/util/qquickglobal.cpp')
-rw-r--r-- | src/quick/util/qquickglobal.cpp | 43 |
1 files changed, 0 insertions, 43 deletions
diff --git a/src/quick/util/qquickglobal.cpp b/src/quick/util/qquickglobal.cpp index 0680a49d6d..fd172006e0 100644 --- a/src/quick/util/qquickglobal.cpp +++ b/src/quick/util/qquickglobal.cpp @@ -479,49 +479,6 @@ public: return false; } - template<typename T> - bool typedCopyConstruct(const void *src, void *dst, size_t dstSize) - { - ASSERT_VALID_SIZE(dstSize, sizeof(T)); - const T *srcT = reinterpret_cast<const T *>(src); - T *destT = reinterpret_cast<T *>(dst); - new (destT) T(*srcT); - return true; - } - - bool copy(int type, const void *src, void *dst, size_t dstSize) - { - switch (type) { - case QMetaType::QColor: - return typedCopyConstruct<QColor>(src, dst, dstSize); - case QMetaType::QFont: - return typedCopyConstruct<QFont>(src, dst, dstSize); - case QMetaType::QVector2D: - return typedCopyConstruct<QVector2D>(src, dst, dstSize); - case QMetaType::QVector3D: - return typedCopyConstruct<QVector3D>(src, dst, dstSize); - case QMetaType::QVector4D: - return typedCopyConstruct<QVector4D>(src, dst, dstSize); - case QMetaType::QQuaternion: - return typedCopyConstruct<QQuaternion>(src, dst, dstSize); - case QMetaType::QMatrix4x4: - { - if (dstSize >= sizeof(QMatrix4x4)) - return typedCopyConstruct<QMatrix4x4>(src, dst, dstSize); - - // special case: copying matrix into variant. - Q_ASSERT(dstSize >= sizeof(QVariant)); - const QMatrix4x4 *srcMatrix = reinterpret_cast<const QMatrix4x4 *>(src); - QVariant *dstMatrixVar = reinterpret_cast<QVariant *>(dst); - new (dstMatrixVar) QVariant(*srcMatrix); - return true; - } - default: break; - } - - return false; - } - bool create(int type, int argc, const void *argv[], QVariant *v) { switch (type) { |