#include #include 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(); }