How do I make my string dynamically updated every time the Text value from a QLineEdit changes? I tried using signals and slots and works fine with QLabel, but not string.
self.lnEditCurrentNS = QtGui.QLineEdit(self) # This is my QLineEdit
my_string = 'none'
self.lnEditCurrentNS.textChanged.connect(self.onSelectedValue)
def onSelectedValue(self):
selectedValue = self.txtEditCurrentNS.displayText()
my_string = selectedValue
Let's say currently lnEditCurrentNS = 'none', then its changed to 'hello'. The value of my_string remains as 'none' instead of getting updated to 'hello'.
The value of lnEditCurrentNS got updated dynamically when the current index of a combobox I have is changed (combobox = 'hello', lnEditCurrentNS = 'hello')
I'm not very familiar with PySide/PyQt so any guidance is highly appreciated. Thanks.