Python Forum
Updating inside Qthread - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: GUI (https://python-forum.io/forum-10.html)
+--- Thread: Updating inside Qthread (/thread-29594.html)



Updating inside Qthread - GMCobraz - Sep-11-2020

Dear all,

I have a question about how to update the value inside qthread?
As the code below, I faced difficulty to update parallel_config and series_config value.
I did connect those emitted signals in the main GUI.
The signals seems like update after, and I wish those values update before abc and efg.

Anyone got any idea?

Thanks.

from PySide2.QtCore import QThread, Signal


class DataViewTask(QThread):
    sig_parallel = Signal(int)
    sig_series = Signal(int)

        if self.parallel_config.value() == 1 or self.series_config.value() == 1:
            parallel_int = int(df.iat[0, 6])
            self.sig_parallel.emit(parallel_int)
            series_int = int(df.iat[1, 6])
            self.sig_series.emit(series_int)
        else:
            parallel_int = self.parallel_config.value()
            self.sig_parallel.emit(parallel_int)
            series_int = self.series_config.value()
            self.sig_series.emit(series_int)

        abc = self.parallel_config.value()
        efg = self.series_config.value()