BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
CustomEditor Class Reference

Base class for all custom variants editors. More...

Inheritance diagram for CustomEditor:
[legend]
Collaboration diagram for CustomEditor:
[legend]

Public Slots

void setData (const QVariant &data)
 Sets the data from the model to editor. More...
 

Signals

void dataChanged (const QVariant &data)
 Signal emit then user changed the data through the editor. More...
 

Public Member Functions

 CustomEditor (QWidget *parent=nullptr)
 
QVariant editorData ()
 

Protected Member Functions

virtual void initEditor ()
 Inits editor widgets from m_data. More...
 
void setDataIntern (const QVariant &data)
 Saves the data from the editor and informs external delegates. More...
 

Protected Attributes

QVariant m_data
 

Detailed Description

Base class for all custom variants editors.

Definition at line 28 of file CustomEditors.h.

Constructor & Destructor Documentation

◆ CustomEditor()

CustomEditor::CustomEditor ( QWidget *  parent = nullptr)
inlineexplicit

Definition at line 31 of file CustomEditors.h.

31 : QWidget(parent) {}

Member Function Documentation

◆ dataChanged

void CustomEditor::dataChanged ( const QVariant &  data)
signal

Signal emit then user changed the data through the editor.

Referenced by PropertyWidgetItem::connectEditor(), SessionModelDelegate::createEditor(), and setDataIntern().

◆ editorData()

QVariant CustomEditor::editorData ( )
inline

Definition at line 33 of file CustomEditors.h.

33 { return m_data; }
QVariant m_data
Definition: CustomEditors.h:45

References m_data.

◆ initEditor()

void CustomEditor::initEditor ( )
protectedvirtual

Inits editor widgets from m_data.

Reimplemented in MultiComboPropertyEditor, BoolEditor, IntEditor, ScientificSpinBoxEditor, DoubleEditor, ScientificDoublePropertyEditor, ComboPropertyEditor, and ExternalPropertyEditor.

Definition at line 56 of file CustomEditors.cpp.

56 {}

Referenced by setData().

◆ setData

void CustomEditor::setData ( const QVariant &  data)
slot

Sets the data from the model to editor.

Definition at line 48 of file CustomEditors.cpp.

49 {
50  m_data = data;
51  initEditor();
52 }
virtual void initEditor()
Inits editor widgets from m_data.

References initEditor(), and m_data.

Here is the call graph for this function:

◆ setDataIntern()

void CustomEditor::setDataIntern ( const QVariant &  data)
protected

Saves the data from the editor and informs external delegates.

Definition at line 60 of file CustomEditors.cpp.

61 {
62  m_data = data;
64 }
void dataChanged(const QVariant &data)
Signal emit then user changed the data through the editor.

References dataChanged(), and m_data.

Referenced by ExternalPropertyEditor::buttonClicked(), BoolEditor::onCheckBoxChange(), ScientificDoublePropertyEditor::onEditingFinished(), DoubleEditor::onEditingFinished(), ScientificSpinBoxEditor::onEditingFinished(), IntEditor::onEditingFinished(), ComboPropertyEditor::onIndexChanged(), and MultiComboPropertyEditor::onModelDataChanged().

Member Data Documentation

◆ m_data


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