qt-interest@trolltech.com
[Top] [All Lists]

QTreeView item icons

Subject: QTreeView item icons
From: Nick Arini
Date: Fri, 05 Aug 2005 14:57:35 +0100
Hi,

can anyone tell me how to add an icon to a QTreeView using the model/view architecture.

I have tried using model->setData(index, QIcon("image.png"), Qt::DecorationRole) and while this does not cause compiler errors it does not display the icon.

I have modified the simpletreemodel example. so model here is a subclass of QAbstractItemModel.

Thanks for any pointers.

Nick

<Prev in Thread] Current Thread [Next in Thread>