QPlainTextEdit: update internal palette on QEvent::EnabledChange

QEvent::EnabledChange did not update the palette of the internal
QPlainTextEditControl which lead to a wrong text color when the
QPlainTextEdit was disabled e.g. due to a QGroupBox.
Fix it the same way it is done in QTextEdit - set the new palette also
to the internal control when QEvent::EnabledChange is received.

Fixes: QTBUG-80150
Change-Id: Icbeddf3d6cd4877a3d8d4a06b2da69383dd776d2
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
bb10
Christian Ehrlicher 2019-11-26 19:32:21 +01:00
parent 83df5c71e6
commit 925b33bdaa
1 changed files with 1 additions and 0 deletions

View File

@ -2328,6 +2328,7 @@ void QPlainTextEdit::changeEvent(QEvent *e)
d->autoScrollTimer.stop();
} else if (e->type() == QEvent::EnabledChange) {
e->setAccepted(isEnabled());
d->control->setPalette(palette());
d->sendControlEvent(e);
} else if (e->type() == QEvent::PaletteChange) {
d->control->setPalette(palette());