SWMMVis  6.0.0-alpha.4
Qt6/C++ GIS-based graphical user interface for the SWMMVis engine (6.0.0-alpha.4)
Loading...
Searching...
No Matches
comprehensiveeditorregistry.h File Reference
#include "layers/swmmmodellayer.h"
#include <QHash>
#include <QString>
#include <functional>
Include dependency graph for comprehensiveeditorregistry.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  ComprehensiveEditorRegistry
 Singleton mapping SWMMModelLayer::DataCategory → comprehensive editor metadata + create-new dispatch. More...
 
struct  ComprehensiveEditorRegistry::Entry
 

Detailed Description

Author
Caleb Buahin caleb.nosp@m..bua.nosp@m.hin@g.nosp@m.mail.nosp@m..com
Date
2026
License\n GPL-3.0-or-later

Slice BM.0-Browse-Edit — Single source of truth mapping each non-spatial data category to its comprehensive MVC editor. Consumed by three surfaces that all need the same (has-editor? / gap-tooltip / open-create-new) answer:

  1. ObjectBrowserPanel's category-header "Add New…" context-menu action.
  2. DataObjectPickerEditor's "…" browse button on attribute-panel rows.
  3. A future attribute-panel row right-click "Edit…" menu (Slice BM.0-Browse-Edit step 5; not yet wired).

Replacing the duplicated switch statements in ObjectBrowserPanel and DataObjectPickerEditor with one registry lookup means each future editor slice (BO/BP/BQ/BR) lights up all three surfaces by adding a single registerEditor(...) call rather than touching N call sites.

Lifetime: the registry is a process-wide singleton. Editor entries are layer-agnostic — the OpenCreateFn receives a SWMMModelLayer* per invocation, never captures one. This survives project switches without re-registration.