Guys, don't overcomplicate things. This is not a task for a delegate, it's a task for the view or its environment. The delegate is responsible for handling one item only, it doesn't interconnect items together in any way. What you want is identical to the Qt::CheckState role in Qt's models. Provide an identical mechanism (involving all the view, delegate and the model) if you can't reuse the check state one. Then connect to the dataChanged() signal in the model (or a custom signal you will emit), track that the change was in this particular role and update the view accordingly. Alternatively implement that directly in the view, without touching the model (like the branching mechanism in QTreeView is implemented) - that would be an even better solution.
Bookmarks