Hi,
I have QFileSystemModel and Custom delegate which inherits from QAbstractItemDelegate and inside paint function I try to paint item icon like that
// ICON
QIcon ic
= QIcon(qvariant_cast<QPixmap>
(index.
data(Qt
::DecorationRole)));
r = option.rect.adjusted(2, 2, -2, -2);
ic.paint(painter, r, Qt::AlignVCenter|Qt::AlignLeft);
// ICON
QIcon ic = QIcon(qvariant_cast<QPixmap>(index.data(Qt::DecorationRole)));
r = option.rect.adjusted(2, 2, -2, -2);
ic.paint(painter, r, Qt::AlignVCenter|Qt::AlignLeft);
To copy to clipboard, switch view to plain text mode
but it does nothing, ic.name() return empty string.
Without setting delegate I see "standard" icons provides by QFileSystemModel so problem is in my delegate implementation.
Bookmarks