a question about visualizing cursor in read-only QTextEdit
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?
Re: a question about visualizing cursor in read-only QTextEdit
If you just want to filter key events, either use a sub-classes QTestEdit or an event filter on a QTextEdit. That way you can keep it editable.
Another way to validate user input is to use a QValidator.
Re: a question about visualizing cursor in read-only QTextEdit
Thanks.
But it still seems that a visual cursor in a read only editor is the way to fit my requirement. I know Java can do it.
Re: a question about visualizing cursor in read-only QTextEdit
Quote:
Originally Posted by
kennyxing
Thanks.
But it still seems that a visual cursor in a read only editor is the way to fit my requirement. I know Java can do it.
And Qt can do it too. You've just been told how to solve this problem.