Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

ListView Section



  • Hello how to add listview section a image ? Or how to access listview modet current item property from listview section ?



  • Anyone help me ?



  • hi

    @NullByte said in ListView Section:

    Hello how to add listview section a image

    you can create a custom section.delegate as shown here

    https://doc.qt.io/qt-5/qml-qtquick-listview.html#section.delegate-prop



  • I don't know how to access listview model current image property in section area. We can use multiple property in section ?

    ListView {
        id: fixtureList
        width: parent.width
        height: parent.height - (header.height + tabBar.height) * dp
        anchors.top: header.bottom
        anchors.left: parent.left
        focus: true
        clip: true
        model: ListModel{}
        delegate: Rectangle {
            id: dataModel
            height: 100 * dp
    
            Text {
                id: matchStartTime
                text: "22:04"
                anchors.left: parent.left
                anchors.leftMargin: 5
                anchors.top: parent.top
                anchors.topMargin: 5
    
    
    
            }
        }
    
        section {
            property: "name"
            criteria: ViewSection.FullString
            delegate: Rectangle {
                color: "#d2d4c7"
                width: parent.width
                height: 50 * dp
    
                Text {
                    text: section
                    anchors.left: parent.left
                    anchors.leftMargin: 15
                    anchors.top: parent.top
                    anchors.topMargin: 5
                    font.pixelSize: 15
                    font.family: fontRegular.name
    
                }
            }
    
        }
    }

Log in to reply