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. Access item in ListView's delegate
Forum Updated to NodeBB v4.3 + New Features

Access item in ListView's delegate

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

    I have a signal and ListView:

       signal userEdited(User user)
    
        ListView {
            delegate: userListDelegate
            model: userList
        }
    

    and then the delegate component which contains button:

    Component {
          id: userListDelegate
          Button{
            onClicked: {
                // here I want to emit signal with a user which is represented by the delegate
                //emit buttonClicked()
           }
          }
    }
    

    On button click, I want to emit the signal, however I don't know how to access the whole user object of the delegate and pass it as the signal's parameter.

    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