After the removeal of the QQmlVMEVariant there is no user left.
Change-Id: I97224127aac57aba9a80827f9292018d03609b85
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
return false;
}
-bool QQmlValueTypeProvider::destroyValueType(int type, void *data, size_t n)
-{
- Q_ASSERT(data);
-
- QQmlValueTypeProvider *p = this;
- do {
- if (p->destroy(type, data, n))
- return true;
- } while ((p = p->next));
-
- return false;
-}
-
QVariant QQmlValueTypeProvider::createValueType(int type, int argc, const void *argv[])
{
QVariant v;
const QMetaObject *QQmlValueTypeProvider::getMetaObjectForMetaType(int) { return 0; }
bool QQmlValueTypeProvider::init(int, QVariant&) { return false; }
-bool QQmlValueTypeProvider::destroy(int, void *, size_t) { return false; }
bool QQmlValueTypeProvider::create(int, int, const void *[], QVariant *) { return false; }
bool QQmlValueTypeProvider::createFromString(int, const QString &, void *, size_t) { return false; }
bool QQmlValueTypeProvider::createStringFrom(int, const void *, QString *) { return false; }
const QMetaObject *metaObjectForMetaType(int);
bool initValueType(int, QVariant&);
- bool destroyValueType(int, void *, size_t);
QVariant createValueType(int, int, const void *[]);
bool createValueFromString(int, const QString &, void *, size_t);
private:
virtual const QMetaObject *getMetaObjectForMetaType(int);
virtual bool init(int, QVariant&);
- virtual bool destroy(int, void *, size_t);
virtual bool create(int, int, const void *[], QVariant *);
virtual bool createFromString(int, const QString &, void *, size_t);
return false;
}
- template<typename T>
- bool typedDestroy(void *data, size_t dataSize)
- {
- ASSERT_VALID_SIZE(dataSize, sizeof(T));
- T *t = reinterpret_cast<T *>(data);
- t->~T();
- return true;
- }
-
- bool destroy(int type, void *data, size_t dataSize)
- {
- switch (type) {
- case QMetaType::QColor:
- return typedDestroy<QColor>(data, dataSize);
- case QMetaType::QFont:
- return typedDestroy<QFont>(data, dataSize);
- case QMetaType::QVector2D:
- return typedDestroy<QVector2D>(data, dataSize);
- case QMetaType::QVector3D:
- return typedDestroy<QVector3D>(data, dataSize);
- case QMetaType::QVector4D:
- return typedDestroy<QVector4D>(data, dataSize);
- case QMetaType::QQuaternion:
- return typedDestroy<QQuaternion>(data, dataSize);
- case QMetaType::QMatrix4x4:
- {
- if (dataSize >= sizeof(QMatrix4x4))
- return typedDestroy<QMatrix4x4>(data, dataSize);
-
- // special case: destroying matrix-containing qvariant.
- Q_ASSERT(dataSize >= sizeof(QVariant));
- QVariant *matvar = reinterpret_cast<QVariant *>(data);
- matvar->~QVariant();
- return true;
- }
- default: break;
- }
-
- return false;
- }
-
bool create(int type, int argc, const void *argv[], QVariant *v)
{
switch (type) {