<div dir="ltr"><div dir="ltr"><div dir="ltr"><div style="font-family:tahoma,sans-serif"><br class="gmail-Apple-interchange-newline"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">One thing I didn't like/expect: your Qt reply is that same as at the forum (so I accept that's the way to do it now), you use the <font face="monospace,monospace">QStyledItemDelegate </font>to get the item being edited (from the <font face="monospace,monospace">QIndex</font> parameter), I expected that to be doable in the <font face="monospace,monospace">QListWidget </font>class by (somehow) it knowing which item was being edited instead, but it seems that's not the case.</blockquote></div><div dir="ltr"><br></div><div dir="ltr">Well, theoretically you could implement the <font face="monospace, monospace">edit()</font> virtual protected method (not the slot) of QAbstractItemView instead, but then you'll have to check that the trigger matches the current editTriggers and, possibly, the relative QEvent which can sometimes be a bit tricky if you are not really careful. Take a look at the Qt sources of edit() of both QAbstractItemView and QListWidget as a reference.<br>I read your original question again, and maybe it's better to just reimplement edit() in your case; there also is the virtual protected slot <font face="monospace, monospace">closeEditor()</font> that can help with what you need. If the reimplementations are not too complex, it might help you completely avoid the QStyledItemDelegate at all.<br>In any case, the index->item conversion is always required, and it's what QListWidget actually does anyway.<br><div><br></div><div>Maurizio</div><div><br></div><div>PS: as a suggestion, it's better to specify keypoints even when referring to an existing question online: I read that forum message this morning, but when I answered I forgot about the actual purpose of your code, then I just focused on the PyQt questions. While that "was" your question, the original one was focused on a slightly different objective, making this thread more like an XY-Problem, since you could probably avoid the delegate implementation.</div><div></div></div></div><div><br></div><div><br></div>-- <br><div dir="ltr" class="gmail_signature">È difficile avere una convinzione precisa quando si parla delle ragioni del cuore. - "Sostiene Pereira", Antonio Tabucchi<br><a href="http://www.jidesk.net" target="_blank">http://www.jidesk.net</a></div></div></div>