aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlvaluetypewrapper.cpp
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2018-06-25 23:18:33 +0200
committerLars Knoll <lars.knoll@qt.io>2018-07-03 08:08:35 +0000
commit61440411a979c7c317bafccfbf5201d969819a06 (patch)
tree6c5825e21e75587121351bc612a76a7af81ef7be /src/qml/qml/qqmlvaluetypewrapper.cpp
parent2aabdd187aae8a953cfcebac8f6c1ba7b19a0727 (diff)
Prefix vtable methods with virtual
Turns out that the overloading of vtable methods and regular ones is problematic in some cases. So let's rather make it explicit which methods are part of the vtable, and which aren't. Change-Id: Ifee32a26104d30f3c82bca8b5a9cdea2d4f4f526 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/qml/qqmlvaluetypewrapper.cpp')
-rw-r--r--src/qml/qml/qqmlvaluetypewrapper.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/qml/qml/qqmlvaluetypewrapper.cpp b/src/qml/qml/qqmlvaluetypewrapper.cpp
index 2dd76ccd84..8f61e2377d 100644
--- a/src/qml/qml/qqmlvaluetypewrapper.cpp
+++ b/src/qml/qml/qqmlvaluetypewrapper.cpp
@@ -227,7 +227,7 @@ bool QQmlValueTypeWrapper::toGadget(void *data) const
return true;
}
-bool QQmlValueTypeWrapper::isEqualTo(Managed *m, Managed *other)
+bool QQmlValueTypeWrapper::virtualIsEqualTo(Managed *m, Managed *other)
{
Q_ASSERT(m && m->as<QQmlValueTypeWrapper>() && other);
QV4::QQmlValueTypeWrapper *lv = static_cast<QQmlValueTypeWrapper *>(m);
@@ -241,7 +241,7 @@ bool QQmlValueTypeWrapper::isEqualTo(Managed *m, Managed *other)
return false;
}
-PropertyAttributes QQmlValueTypeWrapper::getOwnProperty(Managed *m, PropertyKey id, Property *p)
+PropertyAttributes QQmlValueTypeWrapper::virtualGetOwnProperty(Managed *m, PropertyKey id, Property *p)
{
if (id.isString()) {
Scope scope(m);
@@ -251,10 +251,10 @@ PropertyAttributes QQmlValueTypeWrapper::getOwnProperty(Managed *m, PropertyKey
return result ? Attr_Data : Attr_Invalid;
}
- return QV4::Object::getOwnProperty(m, id, p);
+ return QV4::Object::virtualGetOwnProperty(m, id, p);
}
-void QQmlValueTypeWrapper::advanceIterator(Managed *m, ObjectIterator *it, Value *name, uint *index, Property *p, PropertyAttributes *attributes)
+void QQmlValueTypeWrapper::virtualAdvanceIterator(Managed *m, ObjectIterator *it, Value *name, uint *index, Property *p, PropertyAttributes *attributes)
{
name->setM(nullptr);
*index = UINT_MAX;
@@ -279,7 +279,7 @@ void QQmlValueTypeWrapper::advanceIterator(Managed *m, ObjectIterator *it, Value
return;
}
}
- QV4::Object::advanceIterator(m, it, name, index, p, attributes);
+ QV4::Object::virtualAdvanceIterator(m, it, name, index, p, attributes);
}
bool QQmlValueTypeWrapper::isEqual(const QVariant& value) const
@@ -359,12 +359,12 @@ ReturnedValue QQmlValueTypeWrapper::method_toString(const FunctionObject *b, con
return Encode(b->engine()->newString(result));
}
-ReturnedValue QQmlValueTypeWrapper::get(const Managed *m, PropertyKey id, const Value *receiver, bool *hasProperty)
+ReturnedValue QQmlValueTypeWrapper::virtualGet(const Managed *m, PropertyKey id, const Value *receiver, bool *hasProperty)
{
Q_ASSERT(m->as<QQmlValueTypeWrapper>());
if (!id.isString())
- return Object::get(m, id, receiver, hasProperty);
+ return Object::virtualGet(m, id, receiver, hasProperty);
const QQmlValueTypeWrapper *r = static_cast<const QQmlValueTypeWrapper *>(m);
QV4::ExecutionEngine *v4 = r->engine();
@@ -379,7 +379,7 @@ ReturnedValue QQmlValueTypeWrapper::get(const Managed *m, PropertyKey id, const
QQmlPropertyData *result = r->d()->propertyCache()->property(name.getPointer(), nullptr, nullptr);
if (!result)
- return Object::get(m, id, receiver, hasProperty);
+ return Object::virtualGet(m, id, receiver, hasProperty);
if (hasProperty)
*hasProperty = true;
@@ -423,10 +423,10 @@ ReturnedValue QQmlValueTypeWrapper::get(const Managed *m, PropertyKey id, const
#undef VALUE_TYPE_ACCESSOR
}
-bool QQmlValueTypeWrapper::put(Managed *m, PropertyKey id, const Value &value, Value *receiver)
+bool QQmlValueTypeWrapper::virtualPut(Managed *m, PropertyKey id, const Value &value, Value *receiver)
{
if (!id.isString())
- return Object::put(m, id, value, receiver);
+ return Object::virtualPut(m, id, value, receiver);
Q_ASSERT(m->as<QQmlValueTypeWrapper>());
ExecutionEngine *v4 = static_cast<QQmlValueTypeWrapper *>(m)->engine();