1

I am making a component based on QPlainTextEdit. I would like to make portions of text readonly (but still allow selections, navigations and clipboard etc).

I can detect the keypress event and suppress it but I need a condition to do this on. Is there a way to block edits without having to check for different keys, combinations etc (that might be different on each platform)?

Alan Spark
  • 8,152
  • 8
  • 56
  • 91
  • 2
    Use `QPlainTextEdit::setReadOnly(true);`. User cannot modify text, but can still select, copy, navigate, etc. – bnaecker Mar 12 '16 at 19:22
  • Thanks. I would still like portions of the text to be editable but I suppose I could set it to readonly when the cursor is placed within the part that I want to be readonly and not when anywhere else in the document. – Alan Spark Mar 13 '16 at 20:01

0 Answers0