diff options
Diffstat (limited to 'src/corelib/kernel/qproperty.h')
-rw-r--r-- | src/corelib/kernel/qproperty.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/corelib/kernel/qproperty.h b/src/corelib/kernel/qproperty.h index 24aa1804f2..22313bc92e 100644 --- a/src/corelib/kernel/qproperty.h +++ b/src/corelib/kernel/qproperty.h @@ -316,10 +316,11 @@ public: #ifndef Q_CLANG_QDOC template <typename Functor> - QPropertyBinding<T> setBinding(Functor f, - const QPropertyBindingSourceLocation &location = QT_PROPERTY_DEFAULT_BINDING_LOCATION) + QPropertyBinding<T> setBinding(Functor &&f, + const QPropertyBindingSourceLocation &location = QT_PROPERTY_DEFAULT_BINDING_LOCATION, + std::enable_if_t<std::is_invocable_v<Functor>> * = nullptr) { - return setBinding(Qt::makePropertyBinding(f, location)); + return setBinding(Qt::makePropertyBinding(std::forward<Functor>(f), location)); } #else template <typename Functor> |