Show TableView header
-
Hi!
How I can show header columns in TableView?import QtQuick 2.14 import Qt.labs.qmlmodels 1.0 TableView { anchors.fill: parent columnSpacing: 1 rowSpacing: 1 clip: true model: TableModel { TableModelColumn { display: "name" } TableModelColumn { display: "color" } rows: [ { "name": "cat", "color": "black" }, { "name": "dog", "color": "brown" }, { "name": "bird", "color": "white" } ] } delegate: Rectangle { implicitWidth: 100 implicitHeight: 50 border.width: 1 Text { text: display anchors.centerIn: parent } } }
If use this, then in text column I see only 1 ,2 ...
HorizontalHeaderView { id: horizontalHeader syncView: tableView anchors.left: tableView.left }
-
It is work
https://stackoverflow.com/questions/69366338/show-column-titles-in-horizontalheaderviewHorizontalHeaderView { id: horizontalHeader syncView: tableViewDelegatePointsChart anchors.left: tableViewDelegatePointsChart.left model: ["from", "to", "mid", "max", "min"] }