Is there a way to have subheader on a TableView?
Unsolved
QML and Qt Quick
-
I've been tasked to "try" to somehow adapt a TableView that has TableViewColumns in a way that it has header and subheaders.
An example:
As far as i know i can only do it like this:
In code i frequently do:
TableViewColumn { id: zoneNumber title: qsTr("teste") horizontalAlignment: Text.AlignHCenter width: col_zone_width movable: false resizable: false delegate: Rectangle { border.width: 1 border.color: globals.table.borderColor color: globals.table.color height: parent.height anchors.fill: parent Text { anchors.fill: parent horizontalAlignment: Text.AlignHCenter verticalAlignment: Text.AlignVCenter color: globals.text.textColor text: (styleData.row + 1) font.bold: globals.menu.fontBold font.pointSize: globals.text.textSize font.family: robotoRegular.name } } }
From documentation title in TableViewColumn only accepts a string.
Then on TableView i have,
headerDelegate: Rectangle{ id:recHeader width:styleData.width+20 height:301 Text { anchors.fill:parent text:styleData.value horizontalAlignment: Text.AlignHCenter verticalAlignment: Text.AlignVCenter } }
That way it seems impossible to do what i'm trying to achieve.
Is there a solution for this? Using TableView or even another component?
note: i'm using TableViewColumn from QtQuick.Controls 1.4, TableView from QtQuick 2.12