From 61440411a979c7c317bafccfbf5201d969819a06 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Mon, 25 Jun 2018 23:18:33 +0200 Subject: 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 --- src/qml/qml/qqmltypewrapper.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'src/qml/qml/qqmltypewrapper.cpp') diff --git a/src/qml/qml/qqmltypewrapper.cpp b/src/qml/qml/qqmltypewrapper.cpp index 51df0a1fa6..c6affcb79c 100644 --- a/src/qml/qml/qqmltypewrapper.cpp +++ b/src/qml/qml/qqmltypewrapper.cpp @@ -167,12 +167,12 @@ static ReturnedValue throwLowercaseEnumError(QV4::ExecutionEngine *v4, String *n return v4->throwTypeError(message); } -ReturnedValue QQmlTypeWrapper::get(const Managed *m, PropertyKey id, const Value *receiver, bool *hasProperty) +ReturnedValue QQmlTypeWrapper::virtualGet(const Managed *m, PropertyKey id, const Value *receiver, bool *hasProperty) { Q_ASSERT(m->as()); if (!id.isString()) - return Object::get(m, id, receiver, hasProperty); + return Object::virtualGet(m, id, receiver, hasProperty); QV4::ExecutionEngine *v4 = static_cast(m)->engine(); QV4::Scope scope(v4); @@ -288,7 +288,7 @@ ReturnedValue QQmlTypeWrapper::get(const Managed *m, PropertyKey id, const Value } bool ok = false; - const ReturnedValue result = Object::get(m, id, receiver, &ok); + const ReturnedValue result = Object::virtualGet(m, id, receiver, &ok); if (hasProperty) *hasProperty = ok; @@ -304,10 +304,10 @@ ReturnedValue QQmlTypeWrapper::get(const Managed *m, PropertyKey id, const Value } -bool QQmlTypeWrapper::put(Managed *m, PropertyKey id, const Value &value, Value *receiver) +bool QQmlTypeWrapper::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()); @@ -350,7 +350,7 @@ bool QQmlTypeWrapper::put(Managed *m, PropertyKey id, const Value &value, Value return false; } -PropertyAttributes QQmlTypeWrapper::getOwnProperty(Managed *m, PropertyKey id, Property *p) +PropertyAttributes QQmlTypeWrapper::virtualGetOwnProperty(Managed *m, PropertyKey id, Property *p) { if (id.isString()) { Scope scope(m); @@ -361,10 +361,10 @@ PropertyAttributes QQmlTypeWrapper::getOwnProperty(Managed *m, PropertyKey id, P return hasProperty ? Attr_Data : Attr_Invalid; } - return QV4::Object::getOwnProperty(m, id, p); + return QV4::Object::virtualGetOwnProperty(m, id, p); } -bool QQmlTypeWrapper::isEqualTo(Managed *a, Managed *b) +bool QQmlTypeWrapper::virtualIsEqualTo(Managed *a, Managed *b) { Q_ASSERT(a->as()); QV4::QQmlTypeWrapper *qmlTypeWrapperA = static_cast(a); @@ -376,7 +376,7 @@ bool QQmlTypeWrapper::isEqualTo(Managed *a, Managed *b) return false; } -ReturnedValue QQmlTypeWrapper::instanceOf(const Object *typeObject, const Value &var) +ReturnedValue QQmlTypeWrapper::virtualInstanceOf(const Object *typeObject, const Value &var) { Q_ASSERT(typeObject->as()); const QV4::QQmlTypeWrapper *typeWrapper = static_cast(typeObject); @@ -428,11 +428,11 @@ QQmlType Heap::QQmlScopedEnumWrapper::type() const return QQmlType(typePrivate); } -ReturnedValue QQmlScopedEnumWrapper::get(const Managed *m, PropertyKey id, const Value *receiver, bool *hasProperty) +ReturnedValue QQmlScopedEnumWrapper::virtualGet(const Managed *m, PropertyKey id, const Value *receiver, bool *hasProperty) { Q_ASSERT(m->as()); if (!id.isString()) - return Object::get(m, id, receiver, hasProperty); + return Object::virtualGet(m, id, receiver, hasProperty); const QQmlScopedEnumWrapper *resource = static_cast(m); QV4::ExecutionEngine *v4 = resource->engine(); -- cgit v1.2.3