Skip to content

#144 Change navigation

Jaak Kütt requested to merge feature/144-change-navigation into main

I'm still not happy with this implementation. My main objective was to separate a "selection" from "intent to navigate" since a selection in the model/view framework is very much a separate concept from what we previously had as "selection".

I am struggling with finding a proper way to identify/define the single source of truth for what is considered "an active entity" for a given widget. The current model/view implementation has coupled models and views so tightly that it is hard to draw a line between them - in effect, they are the same object.

Right now everything in this branch should work. The only caveat is that now with the context added there are 4? different ways for a widget to "ask what is active":

  1. Context
  2. TableModel.select_event
  3. TableModel.signals.current_changed
  4. QItemSelectionModel.currentChanged

image

Since ...

Signals from the model inform the view about changes to the data held by the data source. Signals from the view provide information about the user's interaction with the items being displayed.

I would suggest removing the responsibility of emitting "what is current" from the model, views using that model would get that information via shared selection model and other widgets would ask for this information from context. Context change would be emitted from view as a result of user interactions.

Edited by Jaak Kütt

Merge request reports