Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-112701

Issues with bindable property documentation

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 6.5
    • None

    Description

      There is a broken snippet/note in https://doc.qt.io/qt-6/qproperty.html#details:

      https://doc.qt.io/qt-6/bindableproperties.html#interaction-with-q-propertys has lots of broken link commands that show up in the actual documentation.

      https://doc.qt.io/qt-6/bindableproperties.html#interaction-with-q-propertys also says:

      Q_PROPERTYs without BINDABLE can also be bound and be used in binding expressions, as long as they define a NOTIFY signal. You must wrap the property in a QBindable using the QBindable(QObject* obj, const char* property) constructor. [...]

      If I then go to https://doc.qt.io/qt-6/qbindable.html#details, it doesn't mention this, only:

      QBindable<T> helps to integrate Qt's traditional Q_PROPERTY with binding-enabled properties. If a property is backed by a QProperty, QObjectBindableProperty or QObjectComputedProperty, you can add BINDABLE bindablePropertyName to the Q_PROPERTY declaration, where bindablePropertyName is a function returning an instance of QBindable constructed from the QProperty. The returned QBindable allows users of the property to set and query bindings of the property, without having to know the exact kind of binding-enabled property used.

      https://doc.qt.io/qt-6/qbindable.html#QBindable-3 does mention that it can be used without the property being BINDABLE, but I would have expected reassurance of this as one of the first things I read as a consumer of the documentation.

      https://doc.qt.io/qt-6/bindableproperties.html#interaction-with-q-propertys also has no code snippets of how to use it with a property that is not BINDABLE.

      It would also be worthwhile stating that the binding is removed when it is destroyed (even if that may seem obvious).

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              fabiankosmale Fabian Kosmale
              mitch_curtis Mitch Curtis
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes