Boke
Boke

Reputation: 85

QML ListView that fits the chosen style

I want to create a simple GUI, and I need to display a selectable list with multiple rows in each entry. I'm using Material as the main style, but it doesn't look like Material. Is there a way to connect the delegates to Material Design or dynamically when I change to another style like Universal?

         Component {
             id: contactDelegate
             Item {
                 width: 180; height: 40
                 Column {
                     Text { text: '<b>Name:</b> ' + name }
                     Text { text: '<b>Number:</b> ' + number }
                 }
                 MouseArea {
                     anchors.fill: parent
                     onClicked:{

                         myList.currentIndex = index
                         myList.focus = true
                          console.log( style.toLocaleString())
                     }
                 }
             }
         }


         ListView {
             id: myList
             anchors.fill: parent
             model: ContactModel {}
             delegate: contactDelegate
             highlight: Rectangle { color: "lightgreen"; radius: 5 }
             focus: true
             addDisplaced: Transition {
                 NumberAnimation { properties: "x,y"; duration: 1000 }
             }
             clip: true
         }```

Upvotes: 0

Views: 53

Answers (0)

Related Questions