Just set, for example, two columns in a QTreeWidget, and then set the text in the first and the icon in the second:
QTreeWidgetItem *newItem = new QTreeWidgetItem;
newItem->setText(0, "Something");
newItem->setIcon(1, QIcon("Path to your icon"));
myTreeWidget->addTopLeveItem(newItem);
Or add a settings icon, which you can simply set in the foreground:
newItem->setForeground(QBrush(QPixmap("Path to your image")));
what could be better for your problem.
source
share