문제

I Need to check if the value of a lineEdit in PyQt4 changed, if this value is changed I Need to Trigger a Slot. My code:

self.connect(self.ui.lineEdit, QtCore.SIGNAL("textChanged (QString & text"), self.sync_lineEdit)

Nothing happend if I Change the value in the GUI. Any idea how to fix this Problem?

Kind regards;

도움이 되었습니까?

해결책

Try simple connect:

self.ui.lineEdit.textChanged.connect(self.sync_lineEdit)
...

def sync_lineEdit(self, text):
    print text

This should work fine

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top