Note that there are some explanatory texts on larger screens.

plurals
  1. POEfficiently updating a QTableView at high speed
    primarykey
    data
    text
    <p>I'm using a QTableView with a subclass of QItemDelegate to control the look and feel of the tableview's cells.</p> <p>Each cell displays the name and status of a of an externally connected device, and as many as 100 devices may be connected at once.</p> <p>The name and type of each device is essentially static, updating very rarely (perhaps once an hour), but each cell needs to display a real time value of the device's input, which I currently poll for every 50 milliseconds. This value is displayed as a basic bar graph drawn by the painter provided to the Delegate::paint() method by the TableView.</p> <p>The problem with updating my model 20 times per second is that the entire table is redrawn each time, which is highly inefficient. Limiting the paint method to only drawing the bar graph shows that the majority of CPU time is dedicated to drawing the name, status and associated image on each cell, rather than the graph.</p> <p>What I need to find is a way to update the graph for each cell regularly without redrawing the cell, but I can't work out how to do it.</p> <p>What is the most efficient way of achieving this?</p> <p><strong>Edit: Image attached to help.</strong></p> <p>Image represents 10 sensors in a QTableView. The Number, Name and Status are virtually static, almost never updating. The bar graph next to the 'Sensor Value' text updates every 50ms. I only want to paint this bar, rather than the text, status and the cell background. The status lights and background are complex images, so take much more CPU time than simply drawing and filling a rect.</p> <p><img src="https://i.stack.imgur.com/GJr3U.png" alt="alt text"></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload