diff options
author | Fabian Kosmale <fabian.kosmale@qt.io> | 2020-12-15 11:50:54 +0100 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2020-12-17 11:37:53 +0000 |
commit | 57845875087cf4a6800c94ac18670376aefaede4 (patch) | |
tree | 257ffb29aac05026bc097529da8f2cace8bf94e6 /src/corelib/kernel | |
parent | 65893e14f243ae4dc315c383ab004208ae5e1a7b (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
Change-Id: I6630ff4bfcbf33eae348ac3d92aae1878dc573ea
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
(cherry picked from commit 2c8d7411ace96f268d0692b366364d606f2608be)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src/corelib/kernel')
-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 715e421295..3ddf693ac9 100644 --- a/src/corelib/kernel/qproperty.cpp +++ b/src/corelib/kernel/qproperty.cpp @@ -940,24 +940,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. |