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

ComboBox: Setting textRole does not work

    XMLWordPrintable

Details

    • 8cc52b9d1e2638f0636f2817dffeccd623063718

    Description

      In the following example, the "text" is expected to be shown inside the combo box. Or the color is shown instead.

      ComboBox {
          model: ListModel {
              id: menuItems
              ListElement { text: "Banana"; color: "Yellow" }
              ListElement { text: "Apple"; color: "Green" }
              ListElement { text: "Coconut"; color: "Brown" }
          }
          width: 200
      }
      

      Attempt to set the textRole to "text" does not help because the model is consider as native and this the role is ignored.

      Attachments

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

        Activity

          People

            dedietri Gabriel de Dietrich (drgvond)
            carochao Caroline Chao (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes