do you mean how to set an icon in QTreeView or QTreeWidget?
for QTreeView use this method
bool QAbstractItemModel::setData ( const QModelIndex & index, const QVariant & value, int role = Qt::EditRole )
example
...
model()->setData
(index,
QIcon(fileName
), Qt
::DecorationRole);
...
...
model()->setData(index, QIcon(fileName), Qt::DecorationRole);
...
To copy to clipboard, switch view to plain text mode
for QTreeWidget
...
item
->setIcon
(column,
QIcon(fileName
));
...
...
QTreeWidgetItem *item = new QTreeWidgetItem();
item->setIcon(column, QIcon(fileName));
...
To copy to clipboard, switch view to plain text mode
Bookmarks