Actually there's no need at all to store the pointer of the widget or the size hint etc...
Just use the model index in the sizeHint to get the needed data.
Qt Code:
QSize CheckBoxDelegate::sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index ) const { CheckBoxDelegateWidget *editor = new CheckBoxDelegateWidget(index.data(...)); return editor->sizeHint(); }To copy to clipboard, switch view to plain text mode
Bookmarks