summaryrefslogtreecommitdiffstats
path: root/src/widgets/styles/qstylesheetstyle.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/widgets/styles/qstylesheetstyle.cpp')
-rw-r--r--src/widgets/styles/qstylesheetstyle.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/widgets/styles/qstylesheetstyle.cpp b/src/widgets/styles/qstylesheetstyle.cpp
index 6d3a9fcfeb..e7662ba5c6 100644
--- a/src/widgets/styles/qstylesheetstyle.cpp
+++ b/src/widgets/styles/qstylesheetstyle.cpp
@@ -57,6 +57,9 @@
#if QT_CONFIG(lineedit)
#include <qlineedit.h>
#endif
+#if QT_CONFIG(textedit)
+#include <qtextedit.h>
+#endif
#include <private/qwindowsstyle_p.h>
#if QT_CONFIG(combobox)
#include <qcombobox.h>
@@ -2103,6 +2106,11 @@ QRenderRule QStyleSheetStyle::renderRule(const QObject *obj, const QStyleOption
}
#endif
+#if QT_CONFIG(textedit)
+ else if (const QTextEdit *edit = qobject_cast<const QTextEdit *>(obj)) {
+ extraClass |= (edit->isReadOnly() ? PseudoClass_ReadOnly : PseudoClass_Editable);
+ }
+#endif
#if QT_CONFIG(lineedit)
// LineEdit sets Sunken flag to indicate Sunken frame (argh)
if (const QLineEdit *lineEdit = qobject_cast<const QLineEdit *>(obj)) {
@@ -2528,6 +2536,11 @@ static quint64 extendedPseudoClass(const QWidget *w)
pc |= (edit->isReadOnly() ? PseudoClass_ReadOnly : PseudoClass_Editable);
} else
#endif
+#if QT_CONFIG(textedit)
+ if (const QTextEdit *edit = qobject_cast<const QTextEdit *>(w)) {
+ pc |= (edit->isReadOnly() ? PseudoClass_ReadOnly : PseudoClass_Editable);
+ } else
+#endif
{ } // required for the above ifdef'ery to work
return pc;
}