|
BornAgain
1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
|
Provides custom editor for ComboProperty with multi-select option. More...
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 | |
| MultiComboPropertyEditor (QWidget *parent=nullptr) | |
| QVariant | editorData () |
| QSize | minimumSizeHint () const |
| QSize | sizeHint () const |
Protected Slots | |
| void | onClickedList (const QModelIndex &index) |
| Processes press event in QComboBox's underlying list view. More... | |
| void | onModelDataChanged (const QModelIndex &, const QModelIndex &, const QVector< int > &) |
| Propagate check state from the model to ComboProperty. More... | |
Protected Member Functions | |
| 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 |
Private Member Functions | |
| bool | eventFilter (QObject *obj, QEvent *event) |
| Handles mouse clicks on QComboBox elements. More... | |
| bool | isClickToExpand (QObject *obj, QEvent *event) const |
| bool | isClickToSelect (QObject *obj, QEvent *event) const |
| void | setConnected (bool isConnected) |
| void | updateBoxLabel () |
| Update text on QComboBox with the label provided by combo property. More... | |
Private Attributes | |
| QComboBox * | m_box |
| QStandardItemModel * | m_model |
| class WheelEventEater * | m_wheel_event_filter |
Provides custom editor for ComboProperty with multi-select option.
Definition at line 28 of file MultiComboPropertyEditor.h.
|
explicit |
Definition at line 46 of file MultiComboPropertyEditor.cpp.
References m_box, m_model, m_wheel_event_filter, and setConnected().
|
signalinherited |
Signal emit then user changed the data through the editor.
Referenced by PropertyWidgetItem::connectEditor(), SessionModelDelegate::createEditor(), and CustomEditor::setDataIntern().
|
inlineinherited |
|
private |
Handles mouse clicks on QComboBox elements.
Definition at line 120 of file MultiComboPropertyEditor.cpp.
References isClickToExpand(), isClickToSelect(), m_box, and onClickedList().
|
protectedvirtual |
Inits editor widgets from m_data.
Reimplemented from CustomEditor.
Definition at line 143 of file MultiComboPropertyEditor.cpp.
References SessionItemUtils::CheckStateRole(), CustomEditor::m_data, m_model, setConnected(), and updateBoxLabel().
|
private |
Definition at line 194 of file MultiComboPropertyEditor.cpp.
References m_box.
Referenced by eventFilter().
|
private |
Definition at line 189 of file MultiComboPropertyEditor.cpp.
References m_box.
Referenced by eventFilter().
| QSize MultiComboPropertyEditor::minimumSizeHint | ( | ) | const |
Definition at line 82 of file MultiComboPropertyEditor.cpp.
References m_box.
|
protectedslot |
Processes press event in QComboBox's underlying list view.
Definition at line 110 of file MultiComboPropertyEditor.cpp.
References m_model.
Referenced by eventFilter().
|
protectedslot |
Propagate check state from the model to ComboProperty.
Definition at line 89 of file MultiComboPropertyEditor.cpp.
References CustomEditor::m_data, m_model, CustomEditor::setDataIntern(), ComboProperty::setSelected(), and updateBoxLabel().
Referenced by setConnected().
|
private |
Definition at line 170 of file MultiComboPropertyEditor.cpp.
References m_model, and onModelDataChanged().
Referenced by MultiComboPropertyEditor(), and initEditor().
|
slotinherited |
Sets the data from the model to editor.
Definition at line 48 of file CustomEditors.cpp.
References CustomEditor::initEditor(), and CustomEditor::m_data.
|
protectedinherited |
Saves the data from the editor and informs external delegates.
Definition at line 60 of file CustomEditors.cpp.
References CustomEditor::dataChanged(), and CustomEditor::m_data.
Referenced by ExternalPropertyEditor::buttonClicked(), BoolEditor::onCheckBoxChange(), ScientificDoublePropertyEditor::onEditingFinished(), DoubleEditor::onEditingFinished(), ScientificSpinBoxEditor::onEditingFinished(), IntEditor::onEditingFinished(), ComboPropertyEditor::onIndexChanged(), and onModelDataChanged().
| QSize MultiComboPropertyEditor::sizeHint | ( | ) | const |
Definition at line 77 of file MultiComboPropertyEditor.cpp.
References m_box.
|
private |
Update text on QComboBox with the label provided by combo property.
Definition at line 183 of file MultiComboPropertyEditor.cpp.
References ComboProperty::label(), m_box, and CustomEditor::m_data.
Referenced by initEditor(), and onModelDataChanged().
|
private |
Definition at line 52 of file MultiComboPropertyEditor.h.
Referenced by MultiComboPropertyEditor(), eventFilter(), isClickToExpand(), isClickToSelect(), minimumSizeHint(), sizeHint(), and updateBoxLabel().
|
protectedinherited |
Definition at line 45 of file CustomEditors.h.
Referenced by ExternalPropertyEditor::buttonClicked(), CustomEditor::editorData(), ExternalPropertyEditor::initEditor(), ScientificDoublePropertyEditor::initEditor(), DoubleEditor::initEditor(), ScientificSpinBoxEditor::initEditor(), IntEditor::initEditor(), BoolEditor::initEditor(), initEditor(), ComboPropertyEditor::internIndex(), ComboPropertyEditor::internLabels(), BoolEditor::onCheckBoxChange(), ScientificDoublePropertyEditor::onEditingFinished(), DoubleEditor::onEditingFinished(), ScientificSpinBoxEditor::onEditingFinished(), IntEditor::onEditingFinished(), ComboPropertyEditor::onIndexChanged(), onModelDataChanged(), CustomEditor::setData(), CustomEditor::setDataIntern(), and updateBoxLabel().
|
private |
Definition at line 54 of file MultiComboPropertyEditor.h.
Referenced by MultiComboPropertyEditor(), initEditor(), onClickedList(), onModelDataChanged(), and setConnected().
|
private |
Definition at line 53 of file MultiComboPropertyEditor.h.
Referenced by MultiComboPropertyEditor().