HorizontalHeaderView disappears if ProxyModel filtering doesnt return any value
Unsolved
QML and Qt Quick
-
Hi guys! I'm having an issue with QuickControls 2's TableView and HorizontalHeaderView. I sync both views in my code, but when I do filtering in my model (is a QSortFilterProxyModel) and it returns no value the header disappears.
This is the header's code (The HeaderDelegate is just a rectangle with fixed height 56 and a TextField inside of it):
HorizontalHeaderView { id: header width: parent.width height: 48 z: 2 syncView: table delegate: HeaderDelegate{ id: headerDelegate text: proxy.headerData(index, Qt.Horizontal, proxy.roleForName("headerName")) visible: true initialWidth: proxy.columnWidth(index) }
This is the TableView's code:
TableView{ id: table width: parent.width height: root.height - header.height - toolBar.height - 24 flickableDirection: Flickable.HorizontalAndVerticalFlick model: proxy delegate: delegateChooser columnWidthProvider: function(column){ return model.columnWidth(column); } }
I'm using a custom fork of the proxy model found in this repo https://github.com/oKcerG/SortFilterProxyModel. We change it to support tables, but the filtering is the same.
Does anyone have a clue of what might be causing the header to disappear?
-
Hello Antonio,
I am having the same issue. Did you find a solution?
cheers,
Tobias