I have a very basic app that displays a tree view and a button that adds items to that tree view, using current selection as a parent. Inserting a first level child works well while inserting the 3d level child fails for some reason (it just is not displayed after inserting is done. I’ve prepared fully verifiable code that you
Tag: qtreeview
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.