BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
ModelView::AbstractEditorFactory Class Referenceabstract

Abstract editor factory for ViewModelDelegate. More...

Inheritance diagram for ModelView::AbstractEditorFactory:
[legend]
Collaboration diagram for ModelView::AbstractEditorFactory:
[legend]

Public Member Functions

virtual std::unique_ptr< CustomEditorcreateEditor (const QModelIndex &index) const =0
 

Protected Member Functions

EditorBuilders::builder_t findBuilder (const std::string &name) const
 
void registerBuilder (const std::string &name, EditorBuilders::builder_t builder)
 

Protected Attributes

std::map< std::string, EditorBuilders::builder_tm_nameToBuilderMap
 

Detailed Description

Abstract editor factory for ViewModelDelegate.

Creates cell editors for Qt trees and tables from model index. Cell editor is Qt widget intended for editing DATA role of some SessionItem.

Definition at line 32 of file defaulteditorfactory.h.

Member Function Documentation

◆ createEditor()

virtual std::unique_ptr<CustomEditor> ModelView::EditorFactoryInterface::createEditor ( const QModelIndex &  index) const
pure virtualinherited

◆ findBuilder()

EditorBuilders::builder_t AbstractEditorFactory::findBuilder ( const std::string &  name) const
protected

Definition at line 43 of file defaulteditorfactory.cpp.

44 {
45  auto it = m_nameToBuilderMap.find(name);
46  return it != m_nameToBuilderMap.end() ? it->second : EditorBuilders::builder_t();
47 }
std::map< std::string, EditorBuilders::builder_t > m_nameToBuilderMap
std::function< editor_t(const SessionItem *)> builder_t
QString const & name(EShape k)
Definition: particles.cpp:21

References m_nameToBuilderMap, and RealSpace::Particles::name().

Referenced by ModelView::VariantDependentEditorFactory::createEditor(), and ModelView::RoleDependentEditorFactory::createItemEditor().

Here is the call graph for this function:

◆ registerBuilder()

void AbstractEditorFactory::registerBuilder ( const std::string &  name,
EditorBuilders::builder_t  builder 
)
protected

Definition at line 37 of file defaulteditorfactory.cpp.

39 {
40  m_nameToBuilderMap[name] = std::move(builder);
41 }

References m_nameToBuilderMap, and RealSpace::Particles::name().

Referenced by ModelView::RoleDependentEditorFactory::RoleDependentEditorFactory(), and ModelView::VariantDependentEditorFactory::VariantDependentEditorFactory().

Here is the call graph for this function:

Member Data Documentation

◆ m_nameToBuilderMap

std::map<std::string, EditorBuilders::builder_t> ModelView::AbstractEditorFactory::m_nameToBuilderMap
protected

Definition at line 37 of file defaulteditorfactory.h.

Referenced by findBuilder(), and registerBuilder().


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