I would like to display widgets between the QHeaderView and the rest of the QTableView, like in the example picture below (created with Photoshop), as this seems like a natural way to enable input for filtering columns. Does anybody have any ideas of how to inject widgets inbetween? Answer Below is a demo of a FilterHeader class that I wrote
Tag: qheaderview
PyQt: removing QTreeView columns
I am using QTreeView with QFileSystemModel. It displays columns like Size, Type, Modification Date, which I don’t need. How can I remove them from the view? I can’t find any removeColumn in model or in view. Answer Get the QHeaderView of your TreeView by calling header() on it, the headerview knows about the columns and can hide them via hideSection.