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

Add expected properties

    XMLWordPrintable

Details

    • 2f3b4ec528f48747a3b7e91e9a7254c25ce24c99

    Description

      Add an expected keyword to QML. expected properties behave similar to normal properties, except that we will emit a warning/error when they are not set.

       

      One of the primary use cases for this are delegates. Instead of accessing model properties "via magic" in the delegate, we could then use expected properties instead.

      The logic there would be that:

      • if there are no expected properties, we use the same behavior as before and simply inject the model properties
      • if a model contains at least one expected property, we set that property to match the model's role. We do not inject any properties from the model which are not expected
      • if there is an expected property, and it is not in the model, we issue a warning

      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
              fabiankosmale Fabian Kosmale
              Votes:
              0 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes