You did not provide code of the delegate but of the widget used for editing - don't mix those two. The problem here might be that you register the editor for QString and by default the model doesn't contain strings (if it's empty, for example). In your case I'd suggest to subclass the delegate class and reimplement QAbstractItemDelegate::createEditor() to return your widget instead of QLineEdit.
Bookmarks