diff options
author | Lars Knoll <lars.knoll@qt.io> | 2020-11-27 16:03:41 +0100 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2020-12-07 16:23:31 +0000 |
commit | 391dc40bd25133c9b7fdd9822a013fae2683d8a6 (patch) | |
tree | bb25010f7316d6ac8e8238ba1e488e1c80b407b4 /src/corelib/kernel/qproperty.cpp | |
parent | 0566e66e887f230cec2632a8129246511d12b267 (diff) |
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 <fabian.kosmale@qt.io>
(cherry picked from commit cb39ea05810bc207100018589da658a0cce98edb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src/corelib/kernel/qproperty.cpp')
-rw-r--r-- | src/corelib/kernel/qproperty.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
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. */ /*! |