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

Description

Base class for all custom variants editors.

Definition at line 29 of file CustomEditors.h.

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
 

Constructor & Destructor Documentation

◆ CustomEditor()

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

Definition at line 32 of file CustomEditors.h.

33  : QWidget(parent)
34  {
35  }

Member Function Documentation

◆ dataChanged

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

Signal emit then user changed the data through the editor.

Referenced by FitParameterDelegate::createEditor(), and setDataIntern().

◆ editorData()

QVariant CustomEditor::editorData ( )
inline

Definition at line 37 of file CustomEditors.h.

37 { return m_data; }
QVariant m_data
Definition: CustomEditors.h:49

References m_data.

◆ initEditor()

void CustomEditor::initEditor ( )
protectedvirtual

Inits editor widgets from m_data.

Reimplemented in ScientificSpinBoxEditor, and ComboPropertyEditor.

Definition at line 48 of file CustomEditors.cpp.

48 {}

Referenced by setData().

◆ setData

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

Sets the data from the model to editor.

Definition at line 40 of file CustomEditors.cpp.

41 {
42  m_data = data;
43  initEditor();
44 }
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 52 of file CustomEditors.cpp.

53 {
54  m_data = data;
56 }
void dataChanged(const QVariant &data)
Signal emit then user changed the data through the editor.

References dataChanged(), and m_data.

Referenced by ScientificSpinBoxEditor::onEditingFinished(), and ComboPropertyEditor::onIndexChanged().

Member Data Documentation

◆ m_data


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