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. HorizontalHeaderView disappears if ProxyModel filtering doesnt return any value
Forum Updated to NodeBB v4.3 + New Features

HorizontalHeaderView disappears if ProxyModel filtering doesnt return any value

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

    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?

    1 Reply Last reply
    0
    • T Offline
      T Offline
      Tobias Fensch
      wrote on last edited by
      #2

      Hello Antonio,

      I am having the same issue. Did you find a solution?

      cheers,
      Tobias

      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