#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 { color: #f1f1f1; background-color: #cc6600; } QAbstractItemView::item:hover, QAbstractItemView::item:alternate:hover { background-color: rgba(204, 102, 0, 0.3); } QAbstractItemView::item { padding: 0.3em 0; } QTreeView::indicator { background-color: #2D2D30; border-color: #3F3F46; width: 15px; height: 15px; border-style: solid; border-width: 1px; } )"); QTreeWidget *w = new QTreeWidget(); w->setAlternatingRowColors(true); QTreeWidgetItem *wa = new QTreeWidgetItem({"a"}), *wb = new QTreeWidgetItem({"b"}), *wc = new QTreeWidgetItem({"c"}); wa->setCheckState(0, Qt::CheckState::Unchecked); wb->setCheckState(0, Qt::CheckState::Unchecked); wc->setCheckState(0, Qt::CheckState::Unchecked); w->addTopLevelItems({wa, wb, wc}); w->show(); return app.exec(); }