PlotPyStack / guiqwt

Efficient 2D plotting Python library based on PythonQwt
https://pypi.python.org/pypi/guiqwt
Other
80 stars 20 forks source link

How to update data realtime from another python thread #77

Closed FredericLeuba closed 2 years ago

FredericLeuba commented 6 years ago

Hello,

Thanks for this great package. I'm having difficulty finding how to update curve data on a periodic basis to display realtime data. Calling set_data() tells me I'm not in the right thread. My knowledge is too limited to go further, and I cannot find any clear and straight example to do so. I would be very graceful to get some hints about that issue.

Best regards Fred

PierreRaybaut commented 2 years ago

When updating from another thread, you will have to use the signal/slot features from Qt. This is not specific to guiqwt, this is only related to the fact that you are trying to call directly a method from an object in another thread which is not allowed. If you connect a signal to the method you are trying to call, it will work.