LANG/Python
[pyqt5] timer.timeout ์ผ์๋ stop()ํด๋ ๋ฉ์ถ์ง ์๋๋ค
timer.timeout ์ผ์๋ stop()ํด๋ ๋ฉ์ถ์ง ์์์ ๊ณจ์ด ์ํ ๋ค. timeout ์๊ทธ๋์ 1์ด๋ง๋ค ๋ฐ์ํ๊ฒ ์ค๋ช
ํ์ฌ ์ฌ์ฉํ๋ค๊ฐ ์๊ทธ๋์ด ๋ฐ์๋๊ณ 1์ด๊ฐ ๋๊ธฐ ์ ์ stop() ๋ฉ์๋๋ก ๋ฉ์ถฐ๋ connect๋ ์ฌ๋กฏ์ ํธ์ถํ๋ค. ์์ ๋ฉ์ถ๊ณ ์ถ๋ค๋ฉด ์ฐ๊ฒฐ๋ ์ฌ๋กฏ์ disconnect ํด์ค์ผ ํ๋ค. # ์์ํ ๋ self.comStatus.start() self.timer.timeout.connect(self.counter) self.timer.start(1000) # ๋ฉ์ถ๊ณ ์ถ์๋ self.timer.timeout.disconnect(self.counter) self.timer.stop()
2023. 7. 6. 15:21
์ต๊ทผ๋๊ธ