I wanted to do the same thing and couldn't find a straight answer about it anywhere on the web. But something led me to try setTextInteractionFlags() and I had some luck with that, so I'll post this here in case it's useful to anyone else. It seems you can get a readonly QTextEdit with a visible cursor (albeit one that doesn't blink, at least on Windows) by doing this:
myTextEdit.setTextInteractionFlags(myTextEdit.textInteractionFlags() | Qt::TextSelectableByKeyboard);
myTextEdit.setTextInteractionFlags(myTextEdit.textInteractionFlags() | Qt::TextSelectableByKeyboard);
To copy to clipboard, switch view to plain text mode
By default after you do
myTextEdit->setReadOnly(true);
myTextEdit->setReadOnly(true);
To copy to clipboard, switch view to plain text mode
the text interaction flags are set to simply Qt::TextSelectableByMouse, so you could also just use
myTextEdit.setTextInteractionFlags(Qt::TextSelectableByMouse | Qt::TextSelectableByKeyboard);
myTextEdit.setTextInteractionFlags(Qt::TextSelectableByMouse | Qt::TextSelectableByKeyboard);
To copy to clipboard, switch view to plain text mode
Bookmarks