Reputation: 11
I have isolated the slowness of QTableView/QTreeview updates to two places:
QStyledItemDelegate::paint()
Q_EMIT dataChanged()
I have tried many things, making the model's data method do virtually nothing but return a string. The GUI is very crisp when there are few columns, say 10 or less. My end user has huge 2560x1600 monitors and likes to maximze the view which can display over 50 columns and rows and is always complaing about how slow the GUI is. Once the model is fully populated there are no insertions or deletions. All I am doing is emitting dataChanged()
as I get new updates at a reasonable rate, 2 times a second for each row, and about 48-100 row updates a second.
I have tried switching the graphics system to OpenGL this does not help.
dataChanged()
my CPU usage is is about 16%QStyledItemDelegate::paint()
my cpu usage is about 30%Based on these statistics, I believe the slowness is somehow Qt related. Is there a magical setting that will fix this?
Upvotes: 1
Views: 2013
Reputation: 4085
Regarding what you wrote in an answer to my comment an answer is that you should refactor code which emit's dataChanged signals. There is no any sense in issue them more then 2-3 times a second. So you should accumulate changes in some kind of proxy/temporary storage and issue emit dataChanged separately based on timerEvent for example, so you will be guarantee with certain refresh rate without stressing CPU
Upvotes: -1