[SOLVED] PyQt: removing QTreeView columns

Issue

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.

Solution

Get the QHeaderView of your TreeView by calling header() on it, the headerview knows about the columns and can hide them via hideSection.

Answered By – Harald Scheirich

Answer Checked By – Jay B. (BugsFixing Admin)

Leave a Reply

Your email address will not be published. Required fields are marked *