Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Roles for model in header not showing

Roles for model in header not showing

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
1 Posts 1 Posters 165 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    dmendizabal
    wrote on last edited by
    #1

    I have a problem that only happens in Qt5.11 and up.
    The same code works well in Qt5.9.

    ListView {
        id: id_listView
        delegate: id_delegate
        header: id_header
        headerPositioning: ListView.OverlayHeader
        model: modelReport
        snapMode: ListView.SnapToItem
        clip: true
    
        Component {
            id: id_delegate
            ....
         }
    
        Component {
            id: id_header
    
                Row {
                    id: id_row
    
                    Repeater {
                        id: id_labelsHeader
                        model: modelHeader
    
                        Label {
                            text: role_c0
                        }
                    }
               }
        }
    }
    

    modelReport is read correctly and the data is shown in the delegate id_delegate.
    modelHeader shows nothing. The role role_c0 is empty
    Both models are created in C++ as derivative from QStandardItemModel

    What could be the difference between Qt5.9 and Qt5.11?

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved