Sorry about that... sizeHint is a wrong path.
Try overriding QItemDelegate::updateEditorGeometry(...);
Like this:
[COLOR=#8B0000][FONT='Courier New,courier'][I][/I][/FONT][/COLOR]void MyDelegate::updateEditorGeometry( QWidget* editor, const QStyleOptionViewItem &option, const QModelIndex &index )
{
editor->setGeometry( option.rect );
}
[COLOR=#8B0000][FONT='Courier New,courier'][I][/I][/FONT][/COLOR]void MyDelegate::updateEditorGeometry( QWidget* editor, const QStyleOptionViewItem &option, const QModelIndex &index )
{
editor->setGeometry( option.rect );
}
To copy to clipboard, switch view to plain text mode
Using option.rect should resize your editor to fit perfectly into the cell.
Regards
Bookmarks