Hi
I am implementing a Item Delegate for my tree based model.
I need to create a different editor depending upon the item being edited.
At the moment I am using switch statements to decide which editor to supply, but as my model grows so do the switch statements.
Qt Code:
QWidget* editor; switch (index.model()->parent(index).row()) { case 0: { switch (index.row()) { case 0: case 1: { } break; case 2: { QStringList list; Common::Enumerations::surveyUnits().getDisplayStrings(list); } break; } } break; case 1: { } break; } return editor;To copy to clipboard, switch view to plain text mode
Is there a better way to achieve this?
TIA
Bookmarks