Here is what I need to do.
-I receive log data through a udp connection -I stack relevant data in a qlist -I have a timer running in the main thread that, on timeout, unstacks this data, updates some arrays then calls widget->update -The widget re-implements paintEvent and uses these arrays to draw charts.
What would be the best way to do this in order to not have any bugs.
this task is basically three processes, two of which are done in the main thread
1-I have a qthread that asks for and receives log through udp packets. This thread also stacks the data in a qlist.
2-I have a qtimer that on timeout, unstacks these events, preps the chart arrays and then calls update
3-I have a reimplementation of the paintEvent method on that widget.
I have mutexes to synchronise and protect data. Is this a bad way of doing it? Some suggestion for a "SAFE" way of doing would be appreciated.
On a side note the paintEvent is dont on a customwidget which is inside my mainwindow. I do have a second thread (concurent function) that periodically refreshes some data then emits a signal to update label fields that are outside the custom widget but inside the mainwindow. could this have a bad side effect on everything?