BornAgain
1.19.79
Simulate and fit neutron and x-ray scattering at grazing incidence
|
List model for instruments.
Used e.g. to present the instrument list in the instrument view.
Definition at line 28 of file InstrumentListModel.h.
Public Member Functions | |
InstrumentListModel (QObject *parent, InstrumentsEditController *ec) | |
QModelIndex | addNewDepthProbeInstrument () |
QModelIndex | addNewGISASInstrument () |
QModelIndex | addNewOffspecInstrument () |
QModelIndex | addNewSpecularInstrument () |
QModelIndex | copyInstrument (const InstrumentItem *source) |
QModelIndex | copyInstrument (const QModelIndex &source) |
QVariant | data (const QModelIndex &index, int role=Qt::DisplayRole) const override |
InstrumentItem * | instrumentForIndex (const QModelIndex &index) const |
void | removeInstrument (const QModelIndex &index) |
int | rowCount (const QModelIndex &parent=QModelIndex()) const override |
Private Member Functions | |
template<class Instrument > | |
QModelIndex | addNewInstrument () |
void | onInstrumentNameChanged (const InstrumentItem *instrument) |
Private Attributes | |
QIcon | m_depthProbeIcon |
InstrumentsEditController * | m_ec |
QIcon | m_gisasIcon |
QIcon | m_offspecIcon |
QIcon | m_specularIcon |
InstrumentListModel::InstrumentListModel | ( | QObject * | parent, |
InstrumentsEditController * | ec | ||
) |
Definition at line 55 of file InstrumentListModel.cpp.
References InstrumentsEditController::instrumentNameChanged(), m_depthProbeIcon, m_gisasIcon, m_offspecIcon, m_specularIcon, and onInstrumentNameChanged().
QModelIndex InstrumentListModel::addNewDepthProbeInstrument | ( | ) |
Definition at line 128 of file InstrumentListModel.cpp.
Referenced by InstrumentListView::onNewDepthProbe().
QModelIndex InstrumentListModel::addNewGISASInstrument | ( | ) |
Definition at line 113 of file InstrumentListModel.cpp.
Referenced by InstrumentListView::onNewGisas().
|
private |
Definition at line 163 of file InstrumentListModel.cpp.
References InstrumentsEditController::addInstrument(), InstrumentsEditController::collectedItems(), InstrumentCollection::collectedItems(), m_ec, GUI::RealSpace::Particles::name(), InstrumentsEditController::setInstrumentName(), and InstrumentCollection::suggestInstrumentName().
QModelIndex InstrumentListModel::addNewOffspecInstrument | ( | ) |
Definition at line 118 of file InstrumentListModel.cpp.
Referenced by InstrumentListView::onNewOffspec().
QModelIndex InstrumentListModel::addNewSpecularInstrument | ( | ) |
Definition at line 123 of file InstrumentListModel.cpp.
Referenced by InstrumentListView::onNewSpecular().
QModelIndex InstrumentListModel::copyInstrument | ( | const InstrumentItem * | source | ) |
Definition at line 149 of file InstrumentListModel.cpp.
References InstrumentsEditController::addCopy(), InstrumentsEditController::collectedItems(), InstrumentCollection::collectedItems(), InstrumentItem::instrumentName(), m_ec, and InstrumentCollection::suggestInstrumentName().
QModelIndex InstrumentListModel::copyInstrument | ( | const QModelIndex & | source | ) |
Definition at line 141 of file InstrumentListModel.cpp.
References instrumentForIndex().
Referenced by InstrumentListView::onCopy(), and InstrumentListView::onLoadFromLibrary().
|
override |
Definition at line 77 of file InstrumentListModel.cpp.
References InstrumentsEditController::collectedItems(), InstrumentCollection::collectedItems(), InstrumentItem::instrumentName(), m_depthProbeIcon, m_ec, m_gisasIcon, m_offspecIcon, and m_specularIcon.
InstrumentItem * InstrumentListModel::instrumentForIndex | ( | const QModelIndex & | index | ) | const |
Definition at line 102 of file InstrumentListModel.cpp.
References InstrumentsEditController::collectedItems(), InstrumentCollection::collectedItems(), and m_ec.
Referenced by copyInstrument(), InstrumentListView::currentInstrument(), InstrumentListView::onItemSelectionChanged(), InstrumentListView::onStoreInLibrary(), and removeInstrument().
|
private |
Definition at line 177 of file InstrumentListModel.cpp.
References InstrumentsEditController::collectedItems(), InstrumentCollection::collectedItems(), and m_ec.
Referenced by InstrumentListModel().
void InstrumentListModel::removeInstrument | ( | const QModelIndex & | index | ) |
Definition at line 133 of file InstrumentListModel.cpp.
References instrumentForIndex(), m_ec, and InstrumentsEditController::removeInstrument().
Referenced by InstrumentListView::onRemove().
|
override |
Definition at line 72 of file InstrumentListModel.cpp.
References InstrumentsEditController::collectedItems(), InstrumentCollection::collectedItems(), and m_ec.
Referenced by InstrumentListView::ensureItemSelected().
|
private |
Definition at line 60 of file InstrumentListModel.h.
Referenced by InstrumentListModel(), and data().
|
private |
Definition at line 56 of file InstrumentListModel.h.
Referenced by addNewInstrument(), copyInstrument(), data(), instrumentForIndex(), onInstrumentNameChanged(), removeInstrument(), and rowCount().
|
private |
Definition at line 57 of file InstrumentListModel.h.
Referenced by InstrumentListModel(), and data().
|
private |
Definition at line 58 of file InstrumentListModel.h.
Referenced by InstrumentListModel(), and data().
|
private |
Definition at line 59 of file InstrumentListModel.h.
Referenced by InstrumentListModel(), and data().