I'm overwriting some events in PyQT QTextEdit, for example:
class myTextEditor(QTextEdit):
def keyPressEvent(self,e):
print 'key pressed'
return super(myTextEditor, self).keyPressEvent(e)
Howewer, the changeEvent, documented here, doesn't seem to work. Here's my code
def changeEvent(self,e):
print 'change'
return super(myTextEditor, self).changeEvent(e)
There's no error but the event isn't processed.
Any ideas how to use a changeEvent (when the text is changed) in PyQt for a QTextEdit ?
changeEvent
is not related to changing text edit's content. It addresses only general QWidget state changes. See this page to get the list of events related to this method.
You should connect to the QTextEdit::textChanged()
signal to track text changes.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With