简体   繁体   English

如何使PYQT gui实时获取数据? 被认为是QLCD和Qlabel的对象?

[英]How to make PYQT gui update upon real time data acquasition? The objects considered being QLCD and Qlabel?

I do understand there is way using Threads by emplying Qtimer and yes I do want it to update on a real time basis. 我确实了解通过使用Qtimer可以使用线程,是的,我确实希望它可以实时更新。 I have experienced changing of these object Qlcd and Qlabel upon pushing button how ever i want it to update upon itself. 我在按下按钮时就经历了如何更改这些对象Qlcd和Qlabel的情况,我希望它如何对其自身进行更新。 Any help would be appreciated. 任何帮助,将不胜感激。

Since there was no answer from anyone I went in for digging and figured it out. 由于没有任何人的回答,所以我去挖掘并弄清楚了。

You need to add follwing code segment for repeated execution on a timely basis this helps the GUI update itself periodically for the stored variable data and update Qlable and QLCD widgets. 您需要添加以下代码段以便及时重复执行,这有助于GUI定期针对存储的变量数据进行自身更新并更新Qlable和QLCD小部件。

    self.timer.timeout.connect(QtCore.SIGNAL(self.READ_DATA))
    self.timer.start(51)

This upon trigger yield continus execturion as there is periodic signal generated. 当产生周期性信号时,这种触发后的屈服持续执行。

Note: READ_DATA is the def i have declared in my program. 注意:READ_DATA是我在程序中声明的定义。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM