BornAgain  1.19.79
Simulate and fit neutron and x-ray scattering at grazing incidence
ModelPath.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file GUI/Model/Model/ModelPath.h
6 //! @brief Defines namespace GUI::Model::Path
7 //!
8 //! @homepage http://www.bornagainproject.org
9 //! @license GNU General Public License v3 or higher (see COPYING)
10 //! @copyright Forschungszentrum Jülich GmbH 2018
11 //! @authors Scientific Computing Group at MLZ (see CITATION, AUTHORS)
12 //
13 // ************************************************************************************************
14 
15 #ifndef BORNAGAIN_GUI_MODEL_MODEL_MODELPATH_H
16 #define BORNAGAIN_GUI_MODEL_MODEL_MODELPATH_H
17 
18 #include <QString>
19 #include <memory>
20 #include <vector>
21 
22 class QModelIndex;
23 class SessionItem;
24 class SessionModel;
25 
26 namespace GUI::Model::Path {
27 
28 bool isValidItem(SessionModel* model, SessionItem* item, const QModelIndex& parent);
29 
30 //! Returns ancestor of given modelType for given item.
31 //!
32 //! For example, returns corresponding jobItem owning ParameterItem via ParameterContainer.
33 SessionItem* ancestor(SessionItem* item, const QString& requiredModelType);
34 
35 } // namespace GUI::Model::Path
36 
37 #endif // BORNAGAIN_GUI_MODEL_MODEL_MODELPATH_H
Base class for a GUI data item.
Definition: SessionItem.h:204
Base class for a GUI data collection. A collection is e.g. all real data (RealDataModel)....
Definition: SessionModel.h:42
bool isValidItem(SessionModel *model, SessionItem *item, const QModelIndex &parent)
Iterates through all the model and returns true if item is found. This is to.
Definition: ModelPath.cpp:20
SessionItem * ancestor(SessionItem *item, const QString &requiredModelType)
Returns ancestor of given modelType for given item.
Definition: ModelPath.cpp:32