aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlpropertybinding.cpp
diff options
context:
space:
mode:
authorFabian Kosmale <fabian.kosmale@qt.io>2020-10-17 14:23:35 +0200
committerFabian Kosmale <fabian.kosmale@qt.io>2020-11-04 13:49:39 +0000
commit4b9249dabf002e204298cfc3cd0e64e607905d54 (patch)
tree4c1d310ed9fac0de38db6b8672f98923878a96a0 /src/qml/qml/qqmlpropertybinding.cpp
parentf9feaa20a8b8a875f9da5c8b561aca8bafd446ca (diff)
Adjust to QPropertyBindingPrivate not using std::function anymore
Change-Id: Id197f3d4bf8ab60256040e0a177d5596ce78a0a8 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/qml/qml/qqmlpropertybinding.cpp')
-rw-r--r--src/qml/qml/qqmlpropertybinding.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/qml/qml/qqmlpropertybinding.cpp b/src/qml/qml/qqmlpropertybinding.cpp
index b691bf39a9..d56d41f834 100644
--- a/src/qml/qml/qqmlpropertybinding.cpp
+++ b/src/qml/qml/qqmlpropertybinding.cpp
@@ -63,12 +63,13 @@ QUntypedPropertyBinding QQmlPropertyBinding::create(const QQmlPropertyData *pd,
QPropertyBindingSourceLocation());
}
- auto binding = new QQmlPropertyBinding(QMetaType(pd->propType()));
+ auto buffer = new std::byte[sizeof(QQmlPropertyBinding)]; // QQmlPropertyBinding uses delete[]
+ auto binding = new (buffer) QQmlPropertyBinding(QMetaType(pd->propType()));
binding->setNotifyOnValueChanged(true);
binding->setContext(ctxt);
binding->setScopeObject(obj);
binding->setupFunction(scope, function);
- return QUntypedPropertyBinding(QPropertyBindingPrivatePtr(binding).data());
+ return QUntypedPropertyBinding(static_cast<QPropertyBindingPrivate *>(QPropertyBindingPrivatePtr(binding).data()));
}
void QQmlPropertyBinding::expressionChanged()
@@ -89,15 +90,14 @@ void QQmlPropertyBinding::expressionChanged()
m_error.setTag(currentTag);
}
-QQmlPropertyBinding::QQmlPropertyBinding(const QMetaType &mt)
+QQmlPropertyBinding::QQmlPropertyBinding(QMetaType mt)
: QPropertyBindingPrivate(mt,
- [this](const QMetaType &metaType, void *dataPtr) -> bool {
- return evaluate(metaType, dataPtr);
- }, QPropertyBindingSourceLocation())
+ &QtPrivate::bindingFunctionVTable<QQmlPropertyBinding>,
+ QPropertyBindingSourceLocation())
{
}
-bool QQmlPropertyBinding::evaluate(const QMetaType &metaType, void *dataPtr)
+bool QQmlPropertyBinding::evaluate(QMetaType metaType, void *dataPtr)
{
const auto ctxt = context();
QQmlEngine *engine = ctxt ? ctxt->engine() : nullptr;