You don't set different delegates for different node types. When createEditor() is called, you receive the model index which you are about to edit. Based on that determine what node you are dealing with and create a proper editor for it.
...::createEditor(..., ..., index) {
switch(determineTypeFromIndex(index)) {
case someOtherType: return new SomeOtherTypeOfWidget;
// ...
}
}
...::createEditor(..., ..., index) {
switch(determineTypeFromIndex(index)) {
case someType: return new QLineEdit;
case someOtherType: return new SomeOtherTypeOfWidget;
// ...
}
}
To copy to clipboard, switch view to plain text mode
Bookmarks