View Full Version : QTreeView Delegate

22nd June 2009, 18:11

I've created an own model that is displayed on a QTreeView. Now I want to use a delegate to let the data be modified.
The application shows the tree perfectly until I set the delegate to the view. Then nothing is showed(no items into the tree).

To create my own delegate I used the "spinboxdelegate" delegate class with some modeifications. I've inserted breakpoints on all functions on the delegate class but they are never called so I don't know where is the problem.

Anoyone had the same problem?


23rd June 2009, 06:23
Can we see some code ? Delegate code and how it is being set ?

23rd June 2009, 07:05
once i forgot to put the "const" at the end of virtual functions... they were never called.. but in a different compiler they were working...

23rd June 2009, 10:10

Sorry, I did a mistake. I create the delegate in the mainWindow constructor to try it but I forget to create it as pointer instead of variable. So when the constructor call is finish, the delegate is deleted.