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

mising info about signal handlers in qml docs

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • 4.7.0
    • 4.7.1
    • Documentation
    • None
    • 43580da7e288258cd61bf48d54c58e1cec7ce36f

    Description

      The docs about "Extending types from QML" (qthelp://com.trolltech.qt.470/qdoc/qml-extending-types.html) mention adding new signals and in what way signal-handler identifier is based on singal's name.

      But in the part about adding new properties, it is not mentioned that adding a new property will also add a signal handler, and in what way the identifier of this signal handler is based on property's name.


      The docs about "Extending QML in C++" (qthelp://com.trolltech.qt.470/qdoc/qml-extending.html) have a section about signals which explain how the identifier of corresponding singnal handler is based on signal's name.

      But again, docs do not mention that adding a property also adds a signal handler with identifier based on this property's name.


      Note: it is especially confusing if someone introduces in C++, for example, a corresponding naming conviention for properties:

      Q_PROPERTY(bool test_property READ testProp WRITE setTestProp NOTIFY testPropChanged)
      

      (plus proper declaration of singal testPropChanged() later in the class declaration). This makes in QML two singnal handlers available: "onTest_propertyChanged:" and "onTestPropChanged:" . No harm with using either, but without proper section in docs it may be quite confusing where these "onXXX:" identifiers came from...


      I attach a patch with my proposition of additional paragraphs.

      Attachments

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

        Activity

          People

            gbk Martin Smith (Qt)
            wiecko Marek Wieckowski
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes