Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
5.3.1
-
None
-
OS X (QMacStyle) and Windows & Linux (QFusionStyle)
-
qtbase#5.3: 5de4ed9db38c7a1a480e5979c2bb3b0340c8a230
Description
Whether the background color is light or dark is tested from QScrollBar's palette, whereas it should be tested from QAbstractScrollArea's palette when feasible.
#include <QtWidgets> class ProxyStyle : public QProxyStyle { public: ProxyStyle() : QProxyStyle(QStyleFactory::create("fusion")) { } int styleHint(StyleHint h, const QStyleOption *o = 0, const QWidget *w = 0, QStyleHintReturn *d = 0) const { if (h == QStyle::SH_ScrollBar_Transient) return 1; return QProxyStyle::styleHint(h, o, w, d); } }; int main(int argc, char *argv[]) { QApplication app(argc, argv); #ifndef Q_OS_MAC app.setStyle(new ProxyStyle); #endif QTextEdit ta; ta.setStyleSheet("QTextEdit { color: #eee; background: #333; }"); for (int i = 0; i < 200; ++i) ta.append(QString::number(i)); ta.show(); return app.exec(); }