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

No way to declaratively instantiate Path elements in ShapePath

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Unresolved
    • P2: Important
    • None
    • 5.11.2
    • Quick: Other

    Description

      When using Shape, it would be nice to be able to construct a ShapePath using data from a model. For example, something like this:

       

      Shape {
          ShapePath {
              Instantiator {
                  model: someModel // Anything which implements Qt model API  
                  PathLine {
                      x: xValue // data from item in model
                      y: yValue // data from item in model
                  }
              }
          }
      }
      

      At the moment, this doesn't work, because it tries to add the Instantiator to the pathElements property of ShapePath and can't because it isn't a PathElement itself.

      I haven't been able to find any other way of declaratively building up a ShapePath using data from a model. I believe it would make Shape and ShapePath much more flexible: Having to define all the line segments ahead of time is very limiting and rarely useful in practice.

      Attachments

        Issue Links

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

          Activity

            People

              qt.team.quick.subscriptions Qt Quick and Widgets Team
              THall Tom Hall
              Votes:
              3 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes