Efficiently updating a QTableView at high speed

后端 未结 3 1155
萌比男神i
萌比男神i 2021-02-06 07:05

I\'m using a QTableView with a subclass of QItemDelegate to control the look and feel of the tableview\'s cells.

Each cell displays the name and status of a of an extern

3条回答
  •  悲&欢浪女
    2021-02-06 07:32

    It's rare that I suggest this path rather than delegates, but it appears in your situation it might be worth it. I'd consider making my own view, which is aware enough to only update the portions of the screen that need to be updated. A view widget like this is obviously a bit more special-purpose than would usually be the case, but if you really need the efficiency, it's one way to go.

    Other things to consider if you need a small boost in efficiency are making sure you only mark the rows changed that actually change (if the sensor values don't change that often, and are only polled that often) or consider adding a hysteresis value between which it isn't actually redrawn (if the sensor values don't change quickly enough to negate this).

提交回复
热议问题