Posted something about this earlier... but it kinda got lost in the posts... so im posing the question again with a better title haha.
i have written a custom item delegate... but it doesnt seem to work
{
public:
{
}
void MyItemDelegate
::paint(QPainter* painter,
const QStyleOptionViewItem
& option,
const QModelIndex
& index
) const {
QIcon icon
= qvariant_cast<QIcon>
(index.
data(Qt
::DecorationRole));
drawBackground(painter, option, index);
drawDecoration(painter, option, option.rect, icon.pixmap(option.rect.size()));
drawFocus(painter, option, option.rect);
}
};
class MyItemDelegate: public QItemDelegate
{
public:
MyItemDelegate(QObject* pParent = 0) : QItemDelegate(pParent)
{
}
void MyItemDelegate::paint(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index) const
{
QIcon icon = qvariant_cast<QIcon>(index.data(Qt::DecorationRole));
drawBackground(painter, option, index);
drawDecoration(painter, option, option.rect, icon.pixmap(option.rect.size()));
drawFocus(painter, option, option.rect);
}
};
To copy to clipboard, switch view to plain text mode
anyone have any ideas? im real desperate to get this thing working, ive been working on it for days now and i dont know where else to look
Bookmarks