2021年2月9日星期二

Populate a tree view in Qt5 Python from an Excel file

I want to create a tree view of the dat I have in Excel. The first column (Level) represents the hierarchy of the row. Level 1 is the root level, Level 2 is the child of Level 1, Level 3 is the child of Level 2 and so on. I am using Qt Designer to generate code for the GUI in Python. I've been trying to do this with treeView and treeWidget. An example of the data I have is attached as an Excel doc as well as how I want it to look like (shown for the first 15 rows only to save space). The Excel file include 50 rows but the actual file has thousands of rows. As shown in the attached I just want to view the Name column and use the Level values to decide on the hierarchy.

Here is the link to the Excel file on Google Drive: https://drive.google.com/file/d/18vtnkpGRCVdftfMAoZ4YGidTGNy-JR2H/view?usp=sharing

Tree view of data:

Tree view of data

https://stackoverflow.com/questions/66130694/populate-a-tree-view-in-qt5-python-from-an-excel-file February 10, 2021 at 11:55AM

没有评论:

发表评论