Fix read-only pseudo-state in QPlainTextEdit stylesheet
Was implemented for the other text edit widgets, but not for QPlainTextEdit. Fixes: QTBUG-92490 Change-Id: Idd2a1b5c743fc030d3f2d4dd24e98f806b58f4d9 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit f3a042c5ab998c0d283017f3569bb72c392580b7) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
f3179ec804
commit
7bba5a5fc5
@ -60,6 +60,7 @@
|
||||
#if QT_CONFIG(textedit)
|
||||
#include <qtextedit.h>
|
||||
#endif
|
||||
#include <qplaintextedit.h>
|
||||
#include <private/qwindowsstyle_p.h>
|
||||
#if QT_CONFIG(combobox)
|
||||
#include <qcombobox.h>
|
||||
@ -2106,6 +2107,9 @@ QRenderRule QStyleSheetStyle::renderRule(const QObject *obj, const QStyleOption
|
||||
|
||||
}
|
||||
#endif
|
||||
else if (const QPlainTextEdit *edit = qobject_cast<const QPlainTextEdit *>(obj)) {
|
||||
extraClass |= (edit->isReadOnly() ? PseudoClass_ReadOnly : PseudoClass_Editable);
|
||||
}
|
||||
#if QT_CONFIG(textedit)
|
||||
else if (const QTextEdit *edit = qobject_cast<const QTextEdit *>(obj)) {
|
||||
extraClass |= (edit->isReadOnly() ? PseudoClass_ReadOnly : PseudoClass_Editable);
|
||||
@ -2541,7 +2545,9 @@ static quint64 extendedPseudoClass(const QWidget *w)
|
||||
pc |= (edit->isReadOnly() ? PseudoClass_ReadOnly : PseudoClass_Editable);
|
||||
} else
|
||||
#endif
|
||||
{ } // required for the above ifdef'ery to work
|
||||
if (const QPlainTextEdit *edit = qobject_cast<const QPlainTextEdit *>(w)) {
|
||||
pc |= (edit->isReadOnly() ? PseudoClass_ReadOnly : PseudoClass_Editable);
|
||||
}
|
||||
return pc;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user