Hi,

have my own model that holds my own custom datatype in a custom role. Now I want to display the content of the model in an item view (QTableView). I read about Delegates, but I have a problem to use them correctly.

I wrote a delegate that creates a custom editor widget for my datatype using createEditor()/setEditorData().

This works, but the custom editor widget is only displayed when I doubleclick a cell to start editing.

I also want to use my custom editor widget for normal display of the items, but there is no "createViewer()" like method in QStyledItemDelegate. It seems that I have to override the paint() method of the delegate in order to influence the display of my items. But now, I'm lost. How can I get Qt to render my custom display widget in the paint() method of the delegate?