Okay. Seems you have different data types on different hierarchies on your tree. One option I could see would be to have the item delegate be aware of the models item type. Here are the steps:
(1) Define a new ItemRole e.g enum { TypeRole = Qt::UserRole + 1 };
(2) Define an enums on the types you want to differentiate between
(3) For each tree item set your type with setData(TypeRole, YourType);
(4) Create a CustomItemDelegate and create your editor based on your type (you get an index as a parameter, just ask the index.data(TypeRole).toInt() to get your type back
Not sure how else to transport custom type information from model over to the delegate. Please let me know if this works. Thanks




Reply With Quote

Bookmarks