PDA

View Full Version : QItemEditorFactory and QStyledDelegate



Qtonimo
1st October 2012, 15:26
Hi guys.
I have one question about QTableView and Model/View Programming...Is it right that the method createEditor of QStyledDelegate does nothing, if I set a default factory for each datatype in the view?



QItemEditorFactory::setDefaultFactory(factory);


And is it right that QItemEditorFactory is just a smarter attempt of creating different editors for types, than having a couple of if-condition in QStyledDelegate::createEditor for each type?

thanks

Qtonimo
1st October 2012, 18:51
No ideas? :(
I don't understand the sense of QItemEditorFactory, if I have a custom QStyledItemDelegate with implemented method createEditor...

http://www.qtcentre.org/threads/10363-QItemEditorFactory-and-custom-Model

this thread explains it a bit, but I would be very happy, if someone can share a bright explanation...