Documentation of qt element connect strings

Hi,
where to find the first parameter of connect for Qt GUI elements e.g. qt.QLineEdit(). I am using qt documentation to find them e.g. this one .

In Slicer interactor I tried:

 t = qt.QLineEdit("some text !!")     
 t.show()
 def tChg(self):
       print(t.text)
 t.connect("textChanged(str)", tChg)

but it didn’t work,

It works now, my mistake. I should use QString instead of str as the documentation says.

I actually prefer new-style connections which would be t.textChanged.connect(tChg)

1 Like

Generally speaking, I would also suggest to use more explicit name for slots. Prefer lineEditTextChanged instead of tChg

t.textChanged.connect(tChg)

cool! now I know where to find these events.

I would also suggest to use more explicit name for slots

Sure, a code must be readable.