BornAgain
1.19.79
Simulate and fit neutron and x-ray scattering at grazing incidence
|
A model extension for InstrumentsTreeModel which.
Definition at line 61 of file InstrumentLibraryEditor.h.
Public Types | |
enum | InstrumentType { None = 0x0 , Gisas = 0x1 , Offspec = 0x2 , Specular = 0x4 , DepthProbe = 0x8 , All = Gisas | Offspec | Specular | DepthProbe } |
Public Member Functions | |
TreeModel (QObject *parent, InstrumentCollection *model) | |
int | columnCount (const QModelIndex &parent=QModelIndex()) const override |
QVariant | data (const QModelIndex &index, int role) const override |
void | enableEmptyHeadlines (bool b) |
Qt::ItemFlags | flags (const QModelIndex &index) const override |
QModelIndex | index (int row, int column, const QModelIndex &parent=QModelIndex()) const override |
QModelIndex | indexForItem (InstrumentItem *item) const |
QModelIndex | indexOfHeadline (InstrumentType type) const |
bool | isHeadline (const QModelIndex &index) const |
InstrumentItem * | itemForIndex (const QModelIndex &index) const |
QModelIndex | parent (const QModelIndex &index) const override |
void | refreshAfterModelChange () |
void | removeItem (InstrumentItem *item) |
int | rowCount (const QModelIndex &parent=QModelIndex()) const override |
bool | setData (const QModelIndex &index, const QVariant &value, int role) override |
void | setNewInstrument (InstrumentItem *addedInstrument) |
Set the instrument which shall have a "NEW" sign in its icon. More... | |
void | setTypeEnabled (InstrumentType type, bool b) |
InstrumentItem * | topMostItem () const |
The topmost visible item. Can be null of course. More... | |
Static Public Member Functions | |
static InstrumentType | instrumentType (InstrumentItem *item) |
Private Member Functions | |
void | clear () |
QVector< InstrumentItem * > | instruments (InstrumentType type) const |
QList< InstrumentType > | visibleTypes () const |
Private Attributes | |
bool | m_enableEmptyHeadlines |
InstrumentCollection * | m_model = nullptr |
bool | m_namesAreEditable |
InstrumentItem * | m_newInstrument = nullptr |
VisibleInstrumentTypes | m_visibleTypes |
|
inherited |
Enumerator | |
---|---|
None | |
Gisas | |
Offspec | |
Specular | |
DepthProbe | |
All |
Definition at line 29 of file InstrumentsTreeModel.h.
InstrumentLibraryEditor::TreeModel::TreeModel | ( | QObject * | parent, |
InstrumentCollection * | model | ||
) |
Definition at line 269 of file InstrumentLibraryEditor.cpp.
|
privateinherited |
Definition at line 63 of file InstrumentsTreeModel.cpp.
|
overrideinherited |
Definition at line 163 of file InstrumentsTreeModel.cpp.
|
override |
Definition at line 280 of file InstrumentLibraryEditor.cpp.
References InstrumentsTreeModel::data().
|
inherited |
Definition at line 32 of file InstrumentsTreeModel.cpp.
References InstrumentsTreeModel::m_enableEmptyHeadlines.
Referenced by InstrumentLibraryEditor::InstrumentLibraryEditor().
|
overrideinherited |
Definition at line 258 of file InstrumentsTreeModel.cpp.
References InstrumentsTreeModel::index(), InstrumentsTreeModel::isHeadline(), and InstrumentsTreeModel::m_namesAreEditable.
|
overrideinherited |
Definition at line 132 of file InstrumentsTreeModel.cpp.
References InstrumentsTreeModel::indexOfHeadline(), InstrumentsTreeModel::instruments(), InstrumentsTreeModel::parent(), and InstrumentsTreeModel::visibleTypes().
Referenced by InstrumentsTreeModel::data(), InstrumentsTreeModel::flags(), InstrumentsTreeModel::isHeadline(), InstrumentsTreeModel::itemForIndex(), InstrumentsTreeModel::parent(), InstrumentsTreeModel::removeItem(), and InstrumentsTreeModel::setData().
|
inherited |
Definition at line 300 of file InstrumentsTreeModel.cpp.
References InstrumentsTreeModel::instruments(), and InstrumentsTreeModel::visibleTypes().
Referenced by InstrumentLibraryEditor::execAdd(), and InstrumentsTreeModel::removeItem().
|
inherited |
Definition at line 120 of file InstrumentsTreeModel.cpp.
References InstrumentsTreeModel::visibleTypes().
Referenced by InstrumentsTreeModel::data(), InstrumentsTreeModel::index(), InstrumentsTreeModel::parent(), and InstrumentsTreeModel::rowCount().
|
privateinherited |
Definition at line 87 of file InstrumentsTreeModel.cpp.
References InstrumentsTreeModel::DepthProbe, InstrumentsTreeModel::Gisas, InstrumentCollection::instrumentItems(), InstrumentsTreeModel::m_model, InstrumentsTreeModel::Offspec, and InstrumentsTreeModel::Specular.
Referenced by InstrumentsTreeModel::index(), InstrumentsTreeModel::indexForItem(), InstrumentsTreeModel::parent(), InstrumentsTreeModel::rowCount(), InstrumentsTreeModel::topMostItem(), and InstrumentsTreeModel::visibleTypes().
|
staticinherited |
Definition at line 331 of file InstrumentsTreeModel.cpp.
References InstrumentsTreeModel::DepthProbe, InstrumentsTreeModel::Gisas, InstrumentItem::is(), InstrumentsTreeModel::None, InstrumentsTreeModel::Offspec, and InstrumentsTreeModel::Specular.
Referenced by InstrumentsTreeModel::data(), and InstrumentLibraryEditor::execAdd().
|
inherited |
Definition at line 323 of file InstrumentsTreeModel.cpp.
References InstrumentsTreeModel::index().
Referenced by InstrumentsTreeModel::data(), InstrumentsTreeModel::flags(), and InstrumentLibraryEditor::getOverlayActions().
|
inherited |
Definition at line 292 of file InstrumentsTreeModel.cpp.
References InstrumentsTreeModel::index().
Referenced by InstrumentLibraryEditor::createWidgetsForCurrentInstrument(), InstrumentsTreeModel::data(), InstrumentLibraryEditor::getOverlayActions(), InstrumentLibraryEditor::onCurrentChangedForChoose(), InstrumentLibraryEditor::onInstrumentChangedByEditor(), InstrumentLibraryEditor::onItemDoubleClickedForChoose(), InstrumentsTreeModel::parent(), and InstrumentsTreeModel::setData().
|
overrideinherited |
Definition at line 147 of file InstrumentsTreeModel.cpp.
References InstrumentsTreeModel::index(), InstrumentsTreeModel::indexOfHeadline(), InstrumentsTreeModel::instruments(), InstrumentsTreeModel::itemForIndex(), and InstrumentsTreeModel::visibleTypes().
Referenced by InstrumentsTreeModel::index(), and InstrumentsTreeModel::rowCount().
|
inherited |
Definition at line 50 of file InstrumentsTreeModel.cpp.
|
inherited |
Definition at line 312 of file InstrumentsTreeModel.cpp.
References InstrumentsTreeModel::index(), InstrumentsTreeModel::indexForItem(), InstrumentsTreeModel::m_model, and InstrumentCollection::removeInstrument().
Referenced by InstrumentLibraryEditor::getOverlayActions().
|
overrideinherited |
Definition at line 168 of file InstrumentsTreeModel.cpp.
References InstrumentsTreeModel::indexOfHeadline(), InstrumentsTreeModel::instruments(), InstrumentsTreeModel::parent(), and InstrumentsTreeModel::visibleTypes().
|
overrideinherited |
Definition at line 272 of file InstrumentsTreeModel.cpp.
References InstrumentsTreeModel::index(), InstrumentsTreeModel::itemForIndex(), InstrumentItem::setDescription(), and InstrumentItem::setInstrumentName().
Referenced by InstrumentLibraryEditor::onInstrumentDescriptionEdited(), and InstrumentLibraryEditor::onInstrumentNameEdited().
void InstrumentLibraryEditor::TreeModel::setNewInstrument | ( | InstrumentItem * | addedInstrument | ) |
Set the instrument which shall have a "NEW" sign in its icon.
Definition at line 275 of file InstrumentLibraryEditor.cpp.
Referenced by InstrumentLibraryEditor::execAdd().
|
inherited |
Definition at line 41 of file InstrumentsTreeModel.cpp.
References InstrumentsTreeModel::m_visibleTypes.
Referenced by InstrumentLibraryEditor::execAdd(), InstrumentLibraryEditor::setDepthProbeEnabled(), InstrumentLibraryEditor::setGisasEnabled(), InstrumentLibraryEditor::setOffspecEnabled(), and InstrumentLibraryEditor::setSpecularEnabled().
|
inherited |
The topmost visible item. Can be null of course.
Definition at line 111 of file InstrumentsTreeModel.cpp.
References InstrumentsTreeModel::instruments(), and InstrumentsTreeModel::visibleTypes().
|
privateinherited |
Definition at line 69 of file InstrumentsTreeModel.cpp.
References InstrumentsTreeModel::DepthProbe, InstrumentsTreeModel::Gisas, InstrumentsTreeModel::instruments(), InstrumentsTreeModel::m_enableEmptyHeadlines, InstrumentsTreeModel::m_visibleTypes, InstrumentsTreeModel::Offspec, and InstrumentsTreeModel::Specular.
Referenced by InstrumentsTreeModel::index(), InstrumentsTreeModel::indexForItem(), InstrumentsTreeModel::indexOfHeadline(), InstrumentsTreeModel::parent(), InstrumentsTreeModel::rowCount(), and InstrumentsTreeModel::topMostItem().
|
privateinherited |
Definition at line 74 of file InstrumentsTreeModel.h.
Referenced by InstrumentsTreeModel::enableEmptyHeadlines(), and InstrumentsTreeModel::visibleTypes().
|
privateinherited |
Definition at line 71 of file InstrumentsTreeModel.h.
Referenced by InstrumentsTreeModel::instruments(), and InstrumentsTreeModel::removeItem().
|
privateinherited |
Definition at line 73 of file InstrumentsTreeModel.h.
Referenced by InstrumentsTreeModel::flags().
|
private |
Definition at line 71 of file InstrumentLibraryEditor.h.
|
privateinherited |
Definition at line 72 of file InstrumentsTreeModel.h.
Referenced by InstrumentsTreeModel::setTypeEnabled(), and InstrumentsTreeModel::visibleTypes().