PDA

View Full Version : closeEditor on QTreeView



abiliojr
8th February 2013, 01:26
I'm using a custom QTreeView class in order to extend the original. One of the features I want to include in my program is that if the user asks for a new element inside the tree, it goes automatically in edition mode... that's done. But then, I want to check if the user actually wrote new text on it, because if he left the default "type new element here" and exited the editor field, the item is automatically deleted.

I've found the function closeEditor and I've overridden it. And yeah, it fires when the editor closes... but the parameter that comes into the function is a QWidget * ... and in order to delete it I believe I need to get the index of the element or something like that...

I've searched a lot around, but I guess that I've been missing something...

Any ideas?

wysota
8th February 2013, 08:42
currentIndex() should be pointing to the edited cell.