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. TableView - interact between itemDelegate and rowDelegate

TableView - interact between itemDelegate and rowDelegate

Scheduled Pinned Locked Moved QML and Qt Quick
1 Posts 1 Posters 876 Views 1 Watching
  • 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.
  • U Offline
    U Offline
    ustulation
    wrote on last edited by
    #1

    I'm currently using TableView to display a single column so could have well used ListView but since TableView is more desktop friendly (with scroll bars added when necessary and disabling flicks etc) I'm sticking to TableView. I don't know how to communicate between rowDelegate and itemDelegate.

    What I'm doing is maintaining arrays, one for each property that I need during interaction. Eg., the height of rowDelegate.

    @property var arrayHeights: []
    rowDelegate: Rectangle {
    height: view.arrayHeights[styledata.row] //assume view is id of TableView which contains property arrayHeights above
    }

    itemDelegate: Text {
    id: myText
    text: "Random"
    Component.onCompleted {
    myText.font.pixelSize: Math.floor(Math.random() * 10) + 10
    arrayHeights.push(myText.font.pixelSize)
    }
    }
    @
    Is there a better way to do it? Else I will need to make such arrays for every property I want to influence in rowDelegate.

    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