Make the output window readonly, but still keyboard friendly

There is no point to change the application output content most
probably it was enable to allow text selection using the keyboard.

  This change is needed to enable output filters, which can't use the
existing content from the output windows because they might be already
filtered.

Change-Id: Ia272143a3a0b085544ee9cd550a4ad4800e3f4dd
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
This commit is contained in:
BogDan Vatra
2016-10-10 15:49:19 +03:00
parent b15a0eb93a
commit 3080d0d9e7

View File

@@ -68,6 +68,8 @@ QPlainTextEdit *OutputFormatter::plainTextEdit() const
void OutputFormatter::setPlainTextEdit(QPlainTextEdit *plainText) void OutputFormatter::setPlainTextEdit(QPlainTextEdit *plainText)
{ {
plainText->setReadOnly(true);
plainText->setTextInteractionFlags(plainText->textInteractionFlags() | Qt::TextSelectableByKeyboard);
d->plainTextEdit = plainText; d->plainTextEdit = plainText;
d->cursor = plainText ? plainText->textCursor() : QTextCursor(); d->cursor = plainText ? plainText->textCursor() : QTextCursor();
initFormats(); initFormats();