Details
-
Bug
-
Resolution: Invalid
-
P3: Somewhat important
-
None
-
6.5.2
-
None
Description
In QStyleItemDelegate on line 367 you have assert for invalid index. Maybe it's needed.
But I have a following use case:
void WordWrapItemDelegate::paint( QPainter * painter, const QStyleOptionViewItem & option, const QModelIndex & index ) const { QStyledItemDelegate::paint( painter, option, QModelIndex() ); painter->drawText( option.rect, Qt::AlignLeft | Qt::TextWordWrap | Qt::AlignVCenter, index.data( Qt::DisplayRole ).toString() ); }
As you can see I draw everything with QStyledItemDelegate, but text I draw manually. To draw everything without data I pass QModelIndex() to QStyledItemDelegate:paint(). And in debug build this leads to assert dialog.
Could you clarify your opinion to dissallow invoke paint() method with invalid index in QStyledItemDelegate?
My use case, as I guess, is very common...