Tom Sevet
Tom Sevet

Reputation: 25

How to pass two arguments to AppListView separator

I would like to display AppListView with separators of custom delegates. Separators should have 2 properties - color defined as string and text also defined as a string - both coming from my model as roles and they always come in pairs so for example

I cannot find any option to pass two arguments to my section, so I can make both color and text to be displayed on my separator.

For those who prefer code:

AppListView {
  id: list
  section {
    property: "separatorTextRole"        /* here I set my first role to be separator property */
    criteria: ViewSection.FullString
    delegate: CustomSeparatorDelegate {
      itemColor:                         /* how can I pass also my separatorColorRole here? */
      itemText: section                  /* here I access my separatorTextRole */
    }
  }
  delegate: CustomListDelegate {
    text: nameRole
    row: rowRole
    value: valueRole
  }
}

Upvotes: 1

Views: 65

Answers (0)

Related Questions