I want to set a QTextEdit as read only, but I still want to show the cursor, how do I do that?

Actually, I'm hoping that the QTextEdit receives key event so that only arbitrary set of characters are received and displayed in QTextEdit.That's why I set it as read only and still want the cursor visible. If QTextEdit cannot do that, any other widget can do it?