QBindable: Add doc example for ctor taking property name

Pick-to: 6.5 6.6
Change-Id: I36de517291ef940d6fa284e062d44a5b619c0018
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
This commit is contained in:
Fabian Kosmale 2023-06-23 15:51:04 +02:00
parent c3fd8e911e
commit b7184e1104

View File

@ -1190,13 +1190,20 @@ QString QPropertyBindingError::description() const
usable directly without reading through a QBindable use \l QProperty or
\l QObjectBindableProperty.
\code
QProperty<QString> displayText;
QDateTimeEdit *dateTimeEdit = findDateTimeEdit();
QBindable<QDateTime> dateTimeBindable(dateTimeEdit, "dateTime");
displayText.setBinding([dateTimeBindable](){ return dateTimeBindable.value().toString(); });
\endcode
\sa QProperty, QObjectBindableProperty, {Qt Bindable Properties}
*/
/*!
\fn template<typename T> QBindable<T>::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)
*/
/*!