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. How to display multiple columns in tableview using qt quick 2
Forum Updated to NodeBB v4.3 + New Features

How to display multiple columns in tableview using qt quick 2

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

    I have created C++ model "chrgHistView" and exposed it to qml. Using the delegate shown below I am able to display only one column role from the model i.e "batteryID" How to display all the columns from the model ?

     TableView {
            id : tableView
            anchors.fill: parent
            columnSpacing: 1
            rowSpacing: 1
            clip: true
    
            ScrollBar.vertical: ScrollBar{}
            ScrollBar.horizontal: ScrollBar{}
            model: chrgHistView
    
            delegate: Rectangle {
                implicitWidth: 100
                implicitHeight: 50
                border.width: 1
    
                Text {
                    text: model.batteryID
                    anchors.centerIn: parent
                }
            }
    
    
        }
    
    
    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