so I'm currently working on a PyQt5 GUI, and as always need to connect some signals to method calls.
Naturally I've looked up a standard syntax to do so and used it throughout my entire project (it's been working so far with more then 20 different signals)
That syntax is: self.widget.signal.connect(lambda x: whatever)
So I recently got to the point of connecting the QPlainTextEdit signal "textChanged()" to one of my methods and it just didn't work. I've tried replacing my method with a simple print(text) but that didn't help. My next step was testing wether another signal of the same widget worked and it did! So now I have the following code:
self.plainTextEdit.textChanged.connect(lambda x: print("testTextChanged"))
self.plainTextEdit.blockCountChanged.connect(lambda x: print("blockCountChanged"))
and the upper signal doesn't trigger, but the lower one does.
I've already read the documentation of QPlainTextEdit, textChanged() should be a valid signal of this class. I've also used the same signal on several QLineEdits within my project.
Does anyone have any suspicion as to why this behaviour is occuring? Maybe I did make an error that I just can't recognize. (I'm trying to trigger the signal by simply typing into the textBox on the GUI, whereas blockCountChanged get's triggered whenever I'm pressing enter while editing it)