From b7184e110434cdae127d03a1467ba6fb02607768 Mon Sep 17 00:00:00 2001 From: Fabian Kosmale Date: Fri, 23 Jun 2023 15:51:04 +0200 Subject: [PATCH] QBindable: Add doc example for ctor taking property name Pick-to: 6.5 6.6 Change-Id: I36de517291ef940d6fa284e062d44a5b619c0018 Reviewed-by: Ulf Hermann --- src/corelib/kernel/qproperty.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/corelib/kernel/qproperty.cpp b/src/corelib/kernel/qproperty.cpp index b6513a0b71d..d9db86a9244 100644 --- a/src/corelib/kernel/qproperty.cpp +++ b/src/corelib/kernel/qproperty.cpp @@ -1190,13 +1190,20 @@ QString QPropertyBindingError::description() const usable directly without reading through a QBindable use \l QProperty or \l QObjectBindableProperty. + \code + QProperty displayText; + QDateTimeEdit *dateTimeEdit = findDateTimeEdit(); + QBindable dateTimeBindable(dateTimeEdit, "dateTime"); + displayText.setBinding([dateTimeBindable](){ return dateTimeBindable.value().toString(); }); + \endcode + \sa QProperty, QObjectBindableProperty, {Qt Bindable Properties} */ /*! \fn template QBindable::QBindable(QObject *obj, const QMetaProperty &property) - See \c \l QBindable::QBindable(QObject *obj, const char *property) + See \l QBindable::QBindable(QObject *obj, const char *property) */ /*!