How to fill the header of QTreeView?

  header, pyqt, pyqt5, python, qtreeview

I want to organize some data in PyQt5 using QTreeView widget. My data has more than one column. My problem is, I can not find a simple function with which I can set the names of the columns (the headers). On some sites, I found that I should use QHeaderView, but I don’t understand how that works. Is there an easy way to set the header? It doesn’t have to change dynamically. I want to set it once and that’s it.

Source: Python Questions

LEAVE A COMMENT