Using Qt4.8 on Mint Linux 12, I implemented a simple window containing a QTableView
to show the contents of the model. The model data is constantly updated (log messages), and the dataChanged()
signal is emitted regularly (i.e., every 100 ms).
The problem that I see is stuttering visual updates in the table.
I set the event filter in a window that takes into account updateRequest
-type events, which should trigger the widget redrawing (also on child widgets, i.e. tableView
). They enter with an average time of ~ 170 ms between them and a standard deviation of ~ 90 ms (which, I think, is quite large). However, the perceived rate of visual refresh is only two or three times per second, and I wonder why. It seems that not all updateRequest
events cause a widget to be redrawn, or that the window system swallows visual updates.
As a second test, I made the window refresh itself by calling repaint
or update
every 100 ms. Using repaint
, I saw a corresponding increase in events like updateRequest
and a decrease in the standard deviation of spaces; with update
number did not increase. However, in both cases, only a moderate increase in perceived update rate was observed.
Also: Is there a good method for measuring how often a widget is truly repainted without overloading the paintEvent
handler? Maybe something from QTest
?
Update: I expanded the event filter to also catch paintEvent
-type events. There is only a one-bit number of these events in comparison s> 1000 updateRequest
.
source share