Delegate erasing text in QTreeView using QStandardItemModel
问题 I'm having some difficulty adding a delegate to my QTreeView. I have added some QStandardItems through a model which works fine, but when I add the delegate, the text is erased and only the icons are visible. This is the code i'm using for my delegate: void SeqNavDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const { if (index.column() == 0 && option.state & QStyle::State_Enabled) { const QIcon icon(QLatin1String(":/SeqNavMenu/images/green.png