GridView's Component won't keep my new properity after scrlling other place



  • I try to assign properity strFileMode to ImgFileCeil.

    But I find the strFileMode will be reload when I scroll the menu to other place.

    It means that the GridView's Component won't keep my new properity after scrolling other place....

    Does it always reload compoment when I scroll the menu to other place?

    How to keep the strFileMode in my gridview?

    GridView {
                id:myGridview
    
                snapMode: GridView.SnapToRow
                property int numCellMargins: 0
                anchors.fill: parent
                anchors.margins: numCellMargins
                clip: true
                model:myModel
                cellWidth:(parent.width-numCellMargins*2)/numColumn // parent.width/3 ...this is error
                cellHeight:myGridview.height/numColumn//cellWidth*1.5
                delegate: myDelegate
            }
            Component {
                id: myDelegate
    
                ImgFileCeil{
                    id:imgFileCeil
                    Component.onCompleted: {
                        console.log(modelData+"-"+strMode+" : "+strDeleteName)
                        myDebug();
                    }
                    strTag: modelData
                    width: myGridview.cellWidth
                    height: myGridview.cellHeight
                    strMode: strFileMode
                    function setDeleteMode(posX,posY){
                        strFileMode="Delete"
                        setCheckBoxVisible()
                        console.log(modelData)
                        myGridviewReload(posX,posY)
                    }
                    function setMySelf(){
                        setCheckStation()
                    }
                }
            }
    

Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.