I have been able to use QCompleter with QLineEdit, but how do I use it with QTextEdit?

According to this and this, it should be possible. But how?

I can probably dig deep into the code and find out, but is there an easy way to do it?

Thanks!