How to set BG color for Tree item.
-
In my TreeView i can scroll to any Item using ScrollTo
TreeModel* myModel = qobject_cast<TreeModel*>(currentTreeView->model()); QModelIndex indexTreeItem = myModel->indexForTreeItem(item); elementTreeView->setCurrentIndex(indexTreeItem); elementTreeView->scrollTo(indexTreeItem); How can i set the BG color of the item that i scroll to , currently it is in light color i want it to be more dark. -
In my TreeView i can scroll to any Item using ScrollTo
TreeModel* myModel = qobject_cast<TreeModel*>(currentTreeView->model()); QModelIndex indexTreeItem = myModel->indexForTreeItem(item); elementTreeView->setCurrentIndex(indexTreeItem); elementTreeView->scrollTo(indexTreeItem); How can i set the BG color of the item that i scroll to , currently it is in light color i want it to be more dark.@summit See "Customizing QTreeView" in https://doc.qt.io/qt-6/stylesheet-examples.html
Especially QTreeView::item:selected part. -
S summit has marked this topic as solved on
-
@summit See "Customizing QTreeView" in https://doc.qt.io/qt-6/stylesheet-examples.html
Especially QTreeView::item:selected part.