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. change property of delegate by function

change property of delegate by function

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

    Hi I wan to change property of delegate in setWidth().
    How to access width of gridViewWidth?

    function setWidth () {

    }

    GridView {
        y : 160
        width: 1300
        height : 500
        clip: true
        snapMode: ListView.SnapToItem
        focus: true
        interactive: true
    
        model : test
    
        cellWidth: 692; cellHeight: 295
    
        ListModel {
            id : test
        }
    
        delegate:
            Item {
                id: gridViewWidth
                width : 650
                height : 250
                
                Text {
                    x : 20
                    width : 500
                    height: 71
                    color: "black"
                    font.pixelSize: 32
                    verticalAlignment: Text.AlignVCenter
                    horizontalAlignment: Text.AlignHCenter
                    text : "test2"
                    elide: Text.ElideRight
                    }
                 }
    }    
    

    Thanks in advance for your answer.

    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