From 391dc40bd25133c9b7fdd9822a013fae2683d8a6 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Fri, 27 Nov 2020 16:03:41 +0100 Subject: Make the signal argument in Q_OBJECT_BINDABLE_PROPERTY optional The intention was always that you can define properties that do not require a changed signal. But having to explicitly pass a nullptr as signal parameter into the macro is ugly, so use the cool QT_OVERLOADED_MACRO to make it optional. Change-Id: I0ce366d043850f983c968d73c544d89933c48df9 Reviewed-by: Fabian Kosmale (cherry picked from commit cb39ea05810bc207100018589da658a0cce98edb) Reviewed-by: Qt Cherry-pick Bot --- src/corelib/kernel/qproperty.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/corelib/kernel/qproperty.cpp') diff --git a/src/corelib/kernel/qproperty.cpp b/src/corelib/kernel/qproperty.cpp index e9256c7b42..27e2de7c4f 100644 --- a/src/corelib/kernel/qproperty.cpp +++ b/src/corelib/kernel/qproperty.cpp @@ -952,6 +952,9 @@ QString QPropertyBindingError::description() const Q_OBJECT_BINDABLE_PROPERTY(MyClass, int, xProp, &MyClass::xChanged) }; \endcode + + If the property does not need a changed notification, you can leave out the "NOFITY xChanged" in the Q_PROPERTY macro as well as the last argument + of the Q_OBJECT_BINDABLE_PROPERTY macro. */ /*! -- cgit v1.2.3