Normally for QTreeView component, with the code below we will get something like this
QStandardItemModel *model = new QStandardItemModel(this->ui->treeView);
model->setColumnCount(1);
QStandardItem* parentItem = new QStandardItem("Parent Node");
QStandardItem* childItem = new QStandardItem("Child Node");
parentItem->appendRow(childItem);
model->appendRow(parentItem);
this->ui->treeView->setModel(model);
▽ Parent Node
O Circle Node
My question is: are we able to set the parent node icon at right like this without building my own QTreeView class?
Parent Node ▽
O Circle Node
Like using stylesheet or something?
I've tried using setLayoutDirection
or setIndentation
, none of them can do this.