Details
-
Bug
-
Resolution: Fixed
-
P2: Important
-
5.15.13, 6.8.0
-
None
-
-
a77a7c157 (dev), bea1e9f73 (6.8)
Description
With the "windows" style plugin loaded, rendering of QComboBox:selected is incorrect if a border is defined. The result is that text is rendered as white, and the "color:" attribute has no effect.
#include <QtWidgets> int main(int argc, char* argv[]) { QApplication a(argc, argv); a.setStyle("windows"); a.setStyleSheet(R"QSS( * { color: black; background-color: darkgrey; } QComboBox { background-color:white; } QComboBox:selected { background-color: yellow; border: 1px solid magenta; } QPushButton { border: 1px solid gray; } QPushButton:selected { border: 1px solid magenta; } )QSS"); auto* window = new QWidget; auto* cb = new QComboBox(window); cb->insertItems(0, {"Fee", "Fi", "Fo", "Fumm"}); auto* btn = new QPushButton("Button", window); auto* layout = new QVBoxLayout(window); layout->addWidget(cb); layout->addWidget(btn); window->move(qApp->primaryScreen()->geometry().center()); window->show(); return a.exec(); }