after calling:

Qt Code:
  1. myTextEdit -> setReadOnly(true);
To copy to clipboard, switch view to plain text mode 

you need to set the flag

Qt Code:
  1. myTextEdit -> setTextInteractionFlags(myTextEdit -> textInteractionFlags() | Qt::TextSelectableByKeyboard);
To copy to clipboard, switch view to plain text mode 

because setReadOnly() doesnt enable that flag