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
openswmmvis::ui::StyleEditorRegistry Class Reference

Maps a property-object class name to an editor-widget factory. More...

#include <istyleeditorwidget.h>

Collaboration diagram for openswmmvis::ui::StyleEditorRegistry:

Public Types

using Factory = std::function< IStyleEditorWidget *(QObject *propertyObject, QWidget *parent)>
 

Public Member Functions

void registerFactory (const QString &className, Factory factory)
 
IStyleEditorWidgetcreateEditorFor (QObject *propertyObject, QWidget *parent=nullptr) const
 

Static Public Member Functions

static StyleEditorRegistryinstance ()
 

Detailed Description

Maps a property-object class name to an editor-widget factory.

   The registry is a singleton populated at static-init time by
   editor source files. Lookup is by QObject::metaObject->className.
   Editors can choose to match the most-derived class first; if no
   match, the LayerStyleDialog falls back to the QPropertyModel
   generic tree.

Member Typedef Documentation

◆ Factory

using openswmmvis::ui::StyleEditorRegistry::Factory = std::function<IStyleEditorWidget *(QObject *propertyObject, QWidget *parent)>

Member Function Documentation

◆ createEditorFor()

IStyleEditorWidget * openswmmvis::ui::StyleEditorRegistry::createEditorFor ( QObject *  propertyObject,
QWidget *  parent = nullptr 
) const

Walk the className then its super-classes looking for a match. Returns a newly-constructed editor (caller owns) or nullptr when no factory matches.

◆ instance()

StyleEditorRegistry & openswmmvis::ui::StyleEditorRegistry::instance ( )
static
Here is the caller graph for this function:

◆ registerFactory()

void openswmmvis::ui::StyleEditorRegistry::registerFactory ( const QString &  className,
StyleEditorRegistry::Factory  factory 
)

Register an editor factory for the given className (e.g. "OpenSWMM::Render::PointFeatureSublayerStyle").

Here is the caller graph for this function:

The documentation for this class was generated from the following files: