[Interest] QItemDelegate with custom edit widget

Etienne Sandré-Chardonnal etienne.sandre at m4x.org
Tue Dec 10 11:19:13 CET 2013


Dear all,

I have a "scientific double spinbox" which works well standalone, when
inserted in dialogs and layouts.

I would like to use it with a custom QItemDelegate for a table view. I
return it with createEditor and also subclassed the setEditorData and
setModelData accordingly

When I double click on the table cell, my widget is created and displayed
correctly, in non-edit mode. Normally, a click on it triggers the edit. But
in the table, the editor disappears when I click it. Any idea why? My
widget handles click events and always accepts the event.

I tested returning a QDoubleSpinBox instead, and this works. Additionally,
it opens in editing state. Why?

I have set my widget focus policy to StrongFocus as suggested in the doc,
but there is very little details about how to implement this.

Thanks,

Etienne
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20131210/120e8ac2/attachment.html>


More information about the Interest mailing list