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. GridView's Component won't keep my new properity after scrlling other place
Forum Updated to NodeBB v4.3 + New Features

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

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
1 Posts 1 Posters 267 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.
  • zenghsingZ Offline
    zenghsingZ Offline
    zenghsing
    wrote on last edited by
    #1

    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()
                    }
                }
            }
    
    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