diff options
author | Fabian Kosmale <fabian.kosmale@qt.io> | 2020-10-11 10:25:43 +0200 |
---|---|---|
committer | Fabian Kosmale <fabian.kosmale@qt.io> | 2020-10-12 13:01:43 +0200 |
commit | 901b2975dd714617f20ec13a66aeac8c5a6638fa (patch) | |
tree | f22abd42d07fd96c6f2f9291313a7a2f0b0ed41e /src/corelib/kernel | |
parent | f912ad0a4ddc56611eb7224b3c4fc11bc19c95eb (diff) |
QProperty: avoid needless std::function copying
Change-Id: Iea6280b12e7146a9ac92f071a4c21b373e9d3ab0
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src/corelib/kernel')
-rw-r--r-- | src/corelib/kernel/qproperty_p.h | 2 | ||||
-rw-r--r-- | src/corelib/kernel/qpropertyprivate.h | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/corelib/kernel/qproperty_p.h b/src/corelib/kernel/qproperty_p.h index 9185c939c6..1193e3e1d2 100644 --- a/src/corelib/kernel/qproperty_p.h +++ b/src/corelib/kernel/qproperty_p.h @@ -334,7 +334,7 @@ class QObjectCompatProperty : public QPropertyData<T> char *that = const_cast<char *>(reinterpret_cast<const char *>(this)); return reinterpret_cast<Class *>(that - QtPrivate::detail::getOffset(Offset)); } - static bool bindingWrapper(QMetaType type, QUntypedPropertyData *dataPtr, QtPrivate::QPropertyBindingFunction binding) + static bool bindingWrapper(QMetaType type, QUntypedPropertyData *dataPtr, const QtPrivate::QPropertyBindingFunction &binding) { auto *thisData = static_cast<ThisType *>(dataPtr); QPropertyData<T> copy; diff --git a/src/corelib/kernel/qpropertyprivate.h b/src/corelib/kernel/qpropertyprivate.h index d03b174a41..158fdbabb4 100644 --- a/src/corelib/kernel/qpropertyprivate.h +++ b/src/corelib/kernel/qpropertyprivate.h @@ -77,7 +77,7 @@ namespace QtPrivate { // writes binding result into dataPtr using QPropertyBindingFunction = std::function<bool(QMetaType metaType, QUntypedPropertyData *dataPtr)>; using QPropertyObserverCallback = void (*)(QUntypedPropertyData *); -using QPropertyBindingWrapper = bool(*)(QMetaType, QUntypedPropertyData *dataPtr, QPropertyBindingFunction); +using QPropertyBindingWrapper = bool(*)(QMetaType, QUntypedPropertyData *dataPtr, const QPropertyBindingFunction &); class Q_CORE_EXPORT QPropertyBindingData { |