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

TreeView / styleData is too restrictive

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Unresolved
    • Not Evaluated
    • None
    • 5.6.0
    • Quick: Controls 1
    • None

    Description

      Suppose, I use TreeView and want to

      1. display some decoration left to text,
      2. have custom background colour
      3. have custom font of my text
      4. and so on...

      How can I achieve this? Seems it's impossible.

      So, I propose to expose model in TreeViewItemDelegateLoader.qml to user. For example, if you add something like

      +        readonly property var modelPrivate: model
      

      to TreeViewItemDelegateLoader.qml then everyone could use it in following way:

      color: styleData.modelPrivate["BackgroundRole"]
      text : styleData.modelPrivate["DisplayRole"]
      font : styleData.modelPrivate["FontRole"]
      

      (Actually it is exactly what I have already done locally, and it is works perfectly)

      What do you think about this?

      Attachments

        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
            dimanne DimanNe
            Votes:
            7 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes