I have a realtime chart along with other objects like rectangles and other shapes.
I receive the data via web-sockets, and on receiving the data I update the chart and the rectangles as well.
Frequency of receiving the data is every second. So every second I receive data and I update the chart and objects accordingly.
My websocket is running on a QThread and on receiving the data ->> I do the calculations and I send a signal to the main thread to render.So practically it renders every second.
The mechanism how I am updating?
Line Chart- On receiving the data I am simply calling
addDataon the graph and adding the delta.
Rectangles-> I am creating 600-700 rectangles every second and asking the application to render.
Since qcustomplot is more like a canvas, for every render it destroys all the items and renders the again, therefore I am recreating the rectangles every second.
There is about 8-9 hours of line chart data . Also there are about 500-700 rectangles on the screen.
The problem is the application is hanging/the mouse pointer is stuck and the rendering is not so real time as the window of the application is stuck as well.
Am I doing the right way to update?
Why is my application hanging? Is the data too much for the UI to render?
Note- I am using a macbook pro, which has plenty of cores of computing power, so I guess my hardware capability is not an issue here.