Fix disabled IME when QPlainTextEdit read only property is toggled

Mirror the behavior of working QTextEdit in QPlainTextEdit. The
WA_InputMethodEnabled flag was overridden by the following call
to setTextInteractionFlags().

Task-number: QTBUG-55699
Change-Id: I46402f5d94204acd304d56f488bb0fb342d1a846
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
This commit is contained in:
Jussi Witick 2016-09-02 12:34:44 +03:00 committed by Alex Blasche
parent f286027e6b
commit 47bbc6d6f6

View File

@ -2633,8 +2633,8 @@ void QPlainTextEdit::setReadOnly(bool ro)
} else {
flags = Qt::TextEditorInteraction;
}
setAttribute(Qt::WA_InputMethodEnabled, shouldEnableInputMethod(this));
d->control->setTextInteractionFlags(flags);
setAttribute(Qt::WA_InputMethodEnabled, shouldEnableInputMethod(this));
QEvent event(QEvent::ReadOnlyChange);
QApplication::sendEvent(this, &event);
}