Search code examples
pyqtsignals-slotsqthreadqlcdnumber

PYQT GUI Updating und showing a float signal via Qthread on a QLCD display in a second window doesnt work


I'm trying to display a float signal from an ADC via QThread in a secondary window. So first I defined all my signals in a workerThread and emit them. Then I used a slot_method to "catch" the needed signal and send this parameter to a LCD display(QLCDNumber).

In total I have two windows. My major window is a based on Qwidget. In that major window I am opening my second window. This second window contains my lcd display where I would like to see the value of my signal as soon as I push a button to open this window from my major window. The workerThread(Qthread) will be started from the my major windows as well.

I tried to add "self.show()" in the second window, which opened another window where the signal was transmitted and displayed. But I only need one second window. Also I tried to start the workerThread in the second window, which displayed the signal in the QlCDNumber as well. Unfortunuatly this led me to an error in which the working thread was working two times.

Hope you guys understand my problem and can help me.


Solution

  • This can be solved by using a simple method within the second window(child window), which just perform self.show(). And this function should be called when you click on the open-button for this second window. Thats it. Solved.