How to make the tree control of Qt display faster?

my project needs to display a large amount of data on the qt tree control, a total of four columns, the first column is the button and text, the second column is text, the third column is combobox, and the fourth column is icon. If all inserted, it will take a lot of time, so I decided to show only the tree window part of the items, other do not display, by responding to the mouse wheel event, combined with the position of the scroll bar to dynamically refresh the data in the display area, in order to reduce time and memory overhead.

but I used three ways to achieve the above functions, all encountered the same problem, the speed is too slow, three methods to refresh the data in the tree window (13 rows), all take nearly 1 second, which for the scroll bar scrolling process, the speed is unacceptable, so I would like to ask you, is there a faster way.

I used three methods: treewidget, treeview and treeview+ proxy

treewidget:

I used the setItemWidget implementation to display button + text and combobox on treewidget. It also turns out that the overall time spent on the setItemWidget function is higher after the 13-line loop.

treeview:

similar to the previous one, the speed of my use of setIndexWidget, did not improve significantly.

treeview + Agent:

Agent combobox, uses the setItemDelegateForColumn function to set up the proxy for the third column, and uses openPersistentEditor to make the proxy work (otherwise combobox does not display). This method is a little faster, but it is still quite different, and openPersistentEditor consumes more time.

generally speaking,

treewidget:setItemWidget takes a long time

treeview: setIndexWidget takes a long time

treeview+delegate:openPersistentEditor takes a long time

I"ve been getting too big with this recently, qt veterans, what to do with this change.

another:

A simple implementation of these three is attached. I hope you will take a look at it and guide me.
https://github.com/liu-wan001.

Mar.13,2021
Menu