我正在尝试在 lineedit 中显示来自 EPICS(包)的运行时数据。我可以通过我的程序接收和发送我的数据,但是当我无法显示数据时。函数 pv.get() 将 EPICS 中的数据提供给 Python。请建议我进行更改,因为连接中的 SIGNAL 函数给出了错误
import sys
from PyQt4.QtGui import *
from PyQt4.QtCore import *
import epics
from epics import *
class MyFrame(QWidget):
def __init__(self, parent=None):
QWidget.__init__(self)
self.lineedit = QLineEdit(self)
self.lineedit.setGeometry(QRect(250,450,75,28))
pv=epics.PV('calc:sum.VAL')
self.lineedit=pv.get()
self.connect(self.lineedit, SIGNAL("textChanged()"), self.changedata)
self.color = QColor(Qt.blue)
self.show()
def changedata (self):
pv=epics.PV('calc:sum.VAL')
self.lineedit=pv.get()
text=pv.get()
self.update()
app=QApplication(sys.argv)
f=MyFrame()
f.show()
app.exec_()
`