diff options
author | Fabian Kosmale <fabian.kosmale@qt.io> | 2020-12-15 11:50:54 +0100 |
---|---|---|
committer | Fabian Kosmale <fabian.kosmale@qt.io> | 2020-12-15 15:54:45 +0100 |
commit | 2c8d7411ace96f268d0692b366364d606f2608be (patch) | |
tree | 5bd7fcf1295ede61c0222bb56399f9ce1708878a /src/corelib/kernel/qproperty.cpp | |
parent | df28d75721f7e57f4421ed8c4b8131da742f3967 (diff) |
Move QObjectBindableProperty documentation into snippet file
The \Q_OBJECT macro has been removed but using Q_OBJECT in the file
would erroneously trigger automoc. Avoid the issue by moving
the snippet into its own file.
Task-number: QTBUG-89505
Pick-to: 6.0
Change-Id: I6630ff4bfcbf33eae348ac3d92aae1878dc573ea
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Diffstat (limited to 'src/corelib/kernel/qproperty.cpp')
-rw-r--r-- | src/corelib/kernel/qproperty.cpp | 19 |
1 files changed, 1 insertions, 18 deletions
diff --git a/src/corelib/kernel/qproperty.cpp b/src/corelib/kernel/qproperty.cpp index f4c026235a..e9228e2141 100644 --- a/src/corelib/kernel/qproperty.cpp +++ b/src/corelib/kernel/qproperty.cpp @@ -944,24 +944,7 @@ QString QPropertyBindingError::description() const Use the Q_BINDABLE_PROPERTY macro in the class declaration to declare the property as bindable. - \code - class MyClass : public QObject - { - \Q_OBJECT - Q_PROPERTY(int x READ x WRITE setX NOTIFY xChanged BINDABLE bindableX) - public: - int x() const { return xProp; } - void setX(int x) { xProp = x; } - Bindable<int> bindableX() { return QBindable<int>(&xProp); } - - signals: - void xChanged(); - - private: - // Declare the instance of the bindable property data. - Q_OBJECT_BINDABLE_PROPERTY(MyClass, int, xProp, &MyClass::xChanged) - }; - \endcode + \snippet code/src_corelib_kernel_qproperty.cpp 0 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. |