In Qt, the GUI application usually consists of one main window which contains several views/widgets.
It is very common to provide a context menu which contains
- Add
- Remove
- Clear
etc. for a item list view.
If I implements the context menu in the view, in many cases, the view should know the model which makes me think that the design is bad.
If I implements the context menu in the main window, the main window code bloats very quickly when many views exist. This also makes me think that this is bad choice.
Where should I put the code for context menu? in view? or in main window?