Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to handle a row click in TableView 2.0?

How to handle a row click in TableView 2.0?

Scheduled Pinned Locked Moved Unsolved General and Desktop
1 Posts 1 Posters 121 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.
  • D Offline
    D Offline
    Dmitriano
    wrote on last edited by Dmitriano
    #1

    How to handle a row click in TableView 2.0?

    I use DelegateChooser with different delegates for all coulmns:

        TableView {
            id: table
            anchors.fill: parent
            columnSpacing: 1
            rowSpacing: 3
            clip: true
    
            property var columnWidths: [100, 90, 90, 60, 60];
            columnWidthProvider: function (column) { return columnWidths[column] }
    
            delegate: DelegateChooser {
                role: "type"
                DelegateChoice {
                    roleValue: "pair"
                    delegate: Text { ...
                    }
                }
                DelegateChoice {
                    roleValue: "price"
                    delegate: Text { ...
                    }
                }
                ...
    

    but need to handle a click not on a particular cell, but on entire row and access the row data from the click handler. How to implement this?

    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