Details
-
Bug
-
Resolution: Fixed
-
P2: Important
-
6.3.0
Description
The `QTreeView::indicator` selector does not seem to work in Qt6.
Example:
#include <QApplication>#include <QTreeWidget> int main(int argc, char* argv[]){ QApplication app(argc, argv); app.setStyleSheet(R"( QAbstractItemView { color: #DCDCDC; background-color: #1E1E1E; alternate-background-color: #262626; border-color: #3F3F46; } QAbstractItemView::item:selected,QAbstractItemView::item:selected:hover { background-color: #3399FF; color: #F1F1F1; } QTreeView::indicator { background-color: #2D2D30; border-color: #3F3F46; width: 13px; height: 13px; border-style: solid; border-width: 1px; } QTreeView::indicator { width: 15px; height: 15px; } )"); QTreeWidget *w = new QTreeWidget(); w->setAlternatingRowColors(true); QTreeWidgetItem *wa = new QTreeWidgetItem({"a"}), *wb = new QTreeWidgetItem({"b"}); wa->setCheckState(0, Qt::CheckState::Unchecked); wb->setCheckState(0, Qt::CheckState::Checked); w->addTopLevelItems({wa, wb}); w->show(); return app.exec(); }
The `QCheckBox::indicator` selectors are working as expected, and the `QTreeView::indicator::hover` too. Only the `QTreeView::indicator` and `QTreeView::indicator::checked` are not working.
This was working fine in Qt 5, the attached capture show the difference between Qt5 (style is correct on both checkboxes) and Qt6 (style is only correct for the selected checkbox).
Might be related to QTBUG-1454