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

ComboBox role delegate function

XMLWordPrintable

    • Icon: Suggestion Suggestion
    • Resolution: Unresolved
    • Icon: Not Evaluated Not Evaluated
    • None
    • 6.9
    • Quick: Controls 2
    • None
    • All

      It would be nice if we could give a delegate function to "textRole" and "valueRole".

      Right now you have to supply textRole in the form of string, which breaks if you need more advanced logic for generating said text. I suggest we add something that lets us use an anonymous lambda instead, that takes the model-data as parameter and returns the string to display.

      Ideally I would like a user-story similar to this:

      ComboBox {
          model: myJsArray
          textRoleFn: (modelData) => { return modelData.someString + "Additional data" }
      }
      

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

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            npskalerud Nils Petter Skålerud
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes